LogoLogo
  • ⏩Introduction
    • Hyperlane Introduction
    • Getting started
    • Why Should You Use Hyperlane?
  • Permissionless Interoperability
    • Overview
    • Deploy Hyperlane
    • Warp Routes
      • Deploy a Warp Route
      • Deploy a UI for your Warp Route
    • Modular Rollup Interoperability
  • Build With Hyperlane
    • Quickstarts
      • Messaging
      • Accounts
      • Queries
      • hyperlane-quickstart repo
    • Guides
      • Finding my messages
      • Automatically pay for interchain gas
      • Manually pay for interchain gas
      • Choosing an interchain gas paymaster contract
      • Unit testing
      • Specifying an ISM
      • V2 migration guide
    • Explorer
      • Debugging messages
      • Configuring PI Chains
      • REST API
      • GraphQL API
    • Troubleshooting/Developer FAQ
    • Example apps
  • APIs and SDKs
    • Messaging API
      • Send
      • Receive
    • Accounts API
    • Queries API
    • Warp Route API
    • Interchain gas paymaster API
    • Hyperlane App Framework
      • Example usage
        • HelloWorld
        • Interchain Token
      • Solidity SDK
        • HyperlaneConnectionClient
        • Router
      • NodeJS SDK
        • RPC Providers
        • Deployment
        • Interchain testing
        • Quoting gas payments
        • App Abstraction
    • Hooks API
      • Contract addresses
  • Protocol
    • Overview
    • Mailbox
    • Interchain security modules
      • Interface
      • Multisig ISM
      • Routing ISM
      • Aggregation ISM
      • Optimistic ISM
      • Wormhole ISM
      • Hook ISM
      • CCIP-Read ISM
    • Interchain gas payments
    • Staking and slashing
    • Agents
      • Validators
      • Relayers
      • Watchtowers
    • Warp Routes
    • Implementation Guide
  • Operators
    • Validators
      • Guide
      • AWS setup
      • Monitoring and alerting
    • Relayers
      • Guide
      • Message filtering
    • Agent keys
      • Hexadecimal keys
      • AWS KMS keys
    • Agent configuration
      • Configuration reference
    • Running with docker compose
  • Resources
    • FAQ
    • Glossary
    • Contract addresses
      • Permissionless Deployment Contract Addresses
    • Domain identifiers
      • Permissionless Domain Identifiers
    • Default ISM settings
    • Coming Soon: Hyperlane v3
    • Token sources & faucets
    • Latencies
    • Github
    • Discord
    • Website
Powered by GitBook
On this page
  • Inputs
  • Make a call
  1. Build With Hyperlane
  2. Quickstarts

Accounts

PreviousMessagingNextQueries

Last updated 1 year ago

This tutorial demonstrates how to make a simple interchain call using the Accounts API to a pre-deployed contract on a remote chain.

You can also check out the repo for running this out of the box.

Want to learn more about interchain accounts? Take a look at the Accounts API documentation

Inputs

  • $DESTINATION_DOMAIN: The domain ID of the destination chain. See Domain identifiers

  • $RECIPIENT: The address of the TestRecipient contract on the destination chain,0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35

  • $CALLDATA: The calldata of the call to make on TestRecipient, which we generate using cast: 0xf07c1f4700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001648656c6c6f576f726c642066726f6d20616e2049434100000000000000000000

$ cast calldata "fooBar(uint256,string)" 1 "HelloWorld from an ICA"

Make a call

Sending a message is a simple matter of calling InterchainAccountRouter.callRemote(). This function can be called easily using Etherscan+ or .

  1. Navigate to the InterchainAccountRouter contract page on Etherscan (or whatever chain you want to send from). See Contract addresses for InterchainAccountRouter addresses

  2. Under the Contract tab, find the Write as Proxy button.

  3. Click on the Connect to Web3 button to connect your Wallet (i.e. Metamask). Make sure that you are on the correct network.

  4. Expand the callRemote box

  5. For destination domain, enter $DESTINATION_DOMAIN. You could use 137 to send to mainnet Polygon, or see other Domain identifiers

  6. For the _to argument, enter the $RECIPIENT

  7. For the _value argument, enter 0

  8. For the _data argument, enter the $CALLDATA

  9. Submit the transaction via your wallet/Metamask

You can call the InterchainAccountRouter directly using cast. Make sure that you have a valid RPC URL for the origin chain and a private key with which you can pay for gas.

cast send 0xE0Be420779cAd6E2bEA1E4F7C02F996D9ED1fCB5 \
  'callRemote(uint32,address,uint256,bytes)' \
  $DESTINATION_DOMAIN $RECIPIENT 0 $CALLDATA \
  --rpc-url $RPC_URL --private-key $PRIVATE_KEY

For your call to be executed on the destination chain, you must Manually pay for interchain gas, using 550000 for the gas amount

If you view the transaction on a block explorer, you should be able to see the Dispatch event. You can see an example message sending transaction .

TestRecipient
hyperlane-quickstart
Metamask
cast
here
Manually pay for interchain gas