- Stack Implementation: Used Python list with validation for 256-bit values and 1024-item limit
- Memory Model: Bytearray with automatic expansion and gas calculation
- Storage Model: Dictionary-based persistent storage
- Gas Metering: Tracked per-operation with dynamic costs for storage
- Type Safety: Pydantic models for all data structures
This project was built to deeply understand Ethereum's execution layer:
- Started with: Basic bytecode interpreter concept
- Learned: EVM specifications, opcodes, gas mechanics
- Implemented: Full EVM with 50+ opcodes
- Tested: 100+ tests covering edge cases and properties
- Documented: Complete architecture and design decisions
- 256-bit arithmetic: Overflow/underflow handling
- Memory expansion: Dynamic gas costs
- Storage patterns: SLOAD/SSTORE gas mechanics
- Stack manipulation: DUP/SWAP operations
- Testing strategies: Property-based and fuzz testing
make setupmake testmake buildmake run- Precompiled contracts
- CALL family opcodes
- CREATE/CREATE2
- Real-world bytecode execution
- EVM trace visualization
- Comparison with geth/execution-specs
- Ethereum Yellow Paper
- evm.codes
- Ethereum Execution Layer Specification (EELS)
- Ethereum Execution Specification Tests (EEST)
This is an educational project, but feedback and suggestions are welcome!
- Fork the repository
- Create a feature branch
- Add tests for any new functionality
- Ensure all tests pass
- Submit a pull request
MIT License - see LICENSE for details
FILIBUS YILRIT DIMKA
Built as preparation for Ethereum Foundation internship application.
- Ethereum Foundation for protocol specifications
- evm.codes for excellent opcode reference
- Python community for amazing testing tools
If this project helped you understand the EVM, please ⭐ star it!