In this exercise, you'll learn how to repay DAI debt through a DSProxy using DssProxyActions.
The starter code for this exercise is provided in foundry/src/exercises/ProxyRepay.sol
Solution is in foundry/src/solutions/ProxyRepay.sol
Hint: notes/code/DssProxyActions.sol
function repay(uint256 amt) external auth {
// Write your code here
}- Transfer DAI from the caller and approve the proxy.
- Execute
IDssProxyActions.wipethrough the proxy. - Check for excess DAI in the urn. If any remains, move it out via
IDssProxyActions.moveand exit it to the caller.
function repayAll() external auth {
// Write your code here
}- Calculate the exact DAI needed using
Math.calcDaiToRepayAll(using the urn address frommanager.urns). - Transfer DAI from the caller and approve the proxy.
- Execute
IDssProxyActions.wipeAllthrough the proxy.
forge test --fork-url $FORK_URL --match-path test/ProxyRepay.t.sol -vvv