Trait revm_interpreter::Host

source ·
pub trait Host {
Show 13 methods // Required methods fn env(&self) -> &Env; fn env_mut(&mut self) -> &mut Env; fn load_account(&mut self, address: Address) -> Option<LoadAccountResult>; fn block_hash(&mut self, number: U256) -> Option<B256>; fn balance(&mut self, address: Address) -> Option<(U256, bool)>; fn code(&mut self, address: Address) -> Option<(Bytecode, bool)>; fn code_hash(&mut self, address: Address) -> Option<(B256, bool)>; fn sload(&mut self, address: Address, index: U256) -> Option<(U256, bool)>; fn sstore( &mut self, address: Address, index: U256, value: U256 ) -> Option<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<SelfDestructResult>;
}
Expand description

EVM context host.

Required Methods§

source

fn env(&self) -> &Env

Returns a reference to the environment.

source

fn env_mut(&mut self) -> &mut Env

Returns a mutable reference to the environment.

source

fn load_account(&mut self, address: Address) -> Option<LoadAccountResult>

Load an account.

Returns (is_cold, is_new_account)

source

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

Get the block hash of the given block number.

source

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

Get balance of address and if the account is cold.

source

fn code(&mut self, address: Address) -> Option<(Bytecode, bool)>

Get code of address and if the account is cold.

source

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

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

source

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

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

source

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

Set storage value of account address at index.

Returns (original, present, new, is_cold).

source

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

Get the transient storage value of address at index.

source

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

Set the transient storage value of address at index.

source

fn log(&mut self, log: Log)

Emit a log owned by address with given LogData.

source

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

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

Implementors§