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
txIndexandtxIndex - 1, isolating exactly which slots a drained protocol touched.
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | blockHash | string | Yes | Hash of the block containing the transaction of interest. |
| 2 | txIndex | integer | Yes | Index of the transaction within the block after whose execution the storage is read. |
| 3 | contractAddress | string | Yes | Address of the contract whose storage to inspect. |
| 4 | startKey | string | Yes | Storage key hash from which to begin iteration. Use `0x0000…0000` to start from the beginning. |
| 5 | limit | integer | Yes | Maximum number of storage entries to return in one call. |
Response
| Type | Description |
|---|---|
| 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
Try it live in the Ethereum playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32601 | Method not found | debug namespace not enabled on the node. |
-32602 | Invalid params | Any required parameter is missing, malformed, or txIndex is out of range for the block. |
-32000 | block not found | Block 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 atkeccak256(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 foundunless you hit an archive node. - Big contracts hold thousands of slots. Pass a sane
limit, follownextKeyacross 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