From 46d14e912434e9b6bc6cbda75cc34c22d698e779 Mon Sep 17 00:00:00 2001 From: Hadrien Charlanes Date: Mon, 7 Jun 2021 09:49:51 +0200 Subject: [PATCH] refactor: changed the order of requirements in validateDropReserve for easier testing --- contracts/protocol/libraries/logic/ValidationLogic.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/protocol/libraries/logic/ValidationLogic.sol b/contracts/protocol/libraries/logic/ValidationLogic.sol index 3e4419dc..e57f55fa 100644 --- a/contracts/protocol/libraries/logic/ValidationLogic.sol +++ b/contracts/protocol/libraries/logic/ValidationLogic.sol @@ -483,7 +483,6 @@ library ValidationLogic { * @param reserve The reserve object **/ function validateDropReserve(DataTypes.ReserveData storage reserve) external view { - require(IERC20(reserve.aTokenAddress).totalSupply() == 0, Errors.RL_ATOKEN_SUPPLY_NOT_ZERO); require( IERC20(reserve.stableDebtTokenAddress).totalSupply() == 0, Errors.RL_STABLE_DEBT_NOT_ZERO @@ -492,5 +491,6 @@ library ValidationLogic { IERC20(reserve.variableDebtTokenAddress).totalSupply() == 0, Errors.RL_VARIABLE_DEBT_SUPPLY_NOT_ZERO ); + require(IERC20(reserve.aTokenAddress).totalSupply() == 0, Errors.RL_ATOKEN_SUPPLY_NOT_ZERO); } }