Skip to main content
POST
eth_getStorageAt
curl --request POST \
  --url https://rpc.testnet.tempo.xyz/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "eth_getStorageAt",
  "params": [
    "0x20c0000000000000000000000000000000000000",
    "0x0",
    "latest"
  ],
  "id": 1
}
'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": "<string>"
}
Tempo API method that returns the value from a storage position at a given address. This is useful for reading raw contract storage slots.

Parameters

  • address — the address of the contract
  • storagePosition — the position in storage (hex)
  • blockParameter — the block number (hex) or tag (latest, earliest, pending)

Response

  • result — the value at the storage position encoded as hexadecimal

eth_getStorageAt code examples

const ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);

// pathUSD token address
const PATHUSD = "0x20c0000000000000000000000000000000000000";

const getStorage = async () => {
    // Slot 0 typically contains the total supply in ERC20 contracts
    const value = await provider.getStorage(PATHUSD, 0);
    console.log(`Storage slot 0: ${value}`);

    // Read a specific slot
    const slot5 = await provider.send("eth_getStorageAt", [
      PATHUSD,
      "0x5",
      "latest"
    ]);
    console.log(`Storage slot 5: ${slot5}`);
  };

getStorage();

Body

application/json
jsonrpc
string
default:2.0
method
string
default:eth_getStorageAt
params
any[]

Address, storage position, and block parameter

id
integer
default:1

Response

200 - application/json

The storage value

jsonrpc
string
id
integer
result
string

The value at the given storage position