zemse / forge-flamegraph

🔥 flamegraphs for solidity

Home Page:https://ethglobal.com/showcase/not-decided-0gr0p

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

forge-flamegraph

a foundry plugin that generates interactive flamegraph for a test case. currently two backends are supported: calltrace and debugtrace.

lets forge some flamegraphs!

flamegraph of poseidon2 hash function

above is a debugtrace flamegraph of poseidon2 hash function.

Installation

cargo install --git https://github.com/zemse/forge-flamegraph 

Usage

calltrace

suitable for complex contracts like defi protocols. generates flamegraph svg with the call trace.

forge-flamegraph -t NAME_OF_TEST_FUNCTION --open

debugtrace

suitable for libraries. generates flamegraph svg including solidity internal functions.

forge-flamegraph -t NAME_OF_TEST_FUNCTION --debugtrace --open

Note: source mappings from the solidity compiler aren't that great, this plugin still tries to guess by looking at source mappings of adjacent steps but unfortunately it only works to some extent.

Acknowledgements

and ofcourse for so much oss used in this project

About

🔥 flamegraphs for solidity

https://ethglobal.com/showcase/not-decided-0gr0p


Languages

Language:Rust 100.0%