如何在合约本身与Axelar一起预测源链上的Gas?

huangapple go评论90阅读模式
英文:

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

问题

目前我正在构建一个解决方案,其中我的合同基于各种链外和链上条件进行自动化,现在我无法使用AxelarJS SDK,因为自动调用将发生在链上。

如何最好地实现这一点?是否有一种方法可以在目标链上扣除一些资产作为燃气费用?

英文:

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

得分: 0

Axelar 不支持在目标链上支付 gas,因为目标链直到消息从验证者网络接收到分散式共识之前都不涉及。

但是,也要注意,您只需要支付一次 gas,交易将在所有远程部署的链上执行。

理论上,如果发现一种使用 AXL 支付确认的方法,就可以在链内调用自己的执行方法。但是,要启动此过程,需要触发器,例如 Chainlink 的 Automation。

您可以随时参考 Axelar 的 gas 和执行器服务拆分,链接在这里:https://docs.axelar.dev/dev/general-message-passing/gas-services/intro,以及 AxelarJS SDK,您可能想要用它来支付 gas。https://docs.axelar.dev/dev/axelarjs-sdk/tx-status-query-recovery#21-native-gas-payment

英文:

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

huangapple
  • 本文由 发表于 2023年8月10日 21:22:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76876143.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定