example_erc20_gas/handlers/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
pub mod post_execution;
pub mod pre_execution;
pub mod validation;

pub use post_execution::Erc20PostExecution;
pub use pre_execution::Erc20PreExecution;
pub use validation::Erc20Validation;

use revm::{
    context::{block::BlockEnv, tx::TxEnv, CfgEnv, Context},
    context_interface::result::{EVMError, InvalidTransaction},
    database_interface::Database,
    handler::{EthExecution, EthHandler},
    Evm,
};

pub type Erc20GasError<DB> = EVMError<<DB as Database>::Error, InvalidTransaction>;

pub type Erc20GasContext<DB> = Context<BlockEnv, TxEnv, CfgEnv, DB>;

pub type CustomHandler<
    CTX,
    ERROR,
    VAL = Erc20Validation<CTX, ERROR>,
    PREEXEC = Erc20PreExecution<CTX, ERROR>,
    EXEC = EthExecution<CTX, ERROR>,
    POSTEXEC = Erc20PostExecution<CTX, ERROR>,
> = EthHandler<CTX, ERROR, VAL, PREEXEC, EXEC, POSTEXEC>;

pub type CustomEvm<DB> = Evm<
    Erc20GasError<DB>,
    Erc20GasContext<DB>,
    CustomHandler<Erc20GasContext<DB>, Erc20GasError<DB>>,
>;