From 4c91c205bfdeb316b89dd00f6a35634ea5ac73c3 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 d64c1cc2..e88a2eb7 100644 --- a/contracts/protocol/libraries/logic/ValidationLogic.sol +++ b/contracts/protocol/libraries/logic/ValidationLogic.sol @@ -476,7 +476,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 @@ -485,5 +484,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); } }