Polygon
Ready to call this in production?
Free tier covers personal projects. Pay-as-you-go scales without a card.
Polygon
Free tier covers personal projects. Pay-as-you-go scales without a card.
debug_storageRangeAt reads the raw storage trie of a contract deployed on Polygon PoS — the MATIC-fee EVM chain whose Bor client is Geth-based, so this Geth-style debug method behaves exactly as it does on mainnet Ethereum. Point the call at https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89). Given a block hash, a transaction index, and a contract address, it returns a paginated slice of that contract's raw storage slots at the state following the chosen transaction within the block, along with a nextKey cursor when more slots remain.
| # | 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. |
| 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. |
Try it live in the Polygon playground.
| 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). |
limit and follow the nextKey cursor instead of trying to pull everything in one call.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