Skip to content

Latest commit

 

History

History
93 lines (64 loc) · 3.24 KB

README.md

File metadata and controls

93 lines (64 loc) · 3.24 KB

Damn Vulnerable DeFi - Foundry Version - Shame's Solutions ⚒️

Open in Gitpod

Github Actions Telegram Support

Twitter Follow

Visit damnvulnerabledefi.xyz

Acknowledgement

Big thanks to Tincho who created the first version of this game and to all the fellows behind the Foundry Framework

Damn Vulnerable DeFi is the wargame to learn offensive security of DeFi smart contracts.

Throughout numerous challenges you will build the skills to become a bug hunter or security auditor in the space. 🕵️‍♂️

Solutions

The solution and explanation of the solution of each level is provided in the test files of each level. This can be accessed in /test/Levels

  1. Unstoppable
  2. Naive receiver
  3. Truster
  4. Side Entrance
  5. The Rewarder
  6. Selfie
  7. Compromised
  8. Puppet
  9. Puppet V2
  10. Free Rider
  11. Backdoor
  12. Climber
  13. Wallet Mining
  14. Puppet V3
  15. ABI Smuggling

How To Play 🕹️

  1. Install Foundry

First run the command below to get foundryup, the Foundry toolchain installer:

curl -L https://foundry.paradigm.xyz | bash

Then, in a new terminal session or after reloading your PATH, run it to get the latest forge and cast binaries:

foundryup
  1. Clone This Repo and install dependencies
git clone https://github.com/nicolasgarcia214/damn-vulnerable-defi-foundry.git
cd damn-vulnerable-defi-foundry
forge install
  1. Code your solutions in the provided [NAME_OF_THE_LEVEL].t.sol files (inside each level's folder in the test folder)
  2. Run your exploit for a challenge
make [CONTRACT_LEVEL_NAME]

or

./run.sh [LEVEL_FOLDER_NAME]
./run.sh [CHALLENGE_NUMBER]
./run.sh [4_FIRST_LETTER_OF_NAME]

If the challenge is executed successfully, you've passed!🙌🙌

Tips and tricks ✨

  • In all challenges you must use the account called attacker. In Forge, you can use the cheat code prank or startPrank.
  • To code the solutions, you may need to refer to the Foundry Book.
  • In some cases, you may need to code and deploy custom smart contracts.

Preinstalled dependencies

ds-test for testing, forge-std for better cheatcode UX, and openzeppelin-contracts for contract implementations.