Overview

Record step-by-step EVM execution with opcode, call, and pre-state tracers.

mega-evme can record detailed execution traces during EVM runs. Traces are useful for debugging reverts, analyzing gas consumption, and understanding call flow.

Enabling Tracing

Add --trace to any command to enable tracing:

mega-evme run 0x60016000526001601ff3 --trace

By default, this uses the opcode tracer. Use --tracer to pick a different tracer.

Tracers

Tracer

--tracer value

Description

opcode (default)

Step-by-step opcode execution log with gas, stack, memory, and storage

call

Nested call tree showing CALL/CREATE hierarchy, gas, and return data

pre-state (alias: prestate)

Account state accessed during execution, with optional diff mode

Common Options

These flags apply to all tracers:

Flag
Default
Description

--trace

false

Enable tracing

--trace.output <PATH>

stdout

Write trace output to a file instead of the console

--tracer <TRACER>

opcode

Select which tracer to use

Output

Trace output is JSON. When --trace.output is not set, the trace is printed to stdout after the execution result. When --trace.output is set, the trace is written to the specified file and only the execution result appears on stdout.

Last updated