How to predict gas on source chain, in the contract itself with Axelar?

34 Views Asked by At

I am currently building a solution where my contracts are automated based on various off-chain and on-chain conditions, now I cannot use the AxelarJS SDK as the automated call will happen on-chain.

Whats the best way to implement this? Is there a way to deduct some amount of the assets being transferred as gas at the destination chain?

1

There are 1 best solutions below

0
On BEST ANSWER

Axelar does not support paying the gas on the destination chain because the destination chain is not involved until the message receives decentralized consensus from the validator network.

However, it is also important to note that you only need to pay gas once, and the transaction will be executed across all remotely deployed chains.

In theory, if a method was discovered to pay for confirmation using AXL, it would be possible to invoke your own execute method within the chain. However, to initiate this process, a trigger such as Chainlink's Automation would be required.

You can always reference the Axelar gas and executor service breakdown here: https://docs.axelar.dev/dev/general-message-passing/gas-services/intro and the AxelarJS SDK, which you would likely want to use to pay the gas. https://docs.axelar.dev/dev/axelarjs-sdk/tx-status-query-recovery#21-native-gas-payment