debug_storageRangeAt

The debug_storageRangeAt method returns the contract storage range for a given block and address. This method retrieves a specified range of storage keys and their corresponding values from a contract's storage at a particular block height and transaction position.

This method is particularly useful for debugging smart contracts, analyzing storage layouts, and inspecting contract state. It allows developers to examine how contract storage evolves during transaction execution and provides pagination support for efficiently iterating through large storage mappings. By specifying the transaction index, you can see the storage state at any point during block execution, making it invaluable for understanding state changes and debugging complex contract interactions.

This method is available only on the full archive node.


Parameters

parameter
type
description
blockHash
string (required)
The hash of the block to query storage from (32-byte hex string with 0x prefix)
txIndex
integer (required)
The transaction index position within the block. Use 0 to see storage before any transactions, or a specific index to see storage after that transaction executes
address
string (required)
The contract address to retrieve storage from (20-byte hex string with 0x prefix)
startKey
string (required)
The starting storage key as a 32-byte hex string (use '0x' + 64 zeros to start from the beginning)
maxResult
integer (required)
Maximum number of storage entries to return in the response. Use this to control pagination
Return Object

The method returns an object containing storage data and pagination information:

storage - object: A mapping object where each key is a storage slot hash and the value is an object containing:

key - string: The storage key as a 32-byte hex string

value - string: The storage value as a 32-byte hex string

nextKey - string: The key hash to use as the startKey parameter in the next request to continue pagination, or null if no more storage entries exist beyond the current range

Request Example
Request
Response Example
Response

Share on
Share on FacebookShare on XShare on LinkedIn
Did you find this page useful?