eth_getStorageAt

Returns the value from a storage position at a given address.

Parameters

  1. DATA, 20 Bytes - address of the storage.

  2. QUANTITY - integer of the position in the storage.

  3. QUANTITY|TAG - integer block number, or the string "latest", "earliest" or "pending", see the default block parameter

Returns

DATA - the value at this storage position.

Example

NOTE: In this example we are using public Ethereum endpoint. Ideally, for your own projects, you should use your own endpoint, which you can generate for free by connecting to your wallet here.

Query

NOTE: ethers used below is a well-known web3 library, check it out here.

import { ethers } from 'ethers';

const provider =
  new ethers
    .providers
    .JsonRpcProvider("https://www.noderpc.xyz/rpc-mainnet/public")

provider.send('eth_getStorageAt', ["0xE592427A0AEce92De3Edee1F18E0157C05861564", "0x0", "latest"]).then((result) => {
  console.log(result);
});

Result

0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

Last updated