trace_callMany
Note
Served only when
traceis named in--http.apior--ws.api; see Enabling Namespaces.
Warning
Fee fields at
latestandpendingAt
latestandpendingthis method prices the call against the block header’s base fee, not the worker’s current epoch base fee thateth_callandeth_estimateGasuse. A request that setsgasPrice,maxFeePerGasormaxPriorityFeePerGascan therefore be accepted byeth_calland rejected here, or the reverse; requests without fee fields are unaffected. Tracked in #1587.
Executes a sequence of calls on the state of a block, each one on top of the state changes of the calls before it, and returns the trace types requested for each call. This traces dependent transactions, such as an approval followed by a transfer, without sending them. Unlike trace_call, this method takes no state or block overrides.
Parameters
Array - The calls, in execution order. Each call is a two-element array: the transaction call object, with the fields trace_call lists, and the trace types to return for that call, any of "trace", "vmTrace" and "stateDiff".
QUANTITY|TAG|DATA - (optional) The block whose state the first call runs on: a hexadecimal block number, a 32-byte block hash, or one of the string tags latest, earliest, pending, safe or finalized. See the default block parameter. Defaults to pending.
Returns
Array - One object per call, in the order of the calls. Each object has:
output:DATA- The return data of the top-level call;0xfor a plain transfer.stateDiff:Object- WithstateDiffrequested, the state changes keyed by account address; otherwisenull. Each account hasbalance,code,nonceandstorage(keyed by slot). Each value is"="when unchanged,{"+": value}when created,{"-": value}when removed, or{"*": {"from": old, "to": new}}when changed.trace:Array- Withtracerequested, the call frames, top-level first; otherwise[]. Each frame hastype,action,error(only when the frame failed),result,subtracesandtraceAddress, with the meanings trace_transaction gives them, and no block or transaction fields. The top-level frame’saction.gasandresult.gasUsedleave out the intrinsic gas, so for a plain transfer with a 21,000 gas limit both are0x0.vmTrace:Object- WithvmTracerequested, the instructions the top-level call executed; otherwisenull. It hascode(DATA, the code that ran) andops, one entry per instruction withcost(Number, its gas cost),pc(Number, the program counter),ex(its effects:used,pushfor the stack items it pushed,memfor a memory write andstorefor a storage write),sub(the nestedvmTraceof a CALL or CREATE, ornull), and, when present,op(the opcode name) andidx.
Example
Request
curl http://localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"trace_callMany","params":[[
[{"from":"0xb14d3c4f5fbfbcfb98af2d330000d49c95b93aa7","to":"0x0000000000000000000000000000000000000000","gas":"0x5208","value":"0x64"},["trace"]],
[{"from":"0xb14d3c4f5fbfbcfb98af2d330000d49c95b93aa7","to":"0x0000000000000000000000000000000000000000","gas":"0x5208","value":"0x64"},["trace"]]],
"latest"],"id":1}'
Result
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"output": "0x",
"stateDiff": null,
"trace": [
{
"type": "call",
"action": {
"from": "0xb14d3c4f5fbfbcfb98af2d330000d49c95b93aa7",
"callType": "call",
"gas": "0x0",
"input": "0x",
"to": "0x0000000000000000000000000000000000000000",
"value": "0x64"
},
"result": {
"gasUsed": "0x0",
"output": "0x"
},
"subtraces": 0,
"traceAddress": []
}
],
"vmTrace": null
},
{
"output": "0x",
"stateDiff": null,
"trace": [
{
"type": "call",
"action": {
"from": "0xb14d3c4f5fbfbcfb98af2d330000d49c95b93aa7",
"callType": "call",
"gas": "0x0",
"input": "0x",
"to": "0x0000000000000000000000000000000000000000",
"value": "0x64"
},
"result": {
"gasUsed": "0x0",
"output": "0x"
},
"subtraces": 0,
"traceAddress": []
}
],
"vmTrace": null
}
]
}