eth_getStorageAt - Arbitrum

Example code for the eth_getStorageAt JSON RPC method. Сomplete guide on how to use eth_getStorageAt JSON RPC in GetBlock Web3 documentation.

This method returns the value stored at a specific storage slot of a contract. Every smart contract stores its data in 32-byte slots, and this method provides direct low-level access to them.

Parameters

Parameter
Type
Required
Description

address

string

yes

The target contract address. Must be a valid Ethereum-style address.

position

string (hex)

yes

The storage slot index. Must be a 32-byte hex value (e.g. "0x0", "0x1", "0xabc...").

block_number

string

yes

Block identifier such as "latest", "earliest", "pending", or a hex-encoded block number.

Request

curl --location 'https://go.getblock.us/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
   "jsonrpc": "2.0",
       "method": "eth_getStorageAt",
    "params": [
        "0x80d40e32FAD8bE8da5C6A42B8aF1E181984D137c",
        "0x0",
        "latest"
    ],
    "id": "getblock.io"
}'

Response

Reponse Parameter Definition

Field
Type
Description

result

string (hex)

32-byte hex value stored at the given slot. Empty slots return "0x000...000".

Use case

The eth_getStorageAt is used to:

  • Reading contract variables without calling a function

  • Inspecting mappings, arrays, and structs by computing their storage slots

  • Powering dashboards and analytics tools that pull historical state data

  • Helping wallets validate allowance, balances, or approvals stored on-chain

  • Supporting audits by letting developers inspect raw contract storage

Error handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS_TOKEN.

-32602

Invalid argument

  • The Address not 20 bytes or missing prefix

  • Slot value not valid hex

  • Block number incorrect or out of range

  • keyword missing

Integration with Web3

The eth_getStorageAt method helps developers to:

  • Build trustless analytics dashboards

  • Inspect contract internals without a function call

  • Recover lost data values during debugging

  • Read live smart contract state with zero gas

  • Simulate contract reads on historical blocks

  • Validate approvals or configurations stored in private mappings

Last updated

Was this helpful?