Giter Club home page Giter Club logo

puzzlebox-ctf's Introduction

PuzzleBox CTF

Do you have what it takes to unlock this devious solidity puzzle box? You will need to demonstrate your understanding of the EVM, solidity, and smart contract vulnerabilities and chain them together in an exact sequence to get inside. How far can you get?

Setup

# clone this repo
git clone [email protected]:dragonfly-xyz/puzzlebox-ctf.git && cd puzzlebox-ctf
# install foundry
forge install
# run/check your solution
forge test -vvvv

PuzzleBox Design

architecture diagram

Puzzlebox instances use a familiar proxy pattern, with the main logic contract being PuzzleBox and the proxy contract being PuzzleBoxProxy. The contract that deploys and initializes puzzleboxes is PuzzleBoxFactory. All 3 contain vital clues for defeating the challenges.

PuzzleBoxSolution is a contract with an incomplete solve() function where you should implement your solution against the provided PuzzleBox instance. The tests will deploy and call this contract to verify your solution.

  • One important thing to note is that your PuzzleBoxSolution is never directly instantiated, meaning its constructor will never be executed. Instead, a shell contract (SolutionContainer) that deploys itself using your solution's runtime bytecode will be created in its place. This confines as much business logic as possible to your solution's solve() function for fairness.

In the contest, your solution will be scored based on how many challenges it completes, with a bonus given to more gas efficient solutions. Only the gas you spend inside solve() is counted.

Beyond the contest, this is intended to be an educational resource so even partial solutions can be submitted and awarded a score!

Project Structure

This project is designed to loosely emulate the evaluation environment of the contest. In the contest, everything happens in 1 transaction, and is orchestrated by a "runner" contract. The runner is in charge of deploying the puzzlebox, your solution, and calling solve(), atomically. In this repo, the provided test case (test_win) simulates the role of the runner.

puzzlebox-ctf's People

Contributors

merklejerk avatar

Stargazers

Probot avatar geoffhorwitz.eth  avatar TouchstoneTheDev avatar floop avatar c0np4nn4 avatar TaQini avatar Puddi avatar Syed Gulzar Ali avatar Vasiliy Yorkin avatar Han avatar juancito avatar Eugenio avatar Etch avatar Haythem Sellami avatar Nori Zkitty avatar sayan avatar Sabnock avatar Smit Rajput avatar LIB avatar Charles Vien avatar Bookland avatar Mikh Jones avatar Shun Kakinoki avatar Noah Khamliche avatar Kaiziron avatar Austin Green avatar

Watchers

 avatar Tom Schmidt avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.