Trait evmodin::host::Host[][src]

pub trait Host {
Show 14 methods fn account_exists(&self, address: Address) -> bool;
fn get_storage(&self, address: Address, key: U256) -> U256;
fn set_storage(
        &mut self,
        address: Address,
        key: U256,
        value: U256
    ) -> StorageStatus;
fn get_balance(&self, address: Address) -> U256;
fn get_code_size(&self, address: Address) -> U256;
fn get_code_hash(&self, address: Address) -> U256;
fn copy_code(
        &self,
        address: Address,
        offset: usize,
        buffer: &mut [u8]
    ) -> usize;
fn selfdestruct(&mut self, address: Address, beneficiary: Address);
fn call(&mut self, msg: &Message) -> Output;
fn get_tx_context(&self) -> TxContext;
fn get_block_hash(&self, block_number: u64) -> U256;
fn emit_log(&mut self, address: Address, data: &[u8], topics: &[U256]);
fn access_account(&mut self, address: Address) -> AccessStatus;
fn access_storage(&mut self, address: Address, key: U256) -> AccessStatus;
}
Expand description

Abstraction that exposes host context to EVM.

Required methods

Check if an account exists.

Get value of a storage key.

Returns Ok(U256::zero()) if does not exist.

Set value of a storage key.

Get balance of an account.

Returns Ok(0) if account does not exist.

Get code size of an account.

Returns Ok(0) if account does not exist.

Get code hash of an account.

Returns Ok(0) if account does not exist.

Copy code of an account.

Returns Ok(0) if offset is invalid.

Self-destruct account.

Call to another account.

Retrieve transaction context.

Get block hash.

Returns Ok(U256::zero()) if block does not exist.

Emit a log.

Mark account as warm, return previous access status.

Returns Ok(AccessStatus::Cold) if account does not exist.

Mark storage key as warm, return previous access status.

Returns Ok(AccessStatus::Cold) if account does not exist.

Implementors