Expand description
§EOT - EVM Opcode Table
A comprehensive Rust library for EVM opcodes with fork-aware metadata, gas cost tracking, and bytecode analysis utilities.
§Architecture
The core type is OpCode, a transparent newtype over u8 backed by a
static [Option<OpCodeInfo>; 256] lookup table. This gives O(1) opcode
lookups with zero heap allocation.
Fork-specific gas costs are handled by OpCode::gas_cost, which applies
known EIP gas changes on top of the base cost stored in OpCodeInfo.
§Quick Start
use eot::{OpCode, Fork};
let add = OpCode::ADD;
assert_eq!(add.gas_cost(Fork::Frontier), 3);
assert!(add.is_valid_in(Fork::Frontier));
// Parse from byte
let op = OpCode::new(0x60).unwrap();
assert_eq!(op, OpCode::PUSH1);Re-exports§
pub use gas::DynamicGasCalculator;pub use gas::ExecutionContext;pub use gas::GasAnalysis;pub use gas::GasCostCategory;
Modules§
- gas
- Gas cost analysis for EVM opcodes.
- validation
- Validation of the opcode table for internal consistency.
Structs§
- OpCode
- A single EVM opcode, stored as a transparent
u8wrapper. - OpCode
Info - Static metadata for a single EVM opcode.