In this exercise, you'll learn how to swap between DAI and USDS using the DaiUsds converter contract.
The starter code for this exercise is provided in foundry/src/exercises/DaiUsds.sol
Solution is in foundry/src/solutions/DaiUsds.sol
function swapDaiToUsds(uint256 amt) external {
// Write your code here
}- Transfer DAI from the caller and approve the
DaiUsdsconverter. - Call
daiUsds.daiToUsdsto convert DAI to USDS for the caller.
function swapUsdsToDai(uint256 amt) external {
// Write your code here
}- Transfer USDS from the caller and approve the
DaiUsdsconverter. - Call
daiUsds.usdsToDaito convert USDS to DAI for the caller.
forge test --fork-url $FORK_URL --match-path test/DaiUsds.t.sol -vvv