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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
//! Core transaction inspector implementation
//!
//! This module provides the main TxInspector type and its core functionality.
//! The inspector is responsible for tracking and collecting detailed information
//! about transaction execution in the EVM.
//!
//! # Architecture
//!
//! The implementation is split across several modules:
//! - `types`: Output and internal data structures
//! - `trace`: Call tracing and error tracking
//! - `inspector`: REVM Inspector trait implementation
//!
//! # Features
//!
//! - Complete transaction tracing
//! - Asset transfer tracking (ETH and ERC20)
//! - Call hierarchy reconstruction
//! - Error propagation tracking
//! - Event log collection
use crate*;
use Serialize;
use ;
use HashMap;
/// Core transaction tracing inspector
///
/// Provides comprehensive transaction execution tracking by implementing
/// the REVM Inspector trait. Collects detailed information about:
///
/// - Asset transfers (ETH and ERC20 tokens)
/// - Contract calls and creations
/// - Call hierarchy and execution paths
/// - Event logs and error states
///
/// # State Management
///
/// The inspector maintains several internal collections to track execution:
/// - Transfers: Chronological list of all value movements
/// - Call traces: Complete tree of contract interactions
/// - Logs: All emitted events
/// - Call stack: Current execution path
/// - Address stack: Caller context for delegate calls
///
/// # Thread Safety
///
/// This inspector is designed to be Send + Sync safe for multi-threaded usage.
/// All internal state uses thread-safe types or types that can be safely
/// moved between threads.
// The explicit implementation of Send and Sync ensures thread safety.
unsafe
unsafe
/// Complete transaction execution trace output
///
/// Aggregates all collected information during transaction execution:
/// - Asset movements (both ETH and tokens)
/// - Complete call hierarchy
/// - Event logs
/// - Error location if execution failed