eth_getStorageAt - Ethereum

This method returns the value at a specific storage slot of a contract at a given block, hex-encoded. Storage slots are 32-byte keys that map to 32-byte values in the contract's state trie. Reading arbitrary slots lets applications inspect contract state directly without a public getter — useful for proxy inspection, storage-layout debugging, and reading private fields.

Parameters

ParameterTypeRequiredDescription
addressstringYesContract address (hex-encoded with 0x prefix)
storageSlotstringYesStorage slot key (hex-encoded 32-byte value)
blockParameterstringYesBlock number in hex, or latest, earliest, pending, finalized, safe

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getStorageAt",
    "params": [
        "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "0x0000000000000000000000000000000000000000000000000000000000000000",
        "latest"
    ],
    "id": "getblock.io"
}'

example.js

javascriptconst axios = require('axios');

const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
    jsonrpc: '2.0',
    method: 'eth_getStorageAt',
    params: [
        "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "0x0000000000000000000000000000000000000000000000000000000000000000",
        "latest"
    ],
    id: 'getblock.io'
}, {
    headers: { 'Content-Type': 'application/json' }
});

console.log(response.data.result);

example.py

pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={
        'jsonrpc': '2.0',
        'method': 'eth_getStorageAt',
        'params': [
        "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "0x0000000000000000000000000000000000000000000000000000000000000000",
        "latest"
    ],
        'id': 'getblock.io'
    }
)

print(response.json())

example.rs

rustuse reqwest::Client;
use serde_json::{json, Value};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    
    let response = client
        .post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .header("Content-Type", "application/json")
        .json(&json!({
            "jsonrpc": "2.0",
            "method": "eth_getStorageAt",
            "params": [
        "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "0x0000000000000000000000000000000000000000000000000000000000000000",
        "latest"
    ],
            "id": "getblock.io"
        }))
        .send()
        .await?
        .json::<Value>()
        .await?;
    
    println!("Result: {}", response["result"]);
    Ok(())
}

Response

json{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "0x000000000000000000000000000000000000000000000000000000000000000a"
}

Response Parameters

ParameterTypeDescription
jsonrpcstringJSON-RPC protocol version ("2.0")
idstringRequest identifier matching the request
resultstringHex-encoded 32-byte value at the requested slot (zero-padded if the underlying type is smaller)

Use Cases

  • Proxy Implementation Detection: Read the EIP-1967 implementation slot (0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc) to identify the current logic contract behind a proxy
  • Storage-Layout Debugging: Inspect specific state variables during development when public getters are unavailable
  • Private Field Reading: Read private state variables whose slots are known from the contract's storage layout
  • Cross-Chain Storage Proofs: Combined with eth_getProof, verify storage values via Merkle proofs on other chains

Error Handling

Error CodeMessageDescription
-32602Invalid paramsAddress or storage slot is malformed, or block parameter is invalid
-32603Internal errorNode failed to look up storage at the requested block

Web3 Integration

ethers-example.js

javascriptimport { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/');

// Read WETH storage slot 0 (the totalSupply-adjacent slot in the WETH9 layout)
const value = await provider.getStorage('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 0);
console.log('Storage value:', value);

viem-example.js

javascriptimport { createPublicClient, http } from 'viem';
import { mainnet } from 'viem/chains';

const client = createPublicClient({
    chain: mainnet,
    transport: http('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/'),
});

const value = await client.getStorageAt({
    address: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
    slot: '0x0',
});
console.log('Storage value:', value);