首页 > 解决方案 > 交易/操作的气体限制是多少?

问题描述

交易的gas限制是多少?通过检查一些交易,看起来汽油价格的限制是300Tgas每笔交易。

functionCall每个动作也有气体限制吗?如果是这样,限制是多少。

第三个问题。例如,我们functionCall在一笔交易中有两个 action,结果是Exceeded the prepaid gaserror,实际上是在告诉我们 gas 不足——是否可以断定哪个 action 的 gas 不足?

标签: nearprotocol

解决方案


每笔交易的 Gas 限制为 300Tgas。每个 functionCall 的 Gas 限制也是 300Tgas。

例如near-cli,有一个标志--gas可以让您指定可以将多少气体附加到函数调用。

 % near call     
near call <contractName> <methodName> [args]

schedule smart contract call which can modify state

Options:
      --gas                      Max amount of gas this call can use (in gas units)

第三个问题:考虑增加附气。顺便说一句,未使用的 gas 将退还给您。要判断哪个函数调用的 gas 不足,您可以在 explorer.near.org(或 explorer.testnet.near.org)检查您的交易,并仔细阅读生成的收据及其结果。


推荐阅读