POST
/
35848e183f3e3303c8cfeacbea831cab
curl --request POST \
  --url https://bsc-mainnet.core.chainstack.com/35848e183f3e3303c8cfeacbea831cab \
  --header 'Content-Type: application/json' \
  --data '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "trace_replayTransaction",
  "params": [
    "0xf6bc709b8086048bff62dba8275922f9bf1fc1f9d82994037d3e7179597b3d1d",
    [
      "trace"
    ]
  ]
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": {}
}

BNB API method trace_replayTransaction replays a single transaction using the trace module, returning detailed trace data about its execution. This method is crucial for developers, auditors, and analysts who need to understand the precise execution flow of a transaction, including calls made to other contracts, state changes, and the execution outcome.

Parameters

  • transactionHash — the hash of the transaction you want to replay, specified as a hexadecimal string.
  • traceTypes — an array of strings specifying the types of traces to return, with options including:
    • vmTrace — virtual machine trace.
    • trace — standard execution trace.
    • stateDiff — state difference trace.

Response

  • result — The trace data for the specified transaction. Depending on the traceTypes requested, this may include a detailed execution trace (vmTrace), a step-by-step list of executed operations (trace), or a summary of state changes (stateDiff).

Use case

The trace_replayTransaction method is invaluable for a detailed analysis of individual transactions. It can be used by developers to debug smart contract interactions, by auditors to verify transaction integrity and security, and by analysts to understand the effects of a transaction on the blockchain state. This method provides a deep dive into the transaction’s execution, offering insights not readily available through standard transaction receipts.

Body

application/json
id
integer
default:1
jsonrpc
string
default:2.0
method
string
default:trace_replayTransaction
params
array

Response

200 - application/json
Results of replaying the transaction with trace.
jsonrpc
string
id
integer
result
object