debug_traceTransaction
Polygon API - The traceTransaction debugging method will attempt to run the transaction in the exact same manner as it was executed on the network. It will replay any transaction that may have been ex

Parameters

In addition to the hash of the transaction you may give it a secondary optional argument, which specifies the options for this specific call. The possible options are:
In addition to the hash of the transaction you may give it a secondary optional argument, which specifies the options for this specific call. The possible options are:
  • disableStorage: BOOL. Setting this to true will disable storage capture (default = false).
  • disableMemory: BOOL. Setting this to true will disable memory capture (default = false).
  • disableStack: BOOL. Setting this to true will disable stack capture (default = false).
  • tracer: STRING. Setting this will enable JavaScript-based transaction tracing, described below. If set, the previous four arguments will be ignored.
  • timeout: STRING. Overrides the default timeout of 5 seconds for JavaScript-based tracing calls. Valid values are described here.
  • disableStorage: BOOL. Setting this to true will disable storage capture (default = false).
  • disableMemory: BOOL. Setting this to true will disable memory capture (default = false).
  • disableStack: BOOL. Setting this to true will disable stack capture (default = false).
  • tracer: STRING. Setting this will enable JavaScript-based transaction tracing, described below. If set, the previous four arguments will be ignored.
  • timeout: STRING. Overrides the default timeout of 5 seconds for JavaScript-based tracing calls. Valid values are described here.
Client
Method Invocation
Go
debug.TraceTransaction(txHash common.Hash, logger *vm.LogConfig) (*ExecutionResurt, error)
Console
debug.traceTransaction(txHash, [options])
RPC
{"method": "debug_traceTransaction", "params": [txHash, {}]}
Client
Method Invocation
Go
debug.TraceTransaction(txHash common.Hash, logger *vm.LogConfig) (*ExecutionResurt, error)
Console
debug.traceTransaction(txHash, [options])
RPC
{"method": "debug_traceTransaction", "params": [txHash, {}]}

Example

Request

1
debug.traceTransaction("0x2059dd53ecac9827faad14d364f9e04b1d5fe5b506e3acc886eff7a6f88a696a")
Copied!

Result

1
{
2
gas: 85301,
3
returnValue: "",
4
structLogs: [{
5
depth: 1,
6
error: "",
7
gas: 162106,
8
gasCost: 3,
9
memory: null,
10
op: "PUSH1",
11
pc: 0,
12
stack: [],
13
storage: {}
14
},
15
/* snip */
16
{
17
depth: 1,
18
error: "",
19
gas: 100000,
20
gasCost: 0,
21
memory: ["0000000000000000000000000000000000000000000000000000000000000006", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000060"],
22
op: "STOP",
23
pc: 120,
24
stack: ["00000000000000000000000000000000000000000000000000000000d67cbec9"],
25
storage: {
26
0000000000000000000000000000000000000000000000000000000000000004: "8241fa522772837f0d05511f20caa6da1d5a3209000000000000000400000001",
27
0000000000000000000000000000000000000000000000000000000000000006: "0000000000000000000000000000000000000000000000000000000000000001",
28
f652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f: "00000000000000000000000002e816afc1b5c0f39852131959d946eb3b07b5ad"
29
}
30
}]
Copied!
1
{
2
gas: 85301,
3
returnValue: "",
4
structLogs: [{
5
depth: 1,
6
error: "",
7
gas: 162106,
8
gasCost: 3,
9
memory: null,
10
op: "PUSH1",
11
pc: 0,
12
stack: [],
13
storage: {}
14
},
15
/* snip */
16
{
17
depth: 1,
18
error: "",
19
gas: 100000,
20
gasCost: 0,
21
memory: ["0000000000000000000000000000000000000000000000000000000000000006", "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000060"],
22
op: "STOP",
23
pc: 120,
24
stack: ["00000000000000000000000000000000000000000000000000000000d67cbec9"],
25
storage: {
26
0000000000000000000000000000000000000000000000000000000000000004: "8241fa522772837f0d05511f20caa6da1d5a3209000000000000000400000001",
27
0000000000000000000000000000000000000000000000000000000000000006: "0000000000000000000000000000000000000000000000000000000000000001",
28
f652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f: "00000000000000000000000002e816afc1b5c0f39852131959d946eb3b07b5ad"
29
}
30
}]
Copied!
Last modified 18d ago