Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 1.15 KB

File metadata and controls

53 lines (40 loc) · 1.15 KB

storage-proof-verifier

The tiny library verifies an ext_getStorageProof response against the reported Nomt state_root, checks that the opened key matches the requested (contract_address, slot) pair, and decodes the verified value as U256.

Library API

use alloy_primitives::{Address, U256};
use eth_proofs_minimal::{verify_storage_proof, GetProofResponse};

fn verify(
    address: Address,
    slot: U256,
    response: GetProofResponse,
) -> Result<U256, eth_proofs_minimal::ProofVerificationError> {
    verify_storage_proof(address, slot, response)
}

CLI Usage

The binary keeps the existing fetch-and-print behavior and is enabled by the default cli feature.

cargo run -- \
  --rpc-url http://localhost:12346/rpc \
  --contract-address 0x1234567890123456789012345678901234567890 \
  --slot 0

If you only want the library, disable default features:

cargo check --no-default-features --lib

Direct dependencies always used by the library:

  • sov-state
  • bcs
  • sha2
  • alloy-primitives
  • serde
  • thiserror

Binary-only direct dependencies behind the cli feature:

  • clap
  • jsonrpsee
  • tokio