debug_traceCall RPC Method

Performs a simulated call and returns detailed execution traces.

Parameters#

objectrequired

Object describing the call to simulate:

fromstringoptional

Sender address for the call.

tostringoptional

Recipient address of the call.

gasstringoptional

Gas budget allocated for execution, hex-encoded.

maxFeePerGasstringoptional

Upper limit on the fee per unit of gas the caller will pay, hex-encoded.

maxPriorityFeePerGasstringoptional

Tip cap per unit of gas for the block producer, hex-encoded.

valuestringoptional

Amount of native token to transfer with the call, hex-encoded.

inputstringoptional

Compiled contract bytecode or ABI-encoded function call data.

datastringoptional

Compiled contract bytecode or ABI-encoded function call data (alias for input).

noncestringoptional

Sender nonce for the transaction, hex-encoded.

chainIdstringoptional

Target chain identifier, hex-encoded.

accessListarrayoptional

EIP-2930 access list.

authorizationListarrayoptional

EIP-7702 authorization list.

stringrequired

Block tag (latest, safe, finalized, pending) or a hex-encoded block hash to use as the execution context.

objectrequired

Object that controls tracing behavior:

tracerstring

Tracer type to apply: callTracer or prestateTracer.

tracerConfigobjectoptional

Optional settings for the chosen tracer:

onlyTopCallbooleanoptional

If true, limits tracing to the outermost call frame only.

diffModebooleanoptional

If true, outputs state differences instead of full pre-state (prestateTracer only).

withLogbooleanoptional

If true, attaches event logs to the trace output.

Result#

object - The resulting trace data.

Code sample#

{
  "jsonrpc": "2.0",
  "method": "debug_traceCall",
  "params": [
    {
      "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
      "data": "0x70a08231000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1"
    },
    "latest",
    {
      "tracer": "callTracer"
    }
  ],
  "id": 1
}

Response#

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "type": "CALL",
    "from": "0x0000000000000000000000000000000000000000",
    "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
    "value": "0x0",
    "gas": "0xbebc200",
    "gasUsed": "0x5208",
    "input": "0x70a08231...",
    "output": "0x0000000000000000000000000000000000000000000000000000000000000000"
  }
}
Try It