A minimal Ethereum Virtual Machine implementation in Rust.
- Stack: 1024-depth LIFO with overflow/underflow detection
- Memory: Byte-addressable storage with word operations
- Storage: Persistent state organized by contract address
- Opcodes: Arithmetic, bitwise, comparison, control flow, memory, storage operations
- Execution: Jump table dispatch for bytecode interpretation
| Category | Opcodes |
|---|---|
| Arithmetic | ADD, SUB, MUL, DIV, MOD, EXP, ADDMOD, MULMOD |
| Comparison | LT, GT, SLT, SGT, EQ, ISZERO |
| Bitwise | AND, OR, XOR, NOT, SHL, SHR, SAR, BYTE |
| Stack | PUSH0-PUSH32, DUP1-DUP16, SWAP1-SWAP16, POP |
| Memory | MLOAD, MSTORE, MSTORE8 |
| Storage | SLOAD, SSTORE |
| Control | STOP, JUMP, JUMPI, JUMPDEST, PC |
| System | CREATE, CALL, DELEGATECALL, STATICCALL, RETURN, REVERT |
cargo runcrates/
├── primitives/ # Core types: Stack, Memory, Storage, Transaction, Account
└── evm_core/ # Execution engine, opcodes, jump table
bins/
└── evm/ # Example runner with contract bytecode
MIT