I use web3 and truffle to get info about my testnet transactions. There are few fields about gas used per transaction, such as: gasPrice, gas, gasUsed. But how to get field 'execution cost'?
Asked
Active
Viewed 140 times
0
1 Answers
0
The field gasUsed is your execution cost. All execution costs are denoted in units of gas in Ethereum.
gasUsed tells you how much gas the transaction actually used. This you can convert directly into Ethers (with the gasPrice) and if you want, you can convert Ethers into real-life currency (fiat) such as euros dollars.
You should read more about gas for example here: What is meant by the term "gas"?
Lauri Peltonen
- 29,391
- 3
- 20
- 57
-
Yeah, I know about gas meaning. Your explanation is clear, but not complete. There is a case when tx cost isn't the execution cost. Appears when, as part of a transaction, storage is cleared with the refund of some amount of gas. You should read more about gas for example here: https://github.com/ethereum/EIPs/issues/1048 – Ivan Zakharov Feb 04 '19 at 12:35
gasPrice * gasUsedsound like what you need? – goodvibration Feb 04 '19 at 12:12