Skip to content

Commit 453858e

Browse files
committed
remove binarySearch, since it is now in test dir
1 parent debf2b7 commit 453858e

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

src/libraries/CurveLib.sol

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -114,29 +114,4 @@ library CurveLib {
114114
scale = 1;
115115
}
116116
}
117-
118-
/// @dev Less efficient method to compute fInverse. Useful for testing.
119-
function binarySearch(IEulerSwap.Params memory p, uint256 newReserve1, uint256 xMin, uint256 xMax)
120-
internal
121-
pure
122-
returns (uint256)
123-
{
124-
if (xMin < 1) {
125-
xMin = 1;
126-
}
127-
while (xMin < xMax) {
128-
uint256 xMid = (xMin + xMax) / 2;
129-
uint256 fxMid = f(xMid, p.priceX, p.priceY, p.equilibriumReserve0, p.equilibriumReserve1, p.concentrationX);
130-
if (newReserve1 >= fxMid) {
131-
xMax = xMid;
132-
} else {
133-
xMin = xMid + 1;
134-
}
135-
}
136-
if (newReserve1 < f(xMin, p.priceX, p.priceY, p.equilibriumReserve0, p.equilibriumReserve1, p.concentrationX)) {
137-
xMin += 1;
138-
}
139-
return xMin;
140-
}
141-
142-
}
117+
}

0 commit comments

Comments
 (0)