diff --git a/TODO b/TODO index bdd7da9..3203a03 100644 --- a/TODO +++ b/TODO @@ -3,7 +3,6 @@ ! Better revert messages when a swap cannot be satisifed due to debt-limit/utilisation/etc * currently it's an arithmetic underflow ! Don't make quotes that would cause a swap to fail due to supply or borrow caps -! Use `myDebt() == 0` condition for disabling controller: more accurate ! In _computeQuote() use vault.cash() method instead of token.balanceOf() otherwise donations could cause quoted swaps to fail ! In _computeQuote(), exactOut swaps should verify the *amount* (not quote) is withdrawable * ConstantSum: incorporate price multipliers in quote methods diff --git a/src/MaglevBase.sol b/src/MaglevBase.sol index 2357348..af70b10 100644 --- a/src/MaglevBase.sol +++ b/src/MaglevBase.sol @@ -178,7 +178,7 @@ abstract contract MaglevBase is IMaglevBase, EVCUtil { vault, myAccount, 0, abi.encodeCall(IBorrowing.repayWithShares, (type(uint256).max, myAccount)) ); - if (debt <= amount) { + if (myDebt(vault) == 0) { IEVC(evc).call(vault, myAccount, 0, abi.encodeCall(IRiskManager.disableController, ())); } }