简体   繁体   English

智能合约执行费的决定因素

[英]Determinants of smart contract execution fee

Is it possible to decompose in details how much an additional line of code will impact the gas price for execution, ie transferring a token from one wallet to another, before deploying a smart contract?在部署智能合约之前,是否可以详细分解额外的一行代码对执行的 gas 价格有多大影响,即将代币从一个钱包转移到另一个钱包?

Test networks are not very accurate there…那里的测试网络不是很准确……

I think not.我想不是。 The final gas price is a dynamic variable.最终的gas价格是一个动态变量。 It depends on many other dynamic variables that cannot be computed beforehand because the actions these variables encode will happen in the future.它取决于许多其他无法预先计算的动态变量,因为这些变量编码的动作将在未来发生。 Of course you can get an approximation based on the current gas price.当然,您可以根据当前的 gas 价格获得一个近似值。

Is it possible to decompose in details how much an additional line of code will impact the gas price for execution, ie transferring a token from one wallet to another, before deploying a smart contract?在部署智能合约之前,是否可以详细分解额外的一行代码对执行的 gas 价格有多大影响,即将代币从一个钱包转移到另一个钱包?

Yes.是的。

You can disassemble the compiled bytecode and then calculate the gas manually from the EVM instructions based on the Ethereum yellow paper .你可以反汇编编译后的字节码,然后根据以太坊黄皮书的EVM指令手动计算gas。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM