Mailbox.process()
.
This function takes as parameters the message to deliver, as well as arbitrary metadata that can be specified by the relayer.
The Mailbox
will pass the message and metadata to the recipient’s Interchain Security Module (ISM) for verification. If the ISM successfully verifies the message, the Mailbox
delivers the message to the recipient by calling recipient.handle()
.
See
Message.sol
for more details on Hyperlane message encodingHandle
This function is called by theMailbox
contract when a message is received.
To ensure only valid interchain messages are accepted, it is important to
restrict access control to the Mailbox address.
Solidity
origin
: Domain of origin chainsender
: Address of sender on origin chain as bytes32messageBody
: Raw bytes content of message body
Sender addresses are left-padded to
bytes32
for compatibility with virtual machines that are addressed differently. The following utility is provided in the TypeCasts
library for convenience.Access Control
Thehandle
function should be restricted to the Mailbox address if the contract should only accept calls from interchain messages.
The following utility is provided in the MailboxClient
library for convenience.
Examples
Verify
When a message is received, the Mailbox will verify security with an Interchain Security Module before calling the message recipient’shandle
.
Default Security
To query the default ISM address, you can call thedefaultIsm
function.