Skip to content

Getting the gas used via receipt/tx in ETH (BNB) ? #2481

Discussion options

You must be logged in to vote

I figured it out, don't know why but I thought i tried this. Anyway this is the solution

      const gasUsed = ethers.utils.formatEther(receipt.gasUsed.mul(tx.gasPrice))

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by iangregsondev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant