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>"
}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>"
}address — the address of the contractstoragePosition — the position in storage (hex)blockParameter — the block number (hex) or tag (latest, earliest, pending)result — the value at the storage position encoded as hexadecimaleth_getStorageAt code examplesconst 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();
Was this page helpful?