Skip to content

Yashiru/evm-rs-emulator

 
 

Repository files navigation

EVM Rust Emulator

The EVM Rust Emulator is a simple in-memory Ethereum Virtual Machine (EVM) emulator written in Rust. It is designed to be a lightweight and easy-to-use tool for developers who want to test EVM bytecode execution directly in a Rust crate, without using a full EVM node with his RPC to interact with a blockchain.

Github action Test coverage

Run some bytecode

Put the bytecode to run in bytecode.bin file and run the following command.

cargo run

🚧 Warning 🚧

This project is currently experimental and subject to frequent changes as we are still working on stabilizing EVM emulation. It has not been audited for security purposes and should not be used in production yet.

Missing features (Contributions welcome ❤️)

  • EVM gas usage
  • EVM gas refund
  • EVM gas price
  • EVM gas limit
  • Mocked data with RPC
    • Block data
    • Call to external contract
  • External crate features
    • Deploy contract
    • Call contract
    • Get logs

Contributions

To install the EVM Rust Emulator, you will need to have Rust and Cargo installed on your system.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Once you have these tools installed, you can clone the project.

git clone https://github.com/Yashiru/evm-rs-emulator.git

To run the tests, you can use the following command.

cargo test

To run the coverage task

cargo make cov

License

The underlying source code is free and unencumbered software released into the public domain. Check LICENSE file for more information.