eth_getStorageAt - Monad
Example code for the eth_getStorageAt JSON-RPC method. Complete guide on how to use eth_getStorageAt JSON-RPC in GetBlock Web3 documentation.
This method returns the value from a storage position at a given address.
Parameters
address
string
Yes
The address of the storage.
position
string
Yes
The storage position (hex).
blockNumber
string
No
Block number in hex, or "latest", "earliest", "pending", "safe", "finalized".
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": ["0xdAC17F958D2ee523a2206206994597C13D831ec7", "0x0", "latest"],
"id": "getblock.io"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": ["0xdAC17F958D2ee523a2206206994597C13D831ec7", "0x0", "latest"],
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": "0x000000000000000000000000000000000000000000000000000000000000000a"
}Response Parameters
result
string
The value at the storage position (32 bytes, hex encoded).
Calculating Storage Slots
For mappings and dynamic arrays, use keccak256 to calculate the slot:
Use Case
The eth_getStorageAt method is essential for:
Reading contract state directly
Analyzing contract storage layout
Security auditing
Verifying contract state without ABI
Debugging contract behavior
Historical state analysis
Error Handling
403
Forbidden
Missing or invalid ACCESS-TOKEN.
-32602
Invalid params
Invalid address or position format.
-32000
Resource not found
Block not found.
Web3 Integration
Last updated
Was this helpful?