Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lazyfuhrer authored Feb 2, 2024
1 parent ce89744 commit 6a46105
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# light-evm • [![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![CI](https://github.com/lazyfuhrer/light-evm/actions/workflows/tests.yml/badge.svg)](https://github.com/lazyfuhrer/light-evm/actions/workflows/tests.yml) ![Built Using Rust](https://img.shields.io/badge/Built%20Using-Rust-orange.svg)

`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

- [Rust](https://doc.rust-lang.org/book/ch01-01-installation.html)

### Build Instructions

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

### Example:
Run: `cargo run 600660070260005360016000f3`

It should return`0x2a` as the output.

```bash
"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
```

0 comments on commit 6a46105

Please sign in to comment.