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();