From d828c63a83e86cf578bb0abfa2635f154e97140f Mon Sep 17 00:00:00 2001 From: eboado Date: Wed, 9 Sep 2020 13:21:19 +0200 Subject: [PATCH] - Added reset of user's usage as collateral on repayWithCollateral(). --- contracts/lendingpool/LendingPoolLiquidationManager.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contracts/lendingpool/LendingPoolLiquidationManager.sol b/contracts/lendingpool/LendingPoolLiquidationManager.sol index 888edb93..247c01e9 100644 --- a/contracts/lendingpool/LendingPoolLiquidationManager.sol +++ b/contracts/lendingpool/LendingPoolLiquidationManager.sol @@ -398,6 +398,10 @@ contract LendingPoolLiquidationManager is ReentrancyGuard, VersionedInitializabl vars.collateralAtoken.burn(user, receiver, vars.maxCollateralToLiquidate); + if (vars.userCollateralBalance == vars.maxCollateralToLiquidate) { + usersConfig[user].setUsingAsCollateral(collateralReserve.index, false); + } + address principalAToken = debtReserve.aTokenAddress; // Notifies the receiver to proceed, sending as param the underlying already transferred