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.
Dispatch
Calling this function dispatches a message to the destination domain and recipient.Hyperlane can only deliver messages to smart contracts that implement the
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.
Solidity
Recipient 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.Examples
Quote Dispatch
Fees are often configured to cover Interchain Gas Payments (IGP) as well as protocol costs. These include transaction submission on the destination chain, security provisioning, and maintenance. To receive a quote for a correspondingdispatch
call, you can query the quoteDispatch
function.
Solidity
fee
must be passed as value to the dispatch
call to ensure it does not revert.
Examples
Underpayment to
dispatch
will revert. If you are composing hooks together,
overpayment may not be refunded to the message sender.Post-Dispatch Hook Config
There are two hooks configured on a Mailboxrequired
: invoked for alldispatch
calls with value that covers the required feedefault
: invoked (unless overridden) with remaining value afterrequired
hook
Required Hook
To query the required hook configuration, you can call therequiredHook
function.
Default Hook
To query the default hook configuration, you can call thedefaultHook
function.
dispatch
call, see the Hooks Reference.