eth_getStorageAt
Returns the value from a storage position at a given address on XDC Network.
Use Cases#
- Contract analysis - Read raw storage values
- State verification - Verify contract state
- Security auditing - Analyze storage layout for tokenized trade finance (Letters of Credit, Bills of Lading), cross-border payments, and real-world asset tokenization
- Protocol monitoring - Track state changes
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
address | DATA | Yes | 20-byte contract address |
position | QUANTITY | Yes | Storage slot position |
blockParameter | QUANTITY|TAG | Yes | Block number or tag |
Request#
{
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"0x0",
"latest"
],
"id": 1
}
Code Examples#
- cURL
- JavaScript
- Python
curl -X POST https://api-xdc-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"0x0",
"latest"
],
"id": 1
}'
import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider('https://api-xdc-mainnet.n.dwellir.com/YOUR_API_KEY');
const address = '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb';
const slot = 0;
const storage = await provider.getStorage(address, slot);
console.log('Storage at slot 0:', storage);
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://api-xdc-mainnet.n.dwellir.com/YOUR_API_KEY'))
address = '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
storage = w3.eth.get_storage_at(address, 0)
print(f'Storage at slot 0: {storage.hex()}')
Related Methods#
eth_getCode- Get contract bytecodeeth_call- Call contract functions