Installing Huff
The Huff Neo Compiler is built in Rust to create an extremely performant experience compiling huff.
Installation of the compiler is similar to that of Foundry.
First, install hnc-up
, a version control manager for the Huff Compiler:
curl -L https://raw.githubusercontent.com/cakevm/huff-neo/main/hnc-up/install | bash
NOTE: This installs the hnc-up
binary, but does not guarantee it is added to your path. If you get an error like hnc-up: command not found
, you will need to source your path by running source ~/.bashrc
or source ~/.zshrc
. Alternatively, you can open a new terminal window.
Now, with hnc-up
installed and in your path, you can simply run hnc-up
to install the latest stable version of hnc
(the huff compiler).
On Windows, build from the source
If you use Windows, you can build from the source or download the binary form the releases to get huff.
Building from the source
Download and run rustup-init
from rustup.rs. It will start the installation in a console.
If you encounter an error, it is most likely the case that you do not have the VS Code Installer which you can download here and install.
After this, run the following to build huff from the source:
cargo install --git https://github.com/cakevm/huff-neo.git hnc --bins --locked
To update from the source, run the same command again.
🎉 TADA, Huff is installed! 🎉
To verify for yourself that it's installed, run hnc --help
to view the help menu.
To get started compiling Huff Contracts, check out compiling.
To diver deeper into the compiler's cli abilities, check out the cli docs.