> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_getStorageValues | BNB Chain

> BNB API method that returns the values of up to 1,024 storage slots across one or more smart contracts in a single call. Use it on BNB Chain via Chainstack.

BNB API method that returns the values stored at multiple storage slots, across one or more smart contracts, in a single call. It replaces a batch of [eth\_getStorageAt](https://docs.chainstack.com/reference/bnb-getstorageat.md) requests when you read several slots at the same block, for example to snapshot a contract's state.

> [!NOTE]
>
> On BNB Smart Chain Global Nodes, `eth_getStorageValues` serves the latest 128 blocks. For an older block, it returns an error of the form `historical state <state root> is not available`; use [eth\_getStorageAt](https://docs.chainstack.com/reference/bnb-getstorageat.md) to read older state.

## Parameters

* `object` — an object that maps each contract address to an array of storage slot keys. Each key must be a full 32-byte hex value, such as `0x0000000000000000000000000000000000000000000000000000000000000001`; a short form such as `0x1` is rejected. A request can include up to 1,024 slots in total.
* `quantity or tag` — the integer of a block encoded as hexadecimal or the string with:

  * `latest` — the most recent block in the blockchain and the current state of the blockchain at the most recent block. A chain reorganization is to be expected.
  * `safe` — the block that received justification from the beacon chain. Although this block could be involved in a chain reorganization, it would necessitate either a coordinated attack by the majority of validators or an instance of severe propagation latency.
  * `finalized` — the block accepted as canonical by more than 2/3 of the validators. A chain reorganization is extremely unlikely, and it would require at least 1/3 of the staked amount to be burned.
  * `pending` — the pending state and transactions block. The current state of transactions that have been broadcast to the network but have not yet been included in a block.

## Response

`result` — an object that maps each requested contract address, in lowercase, to an array of 32-byte storage values in the same order as the requested slots.

A request with no slots returns `-32602` with `empty request`, and a request with more than 1,024 slots returns `-38026` with `too many slots (max 1024)`.

## `eth_getStorageValues` code examples

The examples read slots `0` and `3` of the [Binance-Peg BSC-USD (USDT) contract](https://bscscan.com/token/0x55d398326f99059fF775485246999027B3197955) and slot `0` of the [CAKE token contract](https://bscscan.com/token/0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82) in one call.

```javascript ethers.js theme={"system"}
const { ethers } = require("ethers");

const provider = new ethers.JsonRpcProvider("YOUR_CHAINSTACK_ENDPOINT");

const slot = (n) => ethers.zeroPadValue(ethers.toBeHex(n), 32);

const getStorageValues = async () => {
  const values = await provider.send("eth_getStorageValues", [
    {
      "0x55d398326f99059fF775485246999027B3197955": [slot(0), slot(3)],
      "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82": [slot(0)],
    },
    "latest",
  ]);
  console.log(values);
};

getStorageValues();
```

```python web3.py theme={"system"}
from web3 import Web3

w3 = Web3(Web3.HTTPProvider("YOUR_CHAINSTACK_ENDPOINT"))

def slot(n):
    return "0x" + format(n, "064x")

response = w3.provider.make_request("eth_getStorageValues", [
    {
        "0x55d398326f99059fF775485246999027B3197955": [slot(0), slot(3)],
        "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82": [slot(0)],
    },
    "latest",
])
print(response["result"])
```

## Use case

One use case for `eth_getStorageValues` is reading a consistent snapshot of several contracts' internal state. All slots come from the same block in one round trip, so a monitoring service that tracks owners, balances, or configuration slots across many contracts avoids both the request overhead of separate `eth_getStorageAt` calls and the risk of reading different slots at different blocks.


## OpenAPI

````yaml openapi/bnb_node_api/eth_getStorageValues.json POST /mt_c524ad9781ae5dccd9ac6f5b0370e
openapi: 3.0.0
info:
  title: BNB Node API
  version: 1.0.0
  description: This is an API for interacting with an BNB node.
servers:
  - url: https://bsc-mainnet.core.chainstack.com
security: []
paths:
  /mt_c524ad9781ae5dccd9ac6f5b0370e:
    post:
      tags:
        - upload
      summary: eth_getStorageValues
      operationId: getStorageValues
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                  default: eth_getStorageValues
                params:
                  type: array
                  items:
                    anyOf:
                      - type: object
                        title: Slots by contract
                        description: >-
                          An object that maps each contract address to an array
                          of 32-byte storage slot keys. Up to 1,024 slots in
                          total per request.
                        additionalProperties:
                          type: array
                          items:
                            type: string
                      - type: string
                        title: Block ID
                        description: The block number or tag to use as a reference.
                  default:
                    - '0x55d398326f99059fF775485246999027B3197955':
                        - >-
                          0x0000000000000000000000000000000000000000000000000000000000000000
                        - >-
                          0x0000000000000000000000000000000000000000000000000000000000000003
                      '0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82':
                        - >-
                          0x0000000000000000000000000000000000000000000000000000000000000000
                    - latest
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
      responses:
        '200':
          description: >-
            The storage values for each requested contract, in the order of the
            requested slots.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object
                    description: >-
                      An object that maps each contract address (lowercase) to
                      an array of 32-byte storage values, in the order of the
                      requested slots.
                    additionalProperties:
                      type: array
                      items:
                        type: string

````