Skip to main content

Solidity API

RollupHandler

constructor

constructor(address bridgeAddress) public

_rollupMetadata

mapping(uint72 => struct RollupHandler.Metadata) _rollupMetadata

deposit

function deposit(bytes32, address, bytes) external payable returns (bytes)

Metadata

struct Metadata {
uint8 domainID;
bytes32 resourceID;
bytes32 senderResourceID;
uint64 nonce;
bytes32 msgRootHash;
bytes32 stateRootHash;
uint64 totalBatch;
}

_setRollupMetadata

function _setRollupMetadata(uint72 key, struct RollupHandler.Metadata metadata) internal

_getRollupMetadata

function _getRollupMetadata(uint72 key) internal view returns (struct RollupHandler.Metadata)

executeProposal

function executeProposal(bytes32 resourceID, bytes data) external

Proposal execution should be initiated when a proposal is finalized in the Bridge contract.

Requirements:

  • It must be called by only bridge.
  • {resourceID} must exist.
  • {contractAddress} must be allowed.
  • {resourceID} must be equal to the resource ID from metadata
  • Sender resource ID must exist.
  • Sender contract address must be allowed.

Data passed into the function should be constructed as follows: len(data) uint256 bytes 0 - 32 data bytes bytes 32 - END

If {_contractAddressToExecuteFunctionSignature}[{contractAddress}] is set, {metaData} is expected to consist of needed function arguments.

NameTypeDescription
resourceIDbytes32
databytesConsists of {resourceID}, {lenMetaData}, and {metaData}.

getRollupInfo

function getRollupInfo(uint8 originDomainID, bytes32 resourceID, uint64 nonce) external view returns (struct RollupInfo, address)

Returns rollup info by original domain ID, resource ID and nonce.

Requirements:

  • {resourceID} must exist.
  • {resourceID} must be equal to the resource ID from metadata
  • Sender resource ID must exist.

getResourceIDByAddress

function getResourceIDByAddress(address tokenAddress) external view returns (bytes32)

Returns resource ID by {address}.