Skip to main content

FoundryDatabase

Trait FoundryDatabase 

Source
pub trait FoundryDatabase: DynDatabase {
    // Provided methods
    fn is_forked_mode(&self) -> bool { ... }
    fn active_fork_source_chain_id(&self) -> Option<u64> { ... }
    fn evict_account(&self, _address: &Address) { ... }
    fn evict_storage(&self, _address: &Address, _slot: &U256) { ... }
    fn set_eip161(&self, _eip161: bool) { ... }
    fn prefetch_call(
        &self,
        _caller: Address,
        _target: Address,
        _value: U256,
        _input: Bytes,
        _local: Option<&Cache>,
        _overrides: bool,
    ) { ... }
}
Expand description

Database view the factory needs at construction time.

Provided Methods§

Source

fn is_forked_mode(&self) -> bool

Whether the database is currently in forked mode.

Source

fn active_fork_source_chain_id(&self) -> Option<u64>

Returns the source chain ID of the active fork, independent of execution overrides.

Source

fn evict_account(&self, _address: &Address)

Drops remotely cached state of address, so the next read refetches it.

Source

fn evict_storage(&self, _address: &Address, _slot: &U256)

Drops a remotely cached storage slot, so the next read refetches it.

Source

fn set_eip161(&self, _eip161: bool)

Sets whether the execution reading this database applies EIP-161, under which empty accounts do not exist.

Source

fn prefetch_call( &self, _caller: Address, _target: Address, _value: U256, _input: Bytes, _local: Option<&Cache>, _overrides: bool, )

Prefetches the remote state a call is about to read, if this database reads a remote fork. With overrides, the local state over this database goes along as overrides. A call sent without overrides is skipped when the fork loaded its target without code. It is also skipped when local holds its target but the fork never loaded it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FoundryDatabase for Box<dyn BackingDb>

Source§

fn is_forked_mode(&self) -> bool

Source§

fn active_fork_source_chain_id(&self) -> Option<u64>

Source§

fn evict_account(&self, address: &Address)

Source§

fn evict_storage(&self, address: &Address, slot: &U256)

Source§

fn set_eip161(&self, eip161: bool)

Source§

fn prefetch_call( &self, caller: Address, target: Address, value: U256, input: Bytes, local: Option<&Cache>, overrides: bool, )

Source§

impl FoundryDatabase for EmptyDB

Source§

impl FoundryDatabase for InMemoryDB

Implementors§