curl --request POST \
--url https://nd-954-882-037.p2pify.com/66f812de2a6724a75a51f60dd6f2a154 \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "arbtrace_callMany",
"params": [
[
[
{
"from": "0xb8351B61Fa1Eb007A9f80144C489d513e6A76b14",
"to": "0x478fa4C971a077038B4Fc5C172c3Af5552224ccc",
"value": "0xb1a2bc2ec50000"
},
[
"trace"
]
],
[
{
"from": "0xb8351B61Fa1Eb007A9f80144C489d513e6A76b14",
"to": "0x988aA44E12c7BCE07E449A4156b4A269d6642B3A",
"value": "0x6f05b59d3b20000"
},
[
"trace"
]
]
],
"latest"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}curl --request POST \
--url https://nd-954-882-037.p2pify.com/66f812de2a6724a75a51f60dd6f2a154 \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "arbtrace_callMany",
"params": [
[
[
{
"from": "0xb8351B61Fa1Eb007A9f80144C489d513e6A76b14",
"to": "0x478fa4C971a077038B4Fc5C172c3Af5552224ccc",
"value": "0xb1a2bc2ec50000"
},
[
"trace"
]
],
[
{
"from": "0xb8351B61Fa1Eb007A9f80144C489d513e6A76b14",
"to": "0x988aA44E12c7BCE07E449A4156b4A269d6642B3A",
"value": "0x6f05b59d3b20000"
},
[
"trace"
]
]
],
"latest"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}debug_* methods available for newer blocks.Use the arbtrace_callMany method for calling blocks prior to 22,207,815.array — transaction call objects:
object — the transaction call object to trace; can be multiple call objects for different transactions:
from — (optional) the string of the address used to send the transaction.to — the string of the address to which the transaction is directed, a wallet, or a smart contract.gas — (optional) the maximum amount of gas that can be used by the transaction.gasprice — (optional) the amount of gas price the sender is willing to pay for each gas unit in wei.value — (optional) the value sent with this transaction, encoded as hexadecimal.data — (optional) additional data to be sent with the call, usually used to invoke functions from smart contracts as a string of the hash of the method signature and encoded parameters; see the Ethereum Contract ABI.array — the string trace to indicate the type of tracer.quantity — the integer of a block, encoded as hexadecimal.array — an array with the traces objects:
output — the data returned as a result of the transaction, encoded in hexadecimal format.stateDiff — reveals changes to the state resulting from the execution of the given transaction.trace — the basic trace of specific information.
action — the operation to be performed on the recipient.
from — the address initiating the transaction.callType — the type of method, such as call or delegatecall.gas — the units of gas supplied by the sender, encoded in hexadecimal format.input — the data transmitted along with the transaction, typically used for interaction with smart contracts.to — the recipient’s address. If it’s a contract creation transaction, this field is null.value — the amount sent with the transaction, encoded as a hexadecimal.result — the value of the gas price used, encoded as hexadecimal.
gasUsed — the total amount of gas used by all the transactions in the block, encoded as hexadecimal.output — the return value from the contract call, encoded in hexadecimal. If the RETURN method isn’t executed, the output will be empty bytes.subtraces — a list of contract calls made by the transaction, each represented as a nested callframe object.traceAddress — a list of addresses where the call was executed, the addresses of the parent calls, and the order of the current sub-call.type — the value of the method, such as call or create.vmTrace — a comprehensive trace of the virtual machine’s state during the execution of a given transaction, including any sub-calls.arbtrace_callMany code examplesconst Web3 = require("web3");
const NODE_URL = "YOUR_CHAINSTACK_ENDPOINT";
const web3 = new Web3(NODE_URL);
// Define the arbtrace_callMany custom method
web3.extend({
property: 'arbtrace',
methods: [{
name: 'callMany',
call: 'arbtrace_callMany',
params: 2,
}],
});
async function arbtraceCallMany() {
const calls = [
[
{
"from": "0xb8351B61Fa1Eb007A9f80144C489d513e6A76b14",
"to": "0x478fa4C971a077038B4Fc5C172c3Af5552224ccc",
"value": "0xb1a2bc2ec50000"
},
[
"trace"
]
],
[
{
"from": "0xb8351B61Fa1Eb007A9f80144C489d513e6A76b14",
"to": "0x988aA44E12c7BCE07E449A4156b4A269d6642B3A",
"value": "0x6f05b59d3b20000"
},
[
"trace"
]
]
];
const block = '0x152dd44'
try {
const result = await web3.arbtrace.callMany(calls, block);
console.log(result);
} catch (error) {
console.error("Error:", error);
}
}
arbtraceCallMany();
arbtrace_callMany method is a powerful tool for retrieving execution traces of multiple transactions or contract calls in a single batch. It offers efficiency and convenience by reducing the number of requests required to fetch trace data, thereby improving performance.Was this page helpful?