trace_call - Ethereum

trace_call. Executes the given call and returns a number of possible traces for it

trace_call - ethereum [Value: 60CU]
Executes the given call and returns a number of possible traces for it.
Use cases

Use cases

  • Debug smart contract function calls by tracing
  • Analyze specific transactions for internal operations
  • Investigate gas usage of complex contract interactions
Constraints

Constraints

  • Requires valid input data and addresses
  • Node must support trace_call method
  • Large data output for complex transactions
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://eth.drpc.org \
-X POST \
-H "Content-Type: application/json" \
-d '{"method":"trace_call",
    "params":[{
      "from": "0x6f1FB6EFDf50F34bFA3F2bC0E5576EdD71631638",
      "to": "0x1E0447b19BB6EcFdAe1e4AE1694b0C3659614e4e",
      "value": "0x0",
      "data": "0xa67a6a45000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000"},
      ["trace"]],
    "id":1,
    "jsonrpc":"2.0"}'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "output": "0x",
      "stateDiff": null,
      "trace": [
        {
          "action": {
            "callType": "call",
            "from": "0x407d73d8a49eeb85d32cf465507dd71d507100c1",
            "gas": "0x76c0",
            "input": "0x",
            "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
            "value": "0x186a0"
          },
          "blockHash": "0x...",
          "blockNumber": 1234567,
          "result": {
            "gasUsed": "0x5208",
            "output": "0x"
          },
          "subtraces": 0,
          "traceAddress": [],
          "transactionHash": "0x...",
          "transactionPosition": 0,
          "type": "call"
        }
        // Additional trace objects can be included here
      ],
      "vmTrace": null
    },
    {
      "output": "0x",
      "stateDiff": null,
      "trace": [
        {
          "action": {
            "callType": "call",
            "from": "0x407d73d8a49eeb85d32cf465507dd71d507100c1",
            "gas": "0x76c0",
            "input": "0x",
            "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
            "value": "0x186a0"
          },
          "blockHash": "0x...",
          "blockNumber": 1234567,
          "result": {
            "gasUsed": "0x5208",
            "output": "0x"
          },
          "subtraces": 0,
          "traceAddress": [],
          "transactionHash": "0x...",
          "transactionPosition": 0,
          "type": "call"
        }
        // Additional trace objects can be included here
      ],
      "vmTrace": null
    }
  ]
}{
  "jsonrpc": "2.0",
  "result": {
    "output": "0x",
    "stateDiff": null,
    "trace": [
      {
        "action": {
          "callType": "call",
          "from": "0x6f1fb6efdf50f34bfa3f2bc0e5576edd71631638",
          "gas": "0x1dcd11f8",
          "input": "0xa67a6a45000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000",
          "to": "0x1e0447b19bb6ecfdae1e4ae1694b0c3659614e4e",
          "value": "0x0"
        },
        "error": "Reverted",
        "subtraces": 0,
        "traceAddress": [],
        "type": "call"
      }
    ],
    "vmTrace": null
  },
  "id": 0
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray
array
transactionobject
The transaction call object which contains the following fields.
array
fromstring
The address from which the transaction is sent.
tostring
The address to which the transaction is addressed.
gasinteger
The integer of gas provided for the transaction execution.
gasPriceinteger
The integer of gasPrice used for each paid gas encoded as hexadecimal.
valueinteger
The integer of value sent with this transaction encoded as hexadecimal.
datastring
The hash of the method signature and encoded parameters.
blockNumberstring
The hex value of a block number, hash or tags:
  • latest [default] - the blockchain's most recent block
  • earliest - the first or genesis block
  • pending - transactions broadcasted but not yet included in a block
vmTracestring
To get a full trace of the virtual machine's state during the execution of the given of given transaction, including for any subcalls
traceTypestring
Type of trace, one or more of: "trace", "stateDiff".

Response

200
Array of Block traces

Response params

object
idinteger
jsonrpcstring
resultobject
object
actionobject
object
callTypestring
The type of call.
fromstring
The address of the sender.
tostring
The address of the receiver.
valuestring
The value transferred in wei.
gasstring
The gas provided for the call.
inputstring
The data sent along with the call.
blockHashstring
The hash of the block where the trace occurred.
blockNumberstring
The number of the block where the trace occurred.
resultstring
object
gasUsedstring
The amount of gas used by the trace.
outputstring
The output of the call.
subtracesinteger
The number of subtraces created by this trace.
traceAddressarray_of_strings
The trace address indicating the position of this trace in the call stack.
transactionHashstring
The hash of the transaction to which this trace belongs.
transactionPositionstring
The position of the transaction in the block.
typestring
The type of trace.
vmTracestring
To get a full trace of the virtual machine's state during the execution of the given of given transaction, including for any subcalls