eth_getStorageAt - Celo
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 on the Celo network. This is useful for reading raw contract storage, including private variables that aren't exposed through public functions.
Parameters
address
string
Yes
Contract address
position
string
Yes
Storage position as hex
blockNumber
string
Yes
Block number in hex, or "latest", "earliest", "pending"
Request Example
curl -X POST https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "getblock.io",
"method": "eth_getStorageAt",
"params": [
"0x765DE816845861e75A25fCA122bb6898B8B1282a",
"0x0",
"latest"
]
}'const axios = require('axios');
const url = 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/';
const payload = {
jsonrpc: '2.0',
id: 'getblock.io',
method: 'eth_getStorageAt',
params: [
'0x765DE816845861e75A25fCA122bb6898B8B1282a',
'0x0',
'latest'
]
};
axios.post(url, payload, {
headers: { 'Content-Type': 'application/json' }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));Response Example
Response Definition
result
string
Storage value as 32-byte hex string
Use Cases
Read contract storage directly
Access private variables
Analyze proxy contract state
Debug contract behavior
Error Handling
-32602
Invalid params - malformed address or position
-32603
Internal error - node processing issues
SDK Integration
Last updated
Was this helpful?