Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kadenzipfel/bytepeep
Minimal bytecode peephole optimizer
https://github.com/kadenzipfel/bytepeep
Last synced: 3 days ago
JSON representation
Minimal bytecode peephole optimizer
- Host: GitHub
- URL: https://github.com/kadenzipfel/bytepeep
- Owner: kadenzipfel
- License: apache-2.0
- Created: 2022-09-30T22:12:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-09T18:32:58.000Z (about 2 years ago)
- Last Synced: 2024-12-27T04:06:32.751Z (10 days ago)
- Language: Rust
- Homepage:
- Size: 110 KB
- Stars: 119
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-huff - Bytepeep
README
# Bytepeep • [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Crates.io](https://img.shields.io/crates/v/bytepeep)
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](diagram.png)
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 `### 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.