Optimism
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Optimism
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
debug_storageRangeAt returns a paginated slice of an OP Mainnet contract's raw storage slots, captured at the state that exists immediately after a specific transaction within a block has executed. On OP Mainnet — the OP Stack rollup where gas is paid in ETH — this lets you read the exact storage of any deployed contract (a Velodrome pool, a Synthetix vault, or your own contract) at a precise historical point, not just its current state. Point your request at https://optimism.therpc.io/YOUR_API_KEY (chain ID 10, 0xa); you supply the block hash, the transaction index inside that block, the contract address, a start key, and a limit, and the node walks the storage trie from that key.
| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | blockHash | string | 是 | Hash of the block containing the transaction of interest. |
| 2 | txIndex | integer | 是 | Index of the transaction within the block after whose execution the storage is read. |
| 3 | contractAddress | string | 是 | Address of the contract whose storage to inspect. |
| 4 | startKey | string | 是 | Storage key hash from which to begin iteration. Use `0x0000…0000` to start from the beginning. |
| 5 | limit | integer | 是 | Maximum number of storage entries to return in one call. |
| 类型 | 描述 |
|---|---|
| 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 Optimism playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-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 nextKey to page rather than pulling everything at once.参数
0x-prefixed 32-byte block hash
0-based index
0x-prefixed 20-byte address
0x-prefixed 32-byte storage key hash
e.g. 1024