Gas Usage Flame Graph Generator
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
Gas Usage Flame Graph Generator is an analytics-focused tool that visualizes gas usage distribution across contract calls and operations using flame graphs. It takes gas breakdown data in JSON format (a hierarchical tree with "name", "gas", and optional "children" arrays) and generates a visual flame graph showing how gas is distributed across different functions, sub-calls, and operations. The flame graph displays each function or operation as a colored bar, with the width proportional to the gas consumed. Nested calls are stacked vertically, showing the call hierarchy and relative gas costs at each level. The tool calculates total gas, maximum depth, and node count, and outputs both the SVG flame graph and the original JSON data. This enables developers and auditors to identify gas hotspots, optimize expensive operations, and understand gas consumption patterns across contract calls.
HOW TO USE
Enter gas breakdown data as a JSON tree with "name", "gas", and optional "children" arrays. The root node should represent the total gas usage, with children representing sub-calls or operations. For example: {"name":"total","gas":100000,"children":[{"name":"transfer","gas":30000},{"name":"mint","gas":20000,"children":[{"name":"_mint","gas":15000},{"name":"_update","gas":5000}]}]}. Click "Generate flame graph" to create the visualization. The tool will display a summary with total gas, maximum depth, and node count, along with the flame graph as an SVG image. The data can be copied or downloaded as JSON.
TECHNICAL NOTE: FLAME GRAPH GENERATION AND COLOR MAPPING
The tool parses the JSON tree and recursively traverses it to build a flame graph. Each node's bar width is proportional to its gas consumption relative to its parent, and the color is determined by a hash of the node name to ensure consistent coloring across runs. The flame graph is rendered as an SVG with one row per depth level, showing the hierarchical structure of gas consumption. The tool also calculates total gas, maximum depth, and node count for the summary. The flame graph uses a dark theme matching the tool's design, with hover effects for better readability.
WHAT IT CANNOT SEE
The tool cannot generate flame graphs without detailed gas breakdown data; it requires hierarchical gas data as input. It is limited to the accuracy of the provided gas data; incorrect data will produce incorrect visualizations. It cannot decode opcodes without trace data. The tool is limited by debug_traceTransaction availability on the RPC endpoint for generating trace-based data. It cannot generate flame graphs for transactions without internal traces. It cannot generate flame graphs for non-EVM chains.
PLEASE NOTE
This tool is designed exclusively for EVM-compatible chains (Ethereum, Polygon, BNB Chain, Arbitrum, Optimism, Avalanche C-Chain, etc.). It does not support non-EVM blockchains. The tool requires gas breakdown data in the specified JSON format. The flame graph provides a visual overview of gas distribution but does not replace detailed gas profiling. Always verify the data and consult additional tools for comprehensive gas optimization. The tool provides no warranty that the flame graph is complete or accurate; users are responsible for verifying the input data.