How does ETH get the actual gas consumption fee

Ethereum gets the actual gasUsed

1. Call getTransactionByHash of eth

The returned result is as follows:
Insert picture description here

2. Call getTransactionReceipt of eth

The returned result is as follows:
Insert picture description here

3. Calculate the actual gas cost

GasPrice * GasUsed = ActualTxCost
4294767366 * 4672 = 20065153133952 / 10 **18

Guess you like

Origin blog.csdn.net/qq_43234632/article/details/108491205