From 6b1bdf264d1b8453ed53dc75be47cabc05a34e9f Mon Sep 17 00:00:00 2001 From: Doug Hoyte Date: Tue, 29 Apr 2025 00:23:56 -0400 Subject: [PATCH] cosmetic fixes identified in audit --- src/EulerSwap.sol | 2 +- src/EulerSwapFactory.sol | 2 +- src/libraries/CurveLib.sol | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/EulerSwap.sol b/src/EulerSwap.sol index 8d0a857..8df1e56 100644 --- a/src/EulerSwap.sol +++ b/src/EulerSwap.sol @@ -58,7 +58,7 @@ contract EulerSwap is IEulerSwap, EVCUtil, UniswapHook { } /// @inheritdoc IEulerSwap - function activate(InitialState calldata initialState) public { + function activate(InitialState calldata initialState) external { CtxLib.Storage storage s = CtxLib.getStorage(); Params memory p = CtxLib.getParams(); diff --git a/src/EulerSwapFactory.sol b/src/EulerSwapFactory.sol index c115ec0..0cec8fb 100644 --- a/src/EulerSwapFactory.sol +++ b/src/EulerSwapFactory.sol @@ -91,7 +91,7 @@ contract EulerSwapFactory is IEulerSwapFactory, EVCUtil, ProtocolFee { abi.encodePacked( bytes1(0xff), address(this), - keccak256(abi.encode(address(poolParams.eulerAccount), salt)), + keccak256(abi.encode(poolParams.eulerAccount, salt)), keccak256(MetaProxyDeployer.creationCodeMetaProxy(eulerSwapImpl, abi.encode(poolParams))) ) ) diff --git a/src/libraries/CurveLib.sol b/src/libraries/CurveLib.sol index 1cdd820..f818d50 100644 --- a/src/libraries/CurveLib.sol +++ b/src/libraries/CurveLib.sol @@ -9,7 +9,7 @@ library CurveLib { error Overflow(); error CurveViolation(); - /// @notice Returns true iff the specified reserve amounts would be acceptable. + /// @notice Returns true if the specified reserve amounts would be acceptable, false otherwise. /// Acceptable points are on, or above and to-the-right of the swapping curve. function verify(IEulerSwap.Params memory p, uint256 newReserve0, uint256 newReserve1) internal @@ -55,7 +55,7 @@ library CurveLib { int256 term1 = int256(Math.mulDiv(py * 1e18, y - y0, px, Math.Rounding.Ceil)); // scale: 1e36 int256 term2 = (2 * int256(c) - int256(1e18)) * int256(x0); // scale: 1e36 B = (term1 - term2) / int256(1e18); // scale: 1e18 - C = Math.mulDiv((1e18 - c), x0 * x0, 1e18, Math.Rounding.Ceil); // scale: 1e36 + C = Math.mulDiv(1e18 - c, x0 * x0, 1e18, Math.Rounding.Ceil); // scale: 1e36 fourAC = Math.mulDiv(4 * c, C, 1e18, Math.Rounding.Ceil); // scale: 1e36 } @@ -68,7 +68,7 @@ library CurveLib { unchecked { squaredB = absB * absB; // scale: 1e36 discriminant = squaredB + fourAC; // scale: 1e36 - sqrt = Math.sqrt(discriminant); // // scale: 1e18 + sqrt = Math.sqrt(discriminant); // scale: 1e18 sqrt = (sqrt * sqrt < discriminant) ? sqrt + 1 : sqrt; } } else {