revm_context_interface::host

Trait Host

Source
pub trait Host:
    TransactionGetter
    + BlockGetter
    + CfgGetter {
    // Required methods
    fn load_account_delegated(
        &mut self,
        address: Address,
    ) -> Option<StateLoad<AccountLoad>>;
    fn block_hash(&mut self, number: u64) -> Option<B256>;
    fn balance(&mut self, address: Address) -> Option<StateLoad<U256>>;
    fn code(&mut self, address: Address) -> Option<StateLoad<Bytes>>;
    fn code_hash(&mut self, address: Address) -> Option<StateLoad<B256>>;
    fn sload(
        &mut self,
        address: Address,
        index: U256,
    ) -> Option<StateLoad<U256>>;
    fn sstore(
        &mut self,
        address: Address,
        index: U256,
        value: U256,
    ) -> Option<StateLoad<SStoreResult>>;
    fn tload(&mut self, address: Address, index: U256) -> U256;
    fn tstore(&mut self, address: Address, index: U256, value: U256);
    fn log(&mut self, log: Log);
    fn selfdestruct(
        &mut self,
        address: Address,
        target: Address,
    ) -> Option<StateLoad<SelfDestructResult>>;
}
Expand description

EVM context host.

Required Methods§

Source

fn load_account_delegated( &mut self, address: Address, ) -> Option<StateLoad<AccountLoad>>

Load an account code.

Source

fn block_hash(&mut self, number: u64) -> Option<B256>

Gets the block hash of the given block number.

Source

fn balance(&mut self, address: Address) -> Option<StateLoad<U256>>

Gets balance of address and if the account is cold.

Source

fn code(&mut self, address: Address) -> Option<StateLoad<Bytes>>

Gets code of address and if the account is cold.

Source

fn code_hash(&mut self, address: Address) -> Option<StateLoad<B256>>

Gets code hash of address and if the account is cold.

Source

fn sload(&mut self, address: Address, index: U256) -> Option<StateLoad<U256>>

Gets storage value of address at index and if the account is cold.

Source

fn sstore( &mut self, address: Address, index: U256, value: U256, ) -> Option<StateLoad<SStoreResult>>

Sets storage value of account address at index.

Returns StateLoad with SStoreResult that contains original/new/old storage value.

Source

fn tload(&mut self, address: Address, index: U256) -> U256

Gets the transient storage value of address at index.

Source

fn tstore(&mut self, address: Address, index: U256, value: U256)

Sets the transient storage value of address at index.

Source

fn log(&mut self, log: Log)

Emits a log owned by address with given LogData.

Source

fn selfdestruct( &mut self, address: Address, target: Address, ) -> Option<StateLoad<SelfDestructResult>>

Marks address to be deleted, with funds transferred to target.

Implementations on Foreign Types§

Source§

impl<'a, T: 'a + Host + ?Sized> Host for &'a mut T

Source§

fn load_account_delegated( &mut self, address: Address, ) -> Option<StateLoad<AccountLoad>>

Source§

fn block_hash(&mut self, number: u64) -> Option<B256>

Source§

fn balance(&mut self, address: Address) -> Option<StateLoad<U256>>

Source§

fn code(&mut self, address: Address) -> Option<StateLoad<Bytes>>

Source§

fn code_hash(&mut self, address: Address) -> Option<StateLoad<B256>>

Source§

fn sload(&mut self, address: Address, index: U256) -> Option<StateLoad<U256>>

Source§

fn sstore( &mut self, address: Address, index: U256, value: U256, ) -> Option<StateLoad<SStoreResult>>

Source§

fn tload(&mut self, address: Address, index: U256) -> U256

Source§

fn tstore(&mut self, address: Address, index: U256, value: U256)

Source§

fn log(&mut self, log: Log)

Source§

fn selfdestruct( &mut self, address: Address, target: Address, ) -> Option<StateLoad<SelfDestructResult>>

Source§

impl<T: Host + ?Sized> Host for Box<T>

Source§

fn load_account_delegated( &mut self, address: Address, ) -> Option<StateLoad<AccountLoad>>

Source§

fn block_hash(&mut self, number: u64) -> Option<B256>

Source§

fn balance(&mut self, address: Address) -> Option<StateLoad<U256>>

Source§

fn code(&mut self, address: Address) -> Option<StateLoad<Bytes>>

Source§

fn code_hash(&mut self, address: Address) -> Option<StateLoad<B256>>

Source§

fn sload(&mut self, address: Address, index: U256) -> Option<StateLoad<U256>>

Source§

fn sstore( &mut self, address: Address, index: U256, value: U256, ) -> Option<StateLoad<SStoreResult>>

Source§

fn tload(&mut self, address: Address, index: U256) -> U256

Source§

fn tstore(&mut self, address: Address, index: U256, value: U256)

Source§

fn log(&mut self, log: Log)

Source§

fn selfdestruct( &mut self, address: Address, target: Address, ) -> Option<StateLoad<SelfDestructResult>>

Implementors§

Source§

impl<TX: Transaction, BLOCK: Block, CFG: Cfg> Host for DummyHost<BLOCK, TX, CFG>