Skip to main content

debug_traceCall

POST

Runs eth_call in debugging mode and provides trace functionality. You can trace all stack changes that occur when executing a specific call based on the current block's state.
param[0]
callObjectobjectrequired
Call object for transaction simulation. May include the following fields.
  • from: Enter the transaction's from address as a string.
  • to: Enter the transaction's to address as a string.
  • gas: Enter the gas required to process the transaction as a hex-format string. For smart contract calls, no gas is consumed, so you can enter 0x0.
  • gasPrice: Enter the desired cost per gas as a hex-format string.
  • value: The value of the transaction.
  • data: The method signature hash of the transaction to execute. Can be referenced from the ABI.
fromstring
Enter the transaction's from address as a string.
tostring
Enter the transaction's to address as a string.
gasstring
Enter the gas required to process the transaction as a hex-format string. For smart contract calls, no gas is consumed, so you can enter 0x0.
gasPricestring
Enter the desired cost per gas as a hex-format string.
valuestring
The value of the transaction.
datastring
The method signature hash of the transaction to execute. Can be referenced from the ABI.
param[1]
blockNumberOrHashOrTagstringrequired
Use block hash, block number, or block tag to specify a block.
  • Block number: Hexadecimal string (ex. "0x1")
  • Block hash: 64-digit hexadecimal string (ex. "0x39008d07edf93c03bb9d1cfc80598fcf63f441ec86e9de3733fa6a484980ca48")]
  • Block tag: Enum string (ex. "latest", "earliest", "pending")
    • earliest: The oldest available block on the chain.
    • finalized: A recently finalized block that can no longer be changed. Primarily used in proof-of-stake (PoS) blockchains.
    • safe: A recent block considered safe by the network (immune to reorgs).
    • latest: The most recent block on the chain (may be subject to reorgs).
    • pending: The next block to be mined, including pending transactions in the mempool.
param[2]
traceOptionObjectobjectrequired
Object for trace option configuration.
tracerstring
A field that specifies the tracer type, set to either "callTracer" or "prestateTracer".1. callTracer: Used to inspect the execution path and results of executed transactions. Provides information such as the call stack, return values, gas consumption, and revert reasons, and can trace the process of function calls and interactions with smart contracts. Depending on the execution option (onlyTopCall), you can trace all nested calls of a specific call.2. prestateTracer: A tool that traces the pre-state before a specific transaction or block is executed. Records account state and contract code before transaction execution, allowing you to analyze state changes before and after execution. prestateTracer is used to trace smart contract state changes and interactions between accounts.
tracerConfigobject
Object for tracer configuration. Uses the boolean "onlyTopCall" option; when set to true, traces only the main call. When set to false, traces down to the sub-call level.
onlyTopCallboolean
Responses
fromstring
Caller address
gasstring
Gas limit set for the call (hex)
gasUsedstring
Actual gas used (hex)
tostring
Callee address
inputstring
Call input data (hex)
outputstring
Call return data (hex)
valuestring
Amount of ETH transferred (hex, in wei)
typestring
Call type (CALL, CREATE, STATICCALL, etc.)
callsarray
List of internal sub-calls
errorstring
Error message if execution failed
revertReasonstring
Revert reason if the transaction was reverted
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Unauthorized"
}
cURL
curl -X POST 'https://bnb-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "debug_traceCall",
"params": [
{
"from": "0xc90d3Ac75D1D36dF0b0a229E73D8409FB7F3c4ab",
"to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"value": "0x186a0",
"data": "0x70a08231000000000000000000000000d8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
},
"finalized",
{
"tracer": "callTracer",
"tracerConfig": {
"onlyTopCall": true
}
}
]
}'