InterfaceOrigin

Git Source

Functions

sendBaseMessage

Send a message to the recipient located on destination domain.

*Recipient has to conform to IMessageRecipient interface, otherwise message won't be delivered. Will revert if any of these is true:

  • destination is equal to contract's local domain
  • content length is greater than MAX_CONTENT_BYTES
  • msg.value is lower than value of minimum tips for the given message*
function sendBaseMessage(
    uint32 destination,
    bytes32 recipient,
    uint32 optimisticPeriod,
    uint256 paddedRequest,
    bytes memory content
) external payable returns (uint32 messageNonce, bytes32 messageHash);

Parameters

NameTypeDescription
destinationuint32Domain of destination chain
recipientbytes32Address of recipient on destination chain as bytes32
optimisticPerioduint32Optimistic period for message execution on destination chain
paddedRequestuint256Padded encoded message execution request on destination chain
contentbytesRaw bytes content of message

Returns

NameTypeDescription
messageNonceuint32Nonce of the sent message
messageHashbytes32Hash of the sent message

sendManagerMessage

Send a manager message to the destination domain.

This could only be called by AgentManager, which takes care of encoding the calldata payload. Note: (msgOrigin, proofMaturity) security args will be added to payload on the destination chain so that the AgentManager could verify where the Manager Message came from and how mature is the proof. Note: function is not payable, as no tips are required for sending a manager message. Will revert if destination is equal to contract's local domain.

function sendManagerMessage(uint32 destination, uint32 optimisticPeriod, bytes memory payload)
    external
    returns (uint32 messageNonce, bytes32 messageHash);

Parameters

NameTypeDescription
destinationuint32Domain of destination chain
optimisticPerioduint32Optimistic period for message execution on destination chain
payloadbytesPayload for calling AgentManager on destination chain (with extra security args)

withdrawTips

Withdraws locked base message tips to the recipient.

Could only be called by a local AgentManager.

function withdrawTips(address recipient, uint256 amount) external;

Parameters

NameTypeDescription
recipientaddressAddress to withdraw tips to
amountuint256Tips value to withdraw

getMinimumTipsValue

Returns the minimum tips value for sending a message to a given destination.

Using at least tipsValue as msg.value for sendBaseMessage() will guarantee that the message will be accepted.

function getMinimumTipsValue(uint32 destination, uint256 paddedRequest, uint256 contentLength)
    external
    view
    returns (uint256 tipsValue);

Parameters

NameTypeDescription
destinationuint32Domain of destination chain
paddedRequestuint256Padded encoded message execution request on destination chain
contentLengthuint256The length of the message content

Returns

NameTypeDescription
tipsValueuint256Minimum tips value for a message to be accepted