Skip to main content
POST
debug_traceCall
curl --request POST \
  --url https://rpc.testnet.tempo.xyz/ \
  --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.

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