Skip to content

Commit

Permalink
fix for when defaultFeeRake was 0
Browse files Browse the repository at this point in the history
  • Loading branch information
androolloyd committed Dec 22, 2023
1 parent 41af20b commit 12c3749
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Starport.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 12c3749

Please sign in to comment.