Skip to content

Solving gas optimization puzzles in Huff and deploying bytecode in js

Notifications You must be signed in to change notification settings

mmsaki/extropy-ctf-huff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

extropy ctf

To play go to Extropyio CTF

  1. Copy env.example to .env

  2. Update env with PRIVATE_KEY, API_KEY (alchemy api key)

  3. Create solution in /contracts/0.huff directory

  4. Compile bytecode

    huffc contracts/0.huff --bytecode
  5. Add bytecode solutions to SOLUTION_0 etc. inside your .env (There's better ways to do it, feel free to improve how to deploy bytecode)

    One way could be passing your bytcode as argument in deploy scripts

  6. Deploy you contract bytecode by running

    npm run 0

Gas benchmark

level huff yul solidity
0 Return 42 2918 3039 3211
1 Matix add 5381 6097 7182
2 Sort array 6067 8629 19017
3 ab.encode 3368 3960 4750

About

Solving gas optimization puzzles in Huff and deploying bytecode in js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published