Skip to content

eth_call

Runs a message call immediately against node state without broadcasting a transaction or consuming on-chain gas. Use it to read contract state or simulate calls.

The transaction call object.

FieldTypeDescription
fromstringAddress the call is sent from. Optional; defaults to the zero address.
tostringAddress the call is directed to. Required.
gasstringGas provided for the call as a hexadecimal integer. Defaults to a high limit if omitted.
gasPricestringGas price in wei as a hexadecimal integer. For legacy transactions. Optional.
maxFeePerGasstringEIP-1559 maximum total fee per gas. Optional.
maxPriorityFeePerGasstringEIP-1559 maximum priority fee per gas. Optional.
valuestringValue transferred in wei as a hexadecimal integer. Optional.
datastringABI-encoded call data: the 4-byte function selector followed by encoded arguments. Optional.

Block number in hex, or "latest", "pending", "safe", "finalized", "earliest". Pass "pending" on a Flashblocks endpoint to call against pre-confirmed state.

FieldTypeDescription
resultstringThe return value of the call as a hex-encoded byte array.
CodeMessageDescription
-32000execution revertedThe call reverted. The data field in the error object contains the ABI-encoded revert reason when available.
Terminal window
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
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0000000000000000000000000000000000000000000000000000000005f5e100"
}