Skip to main content
Executes a message call immediately without broadcasting a transaction to the network. No gas is consumed on-chain. Used to read contract state or simulate calls.
Flashblocks: Query https://mainnet-preconf.base.org with "pending" to simulate against the current pre-confirmed block state, updated every ~200ms.
eth_call "pending" block context on Flashblocks nodes: Block-context properties (block.number, block.timestamp, block.basefee) may reflect a block several behind tip due to how nodes cache historical Flashblocks. See the FAQ for details.

Parameters

transaction
object
required
The transaction call object.
block
string
required
Block number in hex, or "latest", "pending", "safe", "finalized", "earliest". Use "pending" on a Flashblocks endpoint to call against pre-confirmed state.

Returns

result
string
The return value of the call as a hex-encoded byte array.

Error Codes

CodeMessageDescription
-32000execution revertedThe call reverted. The data field in the error object contains the ABI-encoded revert reason when available.

Example

curl https://mainnet.base.org \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
      {
        "to": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "data": "0x70a082310000000000000000000000004200000000000000000000000000000000000006"
      },
      "latest"
    ],
    "id": 1
  }'