Skip to main content

phos_data_network_precompiles/storage/
mod.rs

1//! EVM storage abstraction layer for DATA Network precompiles.
2
3pub mod evm;
4pub mod hashmap;
5pub mod thread_local;
6
7pub use thread_local::StorageCtx;
8
9use alloy_primitives::{Address, U256};
10
11use crate::Result;
12
13/// Low-level storage provider for interacting with EVM state.
14pub trait PrecompileStorageProvider {
15    /// Performs an SLOAD operation.
16    fn sload(&mut self, address: Address, key: U256) -> Result<U256>;
17
18    /// Performs an SSTORE operation.
19    fn sstore(&mut self, address: Address, key: U256, value: U256) -> Result<()>;
20
21    /// Returns whether the current call context is static.
22    fn is_static(&self) -> bool;
23}