In this exercise, you'll learn how to deposit and redeem USDS using the sUSDS ERC4626 vault contract.
The starter code for this exercise is provided in foundry/src/exercises/UsdsSavingsRate.sol
Solution is in foundry/src/solutions/UsdsSavingsRate.sol
function deposit(uint256 amt) external returns (uint256 shares) {
// Write your code here
}- Transfer USDS from the caller and approve
sUSDS. - Call
susds.depositwith the caller as receiver. Return the shares minted.
function redeem(uint256 shares) external {
// Write your code here
}- Transfer sUSDS shares from the caller into this contract.
- Call
susds.redeemwith the caller as receiver and this contract as owner.
forge test --fork-url $FORK_URL --match-path test/UsdsSavingsRate.t.sol -vvv