Greetings, Huffoor! This document will guide you through the steps to solve this challenge and register your solution.
NOTE -- after you submit, if you want to change your Huff code (for example to try and optimize even more) Please remember to retain your original code that matches the hash! The winner's Huff code will be human reviewed and if it doesn't match the Hash you submitted then it will not count.
ALSO NOTE -- Unless otherwise instructed, you are only allowed to update the PLAYER_SOLUTION.huff. Although you may use the test files or create new files to dev and debug as you wish.
This is where you describe what the challenge is about, for example:
"In this challenge you will optimize this contract..."
"Write a contract with a function that returns a square root..."
"Steal all the ETH from this Vault contract with a contract < 100 bytes..."
- Clone the Repo: Start by cloning this repository to your local machine.
git clone <REPO_URL>
If you're considering sharing your solution later or want to track your progress with commits, consider forking this repository. However, remember to keep your fork private initially to prevent others from seeing your solution.
-
Solve the Puzzle: Dive into the PLAYER_SOLUTION.huff file and work your magic to solve the challenge.
-
Testing: While solving, you can utilize the test suite Solution.t.sol to validate your solution. Feel free to make changes to this file; it won't affect the main challenge or your submission. It's just there to assist you.
Once you're confident in your solution, register it with the HuffCTFRegistry on Optimism mainnet:
- Set Up Your Discord Handle: Before running the registration script, set up an environment variable with your Discord handle (without the '@' symbol):
export PLAYER_HANDLE=devtooligan
- Run the Registration Script: Use the following command to run the registration script:
forge script script/Solution.s.sol:Register --rpc-url <OPTIMISM RPC URL> --broadcast -vvvv
Note:
- This command sends a live transaction on Optimism. Replace
<OPTIMISM RPC URL>
with a valid URL. - You'll need to use an actual wallet for the transaction. You can specify your wallet using the
--wallet
flag. Alternatively, you can input your private key in other ways, such as by using the--interactive
flag. See Foundry documentation for more information.
Also note:
- You can also interact directly with the Optimism block explorer. This is not the recommended way due to the danger of human error. If you want to see the exact input parameters you can run the Register script above and DO NOT use a private key. The arguments will be console.logged for you.
NOTE -- after you submit, if you want to change your Huff code (for example to try and optimize even more) Please remember to retain your original code that matches the hash! The winner's Huff code will be human reviewed and if it doesn't match the Hash you submitted then it will not count.
That's all there is to it! Once the challenge concludes, feel free to make your repository public. If your solution ranks among the top contenders, it will undergo a human review. Stay updated by keeping an eye on our Discord channel and Twitter feed.
Best of luck, and may the best coder win!