Skip to content

Simple lightweight and modular EVM (Ethereum Virtual Machine) written in rust 🦀

License

Notifications You must be signed in to change notification settings

lazyfuhrer/light-evm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

light-evm • License: Apache-2.0 CI Built Using Rust

light-evm is a simple implementation of the EVM (Ethereum Virtual Machine). It's purely an experimental project for my own educational purposes. So don't use any code from this repo for production.

Getting started:

Prerequisites

Build Instructions

  1. Clone the repository:
    git clone https://github.com/lazyfuhrer/light-evm.git
    cd light-evm
  2. Build the project:
    cargo build
  3. Run the project:
    cargo run <BYTECODE>

Example:

Run: cargo run 600660070260005360016000f3

It should return0x2a as the output.

"PUSH1" @ pc=0
Stack: [6]
Memory: []
---------
"PUSH1" @ pc=2
Stack: [6, 7]
Memory: []
---------
"MUL" @ pc=4
Stack: [42]
Memory: []
---------
"PUSH1" @ pc=5
Stack: [42, 0]
Memory: []
---------
"MSTORE8" @ pc=7
Stack: []
Memory: [42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---------
"PUSH1" @ pc=8
Stack: [1]
Memory: [42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---------
"PUSH1" @ pc=10
Stack: [1, 0]
Memory: [42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---------
"RETURN" @ pc=12
Stack: []
Memory: [42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---------
Output : 0x2a00000000000000

About

Simple lightweight and modular EVM (Ethereum Virtual Machine) written in rust 🦀

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages