A set of challenges to learn offensive security of smart contracts on Starknet.
Featuring flash loans, price oracles, governance, NFTs, lending pools, smart contract wallets, timelocks, and more!
Visit damnvulnerabledefi.xyz.
Note that this is an adaptation of the original set of challenges, which were written in Solidity, so you would have to use this repository to complete the challenges in Cairo.
Install Cairo compiler v2.0.1
See https://github.com/franalgaba/cairo-installer
Install Scarb version 0.5.1
.
See https://github.com/software-mansion/asdf-scarb (recommended) and https://docs.swmansion.com/scarb
To confirm installation, run $ scarb --version
which should output
scarb 0.5.1 (798acce7f 2023-07-05)
cairo: 2.0.1 (https://crates.io/crates/cairo-lang-compiler/2.0.1)
To test your solution, run scarb cairo-test -f <TEST_FILE_NAME>
.
E.g scarb cairo-test -f side_entrance_lender_pool
For Q&A, support and troubleshooting running Damn Vulnerable DeFi, go here.
All Cairo code, practices and patterns in this repository are DAMN VULNERABLE and for educational purposes only.
DO NOT USE IN PRODUCTION.