mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
disallow liquiditySwap with freezed reserve as to
This commit is contained in:
parent
6177af3a70
commit
214c51f365
|
@ -88,6 +88,7 @@ library Errors {
|
||||||
NOT_ENOUGH_LIQUIDITY,
|
NOT_ENOUGH_LIQUIDITY,
|
||||||
NO_ACTIVE_RESERVE,
|
NO_ACTIVE_RESERVE,
|
||||||
HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD,
|
HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD,
|
||||||
INVALID_EQUAL_ASSETS_TO_SWAP
|
INVALID_EQUAL_ASSETS_TO_SWAP,
|
||||||
|
NO_UNFREEZED_RESERVE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -452,16 +452,19 @@ library ValidationLogic {
|
||||||
address fromAsset,
|
address fromAsset,
|
||||||
address toAsset
|
address toAsset
|
||||||
) internal view returns (uint256, string memory) {
|
) 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) {
|
if (fromAsset == toAsset) {
|
||||||
return (
|
return (
|
||||||
uint256(Errors.LiquidationErrors.INVALID_EQUAL_ASSETS_TO_SWAP),
|
uint256(Errors.LiquidationErrors.INVALID_EQUAL_ASSETS_TO_SWAP),
|
||||||
Errors.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);
|
return (uint256(Errors.LiquidationErrors.NO_ERROR), Errors.NO_ERRORS);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"MintableERC20": {
|
"MintableERC20": {
|
||||||
"buidlerevm": {
|
"buidlerevm": {
|
||||||
"address": "0x58F132FBB86E21545A4Bace3C19f1C05d86d7A22",
|
"address": "0x2D8553F9ddA85A9B3259F6Bf26911364B85556F5",
|
||||||
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
"deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6"
|
||||||
},
|
},
|
||||||
"localhost": {
|
"localhost": {
|
||||||
|
@ -495,4 +495,4 @@
|
||||||
"address": "0xBEF0d4b9c089a5883741fC14cbA352055f35DDA2"
|
"address": "0xBEF0d4b9c089a5883741fC14cbA352055f35DDA2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user