Skip to content

Message Execution

The following functions are applicable in the destination chain.

Introduction

Once a message has been delivered to the Message Controller on the destination chain, you can check its status by calling the following function, passing the message id:

solidity
function receivedMessages(bytes32 messageId) public view returns(ReceivedMessage);

The following Struct is returned:

NameTypeDescription
relayedMsgaddress[]The list of target addresses.
calldatasbytes[]The list of calldata to be executed.
thresholduint256The threshold required for the message to be executed.
receivedSoFaruint256The number of times the message has been received.
originChainIduint256The ID of the origin chain.
executableAtuint256The timestamp at which the message can be executed.
expiresAtuint256The timestamp at which the message expires and cannot be executed afterwards (30 days after first receipt)
executedboolA boolean indicating whether the message has been executed.
cancelledboolA boolean indicating whether the message has been cancelled.

isReceivedMessageExecutable

You can check whether a received message is ready for execution by calling the following function on the destination chain, passing the messageId:

solidity
function isReceivedMessageExecutable(bytes32 messageId) public view returns (bool);

Returns true if the message is executable, false otherwise.


Veto

If both a Vetoer and a timelock delay have been set, the Vetoer can cancel a message that:

  • Is still within the timelockDelay period
  • Has not yet been executed
  • Has not expired (30 days have not passed since the message was registered)

The Vetoer can cancel a pending message by calling:

solidity
function cancel(bytes32 messageId) public;

Execute

Lucid will automatically execute a message once it becomes executable. However, anyone can manually trigger execution by calling the following function with the message ID:

solidity
function execute(bytes32 messageId) public;