2

I am developing in Go and I have a question that I have been looking for the solution for a long time and I am not able to find it.

How can I find the effective gas price used in the transaction? Not the one that I have indicated to execute it, but the one that has been finally used. When I ask for the gas price of the transaction I can get the Base Fee or the Max Fee, but not the real price.

Tx Information

Thanks in advance,

A.

Added: The Transaction is 0x4114edac2eee32ac222bbe834bf7c6611488332e2072e85781e5a5c71d957e41 in Mainnet

1 Answer 1

1

You can get precalculated effectiveGasPrice value by calling eth_getTransactionReceipt RPC method.

I did not found EffectiveGasPrice property anywhere in the go-ethereum package though. Instead you can calculate it by yourself by converting transaction into the Message. For this you should take BaseFee value from transaction's block header.

You can get an example from here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.