Trait revm_interpreter::Host
source · 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§
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
sourcefn load_account(&mut self, address: B160) -> Option<(bool, bool)>
fn load_account(&mut self, address: B160) -> Option<(bool, bool)>
load account. Returns (is_cold,is_new_account)
sourcefn block_hash(&mut self, number: U256) -> Option<B256>
fn block_hash(&mut self, number: U256) -> Option<B256>
Get environmental block hash.
sourcefn balance(&mut self, address: B160) -> Option<(U256, bool)>
fn balance(&mut self, address: B160) -> Option<(U256, bool)>
Get balance of address and if account is cold loaded.
sourcefn code(&mut self, address: B160) -> Option<(Bytecode, bool)>
fn code(&mut self, address: B160) -> Option<(Bytecode, bool)>
Get code of address and if account is cold loaded.
sourcefn code_hash(&mut self, address: B160) -> Option<(B256, bool)>
fn code_hash(&mut self, address: B160) -> Option<(B256, bool)>
Get code hash of address and if account is cold loaded.
sourcefn sload(&mut self, address: B160, index: U256) -> Option<(U256, bool)>
fn sload(&mut self, address: B160, index: U256) -> Option<(U256, bool)>
Get storage value of address at index and if account is cold loaded.
sourcefn sstore(
&mut self,
address: B160,
index: U256,
value: U256
) -> Option<(U256, U256, U256, bool)>
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)
sourcefn log(&mut self, address: B160, topics: Vec<B256>, data: Bytes)
fn log(&mut self, address: B160, topics: Vec<B256>, data: Bytes)
Create a log owned by address with given topics and data.
sourcefn selfdestruct(
&mut self,
address: B160,
target: B160
) -> Option<SelfDestructResult>
fn selfdestruct( &mut self, address: B160, target: B160 ) -> Option<SelfDestructResult>
Mark an address to be deleted, with funds transferred to target.
sourcefn create(
&mut self,
inputs: &mut CreateInputs
) -> (InstructionResult, Option<B160>, Gas, Bytes)
fn create( &mut self, inputs: &mut CreateInputs ) -> (InstructionResult, Option<B160>, Gas, Bytes)
Invoke a create operation.
sourcefn call(&mut self, input: &mut CallInputs) -> (InstructionResult, Gas, Bytes)
fn call(&mut self, input: &mut CallInputs) -> (InstructionResult, Gas, Bytes)
Invoke a call operation.