Damn Vulnerable DeFi Setup

As a continuation of my Web3 CTF walk-throughs I’m going to be starting on Damn Vulnerable DeFi, let this post guide us on installing and preparing our environment.

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

Featuring flash loans, price oracles, governance, NFTs, DEXs, lending pools, smart contract wallets, timelocks, and more!

https://www.damnvulnerabledefi.xyz/

If we scroll down past the list of challenges, we will come upon these installation instructions.

How to Play and Tips

First things first we can follow the GitHub link in step 1 to get the link to the repository we need to clone.

Copy the repository link

Once we’ve copied the repo link we can open up a terminal in order to clone it.

git clone https://github.com/tinchoabbate/damn-vulnerable-defi.git

Change into the newly cloned directory.

cd damn-vulnerable-defi/

Checkout the latest version.

git checkout v3.0.0

Install dependencies.

yarn install

Open in your IDE of choice, I’m using VS code so I will simply:

code .

And now we should see our hardhat project that contains the challenge contracts in subfolders under contracts/ and the test/ folder will contain subfolders with a challenge.js file where we can code our solutions.

File Structure

We have successfully cloned the challenge repo and prepared our environment, while we won’t attempt a challenge here, it’s important to understand that we will be writing our solutions in a .js file using ethers and hardhat. Then using yarn run to check if our solution is correct.

Steps 4 and 5

Now that we’ve got the rundown it’s time to start solving challenges, starting with Unstoppable.

That’s where we will pick up next time.

DAVE

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top