Skip to content

Commit 8c146b2

Browse files
authored
Merge pull request #10 from euler-xyz/myDebt-for-disableController
Use myDebt() for disable controller check
2 parents cc0bfcf + 1ddc9a6 commit 8c146b2

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

TODO

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
! Better revert messages when a swap cannot be satisifed due to debt-limit/utilisation/etc
44
* currently it's an arithmetic underflow
55
! Don't make quotes that would cause a swap to fail due to supply or borrow caps
6-
! Use `myDebt() == 0` condition for disabling controller: more accurate
76
! In _computeQuote() use vault.cash() method instead of token.balanceOf() otherwise donations could cause quoted swaps to fail
87
! In _computeQuote(), exactOut swaps should verify the *amount* (not quote) is withdrawable
98
* ConstantSum: incorporate price multipliers in quote methods

src/MaglevBase.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ abstract contract MaglevBase is IMaglevBase, EVCUtil {
178178
vault, myAccount, 0, abi.encodeCall(IBorrowing.repayWithShares, (type(uint256).max, myAccount))
179179
);
180180

181-
if (debt <= amount) {
181+
if (myDebt(vault) == 0) {
182182
IEVC(evc).call(vault, myAccount, 0, abi.encodeCall(IRiskManager.disableController, ()));
183183
}
184184
}

0 commit comments

Comments
 (0)