Send
Send a message to any Hyperlane supported network
Developers can send interchain messages by calling Mailbox.dispatch()
.
Interface
Hyperlane can only deliver messages to smart contracts that implement the IMessageRecipient
interface. See the Receive documentation for more information.
See Contract addressesand Domain identifiers for Mailbox
contract addresses, and chain domain IDs, respectively.
Encoding
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.
Paying for Interchain Gas
Delivering a message to its destination requires submitting a transaction on the destination chain. If you want to have Relayers deliver the message on your behalf, you can pay for the gas for this transaction on the origin chain.
Learn more about Automatically pay for interchain gas.
Example Usage
The code snippet below shows an example of sending a message from Ethereum to Avalanche.
Note this example does not pay for interchain gas, and therefore would not be delivered automatically by a relayer.
Last updated