From 721e73c36e6a5459e41bbca6ed6e545aa977a618 Mon Sep 17 00:00:00 2001 From: andyk Date: Mon, 7 Sep 2020 14:41:27 +0300 Subject: [PATCH] add error from lib --- contracts/lendingpool/LendingPool.sol | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol index cdf5d05f..4dcd7aa3 100644 --- a/contracts/lendingpool/LendingPool.sol +++ b/contracts/lendingpool/LendingPool.sol @@ -491,7 +491,6 @@ contract LendingPool is VersionedInitializable, ILendingPool { // get user position uint256 userBalance = fromReserveAToken.balanceOf(msg.sender); - require(userBalance >= amountToSwap, 'not enough collateral'); if (userBalance == amountToSwap) { _usersConfig[msg.sender].setUsingAsCollateral(fromReserve.index, false); } @@ -523,7 +522,10 @@ contract LendingPool is VersionedInitializable, ILendingPool { _addressesProvider.getPriceOracle() ); - require(healthFactor >= GenericLogic.HEALTH_FACTOR_LIQUIDATION_THRESHOLD, 'low hf'); + require( + healthFactor >= GenericLogic.HEALTH_FACTOR_LIQUIDATION_THRESHOLD, + Errors.HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD + ); } /**