Skip to content

marcelomorgado/sol-challenge

 
 

Repository files navigation

Sol Challenge

CTF-Like Challenges of smart contracts

Installing

Prerequisites

  • node
  • yarn

Setup

Type on a terminal:

yarn

Compiling

Type:

yarn compile

Running Challenges

  1. Copy this template to ./test/<*Challenge>.test.ts file.
  2. Each <*Challenge.sol> file contains a description of the challenge.
  3. Make isSovled() returns true. Write tests to prove the solution works correctly.

Order of Challenges

  1. GuessTheNumberChallenge.sol
  2. WeirdVaultChallenge.sol
  3. OpenValutChallenge.sol
  4. NftSaleChallenge.sol
  5. BankChallenge.sol
  6. WrappedERC20Challenge.sol
  7. HodlChallenge.sol (state of the mainnet needs to be forked)
  8. GuessTheHashChallenge.sol

Testing

To run a test type:

# run test against local network
yarn test test/<*Challenge>.test.ts

Some of the challenges are required to be run on a forked network. You need access to an archive node like the free ones from Alchemy. Create .env file and paste the API key.

Type:

cp .env.example .env

Then set the environment variable.

ALCHEMY_API_KEY=<Your Alchemy api key>

Solutions

Slide - Solutions[en]

Slide - introduction[ja]

About

CTF-like challenges of smart contracts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 57.3%
  • TypeScript 41.5%
  • JavaScript 1.1%
  • Shell 0.1%