debug_traceCall - Polygon

debug_traceCall. Returns the number of possible tracing result

debug_traceCall - polygon [Value: 90CU]
Trace the execution of a call without broadcasting
Use cases

Use cases

  • Simulate a transaction execution without sending it on-chain
  • Trace internal smart contract operations during a call
  • Debug gas usage and execution logic before broadcasting
Constraints

Constraints

  • Requires a valid call object and block number/state
  • Node must support `debug_traceCall`
  • High resource usage for large or complex calls
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl https://polygon.drpc.org \
-X POST \
-H "Content-Type: application/json" \
--data '{
  "method": "debug_traceCall",
  "params": [
    {
      "from": null,
      "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
      "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"
    },
    "latest"
  ],
  "id": 1,
  "jsonrpc": "2.0"
}'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "from": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
    "gas": "0x1e9ef",
    "gasUsed": "0x7657",
    "to": "0x0000000000a39bb272e79075ade125fd351887ac",
    "input": "0xd0e30db0",
    "calls": [
      {
        "from": "0x0000000000a39bb272e79075ade125fd351887ac",
        "gas": "0x17eab",
        "gasUsed": "0x10ff",
        "to": "0x01a656024de4b89e2d0198bf4d468e8fd2358b17",
        "input": "0xd0e30db0",
        "value": "0x0",
        "type": "DELEGATECALL"
      }
    ],
    "value": "0x0",
    "type": "CALL"
  }
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray
array
transactionCallobject
The transaction call object containing the following fields:
array
fromstring
The address the transaction is sent from.
tostring
REQUIRED. The address the transaction is directed to.
gasinteger
The integer of the gas provided for the transaction execution.
gasPriceinteger
The integer of the gas price used for each paid gas.
valueinteger
The integer value sent with this transaction.
datastring
The hash of the method signature and encoded parameters.
blockNumberstring
The block number in hexadecimal format, the block hash, or tags.
tracerobject
REQUIRED. The tracer object specifying the following fields:
array
tracerstring
Type of tracer. Could be 'callTracer' or 'prestateTracer'.
tracerConfigobject
Configuration settings for the tracer.
array
onlyTopCallboolean
If true, traces only the top-level call (primary call) and skips sub-calls.

Response

200

Response params

object
idinteger
jsonrpcstring
resultarray_of_objects
The transaction trace object containing details of the trace.
object
failedboolean
Indicates whether the transaction was successful or not.
gasinteger
Total gas consumed during the transaction.
returnValuestring
The return value of the executed contract call.
structLogsarray
Detailed logs of each step of the trace, including the following fields:
object
pcinteger
Current program counter (bytecode index).
opstring
Name of the current executing operation.
gasinteger
Available gas at this step.
gasCostinteger
Gas cost of the current operation.
depthinteger
Number of call frames deep this operation is.
errorstring
Error encountered during execution, if any.
stackarray
Current state of the EVM stack at this step.
memoryarray
Current state of the EVM memory at this step.
storagestring
Current state of the contract’s storage at this step.
refundinteger
Total gas refund available at this step.