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!
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.Sign up to join this community
You can explore the cost like this:
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
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.