eth
eth_getStorageAt
Returns the value stored at a specific storage position of a contract. This allows direct inspection of a contract's internal state without calling a view function.
Returns the value stored at a specific storage position of a contract. This allows direct inspection of a contract's internal state without calling a view function.
Parameters
| # | Type | Description |
|---|---|---|
| 1 | string | The address of the contract (20 bytes). |
| 2 | string | The storage slot position as a hex string (32 bytes). |
| 3 | string | Block number as a hex string, or a block tag ("latest", "earliest", "pending"). |
Returns
string -- The value at the given storage position as a 32-byte hexadecimal string.
Example
curl -s -X POST https://rpc.pulsechain.box \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": ["0xA1077a294dDE1B09bB078844df40758a5D0f9a27", "0x0", "latest"],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x577261707065642050756c73650000000000000000000000000000000000001a"
}
TRY IT
Notes
- Storage slots are 32-byte key-value pairs. Slot
0x0is the first storage slot of the contract. - The storage layout depends on the Solidity compiler version and variable declaration order. Consult the contract's source code or storage layout documentation to determine which slot holds which variable.
- For mappings and dynamic arrays, the actual storage slot is computed using
keccak256. For example, to findmapping[key]at slotp, the storage position iskeccak256(key . p)where.is concatenation. - As a full archive node, historical storage values at any block number are available, making this useful for forensic analysis of contract state changes.
- The example queries slot 0 of the WPLS contract at
0xA1077a294dDE1B09bB078844df40758a5D0f9a27.
