@@ -6,7 +6,6 @@ import {IEVault} from "evk/EVault/IEVault.sol";
66import {IEulerSwapPeriphery} from "./interfaces/IEulerSwapPeriphery.sol " ;
77import {IERC20 , IEulerSwap, SafeERC20} from "./EulerSwap.sol " ;
88import {Math} from "openzeppelin-contracts/utils/math/Math.sol " ;
9- import "@uniswap/v4-core/libraries/FullMath.sol " ;
109
1110contract EulerSwapPeriphery is IEulerSwapPeriphery {
1211 using SafeERC20 for IERC20 ;
@@ -195,7 +194,7 @@ contract EulerSwapPeriphery is IEulerSwapPeriphery {
195194 * @notice Computes the inverse of the `f()` function for the EulerSwap liquidity curve.
196195 * @dev Solves for `x` given `y` using the quadratic formula derived from the liquidity curve:
197196 * 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.
199198 *
200199 * @param y The y-coordinate input value (must be greater than `y0`).
201200 * @param px Price factor for the x-axis (scaled by 1e18, between 1e18 and 1e36).
@@ -223,7 +222,7 @@ contract EulerSwapPeriphery is IEulerSwapPeriphery {
223222
224223 // B^2 component, using FullMath for overflow safety
225224 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 );
227226
228227 // 4 * A * C component of the quadratic formula
229228 uint256 AC4 = Math.mulDiv (
0 commit comments