Type Definition
Composite key primitive uniquely identifying storage locations in the Ethereum Virtual Machine by combining contract address with storage slot.Quick Reference
API Methods
Constructors
StorageKey()- Factory function creating storage key from address and slotfrom()- Universal constructor from various inputs
Serialization
toString()- Convert to string format for map keysfromString()- Parse from string format
Comparison & Type Guards
Utilities
hashCode()- Compute hash code for storage key
Types
- BrandedStorageKey
- StorageKeyLike
- Each contract has 2^256 storage slots
- Each slot stores 256-bit value
- Slots initially zero, consume gas on first write
Usage Patterns
Basic Storage Operations
String Serialization
Storage Slot Computation
Multi-Contract State
Type Guards
Tree-Shaking
Import only what you need for optimal bundle size:Related
Core Documentation
- Fundamentals - Learn EVM state structure and Merkle Patricia Tries
- Merkle Trees - Trie operations and state roots
- Usage Patterns - Real-world examples
API Methods
- StorageKey() - Factory function
- toString() - String serialization
- fromString() - String parsing
- equals() - Equality comparison
- is() - Type guard
Related Primitives
- Address - Contract address type
- Uint - 256-bit unsigned integers for slot values
- Keccak256 - Keccak256 hashing for state roots
Specification
- Ethereum Yellow Paper - Formal state specification (Section 4.1, Appendix D)
- ethereum.org State Docs - Account and state overview
- Patricia Merkle Trie Spec - Trie structure details
- evm.codes SLOAD/SSTORE - Storage access opcodes
- Solidity Storage Layout - Storage slot computation

