Base
Prêt à utiliser cela en production ?
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
Base
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
eth_call executes a read-only message call against the Base EVM without broadcasting a transaction or spending any ETH on gas — the node runs your calldata against current state and hands back the return value. Base is Coinbase's OP Stack rollup that settles to Ethereum L1 and uses ETH as its gas token, so this is the method you reach for whenever you need to read contract state rather than mutate it. Send the request to https://base.therpc.io/YOUR_API_KEY (chain ID 8453); because nothing is mined, it costs no gas and never appears on-chain.
balanceOf, decimals, symbol, or totalSupply for the many USDC and token contracts deployed on Base.| # | Nom | Type | Obligatoire | Description |
|---|---|---|---|---|
| 1 | transaction | object | Oui | Transaction object. Required fields: `to` (target contract). Optional: `from` (msg.sender), `gas` (hex), `gasPrice` (hex), `value` (hex wei), `data` (ABI-encoded calldata). |
| 2 | blockTag | string | object | Oui | Block at which to execute the call. Use hex block number or a named tag.Défaut : latest |
| 3 | stateOverrides | object | Non | Optional map of address → { balance, nonce, code, state, stateDiff } overrides applied only for this call. Not supported by all providers. |
| Type | Description |
|---|---|
| string | Hex-encoded return data from the executed function. Decode with the contract ABI. If the call reverts, an error with code -32000 or 3 is returned instead. |
Try it live in the Base playground.
| Code | Message | Cause |
|---|---|---|
3 | execution reverted | The EVM reverted the call. Error data contains the revert reason. |
-32602 | invalid argument | Malformed transaction object or missing required `to` field. |
-32000 | execution reverted | Node-level revert without revert data (e.g. out-of-gas within the call, or require with no message). |
latest can shift before your transaction is actually included — with ~2s Base blocks the gap is short, but a price or reserve read is still a snapshot, not a guarantee.3 or -32000), not as a special success field — always handle the error path and decode the revert reason from the error data.Paramètres
Transaction object. Required fields: `to` (target contract). Optional: `from` (msg.sender), `gas` (hex), `gasPrice` (hex), `value` (hex wei), `data` (ABI-encoded calldata).
"latest" | "safe" | "finalized" | "earliest" | "pending" | hex block number
Optional map of address → { balance, nonce, code, state, stateDiff } overrides applied only for this call. Not supported by all providers.