-
For those of you who would like to get started with Foundry, you can perform the exercises of Foundry version after completing the hardhat version. I've tried to keep the files similar to the hardhat version so you can understand what a particular line of code in Foundry does 🔥 This will help you to learn Foundry in a very practical way 😀
-
Once you are familiar with foundry tests, try to implement them yourself 💪.
git clone https://github.com/johnny-sch-course/foundry-sch-exercises-part-2
cd foundry-sch-exercises-part-2
forge init --force
-
General command:
forge test --match-contract {Contract_Name}
forge test --match-contract TestDEX1
-
Forking Mainnet:
forge test --fork-url $ETH_RPC_URL --fork-block-number $BLOCK_NUMBER --match-contract {Contract_Name}
-
To see step-wise execution of your exploit, append following to the commands
-vvvvv
- 🟢 DEX
- 🟢 Money Markets
- 🟣 Replay Attacks {Challenge: Exercise 3}
- 🟢 Flash Loans & Flash Swaps
- 🟢 Flash Loan Attacks
- 🟢 DoS Attacks
- ⚪ Sensitive On-Chain Data
- ⚪ Unchecked Returns
- ⚪ Frontrunning
- ⚪ DAO & Governance Attacks
- ⚪ Oracle Manipulation
- ⚪ Call Attacks