1

Is it possible to know the amount of storage operations (or gas spent) that are between, let's say 4 functions, or a full contract?

Is foundry capable of this?

Thanks!

3
  • This post might answer your question. Commented May 3 at 16:18
  • Seems like that's for contract deployment. Gotta dig deeper to see if it can do what I want to achieve @SYEDASADKAZMI
    – dNyrM
    Commented May 4 at 13:11
  • It actually gives gas usage for the functions within the contract as well. Commented May 4 at 14:12

1 Answer 1

1

According to my knowledge direct measurement of gas usage between functions in a deployed smart contract isn't possible. It's like measuring flour used for each step in a baked cake. Gas is tracked at the instruction level, not the function level in the compiled code (similar to how a recipe doesn't track flour per step).

However, tools like Foundry can help estimate gas usage indirectly:

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.