getStorageAt method

  1. @override
Future<String> getStorageAt(
  1. String address,
  2. BigInt position, {
  3. BlockTag? blockTag,
})
override

Gets an element from the storage of the contract with the specified address at the specified position. See https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getstorageat for more details. This function allows specifying a custom block mined in the past to get historical data. By default, BlockTag.latest will be used.

Implementation

@override
Future<String> getStorageAt(
  String address,
  BigInt position, {
  BlockTag? blockTag,
}) {
  final bt = blockTag?.toParam() ?? const BlockTag.latest().toParam();

  return _makeRPCCall<String>(
      'eth_getStorageAt', [address, '0x${position.toRadixString(16)}', bt]);
}