🔵 Base
eth_getStorageAt

🔍 eth_getStorageAt - Base Chain JSON-RPC Method

📝 overview

The eth_getStorageAt method retrieves the raw value stored at a specific position in a smart contract's storage on the Base blockchain. This method provides direct access to a contract's state at the specified block, returning the value in hexadecimal format.

💡 Contract Storage Explained: Every smart contract on Base has its own persistent key-value store (storage), where each 32-byte slot can hold a 32-byte value. This method lets you directly read these storage slots without going through the contract's interface.

⚙️ Parameters

ParameterTypeDescription
addressStringThe contract address to read storage from (20 bytes)
positionStringThe storage slot position to read (32 bytes, hex-encoded)
blockNumber or TagStringBlock number (hex) or tag: "latest", "earliest", "pending"

Note: Unlike Ethereum mainnet, the "safe" and "finalized" tags are not available on Base chain.

🔄 Returns

Storage Value - The 32-byte value at the specified storage position, returned as a hex string

🌐 Request

POST https://base-mainnet.chainnodes.org/YOUR-API-KEY

🧪 Example

  • HTTPS POST Request with a JSON RPC call in the body
  • Replace YOUR-API-KEY with the API key from your Chainnodes.org Dashboard
  • You can use a different supported network by replacing base-mainnet
curl https://base-mainnet.chainnodes.org/YOUR-API-KEY \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_getStorageAt","params": ["0x4200000000000000000000000000000000000006", "0x0000000000000000000000000000000000000000000000000000000000000000", "latest"],"id":1}'

📊 Response

{
   "jsonrpc": "2.0",
   "id": 1,
   "result": "0x000000000000000000000000000000000000000000000000000000000000000a"
}

Need RPC API keys?

Get 12.5M archival requests for free today.

🚀 Use Cases

1️⃣ Smart Contract Data Inspection

Examine the raw state of a contract to verify its behavior or debug issues without relying on contract interfaces.

// Read the owner address from a standard proxy contract (slot 0)
{"jsonrpc":"2.0","method":"eth_getStorageAt","params":["0xContractAddress","0x0","latest"],"id":1}

2️⃣ Token Balance Verification

Directly verify token balances by reading from token contract storage (useful for auditing or custom indexers).

// For ERC-20 tokens, balance mapping is typically at slot 1
// To find a specific account's balance slot:
// keccak256(abi.encode(accountAddress, 1))
{"jsonrpc":"2.0","method":"eth_getStorageAt","params":["0xTokenAddress","0xCalculatedSlot","latest"],"id":1}

3️⃣ Contract State Monitoring

Track changes in specific contract storage slots over time to monitor contract state evolution.

// Monitor the same storage slot at different blocks
{"jsonrpc":"2.0","method":"eth_getStorageAt","params":["0xContractAddress","0x1","0x100000"],"id":1}
{"jsonrpc":"2.0","method":"eth_getStorageAt","params":["0xContractAddress","0x1","0x200000"],"id":1}

4️⃣ Base Protocol Contract Analysis

Examine Base-specific system contracts to understand the L2 chain's operational state.

// Read from Base system contracts like the L1Block contract
{"jsonrpc":"2.0","method":"eth_getStorageAt","params":["0x4200000000000000000000000000000000000015","0x0","latest"],"id":1}

5️⃣ Security Auditing

Verify that sensitive contract state variables contain expected values, bypassing potentially compromised getter functions.

// Check if a pausable contract is paused (example slot)
{"jsonrpc":"2.0","method":"eth_getStorageAt","params":["0xContractAddress","0x5","latest"],"id":1}

🔗 Related Methods

JSON-RPC Base API Documentation by CHAINNODES is based on Reth node client. Contact us if you are interested in specific methods that are only available on geth, besu, Nethermind or Erigon