curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "debug_traceCall",
"params": [
{
"to": "0x760AfE86e5de5fa0Ee542fc7B7B713e1c5425701",
"data": "0x06fdde03"
},
"latest",
{
"tracer": "callTracer"
}
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "debug_traceCall",
"params": [
{
"to": "0x760AfE86e5de5fa0Ee542fc7B7B713e1c5425701",
"data": "0x06fdde03"
},
"latest",
{
"tracer": "callTracer"
}
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}eth_call but returns detailed execution traces, making it useful for debugging contract calls before sending actual transactions.
-32602 Invalid params) if the parameter is omitted. Always include the trace options, even if empty ({}).{} is provided, Monad defaults to callTracer instead of struct logs, because Monad does not currently support opcode-level struct logs at the VM level.object — the transaction call object:
from (optional) — address the transaction is sent fromto — address the transaction is directed togas (optional) — gas provided for the callgasPrice (optional) — gas price for the callvalue (optional) — value sent with the calldata (optional) — hash of the method signature and encoded parametersquantity|tag — the block number as a hexadecimal string, or block tag (latest, earliest, pending).object (optional) — the tracer options:
tracer — the tracer to use (e.g., callTracer, prestateTracer)tracerConfig — configuration options for the tracertimeout — timeout for the trace operationresult — the trace result object. The structure depends on the tracer used:
callTracer:
type — the call type (CALL, CREATE, etc.)from — sender addressto — recipient addressvalue — value transferredgas — gas providedgasUsed — gas usedinput — call dataoutput — return datacalls — nested callsdebug_traceCall code examplesconst { ethers } = require("ethers");
const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");
async function traceCall() {
// Trace name() call on Wrapped Monad (WMON) contract
const tx = {
to: "0x760AfE86e5de5fa0Ee542fc7B7B713e1c5425701",
data: "0x06fdde03" // name()
};
const trace = await provider.send("debug_traceCall", [
tx,
"latest",
{ tracer: "callTracer" }
]);
console.log("Call trace:", JSON.stringify(trace, null, 2));
}
traceCall();
debug_traceCall is simulating complex contract interactions before sending transactions to understand the execution path, identify potential failures, and verify expected behavior without spending gas.Was this page helpful?