trace_rawTransaction - Ethereum

trace_rawTransaction. Traces a call to eth_sendRawTransaction without making the call, returning the traces

trace_rawTransaction - ethereum [Value: 75CU]
Traces a call to eth_sendRawTransaction without making the call, returning the traces.
Use cases

Use cases

  • Validate the execution paths of smart contracts
  • Analyze the detailed gas usage of a transaction
  • Investigate the root causes of transaction
Constraints

Constraints

  • Invalid or corrupted transaction data will result in errors
  • Not all nodes may have tracing capabilities enabled
  • The types of traces must be specified correctly in the request
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" \
  --data '{"method":"trace_rawTransaction","params":["RAW_TRANSACTION_DATA",["trace"]],"id":1,"jsonrpc":"2.0"}' 
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "action": {
        "callType": "call",
        "from": "0xEdC763b3e418cD14767b3Be02b667619a6374076",
        "gas": "0x76c0",
        "input": "0x",
        "to": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE",
        "value": "0x0"
      },
      "blockHash": "0x1e3b87c5ea233b9d8c19ad7d7beaf0fa8dd3d74157b1441a13f8a18e176a11db",
      "blockNumber": 13328707,
      "result": {
        "gasUsed": "0x5208",
        "output": "0x"
      },
      "subtraces": 0,
      "traceAddress": [],
      "transactionHash": "0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3",
      "transactionPosition": 0,
      "type": "call"
    }
    // Additional traces can be included here
  ]
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray
array
datastring
The raw transaction data/string (RAW_TRANSACTION_DATA)
arrayarray
The type of trace, which can be one of the following:
array
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
The block traces, which have the following fields (please note that all return types are hexadecimal representations of their data type unless otherwise stated):

Response params

object
idinteger
jsonrpcstring
resultobject
object
outputstring
The data which is returned as an output encoded in hexadecimal format.
stateDiffstring
It returns the information on altered Ethereum state due to execution of the given transaction.
traceobject
It is used to retrieve the basic trace of the given information
object
actionstring
The action to be performed on the receiver id.
object
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.
resultstring
object
gasUsedstring
The amount of gas used by the trace.
outputstring
The output of the call.
subtracesstring
The traces of contract calls made by the transaction.
traceAddressstring
The list of addresses where the call was executed, the address of the parents, and the order of the current sub call
typestring
The type of trace.
vmTracestring
It is used to get a full trace of the virtual machine's state during the execution of the given transaction, including for any sub-calls.