eth_call
Network: Arc · Mainnet · Chain ID 5042 (0x13b2)
Data: full node. Old-block state is not available on Arc; query recent blocks.
Counts as 1 request. See Request Counting.
Executes a new message call immediately without creating a transaction on the blockchain. Commonly used to read data from smart contracts.
Parameters
-
Object— The transaction call object:Field Type Required Description from DATA No Sender address to DATA Yes Contract address gas QUANTITY No Gas limit gasPrice QUANTITY No Gas price value QUANTITY No Value sent data DATA No ABI-encoded function call -
QUANTITY|TAG— Block number, or"latest","earliest","pending".
Returns
DATA — The return value of the executed contract function.
Request
{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"data": "0x18160ddd"
},
"latest"
],
"id": 1
}The example reads ERC-20 totalSupply() (selector 0x18160ddd). Replace to with a token contract on Arc.
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0000000000000000000000000000000000000000000000000000001234567890"
}Code Examples
curl -X POST https://arc-rpc.blockreq.com/v1/rpc/public \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","data":"0x18160ddd"},"latest"],"id":1}'