I've got remix connected to ganache-cli and I'm running some read-only transactions. I can't seem to figure out how to see how much gas those transactions used up?

Any help would be great thanks!


You can explore the cost like this:

enter image description here

Have a look over here for a description of transaction cost and execution cost; What is the difference between transaction cost and execution cost in browser solidity?

In case it isn't clear, when view functions are called, or when a client users the call() method (read-only), then the gas cost is returned to the requester. If a view (or pure or constant) function is called from another function or contract, then the cost accrues to the transaction that kicked it off.

More about the subtleties over here: https://blog.b9lab.com/calls-vs-transactions-in-ethereum-smart-contracts-62d6b17d0bc2

Hope it helps.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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