{"id":13767312,"url":"https://github.com/RareSkills/huff-puzzles","last_synced_at":"2025-05-10T22:31:43.408Z","repository":{"id":151055013,"uuid":"614356822","full_name":"RareSkills/huff-puzzles","owner":"RareSkills","description":"These exercises were created for our Advanced Solidity Bootcamp and open sourced. Learn EVM bytecode with the Huff Language.","archived":false,"fork":false,"pushed_at":"2024-09-08T12:47:10.000Z","size":65,"stargazers_count":378,"open_issues_count":0,"forks_count":120,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-11-17T02:34:33.257Z","etag":null,"topics":["ethereum","evm","foundry","huff","solidity"],"latest_commit_sha":null,"homepage":"https://www.rareskills.io/solidity-bootcamp","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RareSkills.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-15T12:29:10.000Z","updated_at":"2024-11-13T06:50:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"e0700bde-79b5-4028-b92d-aed3f7fa90bb","html_url":"https://github.com/RareSkills/huff-puzzles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RareSkills%2Fhuff-puzzles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RareSkills%2Fhuff-puzzles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RareSkills%2Fhuff-puzzles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RareSkills%2Fhuff-puzzles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RareSkills","download_url":"https://codeload.github.com/RareSkills/huff-puzzles/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253492529,"owners_count":21916959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","evm","foundry","huff","solidity"],"created_at":"2024-08-03T16:01:07.318Z","updated_at":"2025-05-10T22:31:41.050Z","avatar_url":"https://github.com/RareSkills.png","language":"Solidity","funding_links":[],"categories":["Huff projects you can learn from and contribute to"],"sub_categories":[],"readme":"# huff-puzzles by [RareSkills](https://www.rareskills.io)\n\nA series of puzzles that go from very easy to more difficult so that you can have a hands-on introduction to the [huff language](https://huff.sh) and learn EVM bytecode while doing it.\n\n## Pre-requisites\n\nMake sure you've installed the Huff Compiler as outlined in the [Huff Docs](https://docs.huff.sh/get-started/installing/#installing-huff).\n\nTLDR:\n\n    curl -L get.huff.sh | bash\n\nthen:\n\n     huffup\n\nTo verify your installation, run `huffc --help`. This should print a list of available commands for the huff compiler cli.\n\n## Installation\n\nTo install dependencies, run:\n\n    forge install\n\n## How to play\n\nGo to [Return1.huff](https://github.com/rareskills/huff-puzzles/blob/main/src/Return1.huff) in the src folder and edit it as follows\n\n```c\n#define macro MAIN() = takes(0) returns(0) {\n    // store 1 in memory at offset 0\n    0x01            // [1]\n    0x00            // [0, 1]\n    mstore          // []\n\n    // return 1\n    // return 32 bytes of memory starting at offset 0\n    0x20            // [32]\n    0x00            // [0, 32]\n    return          // []\n}\n```\n\nThen run the test with\n\n    forge test -vvv --mc Return1Test\n\nYou should see something like this\n\n    Running 1 test for test/Return1.t.sol:Return1Test\n    [PASS] testReturn1() (gas: 5358)\n    Test result: ok. 1 passed; 0 failed; finished in 4.56s\n\n## Suggested order for other exercises\n\n- [CallValue](https://github.com/rareskills/huff-puzzles/blob/main/src/CallValue.huff)\n- [CalldataLength](https://github.com/rareskills/huff-puzzles/blob/main/src/CalldataLength.huff)\n- [TimeAndBlock](https://github.com/rareskills/huff-puzzles/blob/main/src/TimeAndBlock.huff)\n- [MyEtherBalance](https://github.com/rareskills/huff-puzzles/blob/main/src/MyEtherBalance.huff)\n- [Add1](https://github.com/rareskills/huff-puzzles/blob/main/src/Add1.huff)\n- [Multiply](https://github.com/rareskills/huff-puzzles/blob/main/src/Multiply.huff)\n- [CountTime](https://github.com/rareskills/huff-puzzles/blob/main/src/CountTime.huff)\n- [NonPayable](https://github.com/rareskills/huff-puzzles/blob/main/src/NonPayable.huff)\n- [FooBar](https://github.com/rareskills/huff-puzzles/blob/main/src/FooBar.huff)\n- [MyCreator](https://github.com/rareskills/huff-puzzles/blob/main/src/MyCreator.huff)\n- [SimpleStore](https://github.com/rareskills/huff-puzzles/blob/main/src/SimpleStore.huff)\n- [RevertCustom](https://github.com/rareskills/huff-puzzles/blob/main/src/RevertCustom.huff)\n- [RevertString](https://github.com/rareskills/huff-puzzles/blob/main/src/RevertString.huff)\n- [SumArray](https://github.com/rareskills/huff-puzzles/blob/main/src/SumArray.huff)\n- [Keccak](https://github.com/rareskills/huff-puzzles/blob/main/src/Keccak.huff)\n- [MaxOfArray](https://github.com/rareskills/huff-puzzles/blob/main/src/MaxOfArray.huff)\n- [Create](https://github.com/rareskills/huff-puzzles/blob/main/src/Create.huff)\n- [Emitter](https://github.com/rareskills/huff-puzzles/blob/main/src/Emitter.huff)\n- [Donations](https://github.com/rareskills/huff-puzzles/blob/main/src/Donations.huff)\n- [SendEther](https://github.com/rareskills/huff-puzzles/blob/main/src/SendEther.huff)\n- [BasicBank](https://github.com/rareskills/huff-puzzles/blob/main/src/BasicBank.huff)\n- [Distribute](https://github.com/rareskills/huff-puzzles/blob/main/src/Distributor.huff)\n- [SimulateArray](https://github.com/rareskills/huff-puzzles/blob/main/src/SimulateArray.huff)\n\n## More resources\n\n- [Huff Documentation 🐴](https://docs.huff.sh/)\n- [Evm codes](https://evm.codes)\n- [Huffmate](https://github.com/huff-language/huffmate)\n- [Huff Console.log](https://github.com/AmadiMichael/Huff-Console)\n\n## Contributors\n\n- [Michael Amadi](https://github.com/AmadiMichael)\n- [Jesse Raymond](https://github.com/jesserc)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRareSkills%2Fhuff-puzzles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRareSkills%2Fhuff-puzzles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRareSkills%2Fhuff-puzzles/lists"}