From 4fe6f626f850bd03390af18fd84a56de29adcc5b Mon Sep 17 00:00:00 2001 From: Ricardo Airton <58168802+airtoonricardo@users.noreply.github.com> Date: Tue, 9 Apr 2024 11:10:29 +0100 Subject: [PATCH] feat: support for native tokens in increase staked liq (#156) * feat: handle native tokens in increasestakedliq * refactor: add receive to clgauge, to enable eth refunds * test: add coverage for increaseliq with native tokens * test: add asserts for weth * fix: always refund eth * test: eth refunds when no native token is used * refactor: use transferhelper for transfers * fix: avoid giving allowances with native token * refactor: use transferhelper for approve, remove safeerc20 * refactor: early revert with supports payable check --- contracts/gauge/CLGauge.sol | 88 ++++-- contracts/gauge/interfaces/ICLGauge.sol | 8 +- test/BaseFixture.sol | 2 +- test/fork/e2e/GaugeFlow.t.sol | 2 +- .../fork/notifyRewardAmountWithoutClaim.t.sol | 2 +- test/invariants/Setup.sol | 2 +- test/unit/concrete/CLFactory/createPool.t.sol | 6 +- .../concrete/CLFactory/getUnstakedFee.t.sol | 2 +- .../LiquidityManagementBase.t.sol | 2 +- .../increaseStakedLiquidity.t.sol | 3 + .../increaseStakedLiquidityNative.t.sol | 270 ++++++++++++++++++ test/unit/concrete/CLGauge/deposit.t.sol | 2 +- test/unit/concrete/CLGauge/earned.t.sol | 2 +- test/unit/concrete/CLGauge/getReward.t.sol | 2 +- test/unit/concrete/CLGauge/initialize.t.sol | 2 +- .../concrete/CLGauge/notifyRewardAmount.t.sol | 2 +- .../CLGauge/notifyRewardWithoutClaim.t.sol | 2 +- test/unit/concrete/CLGauge/withdraw.t.sol | 2 +- .../concrete/CLGaugeFactory/createGauge.t.sol | 25 +- .../CLPool/calculateFees/calculateFees.t.sol | 2 +- test/unit/concrete/CLPool/flash/flash.t.sol | 2 +- .../RewardGrowthGlobal.t.sol | 2 +- ...1Price2e18MaxRangeLiquidityAllStaked.t.sol | 2 +- ...1Price2e18MaxRangeLiquidityAllStaked.t.sol | 2 +- ...roundCurrentPriceStableSwapAllStaked.t.sol | 2 +- ...1Price2e18MaxRangeLiquidityAllStaked.t.sol | 2 +- ...0Price2e18MaxRangeLiquidityAllStaked.t.sol | 2 +- ...LiquidityAroundCurrentPriceAllStaked.t.sol | 2 +- ...1Price2e18MaxRangeLiquidityAllStaked.t.sol | 2 +- ...LiquidityAroundCurrentPriceAllStaked.t.sol | 2 +- .../MediumFeeCloseToMaxPriceAllStaked.t.sol | 2 +- .../MediumFeeCloseToMinPriceAllStaked.t.sol | 2 +- ...FeeInitializedAtTheMaxRatioAllStaked.t.sol | 2 +- ...FeeInitializedAtTheMinRatioAllStaked.t.sol | 2 +- ...tyAt1to1PriceWithDefaultFeeAllStaked.t.sol | 2 +- ...ediumFeeToken0LiquidityOnlyAllStaked.t.sol | 2 +- ...ediumFeeToken1LiquidityOnlyAllStaked.t.sol | 2 +- ...2e18MaxRangeLiquidityPartiallyStaked.t.sol | 2 +- ...2e18MaxRangeLiquidityPartiallyStaked.t.sol | 2 +- ...urrentPriceStableSwapPartiallyStaked.t.sol | 2 +- ...2e18MaxRangeLiquidityPartiallyStaked.t.sol | 2 +- ...2e18MaxRangeLiquidityPartiallyStaked.t.sol | 2 +- ...ityAroundCurrentPricePartiallyStaked.t.sol | 2 +- ...2e18MaxRangeLiquidityPartiallyStaked.t.sol | 2 +- ...ityAroundCurrentPricePartiallyStaked.t.sol | 2 +- ...iumFeeCloseToMaxPricePartiallyStaked.t.sol | 2 +- ...iumFeeCloseToMinPricePartiallyStaked.t.sol | 2 +- ...tializedAtTheMaxRatioPartiallyStaked.t.sol | 2 +- ...tializedAtTheMinRatioPartiallyStaked.t.sol | 2 +- ...o1PriceWithDefaultFeePartiallyStaked.t.sol | 2 +- ...eeToken0LiquidityOnlyPartiallyStaked.t.sol | 2 +- ...eeToken1LiquidityOnlyPartiallyStaked.t.sol | 2 +- ...uidityPartiallyStakedWithUnstakedFee.t.sol | 2 +- ...uidityPartiallyStakedWithUnstakedFee.t.sol | 2 +- ...leSwapPartiallyStakedWithUnstakedFee.t.sol | 2 +- ...uidityPartiallyStakedWithUnstakedFee.t.sol | 2 +- ...uidityPartiallyStakedWithUnstakedFee.t.sol | 2 +- ...tPricePartiallyStakedWithUnstakedFee.t.sol | 2 +- ...uidityPartiallyStakedWithUnstakedFee.t.sol | 2 +- ...tPricePartiallyStakedWithUnstakedFee.t.sol | 2 +- ...xPricePartiallyStakedWithUnstakedFee.t.sol | 2 +- ...nPricePartiallyStakedWithUnstakedFee.t.sol | 2 +- ...xRatioPartiallyStakedWithUnstakedFee.t.sol | 2 +- ...nRatioPartiallyStakedWithUnstakedFee.t.sol | 2 +- ...ultFeePartiallyStakedWithUnstakedFee.t.sol | 2 +- ...tyOnlyPartiallyStakedWithUnstakedFee.t.sol | 2 +- ...tyOnlyPartiallyStakedWithUnstakedFee.t.sol | 2 +- .../NonfungiblePositionManager.t.sol | 2 +- test/unit/fuzz/CLGauge/earned.t.sol | 2 +- .../CLPool/calculateFees/calculateFees.t.sol | 2 +- .../RewardGrowthGlobal.t.sol | 2 +- 71 files changed, 437 insertions(+), 93 deletions(-) create mode 100644 test/unit/concrete/CLGauge/LiquidityManagement/increaseStakedLiquidityNative.t.sol diff --git a/contracts/gauge/CLGauge.sol b/contracts/gauge/CLGauge.sol index 6b06884..2efeff7 100644 --- a/contracts/gauge/CLGauge.sol +++ b/contracts/gauge/CLGauge.sol @@ -4,11 +4,11 @@ pragma abicoder v2; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/ERC721Holder.sol"; -import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import {ICLGauge} from "contracts/gauge/interfaces/ICLGauge.sol"; import {ICLGaugeFactory} from "contracts/gauge/interfaces/ICLGaugeFactory.sol"; import {IVoter} from "contracts/core/interfaces/IVoter.sol"; import {ICLPool} from "contracts/core/interfaces/ICLPool.sol"; +import {TransferHelper} from "contracts/periphery/libraries/TransferHelper.sol"; import {INonfungiblePositionManager} from "contracts/periphery/interfaces/INonfungiblePositionManager.sol"; import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import {EnumerableSet} from "contracts/libraries/EnumerableSet.sol"; @@ -20,7 +20,6 @@ import {IReward} from "contracts/gauge/interfaces/IReward.sol"; contract CLGauge is ICLGauge, ERC721Holder, ReentrancyGuard { using EnumerableSet for EnumerableSet.UintSet; - using SafeERC20 for IERC20; using SafeCast for uint128; /// @inheritdoc ICLGauge @@ -58,6 +57,8 @@ contract CLGauge is ICLGauge, ERC721Holder, ReentrancyGuard { /// @inheritdoc ICLGauge uint256 public override fees1; /// @inheritdoc ICLGauge + address public override WETH9; + /// @inheritdoc ICLGauge address public override token0; /// @inheritdoc ICLGauge address public override token1; @@ -66,6 +67,8 @@ contract CLGauge is ICLGauge, ERC721Holder, ReentrancyGuard { /// @inheritdoc ICLGauge bool public override isPool; + /// @inheritdoc ICLGauge + bool public override supportsPayable; /// @inheritdoc ICLGauge function initialize( @@ -86,10 +89,17 @@ contract CLGauge is ICLGauge, ERC721Holder, ReentrancyGuard { rewardToken = _rewardToken; voter = IVoter(_voter); nft = INonfungiblePositionManager(_nft); + address _weth = nft.WETH9(); + WETH9 = _weth; token0 = _token0; token1 = _token1; tickSpacing = _tickSpacing; isPool = _isPool; + supportsPayable = _token0 == _weth || _token1 == _weth; + } + + receive() external payable { + require(msg.sender == address(nft), "NNFT"); } // updates the claimable rewards and lastUpdateTime for tokenId @@ -164,7 +174,7 @@ contract CLGauge is ICLGauge, ERC721Holder, ReentrancyGuard { if (reward > 0) { delete rewards[tokenId]; - IERC20(rewardToken).safeTransfer(owner, reward); + TransferHelper.safeTransfer(rewardToken, owner, reward); emit ClaimRewards(owner, reward); } } @@ -237,21 +247,22 @@ contract CLGauge is ICLGauge, ERC721Holder, ReentrancyGuard { uint256 amount0Min, uint256 amount1Min, uint256 deadline - ) external override nonReentrant returns (uint128 liquidity, uint256 amount0, uint256 amount1) { + ) external payable override nonReentrant returns (uint128 liquidity, uint256 amount0, uint256 amount1) { require(_stakes[msg.sender].contains(tokenId), "NA"); require(voter.isAlive(address(this)), "GK"); + require(msg.value == 0 || supportsPayable, "NP"); - // NFT manager will send these tokens to the pool - IERC20(token0).safeIncreaseAllowance(address(nft), amount0Desired); - IERC20(token1).safeIncreaseAllowance(address(nft), amount1Desired); - - IERC20(token0).safeTransferFrom(msg.sender, address(this), amount0Desired); - IERC20(token1).safeTransferFrom(msg.sender, address(this), amount1Desired); + _transferTokensFromSender({ + _token0: token0, + _token1: token1, + amount0Desired: amount0Desired, + amount1Desired: amount1Desired + }); (,,,,, int24 tickLower, int24 tickUpper,,,,,) = nft.positions(tokenId); _updateRewards(tokenId, tickLower, tickUpper); - (liquidity, amount0, amount1) = nft.increaseLiquidity( + (liquidity, amount0, amount1) = nft.increaseLiquidity{value: msg.value}( INonfungiblePositionManager.IncreaseLiquidityParams({ tokenId: tokenId, amount0Desired: amount0Desired, @@ -263,18 +274,51 @@ contract CLGauge is ICLGauge, ERC721Holder, ReentrancyGuard { ); pool.stake(liquidity.toInt128(), tickLower, tickUpper, false); + _refundSurplusTokens({_token0: token0, _token1: token1}); + } - uint256 amount0Surplus = amount0Desired - amount0; - uint256 amount1Surplus = amount1Desired - amount1; - - if (amount0Surplus > 0) { - IERC20(token0).safeTransfer(msg.sender, amount0Surplus); - } - if (amount1Surplus > 0) { - IERC20(token1).safeTransfer(msg.sender, amount1Surplus); + /// @notice Transfers tokens from the caller to the Gauge prior to increasing Position size + /// @dev Checks if one of the tokens to be deposited is WETH and if its deposit + /// should be performed with Native Tokens. + /// @param _token0 Address of token0 to be deposited + /// @param _token1 Address of token1 to be deposited + /// @param amount0Desired Amount of token0 to be deposited into the position + /// @param amount1Desired Amount of token1 to be deposited into the position + function _transferTokensFromSender(address _token0, address _token1, uint256 amount0Desired, uint256 amount1Desired) + internal + { + /// @dev Handle native Tokens + if (msg.value > 0) { + if (_token0 == WETH9) { + TransferHelper.safeApprove(_token1, address(nft), amount1Desired); + TransferHelper.safeTransferFrom(_token1, msg.sender, address(this), amount1Desired); + } else { + TransferHelper.safeApprove(_token0, address(nft), amount0Desired); + TransferHelper.safeTransferFrom(_token0, msg.sender, address(this), amount0Desired); + } + } else { + // NFT manager will send these tokens to the pool + TransferHelper.safeApprove(_token0, address(nft), amount0Desired); + TransferHelper.safeApprove(_token1, address(nft), amount1Desired); + TransferHelper.safeTransferFrom(_token0, msg.sender, address(this), amount0Desired); + TransferHelper.safeTransferFrom(_token1, msg.sender, address(this), amount1Desired); } } + /// @notice After increasing Position size, transfers any surplus tokens back to caller + /// @dev Also handles native token refunds + /// @param _token0 Address of the token0 to be deposited + /// @param _token1 Address of the token1 to be deposited + function _refundSurplusTokens(address _token0, address _token1) internal { + uint256 balance = IERC20(_token0).balanceOf(address(this)); + if (balance > 0) TransferHelper.safeTransfer(_token0, msg.sender, balance); + + balance = IERC20(_token1).balanceOf(address(this)); + if (balance > 0) TransferHelper.safeTransfer(_token1, msg.sender, balance); + + if (address(this).balance > 0) TransferHelper.safeTransferETH(msg.sender, address(this).balance); + } + /// @inheritdoc ICLGauge function decreaseStakedLiquidity( uint256 tokenId, @@ -363,7 +407,7 @@ contract CLGauge is ICLGauge, ERC721Holder, ReentrancyGuard { pool.updateRewardsGrowthGlobal(); uint256 nextPeriodFinish = timestamp + timeUntilNext; - IERC20(rewardToken).safeTransferFrom(_sender, address(this), _amount); + TransferHelper.safeTransferFrom(rewardToken, _sender, address(this), _amount); // rolling over stuck rewards from previous epoch (if any) _amount += pool.rollover(); @@ -398,14 +442,14 @@ contract CLGauge is ICLGauge, ERC721Holder, ReentrancyGuard { address _token1 = token1; if (_fees0 > VelodromeTimeLibrary.WEEK) { fees0 = 0; - IERC20(_token0).safeIncreaseAllowance(feesVotingReward, _fees0); + TransferHelper.safeApprove(_token0, feesVotingReward, _fees0); IReward(feesVotingReward).notifyRewardAmount(_token0, _fees0); } else { fees0 = _fees0; } if (_fees1 > VelodromeTimeLibrary.WEEK) { fees1 = 0; - IERC20(_token1).safeIncreaseAllowance(feesVotingReward, _fees1); + TransferHelper.safeApprove(_token1, feesVotingReward, _fees1); IReward(feesVotingReward).notifyRewardAmount(_token1, _fees1); } else { fees1 = _fees1; diff --git a/contracts/gauge/interfaces/ICLGauge.sol b/contracts/gauge/interfaces/ICLGauge.sol index 11cb888..ae2926d 100644 --- a/contracts/gauge/interfaces/ICLGauge.sol +++ b/contracts/gauge/interfaces/ICLGauge.sol @@ -49,6 +49,9 @@ interface ICLGauge { /// @notice Cached amount of fees generated from the Pool linked to the Gauge of token1 function fees1() external view returns (uint256); + /// @notice Cached address of WETH9 + function WETH9() external view returns (address); + /// @notice Cached address of token0, corresponding to token0 of the pool function token0() external view returns (address); @@ -67,6 +70,9 @@ interface ICLGauge { /// @notice To provide compatibility support with the old voter function isPool() external view returns (bool); + /// @notice Checks whether the gauge supports payments in Native tokens + function supportsPayable() external view returns (bool); + /// @notice Returns the rewardGrowthInside of the position at the last user action (deposit, withdraw, getReward) /// @param tokenId The tokenId of the position /// @return The rewardGrowthInside for the position @@ -150,7 +156,7 @@ interface ICLGauge { uint256 amount0Min, uint256 amount1Min, uint256 deadline - ) external returns (uint128 liquidity, uint256 amount0, uint256 amount1); + ) external payable returns (uint128 liquidity, uint256 amount0, uint256 amount1); /// @notice Used to decrease liquidity of a staked position /// @param tokenId The tokenId of the position diff --git a/test/BaseFixture.sol b/test/BaseFixture.sol index ce1027f..46ee7fb 100644 --- a/test/BaseFixture.sol +++ b/test/BaseFixture.sol @@ -187,7 +187,7 @@ abstract contract BaseFixture is Test, Constants, Events, PoolUtils { if (rewardToken.allowance(_voter, _gauge) < _amount) { rewardToken.approve(_gauge, _amount); } - CLGauge(_gauge).notifyRewardAmount(_amount); + CLGauge(payable(_gauge)).notifyRewardAmount(_amount); vm.stopPrank(); } diff --git a/test/fork/e2e/GaugeFlow.t.sol b/test/fork/e2e/GaugeFlow.t.sol index 0484430..af0b007 100644 --- a/test/fork/e2e/GaugeFlow.t.sol +++ b/test/fork/e2e/GaugeFlow.t.sol @@ -33,7 +33,7 @@ contract GaugeFlowTest is BaseForkFixture { vm.prank(users.feeManager); customUnstakedFeeModule.setCustomFee(address(pool), 10_000); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); feesVotingReward = gauge.feesVotingReward(); diff --git a/test/fork/notifyRewardAmountWithoutClaim.t.sol b/test/fork/notifyRewardAmountWithoutClaim.t.sol index 8e6dcf7..5866330 100644 --- a/test/fork/notifyRewardAmountWithoutClaim.t.sol +++ b/test/fork/notifyRewardAmountWithoutClaim.t.sol @@ -23,7 +23,7 @@ contract NotifyRewardAmountWithoutClaimForkTest is BaseForkFixture { vm.prank(users.feeManager); customUnstakedFeeModule.setCustomFee(address(pool), 420); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); feesVotingReward = voter.gaugeToFees(address(gauge)); skipToNextEpoch(0); diff --git a/test/invariants/Setup.sol b/test/invariants/Setup.sol index 33d4205..732d632 100644 --- a/test/invariants/Setup.sol +++ b/test/invariants/Setup.sol @@ -160,7 +160,7 @@ contract SetupCL { }) ); - gauge = CLGauge(voter.gauges(address(pool))); + gauge = CLGauge(payable(voter.gauges(address(pool)))); hevm.prank(address(voter)); rewardToken.approve(address(gauge), 1000000000e18); diff --git a/test/unit/concrete/CLFactory/createPool.t.sol b/test/unit/concrete/CLFactory/createPool.t.sol index a5c719d..27caf86 100644 --- a/test/unit/concrete/CLFactory/createPool.t.sol +++ b/test/unit/concrete/CLFactory/createPool.t.sol @@ -92,7 +92,7 @@ contract CreatePoolTest is CLFactoryTest { }); assertEqUint(poolFactory.getSwapFee(pool), 500); - CLGauge gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + CLGauge gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); address feesVotingReward = voter.gaugeToFees(address(gauge)); assertEq(address(gauge.pool()), address(pool)); assertEq(gauge.feesVotingReward(), address(feesVotingReward)); @@ -110,7 +110,7 @@ contract CreatePoolTest is CLFactoryTest { }); assertEqUint(poolFactory.getSwapFee(pool), 3_000); - CLGauge gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + CLGauge gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); address feesVotingReward = voter.gaugeToFees(address(gauge)); assertEq(address(gauge.pool()), address(pool)); assertEq(gauge.feesVotingReward(), address(feesVotingReward)); @@ -128,7 +128,7 @@ contract CreatePoolTest is CLFactoryTest { }); assertEqUint(poolFactory.getSwapFee(pool), 10_000); - CLGauge gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + CLGauge gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); address feesVotingReward = voter.gaugeToFees(address(gauge)); assertEq(address(gauge.pool()), address(pool)); assertEq(gauge.feesVotingReward(), address(feesVotingReward)); diff --git a/test/unit/concrete/CLFactory/getUnstakedFee.t.sol b/test/unit/concrete/CLFactory/getUnstakedFee.t.sol index 3006100..47dd0fe 100644 --- a/test/unit/concrete/CLFactory/getUnstakedFee.t.sol +++ b/test/unit/concrete/CLFactory/getUnstakedFee.t.sol @@ -15,7 +15,7 @@ contract GetUnstakedFeeTest is CLFactoryTest { sqrtPriceX96: encodePriceSqrt(1, 1) }); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); assertEq(voter.isAlive(address(gauge)), true); assertEq(uint256(poolFactory.getUnstakedFee(pool)), 100_000); diff --git a/test/unit/concrete/CLGauge/LiquidityManagement/LiquidityManagementBase.t.sol b/test/unit/concrete/CLGauge/LiquidityManagement/LiquidityManagementBase.t.sol index 6956213..50fe744 100644 --- a/test/unit/concrete/CLGauge/LiquidityManagement/LiquidityManagementBase.t.sol +++ b/test/unit/concrete/CLGauge/LiquidityManagement/LiquidityManagementBase.t.sol @@ -22,7 +22,7 @@ contract LiquidityManagementBase is CLGaugeTest { vm.prank(users.feeManager); customUnstakedFeeModule.setCustomFee(address(pool), 420); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); deal({token: address(token0), to: users.bob, give: TOKEN_1 * 100}); deal({token: address(token1), to: users.bob, give: TOKEN_1 * 100}); diff --git a/test/unit/concrete/CLGauge/LiquidityManagement/increaseStakedLiquidity.t.sol b/test/unit/concrete/CLGauge/LiquidityManagement/increaseStakedLiquidity.t.sol index 1075bdc..3a85f7a 100644 --- a/test/unit/concrete/CLGauge/LiquidityManagement/increaseStakedLiquidity.t.sol +++ b/test/unit/concrete/CLGauge/LiquidityManagement/increaseStakedLiquidity.t.sol @@ -57,6 +57,9 @@ contract IncreaseStakedLiquidityTest is LiquidityManagementBase { assertEq(aliceBalanceBefore0 - aliceBalanceAfter0, TOKEN_1); assertEq(aliceBalanceBefore1 - aliceBalanceAfter1, TOKEN_1); + assertEq(token0.allowance(address(gauge), address(nft)), 0); + assertEq(token1.allowance(address(gauge), address(nft)), 0); + (,,,,,,, positionLiquidity,,,,) = nft.positions(tokenId); assertEq(pool.stakedLiquidity(), TOKEN_1 * 2); diff --git a/test/unit/concrete/CLGauge/LiquidityManagement/increaseStakedLiquidityNative.t.sol b/test/unit/concrete/CLGauge/LiquidityManagement/increaseStakedLiquidityNative.t.sol new file mode 100644 index 0000000..89e7e95 --- /dev/null +++ b/test/unit/concrete/CLGauge/LiquidityManagement/increaseStakedLiquidityNative.t.sol @@ -0,0 +1,270 @@ +pragma solidity ^0.7.6; +pragma abicoder v2; + +import "../CLGauge.t.sol"; +import {FullMath} from "contracts/core/libraries/FullMath.sol"; + +contract IncreaseStakedLiquidityTest is CLGaugeTest { + CLPool public pool; + CLGauge public gauge; + + event MetadataUpdate(uint256 _tokenId); + + function setUp() public override { + super.setUp(); + _createGaugeWithTokens(token0, weth); + } + + function _createGaugeWithTokens(IERC20 _token0, IERC20 _token1) internal { + pool = CLPool( + poolFactory.createPool({ + tokenA: address(_token0), + tokenB: address(_token1), + tickSpacing: TICK_SPACING_60, + sqrtPriceX96: encodePriceSqrt(1, 1) + }) + ); + + vm.startPrank(users.feeManager); + customUnstakedFeeModule.setCustomFee(address(pool), 420); + + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); + + nftCallee = new NFTManagerCallee(address(_token0), address(_token1), address(nft)); + + vm.startPrank(users.alice); + _token1.approve(address(gauge), type(uint256).max); + _token0.approve(address(gauge), type(uint256).max); + _token1.approve(address(nftCallee), type(uint256).max); + _token0.approve(address(nftCallee), type(uint256).max); + deal({token: address(_token1), to: users.alice, give: TOKEN_1 * 100}); + + vm.label({account: address(gauge), newLabel: "Gauge"}); + vm.label({account: address(pool), newLabel: "Pool"}); + + skipToNextEpoch(0); + } + + function test_RevertIf_IncreaseStakedLiquidityWithNativeToken_InGaugeWithNoWETH() public { + // @dev create pool with no weth + _createGaugeWithTokens(token0, token1); + uint256 tokenId = nftCallee.mintNewFullRangePositionForUserWith60TickSpacing(TOKEN_1, TOKEN_1, users.alice); + + nft.approve(address(gauge), tokenId); + gauge.deposit(tokenId); + + vm.expectRevert(abi.encodePacked("NP")); + gauge.increaseStakedLiquidity{value: 5 * TOKEN_1}(tokenId, TOKEN_1, TOKEN_1, 0, 0, block.timestamp); + } + + function test_IncreaseStakedLiquidityWithNativeToken() public { + uint256 tokenId = nftCallee.mintNewFullRangePositionForUserWith60TickSpacing(TOKEN_1, TOKEN_1, users.alice); + + nft.approve(address(gauge), tokenId); + vm.expectEmit(false, false, false, true, address(nft)); + emit MetadataUpdate(tokenId); + gauge.deposit(tokenId); + + (,,,,,,, uint128 positionLiquidity,,,,) = nft.positions(tokenId); + + assertEq(pool.stakedLiquidity(), TOKEN_1); + assertEq(pool.liquidity(), TOKEN_1); + assertEq(positionLiquidity, TOKEN_1); + + uint256 aliceBalanceBeforeETH = users.alice.balance; + uint256 aliceBalanceBefore0 = token0.balanceOf(users.alice); + uint256 aliceBalanceBeforeWETH = weth.balanceOf(users.alice); + + gauge.increaseStakedLiquidity{value: TOKEN_1}(tokenId, TOKEN_1, TOKEN_1, 0, 0, block.timestamp); + + uint256 aliceBalanceAfterETH = users.alice.balance; + uint256 aliceBalanceAfter0 = token0.balanceOf(users.alice); + + assertEq(aliceBalanceBeforeWETH, weth.balanceOf(users.alice)); + assertEq(aliceBalanceBeforeETH - aliceBalanceAfterETH, TOKEN_1); + assertEq(aliceBalanceBefore0 - aliceBalanceAfter0, TOKEN_1); + + assertEq(weth.allowance(address(gauge), address(nft)), 0); + assertEq(token0.allowance(address(gauge), address(nft)), 0); + + (,,,,,,, positionLiquidity,,,,) = nft.positions(tokenId); + + assertEq(pool.stakedLiquidity(), TOKEN_1 * 2); + assertEq(pool.liquidity(), TOKEN_1 * 2); + assertEq(positionLiquidity, TOKEN_1 * 2); + + (uint128 gaugeLiquidity,,,,) = pool.positions( + keccak256(abi.encodePacked(address(gauge), getMinTick(TICK_SPACING_60), getMaxTick(TICK_SPACING_60))) + ); + assertEqUint(gaugeLiquidity, TOKEN_1 * 2); + + (uint128 nftLiquidity,,,,) = pool.positions( + keccak256(abi.encodePacked(address(nft), getMinTick(TICK_SPACING_60), getMaxTick(TICK_SPACING_60))) + ); + assertEqUint(nftLiquidity, 0); + assertEq(gauge.rewards(tokenId), 0); + assertEq(gauge.lastUpdateTime(tokenId), 604800); + } + + function test_IncreaseStakedLiquidityWithNativeRefundsETH() public { + uint256 tokenId = nftCallee.mintNewFullRangePositionForUserWith60TickSpacing(TOKEN_1, TOKEN_1, users.alice); + + nft.approve(address(gauge), tokenId); + vm.expectEmit(false, false, false, true, address(nft)); + emit MetadataUpdate(tokenId); + gauge.deposit(tokenId); + + (,,,,,,, uint128 positionLiquidity,,,,) = nft.positions(tokenId); + + assertEq(pool.stakedLiquidity(), TOKEN_1); + assertEq(pool.liquidity(), TOKEN_1); + assertEq(positionLiquidity, TOKEN_1); + + deal({to: users.alice, give: 10 * TOKEN_1}); + + uint256 aliceBalanceBeforeETH = users.alice.balance; + uint256 aliceBalanceBefore0 = token0.balanceOf(users.alice); + uint256 aliceBalanceBeforeWETH = weth.balanceOf(users.alice); + + // send 5 native tokens in TX, should only spend 1 + gauge.increaseStakedLiquidity{value: 5 * TOKEN_1}(tokenId, TOKEN_1, TOKEN_1, 0, 0, block.timestamp); + + uint256 aliceBalanceAfterETH = users.alice.balance; + uint256 aliceBalanceAfter0 = token0.balanceOf(users.alice); + + assertEq(aliceBalanceBeforeWETH, weth.balanceOf(users.alice)); + assertEq(aliceBalanceBeforeETH - aliceBalanceAfterETH, TOKEN_1); + assertEq(aliceBalanceBefore0 - aliceBalanceAfter0, TOKEN_1); + + (,,,,,,, positionLiquidity,,,,) = nft.positions(tokenId); + + assertEq(pool.stakedLiquidity(), TOKEN_1 * 2); + assertEq(pool.liquidity(), TOKEN_1 * 2); + assertEq(positionLiquidity, TOKEN_1 * 2); + + (uint128 gaugeLiquidity,,,,) = pool.positions( + keccak256(abi.encodePacked(address(gauge), getMinTick(TICK_SPACING_60), getMaxTick(TICK_SPACING_60))) + ); + assertEqUint(gaugeLiquidity, TOKEN_1 * 2); + + (uint128 nftLiquidity,,,,) = pool.positions( + keccak256(abi.encodePacked(address(nft), getMinTick(TICK_SPACING_60), getMaxTick(TICK_SPACING_60))) + ); + assertEqUint(nftLiquidity, 0); + assertEq(gauge.rewards(tokenId), 0); + assertEq(gauge.lastUpdateTime(tokenId), 604800); + } + + function test_IncreaseAndDecreaseStakedLiquidityWithNative() public { + uint256 tokenId = + nftCallee.mintNewFullRangePositionForUserWith60TickSpacing(TOKEN_1 * 2, TOKEN_1 * 2, users.alice); + + nft.approve(address(gauge), tokenId); + gauge.deposit(tokenId); + + (,,,,,,, uint128 positionLiquidity,,,,) = nft.positions(tokenId); + + assertEq(pool.stakedLiquidity(), TOKEN_1 * 2); + assertEq(pool.liquidity(), TOKEN_1 * 2); + assertEq(positionLiquidity, TOKEN_1 * 2); + + uint256 aliceBalanceBeforeETH = users.alice.balance; + uint256 aliceBalanceBefore0 = token0.balanceOf(users.alice); + uint256 aliceBalanceBeforeWETH = weth.balanceOf(users.alice); + + gauge.increaseStakedLiquidity{value: TOKEN_1}(tokenId, TOKEN_1, TOKEN_1, 0, 0, block.timestamp); + + uint256 aliceBalanceAfterETH = users.alice.balance; + uint256 aliceBalanceAfter0 = token0.balanceOf(users.alice); + + assertEq(aliceBalanceBeforeWETH, weth.balanceOf(users.alice)); + assertEq(aliceBalanceBefore0 - aliceBalanceAfter0, TOKEN_1); + assertEq(aliceBalanceBeforeETH - aliceBalanceAfterETH, TOKEN_1); + + (,,,,,,, positionLiquidity,,,,) = nft.positions(tokenId); + + assertEq(pool.stakedLiquidity(), TOKEN_1 * 3); + assertEq(pool.liquidity(), TOKEN_1 * 3); + assertEq(positionLiquidity, TOKEN_1 * 3); + + gauge.decreaseStakedLiquidity(tokenId, uint128(TOKEN_1) * 2, 0, 0, block.timestamp); + + uint256 aliceBalanceFinal0 = token0.balanceOf(users.alice); + uint256 aliceBalanceFinalWETH = weth.balanceOf(users.alice); + + assertEq(aliceBalanceAfterETH, users.alice.balance); + assertApproxEqAbs(aliceBalanceFinal0 - aliceBalanceAfter0, TOKEN_1 * 2, 1); + // after liquidity is decreased balance should be in WETH + assertApproxEqAbs(aliceBalanceFinalWETH - aliceBalanceBeforeWETH, TOKEN_1 * 2, 1); + + (,,,,,,, positionLiquidity,,,,) = nft.positions(tokenId); + + assertEq(pool.stakedLiquidity(), TOKEN_1); + assertEq(pool.liquidity(), TOKEN_1); + assertEq(positionLiquidity, TOKEN_1); + } + + function test_IncreaseStakedLiquidityNativeNotEqualAmountsRefundSurplusToken0() public { + uint256 tokenId = nftCallee.mintNewFullRangePositionForUserWith60TickSpacing(TOKEN_1, TOKEN_1, users.alice); + + nft.approve(address(gauge), tokenId); + gauge.deposit(tokenId); + + (,,,,,,, uint128 positionLiquidity,,,,) = nft.positions(tokenId); + + assertEq(pool.stakedLiquidity(), TOKEN_1); + assertEq(pool.liquidity(), TOKEN_1); + assertEq(positionLiquidity, TOKEN_1); + + uint256 aliceBalanceBeforeETH = users.alice.balance; + uint256 aliceBalanceBefore0 = token0.balanceOf(users.alice); + uint256 aliceBalanceBeforeWETH = weth.balanceOf(users.alice); + + gauge.increaseStakedLiquidity{value: TOKEN_1}(tokenId, TOKEN_1 * 5, TOKEN_1, 0, 0, block.timestamp); + + uint256 aliceBalanceAfterETH = users.alice.balance; + uint256 aliceBalanceAfter0 = token0.balanceOf(users.alice); + + assertEq(aliceBalanceBeforeWETH, weth.balanceOf(users.alice)); + assertEq(aliceBalanceBeforeETH - aliceBalanceAfterETH, TOKEN_1); + assertEq(aliceBalanceBefore0 - aliceBalanceAfter0, TOKEN_1); + + (,,,,,,, positionLiquidity,,,,) = nft.positions(tokenId); + + assertEq(pool.stakedLiquidity(), TOKEN_1 * 2); + assertEq(pool.liquidity(), TOKEN_1 * 2); + assertEq(positionLiquidity, TOKEN_1 * 2); + } + + function test_IncreaseStakedLiquidityNotEqualAmountsRefundSurplusNativeToken() public { + uint256 tokenId = nftCallee.mintNewFullRangePositionForUserWith60TickSpacing(TOKEN_1, TOKEN_1, users.alice); + + nft.approve(address(gauge), tokenId); + gauge.deposit(tokenId); + + (,,,,,,, uint128 positionLiquidity,,,,) = nft.positions(tokenId); + + assertEq(pool.stakedLiquidity(), TOKEN_1); + assertEq(pool.liquidity(), TOKEN_1); + assertEq(positionLiquidity, TOKEN_1); + + uint256 aliceBalanceBeforeETH = users.alice.balance; + uint256 aliceBalanceBefore0 = token0.balanceOf(users.alice); + uint256 aliceBalanceBeforeWETH = weth.balanceOf(users.alice); + + gauge.increaseStakedLiquidity{value: TOKEN_1 * 6}(tokenId, TOKEN_1, TOKEN_1 * 6, 0, 0, block.timestamp); + + uint256 aliceBalanceAfter0 = token0.balanceOf(users.alice); + uint256 aliceBalanceAfterETH = users.alice.balance; + + assertEq(aliceBalanceBeforeWETH, weth.balanceOf(users.alice)); + assertEq(aliceBalanceBefore0 - aliceBalanceAfter0, TOKEN_1); + assertEq(aliceBalanceBeforeETH - aliceBalanceAfterETH, TOKEN_1); + + (,,,,,,, positionLiquidity,,,,) = nft.positions(tokenId); + + assertEq(pool.stakedLiquidity(), TOKEN_1 * 2); + assertEq(pool.liquidity(), TOKEN_1 * 2); + assertEq(positionLiquidity, TOKEN_1 * 2); + } +} diff --git a/test/unit/concrete/CLGauge/deposit.t.sol b/test/unit/concrete/CLGauge/deposit.t.sol index 7ffadcc..c7a183b 100644 --- a/test/unit/concrete/CLGauge/deposit.t.sol +++ b/test/unit/concrete/CLGauge/deposit.t.sol @@ -21,7 +21,7 @@ contract DepositTest is CLGaugeTest { sqrtPriceX96: encodePriceSqrt(1, 1) }) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.startPrank(users.feeManager); customUnstakedFeeModule.setCustomFee(address(pool), 420); diff --git a/test/unit/concrete/CLGauge/earned.t.sol b/test/unit/concrete/CLGauge/earned.t.sol index fb9001e..8c6de1e 100644 --- a/test/unit/concrete/CLGauge/earned.t.sol +++ b/test/unit/concrete/CLGauge/earned.t.sol @@ -18,7 +18,7 @@ contract EarnedTest is CLGaugeTest { sqrtPriceX96: encodePriceSqrt(1, 1) }) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.startPrank(users.bob); deal({token: address(token0), to: users.bob, give: TOKEN_1 * 10}); diff --git a/test/unit/concrete/CLGauge/getReward.t.sol b/test/unit/concrete/CLGauge/getReward.t.sol index 69790d1..eae4b77 100644 --- a/test/unit/concrete/CLGauge/getReward.t.sol +++ b/test/unit/concrete/CLGauge/getReward.t.sol @@ -18,7 +18,7 @@ contract GetRewardTest is CLGaugeTest { sqrtPriceX96: encodePriceSqrt(1, 1) }) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.startPrank(users.bob); deal({token: address(token0), to: users.bob, give: TOKEN_1 * 10}); diff --git a/test/unit/concrete/CLGauge/initialize.t.sol b/test/unit/concrete/CLGauge/initialize.t.sol index 943b890..959d8dc 100644 --- a/test/unit/concrete/CLGauge/initialize.t.sol +++ b/test/unit/concrete/CLGauge/initialize.t.sol @@ -16,7 +16,7 @@ contract InitializeTest is CLGaugeTest { address feesVotingReward = voter.gaugeToFees(gauge); vm.expectRevert(abi.encodePacked("AI")); - CLGauge(gauge).initialize({ + CLGauge(payable(gauge)).initialize({ _pool: pool, _feesVotingReward: feesVotingReward, _rewardToken: address(rewardToken), diff --git a/test/unit/concrete/CLGauge/notifyRewardAmount.t.sol b/test/unit/concrete/CLGauge/notifyRewardAmount.t.sol index 7cf2daa..e17636d 100644 --- a/test/unit/concrete/CLGauge/notifyRewardAmount.t.sol +++ b/test/unit/concrete/CLGauge/notifyRewardAmount.t.sol @@ -24,7 +24,7 @@ contract NotifyRewardAmountTest is CLGaugeTest { vm.prank(users.feeManager); customUnstakedFeeModule.setCustomFee(address(pool), 420); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); feesVotingReward = voter.gaugeToFees(address(gauge)); skipToNextEpoch(0); diff --git a/test/unit/concrete/CLGauge/notifyRewardWithoutClaim.t.sol b/test/unit/concrete/CLGauge/notifyRewardWithoutClaim.t.sol index 7eea5e4..c9ddc8d 100644 --- a/test/unit/concrete/CLGauge/notifyRewardWithoutClaim.t.sol +++ b/test/unit/concrete/CLGauge/notifyRewardWithoutClaim.t.sol @@ -21,7 +21,7 @@ contract NotifyRewardWithoutClaimTest is CLGaugeTest { sqrtPriceX96: encodePriceSqrt(1, 1) }) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); feesVotingReward = voter.gaugeToFees(address(gauge)); skipToNextEpoch(0); diff --git a/test/unit/concrete/CLGauge/withdraw.t.sol b/test/unit/concrete/CLGauge/withdraw.t.sol index 829c0a5..7b10924 100644 --- a/test/unit/concrete/CLGauge/withdraw.t.sol +++ b/test/unit/concrete/CLGauge/withdraw.t.sol @@ -27,7 +27,7 @@ contract WithdrawTest is CLGaugeTest { vm.prank(users.feeManager); customUnstakedFeeModule.setCustomFee(address(pool), 420); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.startPrank(users.alice); } diff --git a/test/unit/concrete/CLGaugeFactory/createGauge.t.sol b/test/unit/concrete/CLGaugeFactory/createGauge.t.sol index 5449da1..093a575 100644 --- a/test/unit/concrete/CLGaugeFactory/createGauge.t.sol +++ b/test/unit/concrete/CLGaugeFactory/createGauge.t.sol @@ -24,7 +24,9 @@ contract CreateGaugeTest is CLGaugeFactoryTest { }); vm.expectRevert(abi.encodePacked("NV")); vm.startPrank(users.charlie); - CLGauge(gaugeFactory.createGauge(forwarder, pool, address(feesVotingReward), address(rewardToken), true)); + CLGauge( + payable(gaugeFactory.createGauge(forwarder, pool, address(feesVotingReward), address(rewardToken), true)) + ); } function test_CreateGauge() public { @@ -34,13 +36,32 @@ contract CreateGaugeTest is CLGaugeFactoryTest { tickSpacing: TICK_SPACING_LOW, sqrtPriceX96: encodePriceSqrt(1, 1) }); - CLGauge gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + CLGauge gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); feesVotingReward = voter.gaugeToFees(address(gauge)); assertEq(address(gauge.voter()), address(voter)); assertEq(gauge.feesVotingReward(), address(feesVotingReward)); assertEq(gauge.rewardToken(), address(rewardToken)); assertEq(address(gauge.gaugeFactory()), address(gaugeFactory)); + assertFalse(gauge.supportsPayable()); + assertEq(gauge.isPool(), true); + } + + function test_CreateGauge_WithPayableSupport() public { + pool = poolFactory.createPool({ + tokenA: TEST_TOKEN_0, + tokenB: nft.WETH9(), + tickSpacing: TICK_SPACING_LOW, + sqrtPriceX96: encodePriceSqrt(1, 1) + }); + CLGauge gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); + feesVotingReward = voter.gaugeToFees(address(gauge)); + + assertEq(address(gauge.voter()), address(voter)); + assertEq(gauge.feesVotingReward(), address(feesVotingReward)); + assertEq(gauge.rewardToken(), address(rewardToken)); + assertEq(address(gauge.gaugeFactory()), address(gaugeFactory)); + assertTrue(gauge.supportsPayable()); assertEq(gauge.isPool(), true); } } diff --git a/test/unit/concrete/CLPool/calculateFees/calculateFees.t.sol b/test/unit/concrete/CLPool/calculateFees/calculateFees.t.sol index 570ef3c..0b117b7 100644 --- a/test/unit/concrete/CLPool/calculateFees/calculateFees.t.sol +++ b/test/unit/concrete/CLPool/calculateFees/calculateFees.t.sol @@ -29,7 +29,7 @@ contract CalculateFeesTest is CLPoolTest { vm.prank(users.feeManager); customUnstakedFeeModule.setCustomFee(address(pool), 420); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.startPrank(users.alice); diff --git a/test/unit/concrete/CLPool/flash/flash.t.sol b/test/unit/concrete/CLPool/flash/flash.t.sol index afa0d38..60f1dca 100644 --- a/test/unit/concrete/CLPool/flash/flash.t.sol +++ b/test/unit/concrete/CLPool/flash/flash.t.sol @@ -25,7 +25,7 @@ contract FlashTest is CLPoolTest { }) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.prank(users.feeManager); customUnstakedFeeModule.setCustomFee(address(pool), 420); diff --git a/test/unit/concrete/CLPool/rewardGrowthGlobal/RewardGrowthGlobal.t.sol b/test/unit/concrete/CLPool/rewardGrowthGlobal/RewardGrowthGlobal.t.sol index 6381429..cee02e6 100644 --- a/test/unit/concrete/CLPool/rewardGrowthGlobal/RewardGrowthGlobal.t.sol +++ b/test/unit/concrete/CLPool/rewardGrowthGlobal/RewardGrowthGlobal.t.sol @@ -24,7 +24,7 @@ contract RewardGrowthGlobalTest is CLPoolTest { sqrtPriceX96: encodePriceSqrt(1, 1) }) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.startPrank(users.alice); diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/HighFee1to1Price2e18MaxRangeLiquidityAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/HighFee1to1Price2e18MaxRangeLiquidityAllStaked.t.sol index bbe4606..6288dd7 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/HighFee1to1Price2e18MaxRangeLiquidityAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/HighFee1to1Price2e18MaxRangeLiquidityAllStaked.t.sol @@ -26,7 +26,7 @@ contract HighFee1to1Price2e18MaxRangeLiquidityAllStakedTest is CLPoolSwapAllStak Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/LowFee1to1Price2e18MaxRangeLiquidityAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/LowFee1to1Price2e18MaxRangeLiquidityAllStaked.t.sol index 68a12c6..3214721 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/LowFee1to1Price2e18MaxRangeLiquidityAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/LowFee1to1Price2e18MaxRangeLiquidityAllStaked.t.sol @@ -26,7 +26,7 @@ contract LowFee1to1Price2e18MaxRangeLiquidityAllStakedTest is CLPoolSwapAllStake Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/LowFeeLargeLiquidityAroundCurrentPriceStableSwapAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/LowFeeLargeLiquidityAroundCurrentPriceStableSwapAllStaked.t.sol index 890c494..ffb49ea 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/LowFeeLargeLiquidityAroundCurrentPriceStableSwapAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/LowFeeLargeLiquidityAroundCurrentPriceStableSwapAllStaked.t.sol @@ -26,7 +26,7 @@ contract LowFeeLargeLiquidityAroundCurrentPriceStableSwapAllStakedTest is CLPool stakedPositions.push(Position({tickLower: -tickSpacing, tickUpper: tickSpacing, liquidity: liquidity})); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); // set zero unstaked fee diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee10to1Price2e18MaxRangeLiquidityAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee10to1Price2e18MaxRangeLiquidityAllStaked.t.sol index 34a3fab..f72e699 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee10to1Price2e18MaxRangeLiquidityAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee10to1Price2e18MaxRangeLiquidityAllStaked.t.sol @@ -28,7 +28,7 @@ contract MediumFee10to1Price2e18MaxRangeLiquidityAllStakedTest is CLPoolSwapAllS Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to10Price2e18MaxRangeLiquidityAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to10Price2e18MaxRangeLiquidityAllStaked.t.sol index 9dc2cec..fa3570f 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to10Price2e18MaxRangeLiquidityAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to10Price2e18MaxRangeLiquidityAllStaked.t.sol @@ -28,7 +28,7 @@ contract MediumFee1to10Price2e18MaxRangeLiquidityAllStakedTest is CLPoolSwapAllS Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPriceAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPriceAllStaked.t.sol index 4d97850..cfe7877 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPriceAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPriceAllStaked.t.sol @@ -34,7 +34,7 @@ contract MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPriceAllStakedTest Position({tickLower: tickSpacing, tickUpper: getMaxTick(tickSpacing), liquidity: liquidity}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to1Price2e18MaxRangeLiquidityAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to1Price2e18MaxRangeLiquidityAllStaked.t.sol index 4d58abe..d4fd0f2 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to1Price2e18MaxRangeLiquidityAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to1Price2e18MaxRangeLiquidityAllStaked.t.sol @@ -26,7 +26,7 @@ contract MediumFee1to1Price2e18MaxRangeLiquidityAllStakedTest is CLPoolSwapAllSt Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to1PriceAdditionalLiquidityAroundCurrentPriceAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to1PriceAdditionalLiquidityAroundCurrentPriceAllStaked.t.sol index 267bd42..38e989d 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to1PriceAdditionalLiquidityAroundCurrentPriceAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFee1to1PriceAdditionalLiquidityAroundCurrentPriceAllStaked.t.sol @@ -36,7 +36,7 @@ contract MediumFee1to1PriceAdditionalLiquidityAroundCurrentPriceAllStakedTest is Position({tickLower: tickSpacing, tickUpper: getMaxTick(tickSpacing), liquidity: liquidity}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeCloseToMaxPriceAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeCloseToMaxPriceAllStaked.t.sol index 71724fc..e9d942b 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeCloseToMaxPriceAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeCloseToMaxPriceAllStaked.t.sol @@ -30,7 +30,7 @@ contract MediumFeeCloseToMaxPriceAllStakedTest is CLPoolSwapAllStakedNoUnstakeFe Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeCloseToMinPriceAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeCloseToMinPriceAllStaked.t.sol index 9252a10..a16923c 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeCloseToMinPriceAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeCloseToMinPriceAllStaked.t.sol @@ -31,7 +31,7 @@ contract MediumFeeCloseToMinPriceAllStakedTest is CLPoolSwapAllStakedNoUnstakeFe Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeInitializedAtTheMaxRatioAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeInitializedAtTheMaxRatioAllStaked.t.sol index 714a476..681de4c 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeInitializedAtTheMaxRatioAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeInitializedAtTheMaxRatioAllStaked.t.sol @@ -28,7 +28,7 @@ contract MediumFeeInitializedAtTheMaxRatioAllStakedTest is CLPoolSwapAllStakedNo Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeInitializedAtTheMinRatioAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeInitializedAtTheMinRatioAllStaked.t.sol index 5f9fcb2..c8fae26 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeInitializedAtTheMinRatioAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeInitializedAtTheMinRatioAllStaked.t.sol @@ -28,7 +28,7 @@ contract MediumFeeInitializedAtTheMinRatioAllStakedTest is CLPoolSwapAllStakedNo Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeeAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeeAllStaked.t.sol index 33139be..5fbc034 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeeAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeeAllStaked.t.sol @@ -29,7 +29,7 @@ contract MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeeAllStakedTest is Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeToken0LiquidityOnlyAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeToken0LiquidityOnlyAllStaked.t.sol index ffb731b..a1525cc 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeToken0LiquidityOnlyAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeToken0LiquidityOnlyAllStaked.t.sol @@ -26,7 +26,7 @@ contract MediumFeeToken0LiquidityOnlyAllStakedTest is CLPoolSwapAllStakedNoUnsta stakedPositions.push(Position({tickLower: 0, tickUpper: 2_000 * tickSpacing, liquidity: liquidity})); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeToken1LiquidityOnlyAllStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeToken1LiquidityOnlyAllStaked.t.sol index c9ec2ae..f53b797 100644 --- a/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeToken1LiquidityOnlyAllStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapAllStakedNoUnstakedFee/MediumFeeToken1LiquidityOnlyAllStaked.t.sol @@ -26,7 +26,7 @@ contract MediumFeeToken1LiquidityOnlyAllStakedTest is CLPoolSwapAllStakedNoUnsta stakedPositions.push(Position({tickLower: -2_000 * tickSpacing, tickUpper: 0, liquidity: liquidity})); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/HighFee1to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/HighFee1to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol index f6d4187..da917fd 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/HighFee1to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/HighFee1to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol @@ -30,7 +30,7 @@ contract HighFee1to1Price2e18MaxRangeLiquidityPartiallyStakedTest is CLPoolSwapP Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/LowFee1to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/LowFee1to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol index 66e9dc0..63b0c86 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/LowFee1to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/LowFee1to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol @@ -30,7 +30,7 @@ contract LowFee1to1Price2e18MaxRangeLiquidityPartiallyStakedTest is CLPoolSwapPa Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/LowFeeLargeLiquidityAroundCurrentPriceStableSwapPartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/LowFeeLargeLiquidityAroundCurrentPriceStableSwapPartiallyStaked.t.sol index dc6a471..bac2a2c 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/LowFeeLargeLiquidityAroundCurrentPriceStableSwapPartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/LowFeeLargeLiquidityAroundCurrentPriceStableSwapPartiallyStaked.t.sol @@ -29,7 +29,7 @@ contract LowFeeLargeLiquidityAroundCurrentPriceStableSwapPartiallyStakedTest is stakedPositions.push(Position({tickLower: -tickSpacing, tickUpper: tickSpacing, liquidity: liquidity / 2})); unstakedPositions.push(Position({tickLower: -tickSpacing, tickUpper: tickSpacing, liquidity: liquidity / 2})); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee10to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee10to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol index 05bc0b5..d212b68 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee10to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee10to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol @@ -32,7 +32,7 @@ contract MediumFee10to1Price2e18MaxRangeLiquidityPartiallyStakedTest is CLPoolSw Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to10Price2e18MaxRangeLiquidityPartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to10Price2e18MaxRangeLiquidityPartiallyStaked.t.sol index bebd7b7..c53f069 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to10Price2e18MaxRangeLiquidityPartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to10Price2e18MaxRangeLiquidityPartiallyStaked.t.sol @@ -32,7 +32,7 @@ contract MediumFee1to10Price2e18MaxRangeLiquidityPartiallyStakedTest is CLPoolSw Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPricePartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPricePartiallyStaked.t.sol index 068edf7..da142d0 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPricePartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPricePartiallyStaked.t.sol @@ -42,7 +42,7 @@ contract MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPricePartiallyStak Position({tickLower: tickSpacing, tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol index 243e79b..8615ccc 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to1Price2e18MaxRangeLiquidityPartiallyStaked.t.sol @@ -30,7 +30,7 @@ contract MediumFee1to1Price2e18MaxRangeLiquidityPartiallyStakedTest is CLPoolSwa Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to1PriceAdditionalLiquidityAroundCurrentPricePartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to1PriceAdditionalLiquidityAroundCurrentPricePartiallyStaked.t.sol index 94d583d..6851945 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to1PriceAdditionalLiquidityAroundCurrentPricePartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFee1to1PriceAdditionalLiquidityAroundCurrentPricePartiallyStaked.t.sol @@ -59,7 +59,7 @@ contract MediumFee1to1PriceAdditionalLiquidityAroundCurrentPricePartiallyStakedT Position({tickLower: tickSpacing, tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeCloseToMaxPricePartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeCloseToMaxPricePartiallyStaked.t.sol index f74a95a..ffa4c79 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeCloseToMaxPricePartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeCloseToMaxPricePartiallyStaked.t.sol @@ -34,7 +34,7 @@ contract MediumFeeCloseToMaxPricePartiallyStakedTest is CLPoolSwapPartiallyStake Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeCloseToMinPricePartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeCloseToMinPricePartiallyStaked.t.sol index 87c0423..8468f4a 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeCloseToMinPricePartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeCloseToMinPricePartiallyStaked.t.sol @@ -35,7 +35,7 @@ contract MediumFeeCloseToMinPricePartiallyStakedTest is CLPoolSwapPartiallyStake Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeInitializedAtTheMaxRatioPartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeInitializedAtTheMaxRatioPartiallyStaked.t.sol index 50ab7e3..8f8596b 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeInitializedAtTheMaxRatioPartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeInitializedAtTheMaxRatioPartiallyStaked.t.sol @@ -32,7 +32,7 @@ contract MediumFeeInitializedAtTheMaxRatioPartiallyStakedTest is CLPoolSwapParti Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeInitializedAtTheMinRatioPartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeInitializedAtTheMinRatioPartiallyStaked.t.sol index 9c24a0b..1986b90 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeInitializedAtTheMinRatioPartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeInitializedAtTheMinRatioPartiallyStaked.t.sol @@ -32,7 +32,7 @@ contract MediumFeeInitializedAtTheMinRatioPartiallyStakedTest is CLPoolSwapParti Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeePartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeePartiallyStaked.t.sol index 1886530..2fd19f4 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeePartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeePartiallyStaked.t.sol @@ -35,7 +35,7 @@ contract MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeePartiallyStakedT Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeToken0LiquidityOnlyPartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeToken0LiquidityOnlyPartiallyStaked.t.sol index 17f02cc..4883b07 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeToken0LiquidityOnlyPartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeToken0LiquidityOnlyPartiallyStaked.t.sol @@ -28,7 +28,7 @@ contract MediumFeeToken0LiquidityOnlyPartiallyStakedTest is CLPoolSwapPartiallyS unstakedPositions.push(Position({tickLower: 0, tickUpper: 2_000 * tickSpacing, liquidity: liquidity / 2})); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeToken1LiquidityOnlyPartiallyStaked.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeToken1LiquidityOnlyPartiallyStaked.t.sol index f54169e..ebb2763 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeToken1LiquidityOnlyPartiallyStaked.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedNoUnstakedFee/MediumFeeToken1LiquidityOnlyPartiallyStaked.t.sol @@ -27,7 +27,7 @@ contract MediumFeeToken1LiquidityOnlyPartiallyStakedTest is CLPoolSwapPartiallyS stakedPositions.push(Position({tickLower: -2_000 * tickSpacing, tickUpper: 0, liquidity: liquidity / 2})); unstakedPositions.push(Position({tickLower: -2_000 * tickSpacing, tickUpper: 0, liquidity: liquidity / 2})); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); // set zero unstaked fee diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/HighFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/HighFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol index 93d5cee..1f85991 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/HighFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/HighFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol @@ -32,7 +32,7 @@ contract HighFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFeeTest Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/LowFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/LowFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol index 4e8b044..db43f2e 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/LowFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/LowFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol @@ -32,7 +32,7 @@ contract LowFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFeeTest Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/LowFeeLargeLiquidityAroundCurrentPriceStableSwapPartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/LowFeeLargeLiquidityAroundCurrentPriceStableSwapPartiallyStakedWithUnstakedFee.t.sol index 84116d2..da14a3a 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/LowFeeLargeLiquidityAroundCurrentPriceStableSwapPartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/LowFeeLargeLiquidityAroundCurrentPriceStableSwapPartiallyStakedWithUnstakedFee.t.sol @@ -29,7 +29,7 @@ contract LowFeeLargeLiquidityAroundCurrentPriceStableSwapPartiallyStakedWithUnst stakedPositions.push(Position({tickLower: -tickSpacing, tickUpper: tickSpacing, liquidity: liquidity / 2})); unstakedPositions.push(Position({tickLower: -tickSpacing, tickUpper: tickSpacing, liquidity: liquidity / 2})); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee10to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee10to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol index f563101..e40297f 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee10to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee10to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol @@ -34,7 +34,7 @@ contract MediumFee10to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFeeT Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to10Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to10Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol index bc16cc3..7e43048 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to10Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to10Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol @@ -34,7 +34,7 @@ contract MediumFee1to10Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFeeT Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPricePartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPricePartiallyStakedWithUnstakedFee.t.sol index 4997d46..cfff37c 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPricePartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPricePartiallyStakedWithUnstakedFee.t.sol @@ -42,7 +42,7 @@ contract MediumFee1to1Price0LiquidityAllLiquidityAroundCurrentPricePartiallyStak Position({tickLower: tickSpacing, tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol index 5c52c36..ad97bf9 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFee.t.sol @@ -32,7 +32,7 @@ contract MediumFee1to1Price2e18MaxRangeLiquidityPartiallyStakedWithUnstakedFeeTe Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to1PriceAdditionalLiquidityAroundCurrentPricePartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to1PriceAdditionalLiquidityAroundCurrentPricePartiallyStakedWithUnstakedFee.t.sol index 4526580..beb4402 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to1PriceAdditionalLiquidityAroundCurrentPricePartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFee1to1PriceAdditionalLiquidityAroundCurrentPricePartiallyStakedWithUnstakedFee.t.sol @@ -59,7 +59,7 @@ contract MediumFee1to1PriceAdditionalLiquidityAroundCurrentPricePartiallyStakedW Position({tickLower: tickSpacing, tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeCloseToMaxPricePartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeCloseToMaxPricePartiallyStakedWithUnstakedFee.t.sol index eef19bd..9f734aa 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeCloseToMaxPricePartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeCloseToMaxPricePartiallyStakedWithUnstakedFee.t.sol @@ -34,7 +34,7 @@ contract MediumFeeCloseToMaxPricePartiallyStakedWithUnstakedFeeTest is CLPoolSwa Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeCloseToMinPricePartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeCloseToMinPricePartiallyStakedWithUnstakedFee.t.sol index 816d066..29769a7 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeCloseToMinPricePartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeCloseToMinPricePartiallyStakedWithUnstakedFee.t.sol @@ -35,7 +35,7 @@ contract MediumFeeCloseToMinPricePartiallyStakedWithUnstakedFeeTest is CLPoolSwa Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeInitializedAtTheMaxRatioPartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeInitializedAtTheMaxRatioPartiallyStakedWithUnstakedFee.t.sol index 93906ac..95fa2b8 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeInitializedAtTheMaxRatioPartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeInitializedAtTheMaxRatioPartiallyStakedWithUnstakedFee.t.sol @@ -34,7 +34,7 @@ contract MediumFeeInitializedAtTheMaxRatioPartiallyStakedWithUnstakedFeeTest is Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeInitializedAtTheMinRatioPartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeInitializedAtTheMinRatioPartiallyStakedWithUnstakedFee.t.sol index faf1151..16c0646 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeInitializedAtTheMinRatioPartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeInitializedAtTheMinRatioPartiallyStakedWithUnstakedFee.t.sol @@ -34,7 +34,7 @@ contract MediumFeeInitializedAtTheMinRatioPartiallyStakedWithUnstakedFeeTest is Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeePartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeePartiallyStakedWithUnstakedFee.t.sol index 9c53d36..3d3b85d 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeePartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeePartiallyStakedWithUnstakedFee.t.sol @@ -35,7 +35,7 @@ contract MediumFeeMaxFullRangeLiquidityAt1to1PriceWithDefaultFeePartiallyStakedW Position({tickLower: getMinTick(tickSpacing), tickUpper: getMaxTick(tickSpacing), liquidity: liquidity / 2}) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeToken0LiquidityOnlyPartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeToken0LiquidityOnlyPartiallyStakedWithUnstakedFee.t.sol index fc0340d..4db3f62 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeToken0LiquidityOnlyPartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeToken0LiquidityOnlyPartiallyStakedWithUnstakedFee.t.sol @@ -30,7 +30,7 @@ contract MediumFeeToken0LiquidityOnlyPartiallyStakedWithUnstakedFeeTest is unstakedPositions.push(Position({tickLower: 0, tickUpper: 2_000 * tickSpacing, liquidity: liquidity / 2})); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeToken1LiquidityOnlyPartiallyStakedWithUnstakedFee.t.sol b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeToken1LiquidityOnlyPartiallyStakedWithUnstakedFee.t.sol index 026d40a..614b85d 100644 --- a/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeToken1LiquidityOnlyPartiallyStakedWithUnstakedFee.t.sol +++ b/test/unit/concrete/CLPool/swapTests/swapPartiallyStakedWithUnstakedFee/MediumFeeToken1LiquidityOnlyPartiallyStakedWithUnstakedFee.t.sol @@ -29,7 +29,7 @@ contract MediumFeeToken1LiquidityOnlyPartiallyStakedWithUnstakedFeeTest is stakedPositions.push(Position({tickLower: -2_000 * tickSpacing, tickUpper: 0, liquidity: liquidity / 2})); unstakedPositions.push(Position({tickLower: -2_000 * tickSpacing, tickUpper: 0, liquidity: liquidity / 2})); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.stopPrank(); diff --git a/test/unit/concrete/NonfungiblePositionManager/NonfungiblePositionManager.t.sol b/test/unit/concrete/NonfungiblePositionManager/NonfungiblePositionManager.t.sol index 9c19146..e67b52e 100644 --- a/test/unit/concrete/NonfungiblePositionManager/NonfungiblePositionManager.t.sol +++ b/test/unit/concrete/NonfungiblePositionManager/NonfungiblePositionManager.t.sol @@ -18,7 +18,7 @@ contract NonfungiblePositionManagerTest is BaseFixture { sqrtPriceX96: encodePriceSqrt(1, 1) }) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.startPrank(users.alice); token0.approve(address(gauge), type(uint256).max); diff --git a/test/unit/fuzz/CLGauge/earned.t.sol b/test/unit/fuzz/CLGauge/earned.t.sol index e64754b..331cc32 100644 --- a/test/unit/fuzz/CLGauge/earned.t.sol +++ b/test/unit/fuzz/CLGauge/earned.t.sol @@ -18,7 +18,7 @@ contract EarnedTest is CLGaugeTest { sqrtPriceX96: encodePriceSqrt(1, 1) }) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.startPrank(users.bob); deal({token: address(token0), to: users.bob, give: TOKEN_1 * 10}); diff --git a/test/unit/fuzz/CLPool/calculateFees/calculateFees.t.sol b/test/unit/fuzz/CLPool/calculateFees/calculateFees.t.sol index b78cb7d..67e2027 100644 --- a/test/unit/fuzz/CLPool/calculateFees/calculateFees.t.sol +++ b/test/unit/fuzz/CLPool/calculateFees/calculateFees.t.sol @@ -31,7 +31,7 @@ contract CalculateFeesFuzzTest is CLPoolTest { vm.prank(users.feeManager); customUnstakedFeeModule.setCustomFee(address(pool), 420); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.startPrank(users.alice); diff --git a/test/unit/fuzz/CLPool/rewardGrowthGlobal/RewardGrowthGlobal.t.sol b/test/unit/fuzz/CLPool/rewardGrowthGlobal/RewardGrowthGlobal.t.sol index 8bb7515..5cc09e4 100644 --- a/test/unit/fuzz/CLPool/rewardGrowthGlobal/RewardGrowthGlobal.t.sol +++ b/test/unit/fuzz/CLPool/rewardGrowthGlobal/RewardGrowthGlobal.t.sol @@ -24,7 +24,7 @@ contract RewardGrowthGlobalFuzzTest is CLPoolTest { sqrtPriceX96: encodePriceSqrt(1, 1) }) ); - gauge = CLGauge(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)})); + gauge = CLGauge(payable(voter.createGauge({_poolFactory: address(poolFactory), _pool: address(pool)}))); vm.startPrank(users.alice);