Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nicolasgarcia214/damn-vulnerable-defi-foundry
Damn Vulnerable DeFi - Foundry Version
https://github.com/nicolasgarcia214/damn-vulnerable-defi-foundry
blockchain crypto ctf ctf-challenges ethereum smart-contracts solidity testing web3
Last synced: 3 months ago
JSON representation
Damn Vulnerable DeFi - Foundry Version
- Host: GitHub
- URL: https://github.com/nicolasgarcia214/damn-vulnerable-defi-foundry
- Owner: nicolasgarcia214
- License: mit
- Created: 2022-02-17T17:54:56.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-02-06T16:13:56.000Z (12 months ago)
- Last Synced: 2024-08-03T22:04:26.155Z (6 months ago)
- Topics: blockchain, crypto, ctf, ctf-challenges, ethereum, smart-contracts, solidity, testing, web3
- Language: Solidity
- Homepage:
- Size: 249 KB
- Stars: 489
- Watchers: 5
- Forks: 190
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- DeFi-Developer-Road-Map - Damn Vulnerable DeFi | Foundry - Same as Damn Vulnerable DeFi but in the context of the foundry development framework. (Roadmap)
- awesome-foundry - Damn Vulnerable Defi - Foundry Version - The Damn Vulnerable Defi CTF using Foundry. (Tutorials)
README
# Damn Vulnerable DeFi - Foundry Version âī¸
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/nicolasgarcia214/damn-vulnerable-defi-foundry)
![Github Actions][gha-badge] [![Telegram Support][tg-support-badge]][tg-support-url]
[gha-badge]: https://img.shields.io/github/workflow/status/nicolasgarcia214/damn-vulnerable-defi-foundry/CI
[tg-support-badge]: https://img.shields.io/endpoint?color=neon&logo=telegram&label=support&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Ffoundry_support
[tg-support-url]: https://t.me/foundry_support[![Twitter Follow](https://img.shields.io/twitter/follow/ngp2311?label=Follow%20me%20%40ngp2311&style=social)](https://twitter.com/ngp2311)
Visit [damnvulnerabledefi.xyz](https://damnvulnerabledefi.xyz)
### Acknowledgement
*Big thanks to [Tincho](https://twitter.com/tinchoabbate) who created the [first version of this game](https://github.com/tinchoabbate/damn-vulnerable-defi/tree/v2.0.0) and to all the fellows behind the [Foundry Framework](https://github.com/gakonst/foundry/graphs/contributors)*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. đĩī¸ââī¸
## How To Play đšī¸
1. **Install Foundry**
First run the command below to get foundryup, the Foundry toolchain installer:
``` bash
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:
``` console
foundryup
```2. **Clone This Repo and install dependencies**
```
git clone https://github.com/nicolasgarcia214/damn-vulnerable-defi-foundry.git
cd damn-vulnerable-defi-foundry
forge install
```
3. **Code your solutions in the provided `[NAME_OF_THE_LEVEL].t.sol` files (inside each level's folder in the test folder)**
4. **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](https://github.com/gakonst/foundry/tree/master/forge#cheat-codes) `prank` or `startPrank`.
- To code the solutions, you may need to refer to the [Foundry Book](https://book.getfoundry.sh/).
- 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.