The debug_traceCall
method executes a call to a contract and returns a detailed trace of its execution at the opcode level, without creating a transaction on the blockchain. This provides the deepest possible visibility into how the Ethereum Virtual Machine (EVM) processes contract calls, making it an essential tool for debugging and detailed analysis.
This method simulates a contract call and provides detailed execution information at the opcode level.
Transaction call object
Address the transaction is sent from
Address the transaction is directed to
Gas provided for the transaction execution (hex)
Gas price in wei (hex)
Value transferred in wei (hex)
Contract method call data (function selector and encoded parameters)
Block number in hex format or tag ('latest', 'earliest', 'pending', 'safe', 'finalized') or block hash
Trace options to configure the debugging output
Setting this to true disables storage capture
Setting this to true disables memory capture
Setting this to true disables stack capture
Use a custom tracer (available: callTracer, prestateTracer, etc.)
Overrides the default timeout for JavaScript-based tracing
Trace object with detailed execution information
Gas used during the call
Whether the call failed
The returned data from the call
Array of structured EVM operation logs
Program counter position
The opcode executed
Remaining gas
Gas cost for this opcode
Call depth
EVM memory contents (if not disabled)
EVM stack contents (if not disabled)
Storage changes (if not disabled)
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"gas": 26848,
"failed": false,
"returnValue": "0x000000000000000000000000000000000000000000000000000000000001e240",
"structLogs": [
{
"pc": 0,
"op": "PUSH1",
"gas": 190129,
"gasCost": 3,
"depth": 1,
"stack": [],
"memory": [],
"storage": {}
},
{
"pc": 2,
"op": "MSTORE",
"gas": 190126,
"gasCost": 12,
"depth": 1,
"stack": ["0x60", "0x40"],
"memory": [
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000"
],
"storage": {}
}
// ... more operations
]
}
}
The callTracer produces a hierarchical representation of all calls made during execution:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"type": "CALL",
"from": "0xd7dad5d1413e8c08f2d92d5bd905bed62d9e2400",
"to": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984",
"value": "0x0",
"gas": "0x2cb9e",
"gasUsed": "0x68c5",
"input": "0x70a08231000000000000000000000000d7dad5d1413e8c08f2d92d5bd905bed62d9e2400",
"output": "0x000000000000000000000000000000000000000000000000000000000001e240",
"calls": [
{
"type": "STATICCALL",
"from": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984",
"to": "0x000000000000000000000000000000000000000a",
"gas": "0x26b2f",
"gasUsed": "0xd5",
"input": "0x1c0e9c09",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
}
]
}
}
Geth provides several built-in tracers:
Additionally, you can use JavaScript-based custom tracers for specialized analysis.
The options
parameter lets you configure the tracing:
The default tracer returns every opcode execution in the VM. Common opcodes you'll see:
The structLogs
array contains one entry for each opcode executed:
disableMemory
, disableStack
, or disableStorage
options for large contractscallTracer
provides a much more compact output focusing just on the call structureto
address and provide initialization bytecode in data