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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! YEVM — async, WASM-native EVM in Rust.
//!
//! Top-level integration crate. Re-exports the primitive types and the most
//! commonly used items from [`base`], [`core`], [`lens`], and [`misc`] so a
//! consumer can depend on a single crate instead of wiring the sub-crates by
//! hand.
//!
//! # Example
//!
//! Simulate a transaction against a JSON-RPC node, stream the execution
//! trace, and decode the side effects with [`analyse`]:
//!
//! ```ignore
//! use futures::StreamExt;
//! use yevm::{analyse, trace::filter, Cache, Call, Executor, Rpc, Trace, Tx};
//!
//! async fn simulate(call: Call, tx: Tx, rpc: &str) -> eyre::Result<()> {
//! let mut rpc = Rpc::latest(rpc.into()).await?;
//! let chain_id = rpc.chain_id().await?;
//! let head = rpc.block(rpc.block_number).await?.head;
//! rpc.reset(head.number.as_u64(), head.hash);
//!
//! let (sender, receiver) = futures::channel::mpsc::channel(1 << 20);
//! let mut cache = Cache::with_sender(
//! sender,
//! filter::MOVE | filter::PUT | filter::FEE | filter::LOG | filter::CREATE,
//! );
//! cache.set_chain_id(chain_id);
//!
//! let executor = Executor::new(call);
//! executor.run(tx, head, &mut cache, &rpc).await?;
//!
//! let traces: Vec<Trace> = receiver.collect().await;
//! let alerts = analyse(&traces);
//! for swap in &alerts.proxy_swaps {
//! eprintln!("proxy swap detected: {swap:?}");
//! }
//! Ok(())
//! }
//! ```
pub use yevm_base as base;
pub use yevm_core as core;
pub use yevm_lens as lens;
pub use yevm_misc as misc;
pub use yevm_wasm as wasm;
pub use ;
pub use Buf;
pub use Cache;
pub use Chain;
pub use ;
pub use Rpc;
pub use State;
pub use ;
pub use ;
pub use ;