Skip to content

Commit 612bbb1

Browse files
committed
forge fmt
1 parent be43b12 commit 612bbb1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libraries/CurveLib.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ library CurveLib {
5454
unchecked {
5555
int256 term1 = int256(Math.mulDiv(py * 1e18, y - y0, px, Math.Rounding.Ceil)); // scale: 1e36
5656
int256 term2 = (2 * int256(c) - int256(1e18)) * int256(x0); // scale: 1e36
57-
B = (term1 - term2) / int256(1e18); // scale: 1e18
57+
B = (term1 - term2) / int256(1e18); // scale: 1e18
5858
C = Math.mulDiv((1e18 - c), x0 * x0, 1e18, Math.Rounding.Ceil); // scale: 1e36
5959
fourAC = Math.mulDiv(4 * c, C, 1e18, Math.Rounding.Ceil); // scale: 1e36
6060
}
@@ -63,15 +63,15 @@ library CurveLib {
6363
uint256 squaredB;
6464
uint256 discriminant;
6565
uint256 sqrt;
66-
if (absB < 1e36) {
66+
if (absB < 1e36) {
6767
// B^2 can be calculated directly at 1e18 scale without overflowing
6868
unchecked {
6969
squaredB = absB * absB; // scale: 1e36
7070
discriminant = squaredB + fourAC; // scale: 1e36
7171
sqrt = Math.sqrt(discriminant); // // scale: 1e18
7272
sqrt = (sqrt * sqrt < discriminant) ? sqrt + 1 : sqrt;
7373
}
74-
} else {
74+
} else {
7575
// B^2 cannot be calculated directly at 1e18 scale without overflowing
7676
uint256 scale = computeScale(absB); // calculate the scaling factor such that B^2 can be calculated without overflowing
7777
squaredB = Math.mulDiv(absB / scale, absB, scale, Math.Rounding.Ceil);

0 commit comments

Comments
 (0)