pub trait Host {
Show 14 methods // Required methods fn step( &mut self, interpreter: &mut Interpreter, is_static: bool ) -> InstructionResult; fn step_end( &mut self, interpreter: &mut Interpreter, is_static: bool, ret: InstructionResult ) -> InstructionResult; fn env(&mut self) -> &mut Env; fn load_account(&mut self, address: B160) -> Option<(bool, bool)>; fn block_hash(&mut self, number: U256) -> Option<B256>; fn balance(&mut self, address: B160) -> Option<(U256, bool)>; fn code(&mut self, address: B160) -> Option<(Bytecode, bool)>; fn code_hash(&mut self, address: B160) -> Option<(B256, bool)>; fn sload(&mut self, address: B160, index: U256) -> Option<(U256, bool)>; fn sstore( &mut self, address: B160, index: U256, value: U256 ) -> Option<(U256, U256, U256, bool)>; fn log(&mut self, address: B160, topics: Vec<B256>, data: Bytes); fn selfdestruct( &mut self, address: B160, target: B160 ) -> Option<SelfDestructResult>; fn create( &mut self, inputs: &mut CreateInputs ) -> (InstructionResult, Option<B160>, Gas, Bytes); fn call( &mut self, input: &mut CallInputs ) -> (InstructionResult, Gas, Bytes);
}
Expand description

EVM context host.

Required Methods§

source

fn step( &mut self, interpreter: &mut Interpreter, is_static: bool ) -> InstructionResult

source

fn step_end( &mut self, interpreter: &mut Interpreter, is_static: bool, ret: InstructionResult ) -> InstructionResult

source

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

source

fn load_account(&mut self, address: B160) -> Option<(bool, bool)>

load account. Returns (is_cold,is_new_account)

source

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

Get environmental block hash.

source

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

Get balance of address and if account is cold loaded.

source

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

Get code of address and if account is cold loaded.

source

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

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

source

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

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

source

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

Set storage value of account address at index. Returns (original, present, new, sis_cold)

source

fn log(&mut self, address: B160, topics: Vec<B256>, data: Bytes)

Create a log owned by address with given topics and data.

source

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

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

source

fn create( &mut self, inputs: &mut CreateInputs ) -> (InstructionResult, Option<B160>, Gas, Bytes)

Invoke a create operation.

source

fn call(&mut self, input: &mut CallInputs) -> (InstructionResult, Gas, Bytes)

Invoke a call operation.

Implementors§