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;