One of the best ways to improve as a Smart Contracts Developer is to learn how the EVM
works. After reading Jtriley’s Huff vs Yul article, i wanted to write small ERC20
token contracts in Solidity
, Yul
and Huff
as a more complex exercise (i.e. bigger contract with dynamic length string constructor arguments).
This is for learning purposes only, they are not optimized !
This is a foundry project so i could write the spec tests in Solidity
and reuse them for the Yul
and Huff
contracts. I also used customized Huff
and Yul
deployer contracts.
- The Solidity contract found in
src/ERC20.sol
, serves as the referenceERC20
spec implementation. - The
Yul
contract can be found inyul/ERC20.yul
. - The
Huff
contract is atsrc/huff/ERC20.huff
.
⚠ Prerequisites:
Clone this repository and install the dependencies
git clone git@github.com:The-Wary-One/erc20s.git
mkdir erc20s
forge install
Run the tests
forge test