debug_traceTransaction
Reruns the transaction with the same state as when the transaction executed.

Parameters

Params - a string array containing (required):
  • transactionHash(hex string): - transaction hash
  • options(object): - request options object with the following fields (all optional and default to false):
    • disableStorage(boolean): - true disables storage capture.
    • disableMemory(boolean): - true disables memory capture.
    • disableStack(boolean) : - true disables stack capture.

Returns

Object - Transaction Trace Object.
  • failed(boolean) - True if transaction failed, otherwise, false.
  • gas(hex string) - the amount of gas used by transaction.
  • returnValue(hex string) - Bytes returned from transaction execution.
  • structLogs(array) - Array of structured log objects.
    • depth(integer number)- execution depth.
    • gas(integer number)- the amount of gas used by transaction.
    • gasCost(integer number) - the amount of gas used by opcode cost.
    • op(string) - opcode name.
    • pc(integer number) - program counter.
    • memory(optional) - execution memory.
    • stack(optional) - execution stack.
    • storage(optional) - contract storage.

Example

Request

curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "debug_traceTransaction",
"params": [
"0xf8fd8d2f360caf4a760337a44991596db2a3fec788de9c8e85a8ccf36807d6f2"
],
"id": 1
}'

Result

{
"jsonrpc":"2.0",
"id":1,
"result":{
"structLogs":[
{
"depth":1,
"error":"",
"gas":162106,
"gasCost":3,
"memory":null,
"op":"PUSH1",
"pc":0,
"stack":[],
"storage":{}
}
],
"gas":21000,
"failed":false,
"returnValue":""
}
}
Copy link
Outline
Parameters
Returns
Example
Request
Result