eth_getStorageAt - BSC

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 from a storage position at a given address on the BNB Smart Chain. This allows reading raw contract storage, including private variables.

Parameters

Parameter
Type
Required
Description

address

string

Yes

Contract address

position

string

Yes

Storage position (hex)

blockNumber

string

Yes

Block number or "latest"

Request Example

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

Response Example

Response Parameters

Parameter
Type
Description

result

string

32-byte storage value

Use Cases

  • Read private contract variables

  • Analyze proxy implementations

  • Debug contract state

  • Security research

Error Handling

Error Code
Description

-32602

Invalid params

-32603

Internal error

SDK Integration

Last updated

Was this helpful?