Ethereum

Ethereum

debug_storageRangeAt

debug_storageRangeAt walks the raw storage trie of a contract on Ethereum mainnet (chain ID 1, native coin ETH) and hands back a page of slots exactly as they stood after a chosen transaction executed inside a block. You point it at a block hash, a transaction index within that block, and a contract address, then iterate from a starting storage key. Because mainnet contracts can hold huge storage tries, the result comes back paginated — a nextKey cursor tells you where to resume. Send the request to https://ethereum.therpc.io/YOUR_API_KEY. This is execution-layer introspection, so it needs a debug-enabled archive node to reach the historical state.

Use cases

  • Dump a contract's entire storage layout at one execution point — for example, the slot state of a Uniswap pool or an Aave market right after a given transaction — for a post-mortem.
  • Verify slot assignments in an upgradeable proxy: check that the implementation's layout sits where the proxy expects it before pushing an upgrade, so storage collisions never silently corrupt state.
  • Compare a contract's slots before and after a suspicious transaction by reading at txIndex and txIndex - 1, isolating exactly which slots a drained protocol touched.

Parameters

#NameTypeRequiredDescription
1blockHashstringYesHash of the block containing the transaction of interest.
2txIndexintegerYesIndex of the transaction within the block after whose execution the storage is read.
3contractAddressstringYesAddress of the contract whose storage to inspect.
4startKeystringYesStorage key hash from which to begin iteration. Use `0x0000…0000` to start from the beginning.
5limitintegerYesMaximum number of storage entries to return in one call.

Response

TypeDescription
object`{storage: Record<keyHash, {key: string, value: string}>, nextKey?: string}` — `nextKey` is present when more entries follow and can be passed as `startKey` for the next page.

Example request

curl https://ethereum.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "debug_storageRangeAt",
"params": [
"0x0000000000000000000000000000000000000000000000000000000000000000",
0,
"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"0x0000000000000000000000000000000000000000000000000000000000000000",
5
],
"id": 1
}'

Try it live in the Ethereum playground.

Errors & troubleshooting

CodeMessageCause
-32601Method not founddebug namespace not enabled on the node.
-32602Invalid paramsAny required parameter is missing, malformed, or txIndex is out of range for the block.
-32000block not foundBlock hash not found or the node lacks state for that block (archive node required for historical blocks).

Common pitfalls

  • Keys come back as raw keccak256 hashes. A mapping(address => uint) entry is stored at keccak256(key . slot), so you have to recompute the hash yourself to know which logical field a slot belongs to — the method does no decoding for you.
  • Historical blocks need archive state. A pruned full node only keeps the recent state trie, so a block from last year returns block not found unless you hit an archive node.
  • Big contracts hold thousands of slots. Pass a sane limit, follow nextKey across pages, and don't try to pull an entire stablecoin's balance trie in a single call.

Supported networks

  • Mainnet — Chain ID: 1
  • Sepolia — Chain ID: 11155111

See also

Parameters

0x-prefixed 32-byte block hash

0-based index

0x-prefixed 20-byte address

0x-prefixed 32-byte storage key hash

e.g. 1024

curl https://ethereum.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"debug_storageRangeAt","params":["0x0000000000000000000000000000000000000000000000000000000000000000",0,"","0x0000000000000000000000000000000000000000000000000000000000000000",10]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.