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: Uint<256, 4>) -> Option<FixedBytes<32>>; fn balance(&mut self, address: Address) -> Option<(Uint<256, 4>, bool)>; fn code(&mut self, address: Address) -> Option<(Bytecode, bool)>; fn code_hash(&mut self, address: Address) -> Option<(FixedBytes<32>, bool)>; fn sload( &mut self, address: Address, index: Uint<256, 4> ) -> Option<(Uint<256, 4>, bool)>; fn sstore( &mut self, address: Address, index: Uint<256, 4>, value: Uint<256, 4> ) -> Option<SStoreResult>; fn tload(&mut self, address: Address, index: Uint<256, 4>) -> Uint<256, 4>; fn tstore( &mut self, address: Address, index: Uint<256, 4>, value: Uint<256, 4> ); 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: Uint<256, 4>) -> Option<FixedBytes<32>>

Get the block hash of the given block number.

source

fn balance(&mut self, address: Address) -> Option<(Uint<256, 4>, 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<(FixedBytes<32>, bool)>

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

source

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

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

source

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

Set storage value of account address at index.

Returns (original, present, new, is_cold).

source

fn tload(&mut self, address: Address, index: Uint<256, 4>) -> Uint<256, 4>

Get the transient storage value of address at index.

source

fn tstore(&mut self, address: Address, index: Uint<256, 4>, value: Uint<256, 4>)

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§

source§

impl Host for DummyHost

source§

impl<EXT, DB: Database> Host for Context<EXT, DB>