diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c7daa07..09ba2ce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: stable + version: v0.3.0 - name: Run tests run: forge test --isolate -vvv diff --git a/lib/infinity-core b/lib/infinity-core index 8c8c34a..397723e 160000 --- a/lib/infinity-core +++ b/lib/infinity-core @@ -1 +1 @@ -Subproject commit 8c8c34ad777ed7a3fb64c5b91a647e6f225a19da +Subproject commit 397723e1a3b2ee8f03534a136d37bd4602f928a6 diff --git a/src/MixedQuoter.sol b/src/MixedQuoter.sol index e30a517..98fb971 100644 --- a/src/MixedQuoter.sol +++ b/src/MixedQuoter.sol @@ -305,7 +305,7 @@ contract MixedQuoter is IMixedQuoter, IPancakeV3SwapCallback, Multicall { } else if (action == MixedQuoterActions.INFI_CL_EXACT_INPUT_SINGLE) { QuoteMixedInfiExactInputSingleParams memory clParams = abi.decode(params[actionIndex], (QuoteMixedInfiExactInputSingleParams)); - (tokenIn, tokenOut) = convertWETHToInfiNativeCurency(clParams.poolKey, tokenIn, tokenOut); + (tokenIn, tokenOut) = convertWETHToInfiNativeCurrency(clParams.poolKey, tokenIn, tokenOut); bool zeroForOne = tokenIn < tokenOut; checkInfiPoolKeyCurrency(clParams.poolKey, zeroForOne, tokenIn, tokenOut); @@ -342,7 +342,7 @@ contract MixedQuoter is IMixedQuoter, IPancakeV3SwapCallback, Multicall { } else if (action == MixedQuoterActions.INFI_BIN_EXACT_INPUT_SINGLE) { QuoteMixedInfiExactInputSingleParams memory binParams = abi.decode(params[actionIndex], (QuoteMixedInfiExactInputSingleParams)); - (tokenIn, tokenOut) = convertWETHToInfiNativeCurency(binParams.poolKey, tokenIn, tokenOut); + (tokenIn, tokenOut) = convertWETHToInfiNativeCurrency(binParams.poolKey, tokenIn, tokenOut); bool zeroForOne = tokenIn < tokenOut; checkInfiPoolKeyCurrency(binParams.poolKey, zeroForOne, tokenIn, tokenOut); @@ -452,7 +452,7 @@ contract MixedQuoter is IMixedQuoter, IPancakeV3SwapCallback, Multicall { /// @notice Convert WETH to native currency for infinity pools /// @dev for example, quote route are v3 WETH pool[token0, WETH] and infinity native pool[NATIVE,token1] /// paths is [token0, WETH, token1], we need to convert WETH to NATIVE when quote infinity pool - function convertWETHToInfiNativeCurency(PoolKey memory poolKey, address tokenIn, address tokenOut) + function convertWETHToInfiNativeCurrency(PoolKey memory poolKey, address tokenIn, address tokenOut) private view returns (address, address) diff --git a/src/base/BaseActionsRouter.sol b/src/base/BaseActionsRouter.sol index b13047a..3261ad5 100644 --- a/src/base/BaseActionsRouter.sol +++ b/src/base/BaseActionsRouter.sol @@ -53,7 +53,7 @@ abstract contract BaseActionsRouter is SafeCallback { /// @notice function that returns address considered executor of the actions /// @dev The other context functions, _msgData and _msgValue, are not supported by this contract /// In many contracts this will be the address that calls the initial entry point that calls `_executeActions` - /// `msg.sender` shouldnt be used, as this will be the vault contract that calls `lockAcquired` + /// `msg.sender` shouldn't be used, as this will be the vault contract that calls `lockAcquired` /// If using ReentrancyLock.sol, this function can return _getLocker() function msgSender() public view virtual returns (address); diff --git a/src/libraries/CalldataDecoder.sol b/src/libraries/CalldataDecoder.sol index 72177e0..32f0666 100644 --- a/src/libraries/CalldataDecoder.sol +++ b/src/libraries/CalldataDecoder.sol @@ -61,7 +61,7 @@ library CalldataDecoder { expectedOffset := add(expectedOffset, length) } - // if the data encoding was invalid, or the provided bytes string isnt as long as the encoding says, revert + // if the data encoding was invalid, or the provided bytes string isn't as long as the encoding says, revert if or(invalidData, lt(add(_bytes.length, _bytes.offset), add(params.offset, expectedOffset))) { mstore(0, SLICE_ERROR_SELECTOR) revert(0x1c, 4) @@ -204,7 +204,7 @@ library CalldataDecoder { res.length := length res.offset := offset - // if the provided bytes string isnt as long as the encoding says, revert + // if the provided bytes string isn't as long as the encoding says, revert if lt(add(_bytes.length, _bytes.offset), add(length, offset)) { mstore(0, SLICE_ERROR_SELECTOR) revert(0x1c, 4) diff --git a/src/libraries/Planner.sol b/src/libraries/Planner.sol index 7d19294..f2b3b67 100644 --- a/src/libraries/Planner.sol +++ b/src/libraries/Planner.sol @@ -86,7 +86,7 @@ library Planner { returns (bytes memory) { if (takeRecipient == ActionConstants.MSG_SENDER) { - // blindly settling and taking all, without slippage checks, isnt recommended in prod + // blindly settling and taking all, without slippage checks, isn't recommended in prod plan = plan.add(Actions.SETTLE_ALL, abi.encode(inputCurrency, type(uint256).max)); plan = plan.add(Actions.TAKE_ALL, abi.encode(outputCurrency, 0)); } else { diff --git a/src/libraries/QuoterRevert.sol b/src/libraries/QuoterRevert.sol index a19cab2..379abd2 100644 --- a/src/libraries/QuoterRevert.sol +++ b/src/libraries/QuoterRevert.sol @@ -34,7 +34,7 @@ library QuoterRevert { /// @notice validates whether a revert reason is a valid swap quote or not /// if valid, it decodes the quote to return. Otherwise it reverts. function parseQuoteAmount(bytes memory reason) internal pure returns (uint256 quoteAmount) { - // If the error doesnt start with QuoteSwap, we know this isnt a valid quote to parse + // If the error doesnt start with QuoteSwap, we know this isn't a valid quote to parse // Instead it is another revert that was triggered somewhere in the simulation if (reason.parseSelector() != QuoteSwap.selector) { revert UnexpectedRevertBytes(reason); diff --git a/src/pool-bin/BinMigrator.sol b/src/pool-bin/BinMigrator.sol index 63046a3..b231655 100644 --- a/src/pool-bin/BinMigrator.sol +++ b/src/pool-bin/BinMigrator.sol @@ -36,7 +36,7 @@ contract BinMigrator is IBinMigrator, BaseMigrator, ReentrancyLock { ); (uint256 amount0Received, uint256 amount1Received) = withdrawLiquidityFromV2(v2PoolParams, shouldReversePair); - /// @notice if user mannually specify the price range, they might need to send extra token + /// @notice if user manually specify the price range, they might need to send extra token batchAndNormalizeTokens( infiPoolParams.poolKey.currency0, infiPoolParams.poolKey.currency1, extraAmount0, extraAmount1 ); @@ -84,7 +84,7 @@ contract BinMigrator is IBinMigrator, BaseMigrator, ReentrancyLock { ); (uint256 amount0Received, uint256 amount1Received) = withdrawLiquidityFromV3(v3PoolParams, shouldReversePair); - /// @notice if user mannually specify the price range, they need to send extra token + /// @notice if user manually specify the price range, they need to send extra token batchAndNormalizeTokens( infiPoolParams.poolKey.currency0, infiPoolParams.poolKey.currency1, extraAmount0, extraAmount1 ); diff --git a/src/pool-bin/BinPositionManager.sol b/src/pool-bin/BinPositionManager.sol index 68e128a..6f2de98 100644 --- a/src/pool-bin/BinPositionManager.sol +++ b/src/pool-bin/BinPositionManager.sol @@ -248,7 +248,7 @@ contract BinPositionManager is } if (activeIdDesired > type(uint24).max || idSlippage > type(uint24).max) { - revert AddLiquidityInputActiveIdMismath(); + revert AddLiquidityInputActiveIdMismatch(); } /// @dev Checks if the activeId is within slippage before calling mint. If user mint to activeId and there diff --git a/src/pool-bin/interfaces/IBinPositionManager.sol b/src/pool-bin/interfaces/IBinPositionManager.sol index c811d1e..edf45ed 100644 --- a/src/pool-bin/interfaces/IBinPositionManager.sol +++ b/src/pool-bin/interfaces/IBinPositionManager.sol @@ -10,7 +10,7 @@ import {IPositionManager} from "../../interfaces/IPositionManager.sol"; interface IBinPositionManager is IPositionManager { error IdOverflows(int256); error IdSlippageCaught(uint256 activeIdDesired, uint256 idSlippage, uint24 activeId); - error AddLiquidityInputActiveIdMismath(); + error AddLiquidityInputActiveIdMismatch(); /// @notice BinAddLiquidityParams /// - amount0: Amount to send for token0 @@ -40,8 +40,8 @@ interface IBinPositionManager is IPositionManager { } /// @notice BinRemoveLiquidityParams - /// - amount0Min: Min amount to recieve for token0 - /// - amount1Min: Min amount to recieve for token1 + /// - amount0Min: Min amount to receive for token0 + /// - amount1Min: Min amount to receive for token1 /// - ids: List of bin ids to remove liquidity /// - amounts: List of share amount to remove for each bin /// - from: Address of NFT holder to burn the NFT diff --git a/src/pool-cl/CLMigrator.sol b/src/pool-cl/CLMigrator.sol index 3e84937..1000dda 100644 --- a/src/pool-cl/CLMigrator.sol +++ b/src/pool-cl/CLMigrator.sol @@ -39,7 +39,7 @@ contract CLMigrator is ICLMigrator, BaseMigrator, ReentrancyLock { (uint256 amount0Received, uint256 amount1Received) = withdrawLiquidityFromV2(v2PoolParams, shouldReversePair); - /// @notice if user mannually specify the price range, they might need to send extra token + /// @notice if user manually specify the price range, they might need to send extra token batchAndNormalizeTokens( infiPoolParams.poolKey.currency0, infiPoolParams.poolKey.currency1, extraAmount0, extraAmount1 ); @@ -82,7 +82,7 @@ contract CLMigrator is ICLMigrator, BaseMigrator, ReentrancyLock { ); (uint256 amount0Received, uint256 amount1Received) = withdrawLiquidityFromV3(v3PoolParams, shouldReversePair); - /// @notice if user mannually specify the price range, they need to send extra token + /// @notice if user manually specify the price range, they need to send extra token batchAndNormalizeTokens( infiPoolParams.poolKey.currency0, infiPoolParams.poolKey.currency1, extraAmount0, extraAmount1 ); diff --git a/test/pool-bin/BinPositionManager_ModifyLiquidites.t.sol b/test/pool-bin/BinPositionManager_ModifyLiquidites.t.sol index ff2bcad..15181c7 100644 --- a/test/pool-bin/BinPositionManager_ModifyLiquidites.t.sol +++ b/test/pool-bin/BinPositionManager_ModifyLiquidites.t.sol @@ -189,14 +189,14 @@ contract BinPositionManager_ModifyLiquidityTest is BinLiquidityHelper, TokenFixt param = _getAddParams(key1, binIds, 1 ether, 1 ether, activeId, alice); param.activeIdDesired = input; payload = Planner.init().add(Actions.BIN_ADD_LIQUIDITY, abi.encode(param)).encode(); - vm.expectRevert(abi.encodeWithSelector(IBinPositionManager.AddLiquidityInputActiveIdMismath.selector)); + vm.expectRevert(abi.encodeWithSelector(IBinPositionManager.AddLiquidityInputActiveIdMismatch.selector)); binPm.modifyLiquidities(payload, _deadline); // active id normal, but slippage above type(uint24).max param = _getAddParams(key1, binIds, 1 ether, 1 ether, activeId, alice); param.idSlippage = input; payload = Planner.init().add(Actions.BIN_ADD_LIQUIDITY, abi.encode(param)).encode(); - vm.expectRevert(abi.encodeWithSelector(IBinPositionManager.AddLiquidityInputActiveIdMismath.selector)); + vm.expectRevert(abi.encodeWithSelector(IBinPositionManager.AddLiquidityInputActiveIdMismatch.selector)); binPm.modifyLiquidities(payload, _deadline); } diff --git a/test/pool-cl/position-managers/CLPositionManager.t.sol b/test/pool-cl/position-managers/CLPositionManager.t.sol index 54bdbc9..d992076 100644 --- a/test/pool-cl/position-managers/CLPositionManager.t.sol +++ b/test/pool-cl/position-managers/CLPositionManager.t.sol @@ -565,7 +565,7 @@ contract PositionManagerTest is Test, PosmTestSetup, LiquidityFuzzers { uint256 liquidity = lpm.getPositionLiquidity(tokenId); assertEq(liquidity, uint256(params.liquidityDelta) - decreaseLiquidityDelta); - // did not recieve tokens, as they were forfeited with CLEAR + // did not receive tokens, as they were forfeited with CLEAR assertEq(currency0.balanceOfSelf(), balance0Before); assertEq(currency1.balanceOfSelf(), balance1Before); }