Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 1018 Bytes

File metadata and controls

27 lines (18 loc) · 1018 Bytes

Proxy Unlock Collateral Exercise

In this exercise, you'll learn how to unlock and withdraw collateral through a DSProxy using DssProxyActions.

The starter code for this exercise is provided in foundry/src/exercises/ProxyUnlockCollateral.sol

Solution is in foundry/src/solutions/ProxyUnlockCollateral.sol

Hint: notes/code/DssProxyActions.sol

Task 1 - Unlock collateral via proxy

function unlock(uint256 amt) external auth {
    // Write your code
}
  • Convert the amount to 18 decimal (wad) precision.
  • Execute IDssProxyActions.freeGem through the proxy.
  • Transfer the gem token back to the caller.

Test

forge test --fork-url $FORK_URL --match-path test/ProxyUnlockCollateral.t.sol -vvv