1

I was using ethers.js to get the transaction receipt of a mined transaction but when I get the cumulative gas used it seems to give me cumulative gas of the block mined and not the transaction itself. How do I get gas used only by a mined transaction?

1 Answer 1

3

What you are looking for is the gasUsed parameter of the transaction receipt (https://docs.ethers.io/ethers.js/v3.0/html/api-providers.html#transactionreceipt) which returns the amount of gas used by the transaction.

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.