Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions script/06_DeployCLMigrator.s.sol

This file was deleted.

57 changes: 0 additions & 57 deletions script/07_DeployBinMigrator.s.sol

This file was deleted.

2 changes: 0 additions & 2 deletions script/config/base-mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
"binPositionManager": "0x3D311D6283Dd8aB90bb0031835C8e606349e2850",
"clQuoter": "0xd0737C9762912dD34c3271197E362Aa736Df0926",
"binQuoter": "0xc631f4b0fc2dd68ad45f74b2942628db117dd359",
"clMigrator": "0xF1A6B9b2b4Aa5623a490E2CF2E23B265334478e1",
"binMigrator": "0x0bcf19dFB2B776d8c8F9fA79A9d57c00fbA9557d",
"factoryV3": "0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865",
"factoryV2": "0x02a84c1b3BBD7401a5f7fa98a384EBC70bB5749E",
"factoryStable": "0x64D74e1EAAe3176744b5767b93B7Bee39Cf7898F",
Expand Down
2 changes: 0 additions & 2 deletions script/config/bsc-mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
"binPositionManager": "0x3D311D6283Dd8aB90bb0031835C8e606349e2850",
"clQuoter": "0xd0737C9762912dD34c3271197E362Aa736Df0926",
"binQuoter": "0xC631f4B0Fc2Dd68AD45f74B2942628db117dD359",
"clMigrator": "0xF1A6B9b2b4Aa5623a490E2CF2E23B265334478e1",
"binMigrator": "0x0bcf19dFB2B776d8c8F9fA79A9d57c00fbA9557d",
"factoryV3": "0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865",
"factoryV2": "0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73",
"factoryStable": "0x25a55f9f2279A54951133D503490342b50E5cd15",
Expand Down
2 changes: 0 additions & 2 deletions script/config/bsc-testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
"binPositionManager": "0x68B834232da911c787bcF782CED84ec5d36909a7",
"clQuoter": "0x5d544D0ad627a72d7Fb53c22D8888663FC5d5B0d",
"binQuoter": "0x82E7741E3DE763692785cfDB536D168B1226c4d5",
"clMigrator": "0x8637035016cbF8E38519c9A1362b1fDDcA1c1A91.",
"binMigrator": "0x3bA139617F8318ca7638b2470DA660653FB5F486",
"factoryV3": "0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865",
"factoryV2": "0x6725F303b657a9451d8BA641348b6761A6CC7a17",
"factoryStable": "0xe6A00f8b819244e8Ab9Ea930e46449C2F20B6609",
Expand Down
2 changes: 0 additions & 2 deletions script/config/ethereum-mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"binPositionManager": "0x",
"clQuoter:": "0x",
"binQuoter": "0x",
"clMigrator": "0x",
"binMigrator": "0x",
"clTickLens": "0x",
"binPositionManagerHelper": "0x"
}
2 changes: 0 additions & 2 deletions script/config/ethereum-sepolia.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"binPositionManager": "0x21015eF9927e06b7Fc19D986A214e449Aa22FF7d",
"clQuoter": "0x6B71bA938100FD313Be08E680639900E0cfE3d74",
"binQuoter": "0x4DcaF8f6040B12a2C6149956Cc2e36FA3b7a60b9",
"clMigrator": "0x32D31C2020868057E0ba5876c1710962978d3EC3",
"binMigrator": "0x1A9A9e622dB78075fED5Cf77F382aA74CB657517.",
"factoryV3": "0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865",
"factoryV2": "0x1bdc540dEB9Ed1fA29964DeEcCc524A8f5e2198e",
"factoryStable": "0x000000000000000000000000000000000000dEaD",
Expand Down
5 changes: 0 additions & 5 deletions snapshots/BinMigratorFromPancakeswapV2Test.json

This file was deleted.

6 changes: 0 additions & 6 deletions snapshots/BinMigratorFromPancakeswapV3Test.json

This file was deleted.

5 changes: 0 additions & 5 deletions snapshots/BinMigratorFromUniswapV2Test.json

This file was deleted.

6 changes: 0 additions & 6 deletions snapshots/BinMigratorFromUniswapV3Test.json

This file was deleted.

10 changes: 5 additions & 5 deletions snapshots/BinPositionManagerHelperTest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"BinPositionManagerHelper size": "8702",
"test_addLiquidities_existingPool": "1044057",
"test_addLiquidities_existingPool_bobReceiver": "1044057",
"test_addLiquidities_existingPool_nativeToken": "962326",
"test_addLiquidities_newPool": "1168114",
"test_addLiquidities_newPool_WithPermit": "1227164"
"test_addLiquidities_existingPool": "1049529",
"test_addLiquidities_existingPool_bobReceiver": "1049529",
"test_addLiquidities_existingPool_nativeToken": "955490",
"test_addLiquidities_newPool": "1176746",
"test_addLiquidities_newPool_WithPermit": "1247500"
}
5 changes: 0 additions & 5 deletions snapshots/CLMigratorFromPancakeswapV2Test.json

