eth_getStorageAt - Monad

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

This method returns the value from a storage position at a given address.

Parameters

Parameter
Type
Required
Description

address

string

Yes

The address of the storage.

position

string

Yes

The storage position (hex).

blockNumber

string

No

Block number in hex, or "latest", "earliest", "pending", "safe", "finalized".

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getStorageAt",
    "params": ["0xdAC17F958D2ee523a2206206994597C13D831ec7", "0x0", "latest"],
    "id": "getblock.io"
}'

Response

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

Response Parameters

Field
Type
Description

result

string

The value at the storage position (32 bytes, hex encoded).

Calculating Storage Slots

For mappings and dynamic arrays, use keccak256 to calculate the slot:

Use Case

The eth_getStorageAt method is essential for:

  • Reading contract state directly

  • Analyzing contract storage layout

  • Security auditing

  • Verifying contract state without ABI

  • Debugging contract behavior

  • Historical state analysis

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN.

-32602

Invalid params

Invalid address or position format.

-32000

Resource not found

Block not found.

Web3 Integration

Last updated

Was this helpful?