Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 1.24 KB

README.md

File metadata and controls

37 lines (23 loc) · 1.24 KB

Bytepeep • License Crates.io

Bytecode in, optimized bytecode out.

About

Bytepeep is a minimal bytecode peephole optimizer. Like any other peephole optimizer, it works by passing pairs of opcodes, peepholes, through a pattern matching algorithm to be checked against a set of rules and optimized if possible.

diagram

This is not intended as a replacement for solidity's built-in optimizers. Rather it should serve as a quick and easy tool for low-level smart contract development.

Installation

Install Rust & Cargo: curl https://sh.rustup.rs -sSf | sh

Install bytepeep: cargo install bytepeep

Run: bytepeep <bytecode>

Todo

Contributions welcome!

  • Handle multi-variable rules, (stack/memory dependent)
  • Reassign jumps
  • Handle different inputs
    • Mnemonics
    • Huff
  • Return tips along with optimized bytecode

Disclaimer

This is experimental software and is provided on an "as is" and "as available" basis. We do not give any warranties and will not be liable for any loss incurred through any use of this codebase.