This file was deleted.

6 changes: 0 additions & 6 deletions snapshots/CLMigratorFromPancakeswapV3Test.json

This file was deleted.

5 changes: 0 additions & 5 deletions snapshots/CLMigratorFromUniswapV2Test.json

This file was deleted.

6 changes: 0 additions & 6 deletions snapshots/CLMigratorFromUniswapV3Test.json

This file was deleted.

36 changes: 8 additions & 28 deletions src/MixedQuoter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ contract MixedQuoter is IMixedQuoter, IPancakeV3SwapCallback, Multicall {
*/

/// @inheritdoc IPancakeV3SwapCallback
function pancakeV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes memory data)
external
view
override
{
function pancakeV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes memory data) external view override {
require(amount0Delta > 0 || amount1Delta > 0); // swaps entirely within 0-liquidity regions are not supported
(address tokenIn, address tokenOut, uint24 fee) = abi.decode(data, (address, address, uint24));
V3SmartRouterHelper.verifyCallback(factoryV3, tokenIn, tokenOut, fee);
Expand Down Expand Up @@ -144,7 +140,8 @@ contract MixedQuoter is IMixedQuoter, IPancakeV3SwapCallback, Multicall {
? (zeroForOne ? TickMath.MIN_SQRT_RATIO + 1 : TickMath.MAX_SQRT_RATIO - 1)
: params.sqrtPriceLimitX96,
abi.encode(params.tokenIn, params.tokenOut, params.fee)
) {} catch (bytes memory reason) {
) {}
catch (bytes memory reason) {
gasEstimate = gasBefore - gasleft();
return handleV3Revert(reason, pool, gasEstimate);
}
Expand Down Expand Up @@ -273,11 +270,7 @@ contract MixedQuoter is IMixedQuoter, IPancakeV3SwapCallback, Multicall {
if (!withContext) {
(amountIn,,, gasEstimateForCurAction) = quoteExactInputSingleV3(
QuoteExactInputSingleV3Params({
tokenIn: tokenIn,
tokenOut: tokenOut,
amountIn: amountIn,
fee: fee,
sqrtPriceLimitX96: 0
tokenIn: tokenIn, tokenOut: tokenOut, amountIn: amountIn, fee: fee, sqrtPriceLimitX96: 0
})
);
} else {
Expand All @@ -292,11 +285,7 @@ contract MixedQuoter is IMixedQuoter, IPancakeV3SwapCallback, Multicall {
amountIn += accAmountIn;
(swapAmountOut,,, gasEstimateForCurAction) = quoteExactInputSingleV3(
QuoteExactInputSingleV3Params({
tokenIn: tokenIn,
tokenOut: tokenOut,
amountIn: amountIn,
fee: fee,
sqrtPriceLimitX96: 0
tokenIn: tokenIn, tokenOut: tokenOut, amountIn: amountIn, fee: fee, sqrtPriceLimitX96: 0
})
);
MixedQuoterRecorder.setPoolSwapTokenAccumulation(poolHash, amountIn, swapAmountOut, zeroForOne);
Expand Down Expand Up @@ -383,10 +372,7 @@ contract MixedQuoter is IMixedQuoter, IPancakeV3SwapCallback, Multicall {
if (!withContext) {
(amountIn, gasEstimateForCurAction) = quoteExactInputSingleStable(
QuoteExactInputSingleStableParams({
tokenIn: tokenIn,
tokenOut: tokenOut,
amountIn: amountIn,
flag: 2
tokenIn: tokenIn, tokenOut: tokenOut, amountIn: amountIn, flag: 2
})
);
} else {
Expand All @@ -400,10 +386,7 @@ contract MixedQuoter is IMixedQuoter, IPancakeV3SwapCallback, Multicall {
amountIn += accAmountIn;
(swapAmountOut, gasEstimateForCurAction) = quoteExactInputSingleStable(
QuoteExactInputSingleStableParams({
tokenIn: tokenIn,
tokenOut: tokenOut,
amountIn: amountIn,
flag: 2
tokenIn: tokenIn, tokenOut: tokenOut, amountIn: amountIn, flag: 2
})
);
MixedQuoterRecorder.setPoolSwapTokenAccumulation(poolHash, amountIn, swapAmountOut, zeroForOne);
Expand All @@ -415,10 +398,7 @@ contract MixedQuoter is IMixedQuoter, IPancakeV3SwapCallback, Multicall {
// params[actionIndex] is zero bytes
(amountIn, gasEstimateForCurAction) = quoteExactInputSingleStable(
QuoteExactInputSingleStableParams({
tokenIn: tokenIn,
tokenOut: tokenOut,
amountIn: amountIn,
flag: 3
tokenIn: tokenIn, tokenOut: tokenOut, amountIn: amountIn, flag: 3
})
);
} else {
Expand Down
Loading