Skip to main content

eth_getStorageAt

Accesses raw storage data from a specific position within a smart contract on Arbitrum One. This powerful method enables direct inspection of contract state variables, proxy implementations, and complex storage structures.

Parameters​

ParameterTypeRequiredDescription
addressstringYesThe contract address (20 bytes) to read storage from
positionstringYesThe storage slot position as hex (32 bytes, 0x-prefixed)
blockNumberstringYesBlock number in hex or block tag ("latest", "earliest", "pending")

Storage Layout Understanding​

  • State variables: Sequential slots starting from 0x0
  • Mapping values: keccak256(abi.encodePacked(key, slot))
  • Dynamic arrays: Array length at slot, data at keccak256(slot) + index
  • String/bytes: Length and data encoding based on size

Returns​

A 32-byte hex string representing the storage value. Smaller values are left-padded with zeros to reach the full 32-byte length.

Implementation Examples​

# Read storage from ARB token contract on Arbitrum
curl -X POST https://api-arbitrum-mainnet-archive.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x912CE59144191C1204E64559FE8253a0e49E6548",
"0x3",
"latest"
],
"id": 1
}'

Response Example​

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

Common Use Cases​

  • Token Analysis: Read balances, allowances, and total supply from ERC-20 contracts
  • Proxy Contracts: Extract implementation addresses from upgradeable proxies
  • Governance: Access voting power, proposal states, and delegation data
  • DeFi Protocols: Inspect liquidity pools, reserves, and protocol parameters
  • Security Audits: Verify contract state and detect anomalies

Storage Calculation Examples​

Simple Variables​

// First state variable is at slot 0
const slot0 = '0x0';
// Second state variable is at slot 1
const slot1 = '0x1';

Mappings​

// For mapping at slot 5, key = user address
const mappingSlot = 5;
const userKey = '0x742d35Cc6634C0532925a3b8D7aa86B2ecaedC9C';
const storagePosition = keccak256(userKey.padStart(64, '0') + mappingSlot.toString(16).padStart(64, '0'));

Dynamic Arrays​

// Array length at slot 8
const arrayLengthSlot = '0x8';
// First element at keccak256(8)
const firstElementSlot = keccak256('0x' + '8'.padStart(64, '0'));

Important Considerations​

  • All storage values are exactly 32 bytes in length
  • Arbitrum maintains Ethereum storage compatibility
  • Historical data available through archive node access
  • Gas-optimized contracts may pack multiple values in single slots
  • Storage slots are persistent across contract upgrades in proxy patterns

Need help? Contact our support team or check the Arbitrum documentation.