Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

estimateGas返回结果不准确 #15

Open
AnFengDe opened this issue Aug 29, 2019 · 0 comments
Open

estimateGas返回结果不准确 #15

AnFengDe opened this issue Aug 29, 2019 · 0 comments

Comments

@AnFengDe
Copy link
Contributor

举例的交易链接

这是一个FST的ERC20转账记录,如果试图估计gas

// 实例化fst合约
.....

fst.transfer.estimateGas("0x0c6fcaaae530d029699261179503b56ca3bdd77d", chain3.toBigNumber("0x0000000000000000000000000000000000000000000000b197a2030213b00000"))

fst.approve.estimateGas("0x0c6fcaaae530d029699261179503b56ca3bdd77d", chain3.toBigNumber("0x0000000000000000000000000000000000000000000000b197a2030213b00000"))

返回结果是3570,而实际的transfer交易是34797

在DAPP开发中,要么自己尝试后,找出一个固定的安全边界,想按照传统方式先做燃料估计再调用就会有问题,尤其是涉及到合约升级后,gas的变动也要改程序就很令人困扰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant