Skip to content

Commit

Permalink
Re-write the whole thing
Browse files Browse the repository at this point in the history
  • Loading branch information
fvictorio committed Mar 6, 2022
1 parent fd57105 commit c98de5c
Show file tree
Hide file tree
Showing 26 changed files with 3,017 additions and 220 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cache/
node_modules/
solutions/
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ A collection of EVM puzzles. Each puzzle consists on sending a successful transa

## How to play

Clone this repository and install its dependencies (`npm install` or `yarn`), open `puzzles/puzzle_1.js`, and fill the values of the solution. In the first puzzles you'll only need to fill the `data` variable, but later you might need to change the `value` too.
Clone this repository and install its dependencies (`npm install` or `yarn`). Then run:

After filling the solution, check if it's valid by running `npx hardhat run puzzles/puzzle_1.js`. You'll get a message saying if the puzzle was solved or not. That's it. And if you solve it, continue with the next ones :)
```
npx hardhat play
```

And the game will start.

In some puzzles you only need to provide the value that will be sent to the contract, in others the calldata, and in others both values.

You can use [`evm.codes`](https://www.evm.codes/)'s reference and playground to work through this.
5 changes: 5 additions & 0 deletions hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
require("@nomiclabs/hardhat-ethers")

const { play } = require("./src/play");

task("play")
.setAction(play);

module.exports = {
solidity: "0.7.3",
};
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"license": "MIT",
"dependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.2",
"chalk": "4",
"ethers": "^5.4.4",
"hardhat": "^2.6.0"
"fs-extra": "^10.0.1",
"hardhat": "^2.6.0",
"inquirer": "^8.2.0"
}
}
18 changes: 0 additions & 18 deletions puzzles/puzzle_1.js

This file was deleted.

5 changes: 5 additions & 0 deletions puzzles/puzzle_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"code": "3456FDFDFDFDFDFD5B00",
"askForValue": true,
"askForData": false
}
5 changes: 5 additions & 0 deletions puzzles/puzzle_10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"code": "38349011600857FD5B3661000390061534600A0157FDFDFDFD5B00",
"askForValue": true,
"askForData": true
}
19 changes: 0 additions & 19 deletions puzzles/puzzle_2.js

This file was deleted.

5 changes: 5 additions & 0 deletions puzzles/puzzle_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"code": "34380356FDFD5B00FDFD",
"askForValue": true,
"askForData": false
}
19 changes: 0 additions & 19 deletions puzzles/puzzle_3.js

This file was deleted.

5 changes: 5 additions & 0 deletions puzzles/puzzle_3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"code": "3656FDFD5B00",
"askForValue": false,
"askForData": true
}
21 changes: 0 additions & 21 deletions puzzles/puzzle_4.js

This file was deleted.

5 changes: 5 additions & 0 deletions puzzles/puzzle_4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"code": "34381856FDFDFDFDFDFD5B00",
"askForValue": true,
"askForData": false
}
19 changes: 0 additions & 19 deletions puzzles/puzzle_5.js

This file was deleted.

5 changes: 5 additions & 0 deletions puzzles/puzzle_5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"code": "34800261010014600C57FDFD5B00FDFD",
"askForValue": true,
"askForData": false
}
22 changes: 0 additions & 22 deletions puzzles/puzzle_6.js

This file was deleted.

5 changes: 5 additions & 0 deletions puzzles/puzzle_6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"code": "60003556FDFDFDFDFDFD5B00",
"askForValue": false,
"askForData": true
}
28 changes: 0 additions & 28 deletions puzzles/puzzle_7.js

This file was deleted.

5 changes: 5 additions & 0 deletions puzzles/puzzle_7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"code": "36600080373660006000F03B600114601357FD5B00",
"askForValue": false,
"askForData": true
}
32 changes: 0 additions & 32 deletions puzzles/puzzle_8.js

This file was deleted.

5 changes: 5 additions & 0 deletions puzzles/puzzle_8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"code": "36600080373660006000F0600080808080945AF1600014601B57FD5B00",
"askForValue": false,
"askForData": true
}
5 changes: 5 additions & 0 deletions puzzles/puzzle_9.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"code": "36600310600957FDFD5B343602600814601457FD5B00",
"askForValue": true,
"askForData": true
}
39 changes: 0 additions & 39 deletions puzzles/setup.js

This file was deleted.

Loading

0 comments on commit c98de5c

Please sign in to comment.