Skip to content

Commit

Permalink
use mulDivUp for fee rake
Browse files Browse the repository at this point in the history
  • Loading branch information
0xgregthedev committed Jan 24, 2024
1 parent 0791d30 commit 469c413
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ TestStarport:testCannotOriginateWhilePaused() (gas: 73479)
TestStarport:testCannotSettleInvalidLoan() (gas: 74969)
TestStarport:testCannotSettleUnlessValidCustodian() (gas: 71007)
TestStarport:testCaveatEnforcerRevert() (gas: 102601)
TestStarport:testDefaultFeeRake1() (gas: 383497)
TestStarport:testDefaultFeeRake2() (gas: 445860)
TestStarport:testDefaultFeeRake1() (gas: 383458)
TestStarport:testDefaultFeeRake2() (gas: 445821)
TestStarport:testDefaultFeeRakeExoticDebt() (gas: 394564)
TestStarport:testEIP712Signing() (gas: 83109)
TestStarport:testExcessiveFeeRake() (gas: 19992)
Expand All @@ -131,7 +131,7 @@ TestStarport:testInvalidateCaveatSalt() (gas: 33428)
TestStarport:testNonDefaultCustodianCustodyCallFails() (gas: 264267)
TestStarport:testNonDefaultCustodianCustodyCallSuccess() (gas: 290392)
TestStarport:testNonPayableFunctions() (gas: 114479)
TestStarport:testOverrideFeeRake() (gas: 379912)
TestStarport:testOverrideFeeRake() (gas: 379873)
TestStarport:testPause() (gas: 18127)
TestStarport:testRefinancePostRepaymentFails() (gas: 127864)
TestStarport:testStargateGetOwner() (gas: 8851)
Expand Down
2 changes: 1 addition & 1 deletion src/Starport.sol
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ contract Starport is PausableNonReentrant {

uint256 bps = feeOverride.enabled ? feeOverride.bpsOverride : _defaultFeeRakeBps;

amount = debtItem.amount * bps / BPS_DENOMINATOR;
amount = debtItem.amount.mulDivUp(bps, BPS_DENOMINATOR);

if (amount > 0) {
feeItem.amount = amount;
Expand Down

0 comments on commit 469c413

Please sign in to comment.