curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0xAc586b65F3cd0627D2D05AdB8EF551C9d2D76E12",
"0x0",
"latest"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0xAc586b65F3cd0627D2D05AdB8EF551C9d2D76E12",
"0x0",
"latest"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}data — the 20-byte address of the storage.quantity — the position in the storage as a hexadecimal string.quantity|tag — the block number as a hexadecimal string, or one of the following block tags:
latest — the most recent block in the canonical chainearliest — the genesis blockpending — the pending state/transactionsresult — the value at this storage position, encoded as a 32-byte hexadecimal string.eth_getStorageAt code examplesconst { ethers } = require("ethers");
const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");
async function getStorageAt() {
const contractAddress = "0xAc586b65F3cd0627D2D05AdB8EF551C9d2D76E12";
const position = "0x0"; // Storage slot 0
const value = await provider.getStorage(contractAddress, position);
console.log(`Storage value at position 0: ${value}`);
}
getStorageAt();
eth_getStorageAt is reading private or internal state variables from smart contracts that are not exposed through public getter functions, or verifying that a contract’s storage layout matches expected values during audits.Was this page helpful?