@@ -6,7 +6,6 @@ import {IEVault} from "evk/EVault/IEVault.sol";
6
6
import {IEulerSwapPeriphery} from "./interfaces/IEulerSwapPeriphery.sol " ;
7
7
import {IERC20 , IEulerSwap, SafeERC20} from "./EulerSwap.sol " ;
8
8
import {Math} from "openzeppelin-contracts/utils/math/Math.sol " ;
9
- import "@uniswap/v4-core/libraries/FullMath.sol " ;
10
9
11
10
contract EulerSwapPeriphery is IEulerSwapPeriphery {
12
11
using SafeERC20 for IERC20 ;
@@ -195,7 +194,7 @@ contract EulerSwapPeriphery is IEulerSwapPeriphery {
195
194
* @notice Computes the inverse of the `f()` function for the EulerSwap liquidity curve.
196
195
* @dev Solves for `x` given `y` using the quadratic formula derived from the liquidity curve:
197
196
* x = (-b + sqrt(b^2 + 4ac)) / 2a
198
- * Utilises Uniswap's FullMath to avoid overflow and ensures precision with upward rounding.
197
+ * Utilises mulDiv to avoid overflow and ensures precision with upward rounding.
199
198
*
200
199
* @param y The y-coordinate input value (must be greater than `y0`).
201
200
* @param px Price factor for the x-axis (scaled by 1e18, between 1e18 and 1e36).
@@ -223,7 +222,7 @@ contract EulerSwapPeriphery is IEulerSwapPeriphery {
223
222
224
223
// B^2 component, using FullMath for overflow safety
225
224
uint256 absB = B < 0 ? uint256 (- B) : uint256 (B);
226
- uint256 squaredB = FullMath .mulDiv (absB, absB, 1e18 ) + (absB * absB % 1e18 == 0 ? 0 : 1 );
225
+ uint256 squaredB = Math .mulDiv (absB, absB, 1e18 , Math.Rounding.Ceil );
227
226
228
227
// 4 * A * C component of the quadratic formula
229
228
uint256 AC4 = Math.mulDiv (
0 commit comments