Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

InputBox

Git Source

Inherits: IInputBox

State Variables

_DEPLOYMENT_BLOCK_NUMBER

Deployment block number

uint256 immutable _DEPLOYMENT_BLOCK_NUMBER = block.number

_inputBoxes

Mapping of application contract addresses to arrays of input hashes.

mapping(address => bytes32[]) private _inputBoxes

Functions

addInput

Send an input to an application.

MUST fire an InputAdded event.

function addInput(address appContract, bytes calldata payload)
    external
    override
    returns (bytes32);

Parameters

NameTypeDescription
appContractaddressThe application contract address
payloadbytesThe input payload

Returns

NameTypeDescription
<none>bytes32The hash of the input blob

getNumberOfInputs

Get the number of inputs sent to an application.

function getNumberOfInputs(address appContract)
    external
    view
    override
    returns (uint256);

Parameters

NameTypeDescription
appContractaddressThe application contract address

getInputHash

Get the hash of an input in an application's input box.

The provided index must be valid.

function getInputHash(address appContract, uint256 index)
    external
    view
    override
    returns (bytes32);

Parameters

NameTypeDescription
appContractaddressThe application contract address
indexuint256The input index

getDeploymentBlockNumber

Get number of block in which contract was deployed

function getDeploymentBlockNumber() external view override returns (uint256);