Module slot_identifier

Module slot_identifier 

Source
Expand description

Storage slot identification and decoding utilities for Solidity storage layouts.

This module provides functionality to identify and decode storage slots based on Solidity storage layout information from the compiler.

Structs§

DecodedSlotValues
Decoded storage slot values
SlotIdentifier
Storage slot identifier that uses Solidity [StorageLayout] to identify storage slots.
SlotInfo
Information about a storage slot including its label, type, and decoded values.
StorageTypeInfo
Wrapper type that holds both the original type label and the parsed DynSolType.

Constants§

ENCODING_BYTES
“bytes” encoding type for bytes and string types, which use either inplace or keccak256 hash-based storage depending on length
ENCODING_DYN_ARRAY
“dynamic_array” encoding type for dynamic arrays, which uses keccak256 hash-based storage
ENCODING_INPLACE
“inplace” encoding type for variables that fit in one storage slot i.e 32 bytes
ENCODING_MAPPING
“mapping” encoding type for Solidity mappings, which use keccak256 hash-based storage

Functions§

get_array_base_indices 🔒
Returns the base indices for array types, e.g. “[0][0]” for 2D arrays.
is_struct
Checks if a given type label represents a struct type.
serialize_mapping_keys 🔒
Custom serializer for mapping keys
serialize_slot_type 🔒
Custom serializer for StorageTypeInfo that only outputs the label