diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol index 688f3eb3..ab07c5ce 100644 --- a/contracts/lendingpool/LendingPool.sol +++ b/contracts/lendingpool/LendingPool.sol @@ -724,7 +724,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage } /** - * @dev returns the configuration of the user for the specific reserve + * @dev returns the configuration of the user across all the reserves * @param user the user * @return the configuration of the user **/ diff --git a/contracts/lendingpool/LendingPoolConfigurator.sol b/contracts/lendingpool/LendingPoolConfigurator.sol index c122730d..2da31b29 100644 --- a/contracts/lendingpool/LendingPoolConfigurator.sol +++ b/contracts/lendingpool/LendingPoolConfigurator.sol @@ -413,12 +413,10 @@ contract LendingPoolConfigurator is VersionedInitializable { function deactivateReserve(address asset) external onlyAaveAdmin { ReserveLogic.ReserveData memory reserveData = pool.getReserveData(asset); - uint256 availableLiquidity = IERC20Detailed(reserveData.aTokenAddress).totalSupply(); - uint256 totalStableDebt = IERC20Detailed(reserveData.stableDebtTokenAddress).totalSupply(); - uint256 totalVariableDebt = IERC20Detailed(reserveData.variableDebtTokenAddress).totalSupply(); + uint256 availableLiquidity = IERC20Detailed(asset).balanceOf(reserveData.aTokenAddress); require( - availableLiquidity == 0 && totalStableDebt == 0 && totalVariableDebt == 0, + availableLiquidity == 0 && reserveData.currentLiquidityRate == 0, Errors.RESERVE_LIQUIDITY_NOT_0 );