pub trait Handler {
    type CreateInterrupt;
    type CreateFeedback;
    type CallInterrupt;
    type CallFeedback;
Show 29 methods fn balance(&self, address: H160) -> U256;
fn code_size(&self, address: H160) -> U256;
fn code_hash(&self, address: H160) -> H256;
fn code(&self, address: H160) -> Vec<u8, Global>;
fn storage(&self, address: H160, index: H256) -> H256;
fn original_storage(&self, address: H160, index: H256) -> H256;
fn gas_left(&self) -> U256;
fn gas_price(&self) -> U256;
fn origin(&self) -> H160;
fn block_hash(&self, number: U256) -> H256;
fn block_number(&self) -> U256;
fn block_coinbase(&self) -> H160;
fn block_timestamp(&self) -> U256;
fn block_difficulty(&self) -> U256;
fn block_gas_limit(&self) -> U256;
fn block_base_fee_per_gas(&self) -> U256;
fn chain_id(&self) -> U256;
fn exists(&self, address: H160) -> bool;
fn deleted(&self, address: H160) -> bool;
fn is_cold(&self, address: H160, index: Option<H256>) -> bool;
fn set_storage(
        &mut self,
        address: H160,
        index: H256,
        value: H256
    ) -> Result<(), ExitError>;
fn log(
        &mut self,
        address: H160,
        topics: Vec<H256, Global>,
        data: Vec<u8, Global>
    ) -> Result<(), ExitError>;
fn mark_delete(
        &mut self,
        address: H160,
        target: H160
    ) -> Result<(), ExitError>;
fn create(
        &mut self,
        caller: H160,
        scheme: CreateScheme,
        value: U256,
        init_code: Vec<u8, Global>,
        target_gas: Option<u64>
    ) -> Capture<(ExitReason, Option<H160>, Vec<u8, Global>), Self::CreateInterrupt>;
fn call(
        &mut self,
        code_address: H160,
        transfer: Option<Transfer>,
        input: Vec<u8, Global>,
        target_gas: Option<u64>,
        is_static: bool,
        context: Context
    ) -> Capture<(ExitReason, Vec<u8, Global>), Self::CallInterrupt>;
fn pre_validate(
        &mut self,
        context: &Context,
        opcode: Opcode,
        stack: &Stack
    ) -> Result<(), ExitError>; fn create_feedback(
        &mut self,
        _feedback: Self::CreateFeedback
    ) -> Result<(), ExitError> { ... }
fn call_feedback(
        &mut self,
        _feedback: Self::CallFeedback
    ) -> Result<(), ExitError> { ... }
fn other(
        &mut self,
        _opcode: Opcode,
        _stack: &mut Machine
    ) -> Result<(), ExitError> { ... }
}
Expand description

EVM context handler.

Associated Types

Type of CREATE interrupt.

Feedback value for CREATE interrupt.

Type of CALL interrupt.

Feedback value of CALL interrupt.

Required methods

Get balance of address.

Get code size of address.

Get code hash of address.

Get code of address.

Get storage value of address at index.

Get original storage value of address at index.

Get the gas left value.

Get the gas price value.

Get execution origin.

Get environmental block hash.

Get environmental block number.

Get environmental coinbase.

Get environmental block timestamp.

Get environmental block difficulty.

Get environmental gas limit.

Environmental block base fee.

Get environmental chain ID.

Check whether an address exists.

Check whether an address has already been deleted.

Checks if the address or (address, index) pair has been previously accessed (or set in accessed_addresses / accessed_storage_keys via an access list transaction). References:

  • https://eips.ethereum.org/EIPS/eip-2929
  • https://eips.ethereum.org/EIPS/eip-2930

Set storage value of address at index.

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

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

Invoke a create operation.

Invoke a call operation.

Pre-validation step for the runtime.

Provided methods

Feed in create feedback.

Feed in call feedback.

Handle other unknown external opcodes.

Implementations on Foreign Types

Implementors