VeaMock
Inherits: IFastBridgeSender, IFastBridgeReceiver
Functions
sendFast
Note: Access must be restricted by the receiving gateway by checking the sender argument.
Sends an arbitrary message across domain using the Fast Bridge.
function sendFast(address _receiver, bytes memory _calldata) external;
Parameters
Name | Type | Description |
---|---|---|
_receiver | address | The cross-domain contract address which receives the calldata. |
_calldata | bytes | The receiving domain encoded message data. |
decode
function decode(bytes calldata data) external pure returns (bytes4, bytes memory);
sendBatch
Sends a batch of arbitrary message from one domain to another via the fast bridge mechanism.
function sendBatch() external;
sendSafeFallback
Sends a markle root representing an arbitrary batch of messages across domain using the Safe Bridge, which relies on the chain's canonical bridge. It is unnecessary during normal operations but essential only in case of challenge.
function sendSafeFallback(uint256 _epoch) external payable;
Parameters
Name | Type | Description |
---|---|---|
_epoch | uint256 | block number of batch |
claim
Submit a claim about the _batchMerkleRoot
for the latests completed Fast bridge epoch and submit a deposit. The _batchMerkleRoot
should match the one on the sending side otherwise the sender will lose his deposit.
function claim(uint256 _epoch, bytes32 _batchMerkleRoot) external payable;
Parameters
Name | Type | Description |
---|---|---|
_epoch | uint256 | The epoch of the claim to claim. |
_batchMerkleRoot | bytes32 | The hash claimed for the ticket. |
challenge
Submit a challenge for the claim of the current epoch's Fast Bridge batch merkleroot state and submit a deposit. The batchMerkleRoot
in the claim already made for the last finalized epoch should be different from the one on the sending side, otherwise the sender will lose his deposit.
function challenge(uint256 _epoch) external payable;
Parameters
Name | Type | Description |
---|---|---|
_epoch | uint256 | The epoch of the claim to challenge. |
verifyBatch
Resolves the optimistic claim for '_epoch'.
function verifyBatch(uint256 _epoch) external;
Parameters
Name | Type | Description |
---|---|---|
_epoch | uint256 | The epoch of the optimistic claim. |
verifyAndRelayMessage
Verifies merkle proof for the given message and associated nonce for the most recent possible epoch and relays the message.
function verifyAndRelayMessage(uint256 _epoch, bytes32[] calldata _proof, bytes calldata _message) external;
Parameters
Name | Type | Description |
---|---|---|
_epoch | uint256 | The epoch in which the message was batched by the bridge. |
_proof | bytes32[] | The merkle proof to prove the membership of the message and nonce in the merkle tree for the epoch. |
_message | bytes | The data on the cross-domain chain for the message. |
withdrawClaimDeposit
Sends the deposit back to the Bridger if their claim is not successfully challenged. Includes a portion of the Challenger's deposit if unsuccessfully challenged.
function withdrawClaimDeposit(uint256 _epoch) external;
Parameters
Name | Type | Description |
---|---|---|
_epoch | uint256 | The epoch associated with the claim deposit to withraw. |
withdrawChallengeDeposit
Sends the deposit back to the Challenger if his challenge is successful. Includes a portion of the Bridger's deposit.
function withdrawChallengeDeposit(uint256 _epoch) external;
Parameters
Name | Type | Description |
---|---|---|
_epoch | uint256 | The epoch associated with the challenge deposit to withraw. |
claimChallengePeriod
Returns the start
and end
time of challenge period for this epoch
.
function claimChallengePeriod(uint256 _epoch) external view returns (uint256 start, uint256 end);
Parameters
Name | Type | Description |
---|---|---|
_epoch | uint256 | The epoch of the claim to request the challenge period. |
Returns
Name | Type | Description |
---|---|---|
start | uint256 | The start time of the challenge period. |
end | uint256 | The end time of the challenge period. |
epochPeriod
Returns the epoch period.
function epochPeriod() external view returns (uint256 epochPeriod);
challengePeriod
Returns the challenge period.
function challengePeriod() external view returns (uint256 challengePeriod);