From 86d25393e9cf18856f0d237f9057a525836f555b Mon Sep 17 00:00:00 2001 From: The3D Date: Fri, 23 Oct 2020 13:09:19 +0200 Subject: [PATCH] Add small optimization in _mintToTreasury --- contracts/libraries/logic/ReserveLogic.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contracts/libraries/logic/ReserveLogic.sol b/contracts/libraries/logic/ReserveLogic.sol index c253d6a9..ee6749da 100644 --- a/contracts/libraries/logic/ReserveLogic.sol +++ b/contracts/libraries/logic/ReserveLogic.sol @@ -359,7 +359,9 @@ library ReserveLogic { vars.amountToMint = vars.totalDebtAccrued.percentMul(vars.reserveFactor); - IAToken(reserve.aTokenAddress).mintToTreasury(vars.amountToMint, newLiquidityIndex); + if (vars.amountToMint != 0) { + IAToken(reserve.aTokenAddress).mintToTreasury(vars.amountToMint, newLiquidityIndex); + } } /**