> ## 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_getStorageAt | Cronos

> Cronos API method that returns the data stored at a specific storage slot within a smart contract. Use it on Cronos via Chainstack.

Cronos API method that returns the data stored at a specific storage slot within a smart contract. It can help developers read a smart contract's internal state, like user data or balances, to inform decisions and build more advanced applications that interact with smart contracts on the blockchain.

> [!NOTE]
>
> When called against a block older than the latest \~128 blocks, this method is treated as an archive request (2 RUs instead of 1 RU). See [request units](https://docs.chainstack.com/docs/request-units.md#evm-methods-affected-by-block-age).

## Parameters

* `address` — the address of the smart contract to query
* `quantity` — the index of the storage position to retrieve the data from
* `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.
  * `safe` — on Cronos, the same block as `latest`. Cronos uses CometBFT consensus, which commits a block only after validators with more than two-thirds of the voting power sign it, so committed blocks aren't reorganized.
  * `finalized` — on Cronos, the same block as `latest`, for the same reason.
  * `earliest` — the earliest available or genesis block.
  * `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.

> [!NOTE]
>
> See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).

## Response

`data` — the data stored in the storage slot. Returned as a hexadecimal string.

## `eth_getStorageAt` code examples

The following example returns the storage value at slot `2` from the [WCRO Token on the Cronos mainnet](https://cronoscan.com/token/0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23#readContract). In this case, this is the decimals value.

This method can retrieve the different storage values in time by querying different blocks in the past. Note that to query a state in the past, you need an [archive node](https://chainstack.com/evm-nodes-a-dive-into-the-full-vs-archive-mode).

> [!NOTE]
>
> cURL needs a `HEX String` starting with `0x` to identify the block if you want to use a hex integer block number as a parameter.\
> For example, block number `14000000` will be `0xD59F80`. Use the [Chainstack EVM Knife](https://web3tools.chainstacklabs.com/hexadecimal-decimal) to make those conversions.

```javascript ethers.js theme={"system"}
const ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);

const getstorage = async (address, slot, block) => {
    const storage = await provider.send("eth_getStorageAt", [address, slot, block]);
    console.log(storage);
  };

getstorage("0x5C7F8A570d578ED84E63fdFA7b1eE72dEae1AE23", "2", "latest" )
```

```python web3.py theme={"system"}
from web3 import Web3  
node_url = "CHAINSTACK_NODE_URL" 
web3 = Web3(Web3.HTTPProvider(node_url))

storage = web3.eth.get_storage_at("0x5C7F8A570d578ED84E63fdFA7b1eE72dEae1AE23", 2, "latest")
print(web3.to_hex(storage))
```

## Use case

One use case for `eth_getStorageAt` is analyzing how the value stored at a specific storage slot of a smart contract changes over time. For example, a developer may want to track the change in a specific variable of a smart contract, such as the total supply of a token, and perform some analysis on it.


## OpenAPI

````yaml openapi/cronos_node_api/eth_getStorageAt.json POST /mt_c524ad9781ae5dccd9ac6f5b0370e
openapi: 3.0.0
info:
  title: Cronos Node API
  version: 1.0.0
  description: This is an API for interacting with a Cronos node.
servers:
  - url: https://cronos-mainnet.core.chainstack.com
security: []
paths:
  /mt_c524ad9781ae5dccd9ac6f5b0370e:
    post:
      tags:
        - upload
      summary: eth_getStorageAt
      operationId: getStorageAt
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                  default: eth_getStorageAt
                params:
                  type: array
                  items:
                    anyOf:
                      - type: string
                        title: Smart contract address
                        description: The address of the contract to query.
                      - type: string
                        title: Slot index
                        description: The index of the storage position to query.
                      - type: string
                        title: Block ID
                        description: The block number or tag to use as a reference.
                  default:
                    - '0x5C7F8A570d578ED84E63fdFA7b1eE72dEae1AE23'
                    - '0x2'
                    - latest
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
      responses:
        '200':
          description: The value stored at the specified position.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string

````