IInputBox
Provides data availability of inputs for applications.
Each application has its own append-only list of inputs.
Off-chain, inputs can be retrieved via events.
On-chain, only the input hashes are stored.
See LibInput
for more details on how such hashes are computed.
Functions
addInput
Send an input to an application.
MUST fire an InputAdded
event.
function addInput(address appContract, bytes calldata payload)
external
returns (bytes32);
Parameters
Name | Type | Description |
---|---|---|
appContract | address | The application contract address |
payload | bytes | The input payload |
Returns
Name | Type | Description |
---|---|---|
<none> | bytes32 | The hash of the input blob |
getNumberOfInputs
Get the number of inputs sent to an application.
function getNumberOfInputs(address appContract) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
appContract | address | The 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
returns (bytes32);
Parameters
Name | Type | Description |
---|---|---|
appContract | address | The application contract address |
index | uint256 | The input index |
getDeploymentBlockNumber
Get number of block in which contract was deployed
function getDeploymentBlockNumber() external view returns (uint256);
Events
InputAdded
MUST trigger when an input is added.
event InputAdded(address indexed appContract, uint256 indexed index, bytes input);
Parameters
Name | Type | Description |
---|---|---|
appContract | address | The application contract address |
index | uint256 | The input index |
input | bytes | The input blob |
Errors
InputTooLarge
Input is too large.
error InputTooLarge(address appContract, uint256 inputLength, uint256 maxInputLength);
Parameters
Name | Type | Description |
---|---|---|
appContract | address | The application contract address |
inputLength | uint256 | The input length |
maxInputLength | uint256 | The maximum input length |