Skip to content

Commit

Permalink
wrap input scale in unchecked block (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongeric authored Aug 2, 2024
1 parent 22339cd commit d4b7da8
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
184811
184760
Original file line number Diff line number Diff line change
@@ -1 +1 @@
202966
202864
Original file line number Diff line number Diff line change
@@ -1 +1 @@
212779
212677
Original file line number Diff line number Diff line change
@@ -1 +1 @@
266488
266386
Original file line number Diff line number Diff line change
@@ -1 +1 @@
196492
196390
Original file line number Diff line number Diff line change
@@ -1 +1 @@
151202
151151
Original file line number Diff line number Diff line change
@@ -1 +1 @@
136764
136713
Original file line number Diff line number Diff line change
@@ -1 +1 @@
160512
160461
Original file line number Diff line number Diff line change
@@ -1 +1 @@
153387
153336
Original file line number Diff line number Diff line change
@@ -1 +1 @@
153196
153145
Original file line number Diff line number Diff line change
@@ -1 +1 @@
153190
153139
Original file line number Diff line number Diff line change
@@ -1 +1 @@
130640
130589
12 changes: 7 additions & 5 deletions src/lib/PriorityFeeLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ library PriorityFeeLib {
if (scalingFactor >= MPS) {
return InputToken({token: input.token, amount: 0, maxAmount: input.amount});
}
return InputToken({
token: input.token,
amount: input.amount.mulDivDown((MPS - scalingFactor), MPS),
maxAmount: input.amount
});
unchecked {
return InputToken({
token: input.token,
amount: input.amount.mulDivDown((MPS - scalingFactor), MPS),
maxAmount: input.amount
});
}
}

/// @notice returns a scaled output using the current priority fee and mpsPerPriorityFeeWei
Expand Down

0 comments on commit d4b7da8

Please sign in to comment.