Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Discussion options

see: https://docs.web3js.org/guides/transactions/transactions/#step-4-send-a-transaction-and-review-the-results:~:text=Note%20that%20the,by%20effectiveGasPrice).

effectiveGasPrice is the price per gas at the time of your transaction, so the total gas cost of your transaction is effectiveGasPrice * gasUsed.
gasUsed is the total amount of gas used by this specific transaction.
So, why use cumulativeGasUsed instead of gasUsed for calculations? 😕

You must be logged in to vote

Replies: 1 comment

Comment options

You should generally use gasUsed for transaction-specific calculations, as it represents the gas consumed by the current transaction.
cumulativeGasUsed is only relevant if you are analyzing multiple transactions in the same block or debugging gas usage within a complex block context.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.