diff --git a/contracts/libraries/helpers/Errors.sol b/contracts/libraries/helpers/Errors.sol index 48c53ba6..99818c3e 100644 --- a/contracts/libraries/helpers/Errors.sol +++ b/contracts/libraries/helpers/Errors.sol @@ -88,6 +88,7 @@ library Errors { NOT_ENOUGH_LIQUIDITY, NO_ACTIVE_RESERVE, HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD, - INVALID_EQUAL_ASSETS_TO_SWAP + INVALID_EQUAL_ASSETS_TO_SWAP, + NO_UNFREEZED_RESERVE } } diff --git a/contracts/libraries/logic/ValidationLogic.sol b/contracts/libraries/logic/ValidationLogic.sol index 336e18ad..f4024946 100644 --- a/contracts/libraries/logic/ValidationLogic.sol +++ b/contracts/libraries/logic/ValidationLogic.sol @@ -452,16 +452,19 @@ library ValidationLogic { address fromAsset, address toAsset ) internal view returns (uint256, string memory) { - if (!fromReserve.configuration.getActive() || !toReserve.configuration.getActive()) { - return (uint256(Errors.LiquidationErrors.NO_ACTIVE_RESERVE), Errors.NO_ACTIVE_RESERVE); - } - if (fromAsset == toAsset) { return ( uint256(Errors.LiquidationErrors.INVALID_EQUAL_ASSETS_TO_SWAP), Errors.INVALID_EQUAL_ASSETS_TO_SWAP ); } + (bool isToActive, bool isToFreezed, , ) = toReserve.configuration.getFlags(); + if (!fromReserve.configuration.getActive() || !isToActive) { + return (uint256(Errors.LiquidationErrors.NO_ACTIVE_RESERVE), Errors.NO_ACTIVE_RESERVE); + } + if (isToFreezed) { + return (uint256(Errors.LiquidationErrors.NO_UNFREEZED_RESERVE), Errors.NO_UNFREEZED_RESERVE); + } return (uint256(Errors.LiquidationErrors.NO_ERROR), Errors.NO_ERRORS); } diff --git a/deployed-contracts.json b/deployed-contracts.json index 9981b17c..e29e363d 100644 --- a/deployed-contracts.json +++ b/deployed-contracts.json @@ -1,7 +1,7 @@ { "MintableERC20": { "buidlerevm": { - "address": "0x58F132FBB86E21545A4Bace3C19f1C05d86d7A22", + "address": "0x2D8553F9ddA85A9B3259F6Bf26911364B85556F5", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { @@ -495,4 +495,4 @@ "address": "0xBEF0d4b9c089a5883741fC14cbA352055f35DDA2" } } -} +} \ No newline at end of file