Skip to content

EVM built from Scratch with support for 140 opcodes

Notifications You must be signed in to change notification settings

Inderdeep01/evm-from-scratch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EVM From Scratch

EVM From Scratch

Welcome to EVM From Scratch! It's a 100% practical course that will help you better understand the inner workings of the Ethereum Virtual Machine. During this course, we'll implement EVM in your favorite programming language.

Fully Implemented

I cloned this repo and chose golang to try and build the EVM from scratch. It supports 140 opcodes. Since it is an isolated instance, support for other opcodes is much more complex as they are dependent on the current state and block of the Ethereum Network. My implementation is tested against all the given testcases.

Note

I am currently refactoring the code, I couldn't resist sharing the progress. Please mind the messy code for now :)

Test Cases

Getting Started

Clone the repo:

git clone https://github.com/w1nt3r-eth/evm-from-scratch

This repository contains evm.json file with more than 100 test cases. Your goal is to create an implementation in any programming language of your choice that passes all tests.

The test cases are organized by complexity: they start with the simplest opcodes and gradually progress to advanced. Each test case has a name, code and expectation. The code is provided as a human-readable instructions list (asm) and machine-readable bytecode encoded in hex (bin). Your implementation should only look at bin, the asm is provided to make unit tests easier to debug.

The repository contains templates for JavaScript, TypeScript, Python, Go and Rust. However, you don't have to use the existing templates, you can build your own test suite based on evm.json.

Credits

All the materials in the repository are made by w1nt3r.eth. The repository is part of the "EVM From Scratch" course (release date TBD).

About

EVM built from Scratch with support for 140 opcodes

Resources

Stars

Watchers

Forks

Languages

  • Go 72.7%
  • JavaScript 13.6%
  • Rust 4.8%
  • Ruby 3.5%
  • Python 3.2%
  • TypeScript 2.2%