Skip to main content
@tevm/voltaire
@tevm/voltaire / primitives/StorageProof

primitives/StorageProof

Type Aliases

StorageProofLike

StorageProofLike = StorageProofType | { key: StorageKeyType; proof: readonly Uint8Array[]; value: StorageValueType; }
Defined in: src/primitives/StorageProof/StorageProofType.ts:42 Inputs that can be converted to StorageProof

StorageProofType

StorageProofType = object
Defined in: src/primitives/StorageProof/StorageProofType.ts:18 StorageProof represents an EIP-1186 storage proof for a single storage slot. Each storage proof demonstrates that a specific storage key-value pair exists (or doesn’t exist) in a contract’s storage trie at a given block. The proof consists of RLP-encoded Merkle Patricia Trie nodes forming a path from the storage root to the leaf containing the value. Storage proofs are part of the StateProof structure and enable trustless verification of contract storage without executing transactions or trusting external data providers.

See

EIP-1186: https://eips.ethereum.org/EIPS/eip-1186

Properties

key
readonly key: StorageKeyType
Defined in: src/primitives/StorageProof/StorageProofType.ts:23 The storage slot being proven. Combines contract address and 256-bit slot number.
proof
readonly proof: readonly Uint8Array[]
Defined in: src/primitives/StorageProof/StorageProofType.ts:36 Array of RLP-encoded Merkle Patricia Trie nodes. Forms the path from the storage root hash to this storage slot. Nodes are ordered from root to leaf.
value
readonly value: StorageValueType
Defined in: src/primitives/StorageProof/StorageProofType.ts:29 The value stored at this slot. Zero if the slot is uninitialized or was cleared.

Functions

equals()

equals(a, b): boolean
Defined in: src/primitives/StorageProof/equals.js:22 Compares two StorageProofs for equality. All fields (key, value, and proof elements) must match.

Parameters

a
StorageProofType First StorageProof
b
StorageProofType Second StorageProof

Returns

boolean
  • True if equal

Example

const isEqual = StorageProof.equals(proof1, proof2);

from()

from(storageProof): StorageProofType
Defined in: src/primitives/StorageProof/from.js:23 Creates a StorageProof from an object with key, value, and proof array.

Parameters

storageProof
StorageProofLike Object containing key, value, and proof

Returns

StorageProofType
  • A validated StorageProof

Example

const proof = StorageProof.from({
  key: storageKey,
  value: storageValue,
  proof: [node1, node2, node3],
});