A Simple DEX with BALLs
HuffSwap V2 Core is a decentralized trading protocol that facilitates permissionless and trustless trading of ERC20 tokens through smart contracts. Its based on Uniswap V2, and should be compatible.
This project builds upon the UniswapV2-core contracts and maintains full compatibility. It also draws inspiration from previous efforts to rebuild the pair contract in Huff, such as UniswapV2-Huff.
These steps are optional if you want to modify the Pair code and recompile everything.
To recompile the contracts, run the following commands:
sh build-erc20.sh
sh build-erc1363.sh
sh build-libs.sh
sh build-lp.sh
sh create-bytecode-pair.sh
If you are on a liunx env you might want to limit the max amount of RAM to avoid deadlocks, example;
systemd-run --scope -p MemoryLimit=14000M ./build-lp.sh
After recompiling, paste your new bytecode into Factory:getCreationCode
.
To get started with HuffSwap V2 Core, ensure you have Foundry installed. Follow these steps:
- Clone the HuffSwap V2 Core repository:
git clone https://github.com/eugenioclrc/huffswap-v2-core.git
- Navigate to the project directory:
cd huffswap-v2-core
- Install dependencies:
forge update
- Build the project:
forge build
- Run tests to ensure everything is set up correctly:
forge test
We welcome contributions from the community! To contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Make your changes.
- Submit a pull request with a detailed description of your changes.
HuffSwap V2 Core is released under the MIT License.
For questions or support, please open an issue in this repository or reach out me on twitter.