eth_call - Arbitrum

This method executes a read-only smart contract call on the Arbitrum blockchain without creating a transaction.

This method does not modify the blockchain state. It only simulates the call and returns the output.

Parameters

FieldTypeRequiredDescription
transactionobjectyesMain transaction object containing the call data
fromstringoptionalCaller address used for the simulation. Included inside the transaction object
tostringyesSmart contract address to call
gasstring (hex)optionalGas limit for the simulated call
gasPricestring (hex)optionalIgnored for simulations but allowed for compatibility
valuestring (hex)optionalAmount of ETH to send with the call (usually zero)
datastringyesEncoded function selector plus parameters
block tagstring or hexoptionalBlock context for the simulation. Default is latest

Request

bashcurl --location 'https://shared.us-east-1.getblock.io/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
  "jsonrpc": "2.0",
  "method": "eth_call",
  "id": "getblock.io",
  "params": [
    {
      "to": "0x1F98431c8aD98523631AE4a59f267346ea31F984",
      "data": "0x8da5cb5b"
    },
    "latest"
  ]
}'
javascriptimport axios from 'axios'
let data = JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_call",
  "id": "getblock.io",
  "params": [
    {
      "to": "0x1F98431c8aD98523631AE4a59f267346ea31F984",
      "data": "0x8da5cb5b"
    },
    "latest"
  ]
};

let config = {
  method: "post",
  maxBodyLength: Infinity,
  url: "https://shared.us-east-1.getblock.io/<ACCESS_TOKEN>",
  headers: {
    "Content-Type": "application/json",
  },
  data: data,
};

axios
  .request(config)
  .then((response) => {
    console.log(JSON.stringify(response.data));
  })
  .catch((error) => {
    console.log(error);
  });
pythonimport requests
import json

url = "https://shared.us-east-1.getblock.io/<ACESS_TOKEN>"

payload = json.dumps({
  "jsonrpc": "2.0",
  "method": "eth_call",
  "id": "getblock.io",
  "params": [
    {
      "to": "0x1F98431c8aD98523631AE4a59f267346ea31F984",
      "data": "0x8da5cb5b"
    },
    "latest"
  ]
})
headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
rs#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::builder()
        .build()?;

    let mut headers = reqwest::header::HeaderMap::new();
    headers.insert("Content-Type", "application/json".parse()?);

    let data = r#"{{
  "jsonrpc": "2.0",
  "method": "eth_call",
  "id": "getblock.io",
  "params": [
    {
      "to": "0x1F98431c8aD98523631AE4a59f267346ea31F984",
      "data": "0x8da5cb5b"
    },
    "latest"
  ]
}"#;

    let json: serde_json::Value = serde_json::from_str(&data)?;

    let request = client.request(reqwest::Method::POST, "https://shared.us-east-1.getblock.io/<ACCESS_TOKEN>")
        .headers(headers)
        .json(&json);

    let response = request.send().await?;
    let body = response.text().await?;

    println!("{}", body);

    Ok(())
}

Response

java{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "0x0000000000000000000000002bad8182c09f50c8318d769245bea52c32be46cd"
}

Reponse Parameter Definition

FieldData TypeDefinition
resultstringThe return value of the executed contract function, encoded as a hexadecimal string.

Use case

eth_call is used to:

  • Track the latest block height
  • Monitor chain progress or finality
  • Trigger event-based updates when the block number increases

Error handling

Status CodeError MessageCause
403ForbiddenMissing or invalid ACCESS_TOKEN.

Integration with Web3

The eth_call can help developers to:

  • Enables trustless frontends
  • Reads live contract state without gas
  • Supports dashboards, DeFi analytics, wallets, NFT explorers
  • Let's developers simulate transactions before execution
javascriptimport { ethers } from "ethers";
const RPC_URL = "https://shared.us-east-1.getblock.io/<ACCESS-TOKEN>";
const provider = new ethers.JsonRpcProvider(RPC_URL);
async function Call() {
  try {
    // Call the method — this will resolve to a number (promise resolves to number)
     const result = await provider.send("eth_call", [
       {
         to: "0x1F98431c8aD98523631AE4a59f267346ea31F984",
         data: "0x8da5cb5b",
       },
       "latest",
     ]);
    console.log("The result:", result);
    return result;
  } catch (error) {
    console.error("Ethers Error fetching block number:", error);
    throw error;
  }
}