BrandedStorageKey to string format for use as JavaScript Map keys or persistent storage.
Signature
Parameters
- key (
BrandedStorageKey) - Storage key to serialize
Returns
string - String format: "address:slot" with lowercase hex address (no 0x prefix) and decimal slot
Format
- address: Lowercase 40-character hex string (no 0x prefix)
- slot: Decimal string representation of bigint slot number
Examples
Basic Usage
Various Slot Numbers
Map Keys
Persistent Storage
Database Keys
Logging and Debugging
Round-Trip Conversion
Performance Considerations
String serialization is fast but creates new string objects:Related
- fromString() - Parse from string format
- StorageKey() - Factory function
- equals() - Compare storage keys
- Fundamentals - Learn about storage keys

