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

IOutputsMerkleRootValidator

Git Source

Inherits: IERC165

Provides valid outputs Merkle roots for validation.

ERC-165 can be used to determine whether this contract also supports any other interface (e.g. for submitting claims).

Functions

isOutputsMerkleRootValid

Check whether an outputs Merkle root is valid.

function isOutputsMerkleRootValid(address appContract, bytes32 outputsMerkleRoot)
    external
    view
    returns (bool);

Parameters

NameTypeDescription
appContractaddressThe application contract address
outputsMerkleRootbytes32The outputs Merkle root

getLastFinalizedMachineMerkleRoot

Get the last finalized machine Merkle root.

Returns zero if no machine merkle root has been finalized yet for that particular application. This should not be a problem given that the pre-image Keccak-256 hash of zero is unknown.

function getLastFinalizedMachineMerkleRoot(address appContract)
    external
    view
    returns (bytes32);

Parameters

NameTypeDescription
appContractaddressThe application contract address

wasInputFinalized

Check whether an input was finalized.

This function assumes that an input with such an index exists in the input box of the application, and that it was added in such a base-layer block. Foreclosed applications can use this function to issue refunds for deposit inputs that were not finalized.

function wasInputFinalized(
    address appContract,
    uint256 inputIndex,
    uint256 blockNumber
) external view returns (bool);

Parameters

NameTypeDescription
appContractaddressThe application contract address
inputIndexuint256The index of the input in the application's input box
blockNumberuint256The number of the base-layer block in which the input was added

Returns

NameTypeDescription
<none>boolWhether the input was finalized