Infura icon

Infura

Interact with blockchain APIs via Infura

Get Storage At

AI-generated

Overview

This node operation interacts with the Infura API to read a value from a specific storage position of a smart contract on the Ethereum blockchain. It is useful for developers or blockchain analysts who need to inspect the stored data at a particular slot in a contract's storage, for example, to verify contract state or debug smart contract behavior.

Use Case Examples

  1. Reading the balance stored at a specific position in a token contract's storage.
  2. Inspecting a configuration value stored in a contract's storage slot.

Properties

Name Meaning
Contract Address The Ethereum address of the smart contract whose storage is being read.
Position The storage position (in hexadecimal format) to read from the contract's storage.
Block The block identifier (hexadecimal or tags like 'latest', 'earliest', 'pending') at which to read the storage value.

Output

JSON

  • contractAddress - The contract address from which the storage was read.
  • position - The storage position that was queried.
  • blockTag - The block identifier used for the request.
  • value - The value read from the contract's storage at the specified position.
  • metadata
    • network - The blockchain network used (e.g., mainnet, rinkeby).
    • operation - The operation performed, here 'getStorageAt'.
    • timestamp - The timestamp when the request was made.
    • infura_endpoint - The Infura API endpoint used for the request.
    • raw_response - The raw response data returned from the Infura API.

Dependencies

  • Requires an Infura API key credential with project ID and optionally a project secret for authentication.

Troubleshooting

  • Common issues include invalid contract address or position format, which may cause the API to return errors or empty results.
  • Incorrect block tag values can lead to unexpected or no data being returned; ensure valid tags like 'latest', 'earliest', 'pending', or a valid hex block number are used.
  • Network connectivity or authentication errors with Infura API can cause failures; verify API credentials and network access.

Links

Discussion