Skip to content

Latest commit

 

History

History
153 lines (132 loc) · 20 KB

README.md

File metadata and controls

153 lines (132 loc) · 20 KB

awesome-huff

What the heck is Huff?

Huff is a low-level programming language designed for developing highly optimized smart contracts that run on the Ethereum Virtual Machine (EVM). Huff does not hide the inner workings of the EVM. Instead, Huff exposes its programming stack and provides useful tools like constants and macros.

Initially developed by the Aztec Protocol team, Huff was created to write Weierstrudel, an on-chain elliptical curve arithmetic library that requires incredibly optimized code which neither Solidity nor Yul could provide. Huff was later rewritten by Jet Jadeja in Typescript, and finally it has been rewritten in Rust as huff-rs which is the version we use today.

Huff can be used to write highly-efficient smart contracts for use in production, or it can serve as a way for beginners to learn more about the EVM.

Join the movement on Twitter

Drop a gm in the Discord

  • Huff is still young, but it already has a thriving community. People on the Huff discord are helpful, friendly, and chill.

Start here

Official huff-language Github repo

This is your main GH org for all things Huff: https://github.com/huff-language.

  • huff-rs You'll be installing this, the new compiler built in Rust, developed by the community and recently released to the public. After installing huffc it's time to start hacking! Write your first Huff function, anon. Start with something simple like adding two numbers. See the tutorials in the docs.
  • huff-project-template A template for bootstrapping new Huff projects. Includes Foundry HuffDeployer.
  • huffmate A library of modern, hyper-optimized, and secure Huff contracts. Currently the gold standard of Huff libraries.
  • vscode-huff A VSCode extension for Huff with syntax highlighting. Also available from within your VSCode in the Extensions Marketplace.
  • huff-examples Currently has wip versions of ERC20 and ERC721.
  • huff-breakage 💎HIDDEN GEM💎 A repo containing incorrect, breaking, and footgunned Huff contracts. You'll learn a lot about Huff by reading what not to do in this excellent resource by @refcells.
  • huff-debug An easy hevm debug integration for hardhat-huff projects.
  • foundry-huff Foundry support for Huff. Includes HuffDeployer to compile and test Huff contracts.
  • hardhat-huff Huff support for Hardhat.

Huff tooling

  • Bytepeep Bytepeep is a minimal bytecode peephole optimizer by @0xKaden.
  • Murph Transpile EVM bytecode into Huff.
  • vim-huff Huff syntax highlighting for vim
  • hufflime A Sublime Text package for Huff syntax highlighting.
  • huff-stacker Automatically generate stack comments for huff macros.
  • Huff-Console Console logging functionality for debugging Huff contracts during development. Allows you log out the stack, memory and calldata easily and dynamically by Michael Amadi.
  • Huffpoint Create breakpoints in your Huff code to use with Foundry debugger.

Huff articles

Huff videos

Projects using Huff in the wild

Huff projects you can learn from and contribute to

We heard you like ERC20 implementations

  • huffmate ERC20 This is the current gold standard of Huff ERC20 (includes EIP-2612 Permit) and passing all Solmate tests.
  • erc20-huff An ERC20 with Foundry tests.
  • huff-pg An ERC20 implementation with SafeMath.
  • huff-examples-ERC20 Currently has wip versions of ERC20 and ERC721.
  • Solmate ERC20 ERC20 implemented on Huff fully complete with all functionality

Know your roots, anon

Advanced EVM articles

EVM opcodes

  • evm.codes WITH HUFF PLAYGROUND check it out! This is a fork of evm.codes with Huff language support in the playground. Prototype, practice, and learn Huff with real time feedback and interactive debugger.
  • evm.codes The ultimate resource for evm opcodes. The playground will soon have Huff support!
  • evm-puzzles 10 puzzles to get you thinking like an evm.
  • more-evm-puzzles 10 more puzzles!

Huff honorable mentions