Manually pay for interchain gas
Manually pay a relayer to deliver messages
Read up on Interchain gas payments and the Interchain gas paymaster API
This guide will show you how to make a manual gas payment.
Typically, the smart contract that sent the interchain message will Automatically pay for interchain gas.
In some cases (e.g. Quickstarts) it may be useful to make gas payments manually.
To make a manual gas payment, you will need
The
$MESSAGE_ID
of the interchain message you are paying forThe
$DESTINATION_DOMAIN
of the interchain message you are paying forThe
$GAS_AMOUNT
that you need in order to deliver your message on the destination chain
Finding your message ID
If you have the hash of the transaction that sent your interchain message, you can use a block explorer to find the message ID. Navigate to the transaction in a block explorer, open the "Logs" tab, and find the DispatchId
log. The "Topic 1" is your message ID. Use the dropdown to select "Hex", and use this value. For example:
Paying for interchain gas
Getting the interchain gas payment quote
Under the
Contract
tab, selectRead Contract
.Expand the
quoteGasPayment
function.For destination domain, enter
$DESTINATION_DOMAIN
.For gas amount, enter
$GAS_AMOUNT
.Click
Query
and make note of the amount returned as$GAS_PAYMENT_QUOTE
. For example, at the time of writing, the quote is1
wei.
Make the interchain gas payment
Still on the
DefaultIsmInterchainGasPaymaster
contract page on Etherscan, selectWrite Contract
.Click on the
Connect to Web3
button to connect your Wallet (i.e. Metamask). Make sure that you are on the correct network.Expand the
payForGas
function.For the payable amount, Etherscan expects an amount quoted in ether, while our
$GAS_PAYMENT_QUOTE
is in wei. To convert from wei to ether, input the amount$GAS_PAYMENT_QUOTE
, which is in wei, into https://eth-converter.com/ and copy the ether amount. Use this ether amount as the payable amount.For the message ID, input your
$MESSAGE_ID
.For the destination domain, input your
$DESTINATION_DOMAIN
.For gas amount, enter
$GAS_AMOUNT
.For the refund address, input the address of the account you will sign the transaction with. This will receive a potential refund if you overpay for interchain gas.
Click "Write" and submit the transaction via your wallet/Metamask.
Confirm delivery
After you've paid for interchain gas, you should be able to see a corresponding transaction delivering your message on the destination chain. You can watch for this transaction on Hyperlane's Message Explorer by entering the transaction hash or the sender/recipient address in the input field. You can see an example message delivery transaction here.
Message not delivered? See Debugging messages for tips and tricks
Last updated