Crate arb_storage

Crate arb_storage 

Source
Expand description

Storage-backed types for ArbOS state.

Provides typed wrappers over raw storage slots: integers, addresses, byte arrays, queues, and vectors that persist in the state trie.

Re-exports§

pub use queue::initialize_queue;
pub use queue::open_queue;
pub use queue::Queue;
pub use vector::open_sub_storage_vector;
pub use vector::SubStorageVector;

Modules§

queue
vector

Structs§

Storage
Hierarchical storage abstraction over EVM account state.
StorageBackedAddress
Storage-backed Ethereum address (20 bytes, right-aligned in 32-byte slot).
StorageBackedAddressOrNil
Storage-backed optional address.
StorageBackedBigInt
Storage-backed signed 256-bit integer using two’s complement.
StorageBackedBigUint
Storage-backed 256-bit unsigned integer.
StorageBackedBips
Basis points stored as signed i64. 10000 bips = 100%.
StorageBackedBytes
Variable-length byte storage.
StorageBackedInt64
Storage-backed signed 64-bit integer.
StorageBackedUBips
Unsigned basis points stored as u64. 10000 ubips = 100%.
StorageBackedUint16
Storage-backed 16-bit unsigned integer.
StorageBackedUint24
Storage-backed 24-bit unsigned integer.
StorageBackedUint32
Storage-backed 32-bit unsigned integer.
StorageBackedUint64
Storage-backed 64-bit unsigned integer.

Constants§

ARBOS_STATE_ADDRESS
ArbOS state address — the fictional account that stores all ArbOS state.
FILTERED_TX_STATE_ADDRESS
Filtered transactions state address — a separate account for tracking filtered tx hashes.

Functions§

ensure_account_in_bundle
Ensures an arbitrary account exists in bundle_state with nonce=1.
ensure_arbos_account_in_bundle
Ensures the ArbOS account exists in bundle_state.
get_account_balance
Reads the balance of an account from the state.
read_arbos_storage
Reads a storage slot from the ArbOS account, checking cache -> bundle -> database.
read_storage_at
Reads a storage slot from an arbitrary account, checking cache -> bundle -> database.
set_account_code
Sets the code of an account, loading it into cache if needed.
set_account_nonce
Sets the nonce of an account, loading it into cache if needed.
storage_key_map
Computes a storage slot using the keccak256-based mapAddress algorithm.
write_arbos_storage
Writes a storage slot to the ArbOS account using the transition mechanism.
write_storage_at
Writes a storage slot to an arbitrary account using the transition mechanism.