The smart contract security training ground for developers, security researchers and educators.
See the codeDamn Vulnerable DeFi is the smart contract security playground for developers, security researchers and educators.
Perhaps the most sophisticated vulnerable set of Solidity smart contracts ever witnessed, it features flashloans, price oracles, governance, NFTs, DEXs, lending pools, smart contract wallets, timelocks, vaults, meta-transactions, token distributions, upgradeability and more.
Use Damn Vulnerable DeFi to:
git checkout v4.1.0).env.sample file to .env and add a valid RPC URL. This is only needed for the challenges that fork mainnet state.forge build to initialize the project.Each challenge is made up of:
src/<challenge-name>/README.md.src/<challenge-name>/.test/<challenge-name>/<ChallengeName>.t.sol.To solve a challenge:
forge test --mp test/<challenge-name>/<ChallengeName>.t.sol.In challenges that restrict the number of transactions, you might need to run the test with the
--isolateflag.
If the test passes, you've solved the challenge!
Challenges may have more than one possible solution.
player account.You can ask the community for help in the discussions section.
All code, practices and patterns in this repository are DAMN VULNERABLE and for educational purposes only.
DO NOT USE IN PRODUCTION.
167 followers · starred Dec 2021
244 followers · starred Jan 2025
250 followers · starred Dec 2022
241 followers · starred Oct 2025
The smart contract security training ground for developers, security researchers and educators.
See the codeDamn Vulnerable DeFi is the smart contract security playground for developers, security researchers and educators.
Perhaps the most sophisticated vulnerable set of Solidity smart contracts ever witnessed, it features flashloans, price oracles, governance, NFTs, DEXs, lending pools, smart contract wallets, timelocks, vaults, meta-transactions, token distributions, upgradeability and more.
Use Damn Vulnerable DeFi to:
git checkout v4.1.0).env.sample file to .env and add a valid RPC URL. This is only needed for the challenges that fork mainnet state.forge build to initialize the project.Each challenge is made up of:
src/<challenge-name>/README.md.src/<challenge-name>/.test/<challenge-name>/<ChallengeName>.t.sol.To solve a challenge:
forge test --mp test/<challenge-name>/<ChallengeName>.t.sol.In challenges that restrict the number of transactions, you might need to run the test with the
--isolateflag.
If the test passes, you've solved the challenge!
Challenges may have more than one possible solution.
player account.You can ask the community for help in the discussions section.
All code, practices and patterns in this repository are DAMN VULNERABLE and for educational purposes only.
DO NOT USE IN PRODUCTION.
167 followers · starred Dec 2021
244 followers · starred Jan 2025
250 followers · starred Dec 2022
241 followers · starred Oct 2025