Optimism
Pronto para usar isso em produção?
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
Optimism
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
eth_getStorageAt reads the raw 32-byte value held at a given storage slot of a contract on OP Mainnet, at whichever block you choose. Because OP Mainnet is EVM-equivalent — an OP Stack optimistic rollup (Bedrock) settling to Ethereum L1 with gas paid in ETH — the storage layout of a Velodrome or Synthetix contract follows the same Solidity slot rules as on L1. Send the request to https://optimism.therpc.io/YOUR_API_KEY (chain ID 10, 0xa). The response is the 32-byte slot value, hex-encoded and left-padded with zeros.
| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | address | string (hex) | Sim | The contract whose storage to read. |
| 2 | storageSlot | string (hex) | Sim | Storage position to read. For mappings, this is the keccak256-derived slot. |
| 3 | blockTag | string | Não | Block at which to read.Padrão: latest |
| Tipo | Descrição |
|---|---|
| string (hex) | 32-byte hex-encoded value stored at the slot, left-padded with zeros. |
Try it live in the Optimism playground.
| Código | Mensagem | Causa |
|---|---|---|
-32602 | Invalid params | Address or slot index is malformed. |
-32000 | Missing trie node | Historical block pruned on a non-archive node. |
keccak256(abi.encode(key, baseSlot)), which you must compute before calling.Parâmetros
0x-prefixed 20-byte contract address
0x-prefixed 32-byte slot index (e.g. "0x0")
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"