Send your first interchain message
This tutorial demonstrates how to send an interchain message to a pre-deployed TestRecipient
contract.
Sending a message is a simple matter of calling Mailbox.dispatch
. Make sure you have an account with funds on the origin chain.
origin:
destination:
body:
- Hyperlane CLI
- Cast
- Explorer
Install the CLI:Send the message:
npm install -g @hyperlane-xyz/cli
hyperlane send message --origin alfajores --destination basegoerli
Install Send the message:
cast
:curl -L https://foundry.paradigm.xyz | bash
cast send 0xEf9F292fcEBC3848bF4bB92a96a04F9ECBb78E59 "dispatch(uint32,bytes32,bytes)" 84531 0x00000000000000000000000054Bd02f0f20677e9846F8E9FdB1Abc7315C49C38 $(cast --from-utf8 "Hello, world") --rpc-url https://alfajores-forno.celo-testnet.org --value 0.01 ether
- Navigate to the alfajores.celoscan.io
dispatch
interface - Click on the
Connect to Web3
button to connect your Wallet. Make sure you are onalfajores
. - Fill in value:
0.01 ether
, destination:84531
, recipient:0x00000000000000000000000054Bd02f0f20677e9846F8E9FdB1Abc7315C49C38
, and message:Hello, world
- Click the
Write
button to submit the transaction!
tip
You can watch the progress of your message on explorer.hyperlane.xyz by searching for the transaction hash of your Mailbox.dispatch
call.
Check the result
The TestRecipient
has the following handle implementation:
- Solidity
- CosmWasm
function handle(
uint32 _origin,
bytes32 _sender,
bytes calldata _data
) external payable virtual override {
emit ReceivedMessage(_origin, _sender, msg.value, string(_data));
lastSender = _sender;
lastData = _data;
}
🚧 Coming soon! 🚧
Check the logs to see your message delivery!
Testnet TestRecipient
Addresses
Chain | Domain | Address | Explorer |
---|---|---|---|
Alfajores | 44787 | 0x6489d13AcAd3B8dce4c5B31f375DE4f9451E7b38 | alfajores.celoscan.io |
Basegoerli | 84531 | 0x54Bd02f0f20677e9846F8E9FdB1Abc7315C49C38 | goerli.basescan.org |
Fuji | 43113 | 0x44a7e1d76fD8AfA244AdE7278336E3D5C658D398 | testnet.snowtrace.io |
Mumbai | 80001 | 0xF45A4D54223DA32bf7b5D43a9a460Ef3C94C713B | mumbai.polygonscan.com |
Bsctestnet | 97 | 0xfbcD1c00a3d809f36cC1A15918694B17B32c0b6c | testnet.bscscan.com |
Goerli | 5 | 0x4fC0Ac163eFFEb7890937cB89275B2C231880F22 | goerli.etherscan.io |
Scrollsepolia | 534351 | 0xa3AB7E6cE24E6293bD5320A53329Ef2f4DE73fCA | sepolia.scrollscan.dev |
Sepolia | 11155111 | 0xeDc1A3EDf87187085A3ABb7A9a65E1e7aE370C07 | sepolia.etherscan.io |
Moonbasealpha | 1287 | 0x68729446296E413f0b7d6E85F2FD128465F0e5D0 | moonbase.moonscan.io |
Optimismgoerli | 420 | 0x518eA1802407b4b5AAF3aA92c1A803FfbA9FB7fe | goerli-optimism.etherscan.io |
Arbitrumgoerli | 421613 | 0x07543860AE9E72aBcF2Bae9827b23621A64Fa416 | goerli.arbiscan.io |
Polygonzkevmtestnet | 1442 | 0x11918DC33E067C5DA83EEF58E50F856398b8Df4C | testnet-zkevm.polygonscan.com |
Testnet Mailbox
Addresses
Chain | Domain | Address | Explorer |
---|---|---|---|
Basegoerli | 84531 | 0x58483b754Abb1E8947BE63d6b95DF75b8249543A | goerli.basescan.org |
Arbitrumgoerli | 421613 | 0x13dABc0351407d5aAa0A50003a166A73b4febfDc | goerli.arbiscan.io |
Optimismgoerli | 420 | 0xB5f021728Ea6223E3948Db2da61d612307945eA2 | goerli-optimism.etherscan.io |
Scrollsepolia | 534351 | 0x3C5154a193D6e2955650f9305c8d80c18C814A68 | sepolia.scrollscan.dev |
Alfajores | 44787 | 0xEf9F292fcEBC3848bF4bB92a96a04F9ECBb78E59 | alfajores.celoscan.io |
Polygonzkevmtestnet | 1442 | 0x598facE78a4302f11E3de0bee1894Da0b2Cb71F8 | testnet-zkevm.polygonscan.com |
Sepolia | 11155111 | 0xfFAEF09B3cd11D9b20d1a19bECca54EEC2884766 | sepolia.etherscan.io |
Fuji | 43113 | 0x5b6CFf85442B851A8e6eaBd2A4E4507B5135B3B0 | testnet.snowtrace.io |
Bsctestnet | 97 | 0xF9F6F5646F478d5ab4e20B0F910C92F1CCC9Cc6D | testnet.bscscan.com |
Goerli | 5 | 0x49cfd6Ef774AcAb14814D699e3F7eE36Fdfba932 | goerli.etherscan.io |
Moonbasealpha | 1287 | 0x76189acFA212298d7022624a4633411eE0d2f26F | moonbase.moonscan.io |
Mumbai | 80001 | 0x2d1889fe5B092CD988972261434F7E5f26041115 | mumbai.polygonscan.com |