Polygon
Bereit, das in der Produktion aufzurufen?
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
Polygon
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
eth_call executes a read-only message call against Polygon's EVM-equivalent state without broadcasting a transaction or spending any MATIC. The node runs your calldata against the target contract at a chosen block and returns the raw return data — nothing is mined, no gas leaves your account. This is the workhorse for reading on-chain state: an ERC-20 balanceOf, a QuickSwap pool's reserves, or an Aave position, all without signing anything. Point it at https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89) and decode the hex result with the contract ABI.
balanceOf, decimals, symbol, or totalSupply — for example query USDT on Polygon at 0xc2132D05D31c914a87C6611C10748AEb04B58e8F.stateOverrides argument to test what-if scenarios — overridden balances or code — without touching live chain state.| # | Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
| 1 | transaction | object | Ja | 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 | Ja | Block at which to execute the call. Use hex block number or a named tag.Standard: latest |
| 3 | stateOverrides | object | Nein | Optional map of address → { balance, nonce, code, state, stateDiff } overrides applied only for this call. Not supported by all providers. |
| Typ | Beschreibung |
|---|---|
| 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 Polygon playground.
| Code | Meldung | Ursache |
|---|---|---|
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 between your call and actual inclusion — at ~2s Polygon blocks the head moves quickly, so never treat a read as a settlement guarantee. For reorg-safe reads use finalized.stateOverrides third argument is not supported by every node; detect the failure and fall back to a plain call rather than assuming it worked.3 or -32000), not as a special success field — always handle the error path and decode the revert reason from the error data.Parameter
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.