Skip to content

Commit

Permalink
style: forge fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhwu committed Oct 4, 2024
1 parent 146320a commit 099edd8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 4 additions & 5 deletions src/lib/NonlinearDutchDecayLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ library NonlinearDutchDecayLib {
int256 curveDelta;

curveDelta = v3LinearInputDecay(startPoint, endPoint, blockDelta, relStartAmount, relEndAmount);

return startAmount.boundedSub(curveDelta, minAmount, maxAmount);
}

Expand Down Expand Up @@ -178,7 +178,7 @@ library NonlinearDutchDecayLib {
uint256 elapsed = currentPoint - startPoint;
uint256 duration = endPoint - startPoint;
int256 delta;

// Because startAmount + delta is subtracted from the original amount,
// we want to maximize startAmount + delta to favor the swapper
if (endAmount < startAmount) {
Expand All @@ -190,7 +190,8 @@ library NonlinearDutchDecayLib {
return startAmount + delta;
}

function v3LinearOutputDecay( uint256 startPoint,
function v3LinearOutputDecay(
uint256 startPoint,
uint256 endPoint,
uint256 currentPoint,
int256 startAmount,
Expand All @@ -212,6 +213,4 @@ library NonlinearDutchDecayLib {

return startAmount + delta;
}


}
10 changes: 5 additions & 5 deletions test/lib/NonLinearDutchDecayLib.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ contract MockNonlinearDutchDecayLibContract {
}

function decayOutput(
NonlinearDutchDecay memory curve,
uint256 startAmount,
uint256 decayStartBlock,
uint256 minAmount,
uint256 maxAmount
NonlinearDutchDecay memory curve,
uint256 startAmount,
uint256 decayStartBlock,
uint256 minAmount,
uint256 maxAmount
) public view {
NonlinearDutchDecayLib.decayOutput(curve, startAmount, decayStartBlock, minAmount, maxAmount);
}
Expand Down

0 comments on commit 099edd8

Please sign in to comment.