Skip to main content
POST
debug_traceCall
curl --request POST \
  --url https://tempo-moderato.core.chainstack.com/a25a421add2280d53fdbc23417055501/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "debug_traceCall",
  "params": [
    {
      "to": "0x20c0000000000000000000000000000000000000",
      "data": "0x70a082310000000000000000000000009729187d9e8bbefa8295f39f5634ca454dd9d294"
    },
    "latest",
    {}
  ],
  "id": 1
}
'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": {}
}
Tempo API method that traces the execution of a call without creating a transaction on the blockchain. This is useful for debugging contract interactions before sending actual transactions.
Get you own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • callObject — the call object:
    • from — (optional) sender address
    • to — recipient address
    • gas — (optional) gas limit
    • gasPrice — (optional) gas price
    • value — (optional) value to send
    • data — (optional) call data
  • blockParameter — the block number (hex) or tag (latest, earliest, pending)
  • tracerConfig — (optional) tracer configuration object:
    • tracer — tracer type (e.g., callTracer, prestateTracer)

Response

  • result — the trace result object, format depends on the tracer used
For the default tracer:
  • gas — gas used
  • failed — whether the call failed
  • returnValue — return data
  • structLogs — array of execution steps

debug_traceCall code examples

The following example traces a balanceOf call on the pathUSD token:
const ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);

// pathUSD token address
const PATHUSD = "0x20c0000000000000000000000000000000000000";
const TARGET_ADDRESS = "0x9729187D9E8Bbefa8295F39f5634cA454dd9d294";

// Encode balanceOf(address)
const iface = new ethers.Interface(["function balanceOf(address) view returns (uint256)"]);
const data = iface.encodeFunctionData("balanceOf", [TARGET_ADDRESS]);

const traceCall = async () => {
    // Using default tracer
    const trace = await provider.send("debug_traceCall", [
      {
        to: PATHUSD,
        data: data
      },
      "latest",
      {}
    ]);

    console.log("Gas used:", trace.gas);
    console.log("Failed:", trace.failed);
    console.log("Return value:", trace.returnValue);
    console.log("Execution steps:", trace.structLogs.length);
  };

traceCall();

Body

application/json
jsonrpc
string
default:2.0
method
string
default:debug_traceCall
params
any[]

Call object, block identifier, and optional tracer config

id
integer
default:1

Response

200 - application/json

Call trace

jsonrpc
string
id
integer
result
object

Trace result object

Last modified on January 28, 2026