BNB Smart Chain

BNB Smart Chain

eth_getStorageAt

A contract on BNB Smart Chain keeps its state in 32-byte slots. eth_getStorageAt reads one of those slots directly. No ABI and no getter function required. You supply the contract address plus the slot index and a block tag, and the method returns the raw 32-byte word found there, zero-padded on the left. Since BNB Smart Chain is a geth-equivalent EVM funded by BNB, the slot layout matches what any Solidity compiler would produce. Send the call to https://bsc.therpc.io/YOUR_API_KEY on chain ID 56 when you need to peek at storage the contract never exposes publicly.

Use cases

  • Resolve a proxy's logic address straight from the EIP-1967 implementation slot even when no getter is exposed.
  • Read DAO governance internals such as proposal state or tallied vote counts that the contract leaves unexported.
  • Confirm a deployed contract's storage layout matches the source during a BSC security audit or upgrade review.
  • Track down a misbehaving contract by dumping the raw slot values behind its unexpected on-chain behaviour.

Parameters

#NameTypeRequiredDescription
1addressstring (hex)YesThe contract whose storage to read.
2storageSlotstring (hex)YesStorage position to read. For mappings, this is the keccak256-derived slot.
3blockTagstringNoBlock at which to read.Default: latest

Response

TypeDescription
string (hex)32-byte hex-encoded value stored at the slot, left-padded with zeros.

Example request

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x8894E0a0c962CB723c1976a4421c95949bE2D4E3",
"0x0",
"latest"
],
"id": 1
}'

Try it live in the BNB Smart Chain playground.

Errors & troubleshooting

CodeMessageCause
-32602Invalid paramsAddress or slot index is malformed.
-32000Missing trie nodeHistorical block pruned on a non-archive node.

Common pitfalls

  • The ABI says nothing about where each variable lives. You have to compute the slot index for whatever field you want to read, or look it up.
  • Several small variables can be packed into one 32-byte word. To pull out an individual field you then have to mask the returned value and shift it.
  • A mapping entry does not sit at its declared base slot — it resides at keccak256(abi.encode(key, baseSlot)), which you must hash before querying.

Supported networks

  • Mainnet — Chain ID: 56
  • Testnet — Chain ID: 97

See also

Parameters

0x-prefixed 20-byte contract address

0x-prefixed 32-byte slot index (e.g. "0x0")

hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getStorageAt","params":["0x8894E0a0c962CB723c1976a4421c95949bE2D4E3","",""]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.