pub trait Host {
type DB: Database;
const INSPECT: bool;
Show 14 methods
fn step(&mut self, machine: &mut Machine, is_static: bool) -> Return;
fn step_end(&mut self, ret: Return, machine: &mut Machine) -> Return;
fn env(&mut self) -> &mut Env;
fn load_account(&mut self, address: H160) -> (bool, bool);
fn block_hash(&mut self, number: U256) -> H256;
fn balance(&mut self, address: H160) -> (U256, bool);
fn code(&mut self, address: H160) -> (Bytes, bool);
fn code_hash(&mut self, address: H160) -> (H256, bool);
fn sload(&mut self, address: H160, index: U256) -> (U256, bool);
fn sstore(
&mut self,
address: H160,
index: U256,
value: U256
) -> (U256, U256, U256, bool);
fn log(&mut self, address: H160, topics: Vec<H256>, data: Bytes);
fn selfdestruct(
&mut self,
address: H160,
target: H160
) -> SelfDestructResult;
fn create<SPEC: Spec>(
&mut self,
caller: H160,
scheme: CreateScheme,
value: U256,
init_code: Bytes,
gas: u64
) -> (Return, Option<H160>, Gas, Bytes);
fn call<SPEC: Spec>(
&mut self,
code_address: H160,
transfer: Transfer,
input: Bytes,
gas: u64,
context: CallContext
) -> (Return, Gas, Bytes);
}
Expand description
EVM context host.
Associated Types
Associated Constants
Required methods
load account. Returns (is_cold,is_new_account)
fn block_hash(&mut self, number: U256) -> H256
fn block_hash(&mut self, number: U256) -> H256
Get environmental block hash.
Get storage value of address at index.
Set storage value of address at index. Return if slot is cold/hot access.
Create a log owned by address with given topics and data.
fn selfdestruct(&mut self, address: H160, target: H160) -> SelfDestructResult
fn selfdestruct(&mut self, address: H160, target: H160) -> SelfDestructResult
Mark an address to be deleted, with funds transferred to target.
Invoke a create operation.