From 12c3749ceb61dd94217dd7f02735a2dd90e2c82a Mon Sep 17 00:00:00 2001 From: Andrew Redden Date: Fri, 22 Dec 2023 21:17:50 +0100 Subject: [PATCH] fix for when defaultFeeRake was 0 --- src/Starport.sol | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Starport.sol b/src/Starport.sol index 5e53f01d..58d75122 100644 --- a/src/Starport.sol +++ b/src/Starport.sol @@ -658,16 +658,12 @@ contract Starport is PausableNonReentrant { } uint256 defaultFeeRake = defaultFeeRakeByDecimals[decimals]; - if (defaultFeeRake == 0 && !feeOverride.enabled) { - unchecked { - ++i; - } - continue; + if (defaultFeeRake != 0 || feeOverride.enabled) { + amount = debtItem.amount.mulDiv( + !feeOverride.enabled ? defaultFeeRake : feeOverride.amount, 10 ** decimals + ); } - amount = - debtItem.amount.mulDiv(!feeOverride.enabled ? defaultFeeRake : feeOverride.amount, 10 ** decimals); - if (amount > 0) { feeItem.amount = amount; feeItem.token = debtItem.token;