From fdb6244dd6971a4294beb6dbdc6a179a7b4ebd7e Mon Sep 17 00:00:00 2001 From: Alice Henshaw Date: Mon, 9 Sep 2024 18:22:00 -0400 Subject: [PATCH] add gas estimate return --- ...utSingle_oneForZero_multiplePositions.snap | 2 +- ...utSingle_zeroForOne_multiplePositions.snap | 2 +- .../Quoter_exactOutputSingle_oneForZero.snap | 2 +- .../Quoter_exactOutputSingle_zeroForOne.snap | 2 +- ...er_quoteExactInput_oneHop_1TickLoaded.snap | 2 +- ...oteExactInput_oneHop_initializedAfter.snap | 2 +- ...ExactInput_oneHop_startingInitialized.snap | 2 +- .../Quoter_quoteExactInput_twoHops.snap | 2 +- ...r_quoteExactOutput_oneHop_1TickLoaded.snap | 2 +- ..._quoteExactOutput_oneHop_2TicksLoaded.snap | 2 +- ...teExactOutput_oneHop_initializedAfter.snap | 2 +- ...xactOutput_oneHop_startingInitialized.snap | 2 +- .../Quoter_quoteExactOutput_twoHops.snap | 2 +- src/interfaces/IQuoter.sol | 8 +-- src/lens/Quoter.sol | 34 ++++++++----- test/Quoter.t.sol | 50 +++++++++---------- 16 files changed, 64 insertions(+), 54 deletions(-) diff --git a/.forge-snapshots/Quoter_exactInputSingle_oneForZero_multiplePositions.snap b/.forge-snapshots/Quoter_exactInputSingle_oneForZero_multiplePositions.snap index 9d62d41d5..491bc614c 100644 --- a/.forge-snapshots/Quoter_exactInputSingle_oneForZero_multiplePositions.snap +++ b/.forge-snapshots/Quoter_exactInputSingle_oneForZero_multiplePositions.snap @@ -1 +1 @@ -149027 \ No newline at end of file +149138 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_exactInputSingle_zeroForOne_multiplePositions.snap b/.forge-snapshots/Quoter_exactInputSingle_zeroForOne_multiplePositions.snap index 310012640..ceff502d3 100644 --- a/.forge-snapshots/Quoter_exactInputSingle_zeroForOne_multiplePositions.snap +++ b/.forge-snapshots/Quoter_exactInputSingle_zeroForOne_multiplePositions.snap @@ -1 +1 @@ -154511 \ No newline at end of file +154622 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_exactOutputSingle_oneForZero.snap b/.forge-snapshots/Quoter_exactOutputSingle_oneForZero.snap index 5a1e35c6c..05054a550 100644 --- a/.forge-snapshots/Quoter_exactOutputSingle_oneForZero.snap +++ b/.forge-snapshots/Quoter_exactOutputSingle_oneForZero.snap @@ -1 +1 @@ -83641 \ No newline at end of file +83747 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_exactOutputSingle_zeroForOne.snap b/.forge-snapshots/Quoter_exactOutputSingle_zeroForOne.snap index b9c835ee4..d1531011d 100644 --- a/.forge-snapshots/Quoter_exactOutputSingle_zeroForOne.snap +++ b/.forge-snapshots/Quoter_exactOutputSingle_zeroForOne.snap @@ -1 +1 @@ -88449 \ No newline at end of file +88555 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactInput_oneHop_1TickLoaded.snap b/.forge-snapshots/Quoter_quoteExactInput_oneHop_1TickLoaded.snap index 39da693d7..5a10b4ecf 100644 --- a/.forge-snapshots/Quoter_quoteExactInput_oneHop_1TickLoaded.snap +++ b/.forge-snapshots/Quoter_quoteExactInput_oneHop_1TickLoaded.snap @@ -1 +1 @@ -128559 \ No newline at end of file +128751 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactInput_oneHop_initializedAfter.snap b/.forge-snapshots/Quoter_quoteExactInput_oneHop_initializedAfter.snap index efb45ba34..43b849118 100644 --- a/.forge-snapshots/Quoter_quoteExactInput_oneHop_initializedAfter.snap +++ b/.forge-snapshots/Quoter_quoteExactInput_oneHop_initializedAfter.snap @@ -1 +1 @@ -153480 \ No newline at end of file +153672 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactInput_oneHop_startingInitialized.snap b/.forge-snapshots/Quoter_quoteExactInput_oneHop_startingInitialized.snap index 5281d2e2f..d7e7dc632 100644 --- a/.forge-snapshots/Quoter_quoteExactInput_oneHop_startingInitialized.snap +++ b/.forge-snapshots/Quoter_quoteExactInput_oneHop_startingInitialized.snap @@ -1 +1 @@ -87503 \ No newline at end of file +87695 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactInput_twoHops.snap b/.forge-snapshots/Quoter_quoteExactInput_twoHops.snap index d8a20ee9a..32647ca37 100644 --- a/.forge-snapshots/Quoter_quoteExactInput_twoHops.snap +++ b/.forge-snapshots/Quoter_quoteExactInput_twoHops.snap @@ -1 +1 @@ -212546 \ No newline at end of file +212738 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_1TickLoaded.snap b/.forge-snapshots/Quoter_quoteExactOutput_oneHop_1TickLoaded.snap index 43a31e7c4..6d67520ce 100644 --- a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_1TickLoaded.snap +++ b/.forge-snapshots/Quoter_quoteExactOutput_oneHop_1TickLoaded.snap @@ -1 +1 @@ -148306 \ No newline at end of file +148498 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_2TicksLoaded.snap b/.forge-snapshots/Quoter_quoteExactOutput_oneHop_2TicksLoaded.snap index 8ba91a98d..d8eadd5e8 100644 --- a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_2TicksLoaded.snap +++ b/.forge-snapshots/Quoter_quoteExactOutput_oneHop_2TicksLoaded.snap @@ -1 +1 @@ -178443 \ No newline at end of file +178635 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_initializedAfter.snap b/.forge-snapshots/Quoter_quoteExactOutput_oneHop_initializedAfter.snap index 31ecb056f..471d7f5c5 100644 --- a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_initializedAfter.snap +++ b/.forge-snapshots/Quoter_quoteExactOutput_oneHop_initializedAfter.snap @@ -1 +1 @@ -148374 \ No newline at end of file +148566 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_startingInitialized.snap b/.forge-snapshots/Quoter_quoteExactOutput_oneHop_startingInitialized.snap index d8993e483..8c9d054ed 100644 --- a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_startingInitialized.snap +++ b/.forge-snapshots/Quoter_quoteExactOutput_oneHop_startingInitialized.snap @@ -1 +1 @@ -125073 \ No newline at end of file +125265 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactOutput_twoHops.snap b/.forge-snapshots/Quoter_quoteExactOutput_twoHops.snap index 238bcf31e..7f6188290 100644 --- a/.forge-snapshots/Quoter_quoteExactOutput_twoHops.snap +++ b/.forge-snapshots/Quoter_quoteExactOutput_twoHops.snap @@ -1 +1 @@ -252910 \ No newline at end of file +253102 \ No newline at end of file diff --git a/src/interfaces/IQuoter.sol b/src/interfaces/IQuoter.sol index befc166a2..c13676a3d 100644 --- a/src/interfaces/IQuoter.sol +++ b/src/interfaces/IQuoter.sol @@ -48,7 +48,7 @@ interface IQuoter { /// @return sqrtPriceX96After The sqrt price of the pool after the swap function quoteExactInputSingle(QuoteExactSingleParams memory params) external - returns (int128[] memory deltaAmounts, uint160 sqrtPriceX96After); + returns (int128[] memory deltaAmounts, uint160 sqrtPriceX96After, uint256 gasEstimate); /// @notice Returns the delta amounts along the swap path for a given exact input swap /// @param params the params for the quote, encoded as 'QuoteExactParams' @@ -59,7 +59,7 @@ interface IQuoter { /// @return sqrtPriceX96AfterList List of the sqrt price after the swap for each pool in the path function quoteExactInput(QuoteExactParams memory params) external - returns (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList); + returns (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList, uint256 gasEstimate); /// @notice Returns the delta amounts for a given exact output swap of a single pool /// @param params The params for the quote, encoded as `QuoteExactSingleParams` @@ -72,7 +72,7 @@ interface IQuoter { /// @return sqrtPriceX96After The sqrt price of the pool after the swap function quoteExactOutputSingle(QuoteExactSingleParams memory params) external - returns (int128[] memory deltaAmounts, uint160 sqrtPriceX96After); + returns (int128[] memory deltaAmounts, uint160 sqrtPriceX96After, uint256 gasEstimate); /// @notice Returns the delta amounts along the swap path for a given exact output swap /// @param params the params for the quote, encoded as 'QuoteExactParams' @@ -83,5 +83,5 @@ interface IQuoter { /// @return sqrtPriceX96AfterList List of the sqrt price after the swap for each pool in the path function quoteExactOutput(QuoteExactParams memory params) external - returns (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList); + returns (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList, uint256 gasEstimate); } diff --git a/src/lens/Quoter.sol b/src/lens/Quoter.sol index 4480ed642..0967e62fc 100644 --- a/src/lens/Quoter.sol +++ b/src/lens/Quoter.sol @@ -50,45 +50,53 @@ contract Quoter is IQuoter, SafeCallback { /// @inheritdoc IQuoter function quoteExactInputSingle(QuoteExactSingleParams memory params) public - returns (int128[] memory deltaAmounts, uint160 sqrtPriceX96After) + returns (int128[] memory deltaAmounts, uint160 sqrtPriceX96After, uint256 gasEstimate) { + uint256 gasBefore = gasleft(); try poolManager.unlock(abi.encodeCall(this._quoteExactInputSingle, (params))) {} catch (bytes memory reason) { - return _handleRevertSingle(reason); + gasEstimate = gasBefore - gasleft(); + return _handleRevertSingle(reason, gasEstimate); } } /// @inheritdoc IQuoter function quoteExactInput(QuoteExactParams memory params) external - returns (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) + returns (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList, uint256 gasEstimate) { + uint256 gasBefore = gasleft(); try poolManager.unlock(abi.encodeCall(this._quoteExactInput, (params))) {} catch (bytes memory reason) { - return _handleRevert(reason); + gasEstimate = gasBefore - gasleft(); + return _handleRevert(reason, gasEstimate); } } /// @inheritdoc IQuoter function quoteExactOutputSingle(QuoteExactSingleParams memory params) public - returns (int128[] memory deltaAmounts, uint160 sqrtPriceX96After) + returns (int128[] memory deltaAmounts, uint160 sqrtPriceX96After, uint256 gasEstimate) { + uint256 gasBefore = gasleft(); try poolManager.unlock(abi.encodeCall(this._quoteExactOutputSingle, (params))) {} catch (bytes memory reason) { + gasEstimate = gasBefore - gasleft(); if (params.sqrtPriceLimitX96 == 0) delete amountOutCached; - return _handleRevertSingle(reason); + return _handleRevertSingle(reason, gasEstimate); } } /// @inheritdoc IQuoter function quoteExactOutput(QuoteExactParams memory params) public - returns (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) + returns (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList, uint256 gasEstimate) { + uint256 gasBefore = gasleft(); try poolManager.unlock(abi.encodeCall(this._quoteExactOutput, (params))) {} catch (bytes memory reason) { - return _handleRevert(reason); + gasEstimate = gasBefore - gasleft(); + return _handleRevert(reason, gasEstimate); } } @@ -111,23 +119,25 @@ contract Quoter is IQuoter, SafeCallback { } /// @dev parse revert bytes from a single-pool quote - function _handleRevertSingle(bytes memory reason) + function _handleRevertSingle(bytes memory reason, uint256 gasEstimate) private pure - returns (int128[] memory deltaAmounts, uint160 sqrtPriceX96After) + returns (int128[] memory deltaAmounts, uint160 sqrtPriceX96After, uint256) { reason = validateRevertReason(reason); (deltaAmounts, sqrtPriceX96After) = abi.decode(reason, (int128[], uint160)); + return (deltaAmounts, sqrtPriceX96After, gasEstimate); } /// @dev parse revert bytes from a potentially multi-hop quote and return the delta amounts, and sqrtPriceX96After - function _handleRevert(bytes memory reason) + function _handleRevert(bytes memory reason, uint256 gasEstimate) private pure - returns (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) + returns (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList, uint256) { reason = validateRevertReason(reason); (deltaAmounts, sqrtPriceX96AfterList) = abi.decode(reason, (int128[], uint160[])); + return (deltaAmounts, sqrtPriceX96AfterList, gasEstimate); } /// @dev quote an ExactInput swap along a path of tokens, then revert with the result diff --git a/test/Quoter.t.sol b/test/Quoter.t.sol index 86b57181d..552295d85 100644 --- a/test/Quoter.t.sol +++ b/test/Quoter.t.sol @@ -85,7 +85,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { uint256 expectedAmountOut = 9871; uint160 expectedSqrtPriceX96After = 78461846509168490764501028180; - (int128[] memory deltaAmounts, uint160 sqrtPriceX96After) = quoter.quoteExactInputSingle( + (int128[] memory deltaAmounts, uint160 sqrtPriceX96After,) = quoter.quoteExactInputSingle( IQuoter.QuoteExactSingleParams({ poolKey: key02, zeroForOne: true, @@ -105,7 +105,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { uint256 expectedAmountOut = 9871; uint160 expectedSqrtPriceX96After = 80001962924147897865541384515; - (int128[] memory deltaAmounts, uint160 sqrtPriceX96After) = quoter.quoteExactInputSingle( + (int128[] memory deltaAmounts, uint160 sqrtPriceX96After,) = quoter.quoteExactInputSingle( IQuoter.QuoteExactSingleParams({ poolKey: key02, zeroForOne: false, @@ -132,7 +132,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { tokenPath.push(token2); IQuoter.QuoteExactParams memory params = getExactInputParams(tokenPath, 10000); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactInput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactInput(params); assertEq(uint128(-deltaAmounts[1]), 9871); assertEq(sqrtPriceX96AfterList[0], 78461846509168490764501028180); @@ -146,7 +146,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { // -120 is an initialized tick for this pool. We check that we don't count it. IQuoter.QuoteExactParams memory params = getExactInputParams(tokenPath, 6200); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactInput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactInput(params); assertEq(uint128(-deltaAmounts[1]), 6143); assertEq(sqrtPriceX96AfterList[0], 78757224507315167622282810783); @@ -160,7 +160,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { // -60 is an initialized tick for this pool. We check that we don't count it. IQuoter.QuoteExactParams memory params = getExactInputParams(tokenPath, 4000); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactInput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactInput(params); snapLastCall("Quoter_quoteExactInput_oneHop_1TickLoaded"); @@ -173,7 +173,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { tokenPath.push(token2); IQuoter.QuoteExactParams memory params = getExactInputParams(tokenPath, 10); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactInput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactInput(params); assertEq(uint128(-deltaAmounts[1]), 8); assertEq(sqrtPriceX96AfterList[0], 79227483487511329217250071027); @@ -185,7 +185,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { tokenPath.push(token2); IQuoter.QuoteExactParams memory params = getExactInputParams(tokenPath, 10); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactInput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactInput(params); assertEq(uint128(-deltaAmounts[1]), 8); assertEq(sqrtPriceX96AfterList[0], 79227817515327498931091950511); @@ -196,7 +196,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { tokenPath.push(token0); IQuoter.QuoteExactParams memory params = getExactInputParams(tokenPath, 10000); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactInput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactInput(params); assertEq(-deltaAmounts[1], 9871); assertEq(sqrtPriceX96AfterList[0], 80001962924147897865541384515); @@ -210,7 +210,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { // 120 is an initialized tick for this pool. We check that we don't count it. IQuoter.QuoteExactParams memory params = getExactInputParams(tokenPath, 6250); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactInput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactInput(params); snapLastCall("Quoter_quoteExactInput_oneHop_initializedAfter"); @@ -225,7 +225,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { IQuoter.QuoteExactParams memory params = getExactInputParams(tokenPath, 200); // Tick 0 initialized. Tick after = 1 - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactInput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactInput(params); snapLastCall("Quoter_quoteExactInput_oneHop_startingInitialized"); @@ -239,7 +239,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { tokenPath.push(token0); IQuoter.QuoteExactParams memory params = getExactInputParams(tokenPath, 103); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactInput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactInput(params); assertEq(-deltaAmounts[1], 101); assertEq(sqrtPriceX96AfterList[0], 79235858216754624215638319723); @@ -250,7 +250,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { tokenPath.push(token1); IQuoter.QuoteExactParams memory params = getExactInputParams(tokenPath, 10000); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactInput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactInput(params); assertEq(-deltaAmounts[1], 9871); assertEq(sqrtPriceX96AfterList[0], 80018067294531553039351583520); } @@ -261,7 +261,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { tokenPath.push(token1); IQuoter.QuoteExactParams memory params = getExactInputParams(tokenPath, 10000); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactInput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactInput(params); snapLastCall("Quoter_quoteExactInput_twoHops"); @@ -271,7 +271,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { } function testQuoter_quoteExactOutputSingle_0to1() public { - (int128[] memory deltaAmounts, uint160 sqrtPriceX96After) = quoter.quoteExactOutputSingle( + (int128[] memory deltaAmounts, uint160 sqrtPriceX96After,) = quoter.quoteExactOutputSingle( IQuoter.QuoteExactSingleParams({ poolKey: key01, zeroForOne: true, @@ -287,7 +287,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { } function testQuoter_quoteExactOutputSingle_1to0() public { - (int128[] memory deltaAmounts, uint160 sqrtPriceX96After) = quoter.quoteExactOutputSingle( + (int128[] memory deltaAmounts, uint160 sqrtPriceX96After,) = quoter.quoteExactOutputSingle( IQuoter.QuoteExactSingleParams({ poolKey: key01, zeroForOne: false, @@ -307,7 +307,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { tokenPath.push(token2); IQuoter.QuoteExactParams memory params = getExactOutputParams(tokenPath, 15000); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactOutput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactOutput(params); snapLastCall("Quoter_quoteExactOutput_oneHop_2TicksLoaded"); @@ -321,7 +321,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { IQuoter.QuoteExactParams memory params = getExactOutputParams(tokenPath, 6143); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactOutput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactOutput(params); snapLastCall("Quoter_quoteExactOutput_oneHop_initializedAfter"); assertEq(deltaAmounts[0], 6200); @@ -334,7 +334,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { IQuoter.QuoteExactParams memory params = getExactOutputParams(tokenPath, 4000); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactOutput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactOutput(params); snapLastCall("Quoter_quoteExactOutput_oneHop_1TickLoaded"); assertEq(deltaAmounts[0], 4029); @@ -349,7 +349,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { IQuoter.QuoteExactParams memory params = getExactOutputParams(tokenPath, 100); // Tick 0 initialized. Tick after = 1 - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactOutput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactOutput(params); snapLastCall("Quoter_quoteExactOutput_oneHop_startingInitialized"); assertEq(deltaAmounts[0], 102); @@ -362,7 +362,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { IQuoter.QuoteExactParams memory params = getExactOutputParams(tokenPath, 10); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactOutput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactOutput(params); assertEq(deltaAmounts[0], 12); assertEq(sqrtPriceX96AfterList[0], 79227408033628034983534698435); @@ -373,7 +373,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { tokenPath.push(token0); IQuoter.QuoteExactParams memory params = getExactOutputParams(tokenPath, 15000); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactOutput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactOutput(params); assertEq(deltaAmounts[0], 15273); assertEq(sqrtPriceX96AfterList[0], 80418414376567919517220409857); @@ -385,7 +385,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { IQuoter.QuoteExactParams memory params = getExactOutputParams(tokenPath, 6223); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactOutput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactOutput(params); assertEq(deltaAmounts[0], 6283); assertEq(sqrtPriceX96AfterList[0], 79708304437530892332449657932); @@ -396,7 +396,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { tokenPath.push(token0); IQuoter.QuoteExactParams memory params = getExactOutputParams(tokenPath, 6000); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactOutput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactOutput(params); assertEq(deltaAmounts[0], 6055); assertEq(sqrtPriceX96AfterList[0], 79690640184021170956740081887); @@ -408,7 +408,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { IQuoter.QuoteExactParams memory params = getExactOutputParams(tokenPath, 9871); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactOutput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactOutput(params); assertEq(deltaAmounts[0], 10000); assertEq(sqrtPriceX96AfterList[0], 80018020393569259756601362385); @@ -421,7 +421,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { IQuoter.QuoteExactParams memory params = getExactOutputParams(tokenPath, 9745); - (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList) = quoter.quoteExactOutput(params); + (int128[] memory deltaAmounts, uint160[] memory sqrtPriceX96AfterList,) = quoter.quoteExactOutput(params); snapLastCall("Quoter_quoteExactOutput_twoHops");