Skip to content

mini evm that simulates stack, memory, calldata, and storage given bytecode or mnemonic (easm)

Notifications You must be signed in to change notification settings

simonshampoo/minirevm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniRevm

mini EVM built in Rust that parses bytecode into a mnemonic and simulates, stack, storage, and memory.

inspired by evm.codes

Usage

cargo run <bytecode>

Example

cargo run 60FF61FFFF62FFFFFF63FFFFFFFF6FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Output:

=================================================================================
Bytecode received: 600660070200
=================================================================================
0x60 06                                                   (1 bytes)
0x60 07                                                   (1 bytes)
0x2
0x0
=================================================================================
PUSH1 0x06
PUSH1 0x07
### END OF EXECUTION ###
Stack 2a

Memory { memory: [] }
Storage { kvstore: {} }
Stack 2a

Memory { memory: [] }
Storage { kvstore: {} }
=================================================================================

TODO

this project is not finished yet. i am not responsible for any losses you incur using this software. feel free to make a pr though i could use some extra hands

Urgent

  • left padding for all Bytes32 types
  • rework Memory

Not urgent

  • multiple contract support (.sol and ABI)
  • multithreading
  • refine to be more of a library with a cli tool

About

mini evm that simulates stack, memory, calldata, and storage given bytecode or mnemonic (easm)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages