How to send interchain messages using Hyperlane’s Mailbox.dispatch() function
Mailbox.dispatch()
.
This function takes as parameters the message contents, the destination chain ID, and the recipient address. Each message gets inserted as a leaf into an incremental merkle tree stored by the Mailbox
. Hyperlane’s proof of stake protocol uses this merkle tree to verify fraud proofs.
handle
function. See the receive a message documentation for
more information.dispatch
hook configuration, some payment may be required. See the quoteDispatch
section for more information.
bytes32
for compatibility with virtual machines that are addressed differently. The following utility is provided in the TypeCasts
library for convenience.dispatch
call, you can query the quoteDispatch
function.
fee
must be passed as value to the dispatch
call to ensure it does not revert.
dispatch
will revert. If you are composing hooks together,
overpayment may not be refunded to the message sender.required
: invoked for all dispatch
calls with value that covers the required feedefault
: invoked (unless overridden) with remaining value after required
hookrequiredHook
function.
defaultHook
function.
dispatch
call, see the Hooks Reference.