EVM-FROM-SCRATCH is an implementation of the Ethereum Virtual Machine (EVM) in Go. It follows the Ethereum Yellow Paper, with clear, idiomatic Go code for accessibility and extensibility.
- Core EVM Interpreter: Executes EVM bytecode, modeling stack, memory, storage, and flow control as per Ethereum specification.
- Educational Structure: Minimal dependencies, focused on readability and hackability.
- Testing & Linting Automation: Full developer tooling for Go best practices and continuous integration.
- Go 1.19 or higher
- Tools:
golangci-lint,shadow(for full linting support)
Clone this repository and install dependencies:
git clone https://github.com/irajgill/EVM-FROM-SCRATCH.git
cd EVM-FROM-SCRATCH
go mod tidy
The main EVM implementation is in the go-evm/evm directory. You can import this as a package or run the included test suite to explore its behavior. Modify or extend the code for your use case or to better understand EVM semantics.
All common tasks are automated via Makefile targets.
- Help:
make help - Lint and Format:
make lint
Runs go mod tidy, go vet, golangci-lint, and variable shadow checks.
Automatically formats the code using make fmt.
-
Testing:
make test -
Runs all EVM package tests with coverage reporting:
make coverage
Opens an interactive HTML coverage report in your browser.