post https://ethereum-mainnet-archive.allthatnode.com/
The debug_traceCall method lets you run an eth_call within the context of the given block execution using the final state of parent block as the base. The first argument (just as in eth_call) is a transaction object. The block can be specified either by hash or by number as the second argument. The trace can be configured similar to debug_traceTransaction, see TraceConfig. The method returns the same output as debug_traceTransaction.
Parameters
Object
- The transaction call objectfrom
:DATA
, 20 Bytes - The address the transaction is sent from.to
:DATA
, 20 Bytes - (optional when creating new contract) The address the transaction is directed to.gas
:QUANTITY
- (optional, default: 90000) Integer of the gas provided for the transaction execution. It will return unused gas.gasPrice
:QUANTITY
- (optional, default: To-Be-Determined) Integer of the gasPrice used for each paid gas.value
:QUANTITY
- (optional) Integer of the value sent with this transaction.data
:DATA
- The compiled code of a contract OR the hash of the invoked method signature and encoded parameters.nonce
:QUANTITY
- (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.
hash
|QUANTITY
|TAG
- block hash, or hex encoded integer block number, or the string "latest", "earliest" or "pending", see the default block parameterobject
- (Optional) The tracer object with the following fields:disableStorage
:boolean
- Setting this to true will disable storage capture (default = false).disableStack
:boolean
- Setting this to true will disable stack capture (default = false).enableMemory
:boolean
- Setting this to true will disable memory capture (default = false).enableReturnData
:boolean
- Setting this to true will disable stack capture (default = false).tracer
:string
- The type of tracer. It could be callTracer or prestateTracercallTracer
- The calltracer keeps track of all call frames, including depth 0 calls, that are made during a transactionprestateTracer
- The prestateTracer replays the transaction and tracks every part of state that occured during the transaction
tracerConfig
:object
- The object to specify the configurations of the traceronlyTopCall
:boolean
- When set to true, this will only trace the primary (top-level) call and not any sub-calls. It eliminates the additional processing for each call frame
curl https://ethereum-mainnet-archive.allthatnode.com/8U3JLUhzIDg3GShvy9hkCCSYkLGc11kj \
--request POST \
--header "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "debug_traceCall",
"params": [
{
"from": "0xc5a93444Cc4dA6EfB9e6FC6e5D3CB55A53b52396",
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
"gas": "0x76c00",
"gasPrice": "0xe1cb98800",
"value": "0x9184e72a",
"data": "0x"
},
"latest",
{
"enableMemory": true,
"disableStack": false,
"disableStorage": false,
"enableReturnData": true
}
]
}'
Returns
object
- trace objectfailed
- The transaction is successful or notgas
- The total consumed gas in the transactionreturnValue
- The return value of the executed contract callstructLogs
- The trace result of each step with the following fields:pc
- The current index in bytecodeop
- The name of current executing operationgas
- The available gas in the executiongasCost
- The gas cost of the operationdepth
- The number of levels of calling functionserror
- The error of the executionstack
- An array of values in the current stackmemory
- An array of values in the current memorystorage
- The mapping of the current storagerefund
- The total of current refund value
//with default tracer option
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"gas": 21045,
"failed": true,
"returnValue": "",
"structLogs": [
{
"pc": 0,
"op": "PUSH1",
"gas": 465400,
"gasCost": 3,
"depth": 1,
"stack": [],
"memory": []
},
{
"pc": 2,
"op": "PUSH1",
"gas": 465397,
"gasCost": 3,
"depth": 1,
"stack": [
"0x80"
],
"memory": []
},
{
"pc": 4,
"op": "MSTORE",
"gas": 465394,
"gasCost": 12,
"depth": 1,
"stack": [
"0x80",
"0x40"
],
"memory": []
},
{
"pc": 5,
"op": "CALLVALUE",
"gas": 465382,
"gasCost": 2,
"depth": 1,
"stack": [],
"memory": [
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000080"
]
},
//more objects
{
"pc": 14,
"op": "DUP1",
"gas": 465358,
"gasCost": 3,
"depth": 1,
"stack": [
"0x9184e72a",
"0x0"
],
"memory": [
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000080"
]
},
{
"pc": 15,
"op": "REVERT",
"gas": 465355,
"gasCost": 0,
"depth": 1,
"stack": [
"0x9184e72a",
"0x0",
"0x0"
],
"memory": [
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000080"
]
}
]
}
}
//with callTracer option
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"from": "0xc5a93444cc4da6efb9e6fc6e5d3cb55a53b52396",
"gas": "0x76c00",
"gasUsed": "0x5208",
"to": "0x7c4cbc1c8cb34e3ae021e66efda4c69d759ff499",
"input": "0x",
"value": "0x9184e72a",
"type": "CALL"
}
}