/foundry-yul-puzzles

Foundry + Yul puzzles

Primary LanguageSolidity

About

Virgin Solidity devs use Yul embedded into Solidity assembly block. Chads use pure Yul. Legends use Huff...

Before being a legend, one shall go through the path of a Yul chad.

About, again

This is a repo containing Yul puzzles to improve your Yul skills. Shoutdout to CodeForce, who created this template. GLHF!

Repository installation

  1. Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup
  1. Install solidity compiler https://docs.soliditylang.org/en/latest/installing-solidity.html#installing-the-solidity-compiler

  2. Build Yul contracts and check tests pass

forge test

Running tests

Run tests (compiles yul then fetch resulting bytecode in test)

forge test

To see the console logs during tests

forge test -vvv

Contributing

Feel free to create new puzzles and create pull request to merge it. To create a puzzle:

  1. copy yul/_Template.yul, rename it and provide puzzle description
  2. copy test_Template.t.yul, rename it and provide all test cases verifying correctness of the solution
  3. write solution to the puzzle to solutions folder