@tevm/voltaire / Storage
Storage
Storage Layout UtilitiesSee
- https://eips.ethereum.org/EIPS/eip-7201 - Namespaced Storage Layout
- https://eips.ethereum.org/EIPS/eip-8042 - Diamond Storage
Type Aliases
StorageSlotType
StorageSlotType =Defined in: src/primitives/Storage/StorageType.ts:7 Storage slot type (32 bytes) Represents a storage location in Ethereum contract storageUint8Array&object
Type Declaration
[brand]
readonly[brand]:"StorageSlot"
Functions
calculateErc7201()
calculateErc7201(Defined in: src/primitives/Storage/calculateErc7201.js:10 Calculate ERC-7201 namespaced storage slot Formula: keccak256(keccak256(id) - 1) & ~0xff The result has the last byte cleared (set to 0x00)keccak256,id):Uint8Array<ArrayBufferLike>
Parameters
keccak256
(data) => Uint8Array
Keccak256 hash function
id
string
Namespace identifier string
Returns
Uint8Array<ArrayBufferLike>
32-byte storage slot
See
https://eips.ethereum.org/EIPS/eip-7201calculateErc8042()
calculateErc8042(Defined in: src/primitives/Storage/calculateErc8042.js:10 Calculate ERC-8042 (Diamond Storage) storage slot Formula: keccak256(id) Simpler than ERC-7201, just the direct hash of the identifierkeccak256,id):Uint8Array<ArrayBufferLike>
Parameters
keccak256
(data) => Uint8Array
Keccak256 hash function
id
string
Storage namespace identifier string
Returns
Uint8Array<ArrayBufferLike>
32-byte storage slot

