Ethereum
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.
Ethereum
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
eth_getStorageAt reads one raw 32-byte word straight out of a contract's storage on Ethereum mainnet (chain ID 1, the EVM network whose gas is paid in ETH). Every contract keeps its state in a flat key-value store of 256-bit slots, and this method returns the value at the slot you name — no ABI, no getter function required. You give it a contract address, a slot index, and a block, and it answers with the 32-byte value left-padded with zeros. Pass a historical block and you read the slot as it stood at that height, not just at the head. The endpoint is https://ethereum.therpc.io/YOUR_API_KEY. It's the unfiltered counterpart to calling a public view function: closer to the metal, and it works even when no getter is exposed.
0x360894...bbc) when the contract exposes no getter for it.| # | 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 Ethereum 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. |
uint8/bool/address fields can share one 32-byte slot. Reading that slot gives you all of them at once, and you mask and shift to pull out the field you want.k lives at keccak256(abi.encode(k, baseSlot)), so you compute that hash first, then read it — the base slot itself is empty.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"