InterfaceOrigin
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.
function sendBaseMessage(
uint32 destination,
bytes32 recipient,
uint32 optimisticPeriod,
uint256 paddedRequest,
bytes memory content
) external payable returns (uint32 messageNonce, bytes32 messageHash);
Parameters
Name | Type | Description |
---|---|---|
destination | uint32 | Domain of destination chain |
recipient | bytes32 | Address of recipient on destination chain as bytes32 |
optimisticPeriod | uint32 | Optimistic period for message execution on destination chain |
paddedRequest | uint256 | Padded encoded message execution request on destination chain |
content | bytes | Raw bytes content of message |
Returns
Name | Type | Description |
---|---|---|
messageNonce | uint32 | Nonce of the sent message |
messageHash | bytes32 | Hash 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.
function sendManagerMessage(uint32 destination, uint32 optimisticPeriod, bytes memory payload)
external
returns (uint32 messageNonce, bytes32 messageHash);
Parameters
Name | Type | Description |
---|---|---|
destination | uint32 | Domain of destination chain |
optimisticPeriod | uint32 | Optimistic period for message execution on destination chain |
payload | bytes | Payload 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
Name | Type | Description |
---|---|---|
recipient | address | Address to withdraw tips to |
amount | uint256 | Tips 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
Name | Type | Description |
---|---|---|
destination | uint32 | Domain of destination chain |
paddedRequest | uint256 | Padded encoded message execution request on destination chain |
contentLength | uint256 | The length of the message content |
Returns
Name | Type | Description |
---|---|---|
tipsValue | uint256 | Minimum tips value for a message to be accepted |