POST
/
efb0a5eccd2caa5135eb54eba6f7f300
curl --request POST \
  --url https://optimism-mainnet.core.chainstack.com/efb0a5eccd2caa5135eb54eba6f7f300 \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "method": "eth_callMany",
  "id": 1,
  "params": [
    [
      {
        "transactions": [
          {
            "from": "0xacD03D601e5bB1B275Bb94076fF46ED9D753435A",
            "to": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",
            "gas": "0xf4240",
            "gasPrice": "0x7896e72a",
            "data": "0xa9059cbb000000000000000000000000bc0E63965946815d105E7591407704e6e1964E590000000000000000000000000000000000000000000000000000000005f5e100"
          },
          {
            "to": "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",
            "gasPrice": "0x7896e72a",
            "data": "0x70a08231000000000000000000000000bc0E63965946815d105E7591407704e6e1964E59"
          }
        ],
        "blockOverride": {
          "blockNumber": "0x6eee101"
        }
      }
    ],
    {
      "blockNumber": "0x6eee101",
      "transactionIndex": 1
    },
    {}
  ]
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": [
    {}
  ]
}

Optimism API method eth_callMany executes a list of transaction bundles without creating transactions on the blockchain. This method is particularly useful for simulating transactions to understand their potential outcomes. It supports simulating transactions at an intermediate state of a block, simulating multiple transactions with sequential dependencies, and overwriting block headers.

This examples simulates the transfer of 100 USDT to an address in block 116318465 at transaction position 1 in the block and does the balance check of the address for the USDT, all in one call.

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • BUNDLES (array, required): A list of bundles where each bundle contains:

    • transactions (array): An array of transaction objects with parameters similar to eth_call.
    • blockOverride (object, optional): Overrides for the execution context block header, including blockNumber, blockHash, coinbase, timestamp, difficulty, gasLimit, and baseFee.
  • SIMULATION CONTEXT (object, required): The context for the simulation, specifying the blockNumber or Tag and transactionIndex.

  • STATE OVERRIDES (object, optional): An optional mapping for state overrides, following the eth_call standard.

  • TIMEOUT (integer, optional): The maximum running time for the simulations in milliseconds, defaulting to 5000 milliseconds.

Response

The method returns a list of lists containing either the return value of the executed contract call or the reverted error code.

  • array - All the return/error values
    • value - The value if was successful
    • error - The error if the transaction failed

Use case

The eth_callMany method is essential for:

  • Developers who need to simulate the outcome of transactions at a specific block height without making actual state changes.
  • Applications that require understanding the sequential dependencies between multiple transactions.
  • Services that need to test the impact of block header changes on transaction execution.

Body

application/json
jsonrpc
string
default:2.0
required
method
string
default:eth_callMany
required
id
integer
default:1
required
params
object[]
required

Response

200 - application/json
The result of the multiple calls
jsonrpc
string
id
integer
result
object[]

The results of the executed calls.