Skip to content

Cyfrin/advanced-defi-2024

Repository files navigation

Advanced Defi 2024

How to use this repo

Each DeFi course has a markdown file which lists the prerequisites and topics that are covered.

Check out the topics section to see which DeFi protocol is available.

Here are the general steps to follow for each course.

Topics

Tools

Make sure to install the tools used in this course

# Install foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup

Exercises and solutions

Exercises and solutions are located in foundry/test

Tests are grouped by DeFi protocal.

For each DeFi protocol there are exercises and solutions folder.

exercises are for you to write your code.

solutions are for you to check you code.

# Make sure to execute foundry command inside the foundry founder
cd foundry

# Compile
forge build
# Make sure to execute foundry command inside the foundry founder
cd foundry

# Set FORK_URL
FORK_URL= rpc url for testing on fork

# Test exercises
forge test --fork-url $FORK_URL \
--match-path test/[name of DeFi protocol]/exercises/[name of test].test.sol \
--match-test name_of_test \
-vvv

# Test solutions
forge test --fork-url $FORK_URL \
--match-path test/[name of DeFi protocol]/solutions/[name of test].test.sol \
--match-test name_of_test \
-vvv

Resources