A library for secure Huff smart contract development. Directly inspired by OpenZeppelin contracts, this library is an implementation of the openzeppelin's concepts, written in Huff and thus much more economic in terms of gas usage.
This library is under development and you won't find all the openzeppelin designs yet.
git submodule add https://github.com/Yashiru/open-huff
Once installed, you can use the contracts in the library by importing them:
#include "@open-huff/contracts/ERC20.sol"
This project is maintained by Yashiru. Open Huff Contracts is meant to provide tested and community-audited code, but please use common sense when doing anything that deals with real money! We take no responsibility for your implementation decisions and any security problems you might experience.
⚠️ No audit has been done yet.⚠️
Open Huff Contracts exists thanks to its contributors. There are many ways you can participate and help build high quality software. Check out the issues panel.
The following will need to be installed in order to work on this project. Please follow the links and instructions.
- Foundry / Foundryup
- This will install
forge
,cast
, andanvil
- To get the latest of each, just run
foundryup
- This will install
- Huff Compiler
- You'll know you've done it right if you can run
huffc --version
and get an output like:huffc 0.3.0
- You'll know you've done it right if you can run
- Install dependencies
Once you've cloned and entered into your repository, you need to install the necessary dependencies. In order to do so, simply run:
forge install
- Build & Test
To build and test your contracts with foundry, you can run:
forge build
forge test # To simply run tests
forge test -vvv # To run tests and print execution traces of failing tests
To compile your contract using Huff, you can run:
huffc ./path/to/your/contract.huff
For more information on how to use Foundry, check out the Foundry Github Repository and the foundry-huff library repository.
For mor information on how to use Huff, check out the Huff documentation and the Huff language repository.
Open Huff Contracts is released under the MIT License.