debug_storageRangeAt
The debug_storageRangeAt method returns the contract storage range for a given block and address on the Optimism network. This method retrieves a specified range of storage keys and their corresponding values from a contract's storage at a particular block height. It's particularly useful for debugging smart contracts and analyzing storage layouts, as it allows developers to inspect the state of contract storage at any point in blockchain history.
Parameters
parameter | type | description |
|---|---|---|
blockHash | string (required) | The hash of the block to query storage from |
txIndex | integer (required) | The transaction index position within the block |
address | string (required) | The contract address to retrieve storage from |
startKey | string (required) | The starting storage key (32-byte hex string) |
maxResult | integer (required) | Maximum number of storage entries to return |
Return Object
The response contains the storage range data including the storage keys, values, and a next key for pagination if more entries exist beyond the requested range.
Request Example
Request
Response Example
Response