foundry_evm_core/
lib.rs
1#![cfg_attr(not(test), warn(unused_crate_dependencies))]
6#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
7
8use crate::constants::DEFAULT_CREATE2_DEPLOYER;
9use alloy_primitives::Address;
10use auto_impl::auto_impl;
11use backend::DatabaseExt;
12use revm::{inspectors::NoOpInspector, interpreter::CreateInputs, EvmContext, Inspector};
13use revm_inspectors::access_list::AccessListInspector;
14
15#[macro_use]
16extern crate tracing;
17
18pub mod abi {
19 pub use foundry_cheatcodes_spec::Vm;
20 pub use foundry_evm_abi::*;
21}
22
23mod ic;
24
25pub mod backend;
26pub mod buffer;
27pub mod constants;
28pub mod decode;
29pub mod fork;
30pub mod opcodes;
31pub mod opts;
32pub mod precompiles;
33pub mod state_snapshot;
34pub mod utils;
35
36#[auto_impl(&mut, Box)]
39pub trait InspectorExt: for<'a> Inspector<&'a mut dyn DatabaseExt> {
40 fn should_use_create2_factory(
45 &mut self,
46 _context: &mut EvmContext<&mut dyn DatabaseExt>,
47 _inputs: &mut CreateInputs,
48 ) -> bool {
49 false
50 }
51
52 fn console_log(&mut self, msg: &str) {
54 let _ = msg;
55 }
56
57 fn is_odyssey(&self) -> bool {
59 false
60 }
61
62 fn create2_deployer(&self) -> Address {
64 DEFAULT_CREATE2_DEPLOYER
65 }
66}
67
68impl InspectorExt for NoOpInspector {}
69
70impl InspectorExt for AccessListInspector {}