Skip to main content

StorageOps

Trait StorageOps 

Source
pub trait StorageOps {
    // Required methods
    fn store(&mut self, slot: U256, value: U256) -> Result<()>;
    fn load(&self, slot: U256) -> Result<U256>;
}
Expand description

Storage operations for a given (contract) address.

Abstracts over persistent storage (SLOAD/SSTORE) and transient storage (TLOAD/TSTORE). Implementors must route to the appropriate opcode.

Required Methods§

Source

fn store(&mut self, slot: U256, value: U256) -> Result<()>

Stores a value at the provided slot.

Source

fn load(&self, slot: U256) -> Result<U256>

Loads a value from the provided slot.

Implementors§