VeaMock

Git Source

Inherits: IVeaOutboxOnL1, IVeaInbox

Functions

sendMessage

Sends an arbitrary message to receiving chain. Note: Calls authenticated by receiving gateway checking the sender argument.

function sendMessage(address _to, bytes4 _fnSelector, bytes memory _data) external returns (uint64 msgId);

Parameters

NameTypeDescription
_toaddressThe cross-domain contract address which receives the calldata.
_fnSelectorbytes4The function selector of the receiving contract.
_databytesThe message calldata, abi.encode(...)

Returns

NameTypeDescription
msgIduint64The index of the message in the inbox, as a message Id, needed to relay the message.

saveSnapshot

Snapshots can be saved a maximum of once per epoch. Saves snapshot of state root. O(log(count)) where count number of messages in the inbox.

function saveSnapshot() external;

sendMessage

Verifies and relays the message. Note: Gateways expect first argument of message call to be the arbitrum message sender, used for authentication.

function sendMessage(bytes32[] calldata _proof, uint64 _msgId, address _to, bytes calldata _message) external;

Parameters

NameTypeDescription
_proofbytes32[]The merkle proof to prove the message.
_msgIduint64The zero based index of the message in the inbox.
_toaddressThe address to send the message to.
_messagebytesThe message to relay.

resolveDisputedClaim

Resolves any challenge of the optimistic claim for 'epoch' using the canonical bridge. Note: Access restricted to canonical bridge.

function resolveDisputedClaim(uint256 _epoch, bytes32 _stateRoot, Claim memory _claim) external;

Parameters

NameTypeDescription
_epochuint256The epoch to verify.
_stateRootbytes32The true state root for the epoch.
_claimClaimThe claim associated with the epoch.