diff --git a/contracts/lens/Quoter.sol b/contracts/lens/Quoter.sol index 475b231b..4d908454 100644 --- a/contracts/lens/Quoter.sol +++ b/contracts/lens/Quoter.sol @@ -30,7 +30,7 @@ contract Quoter is IQuoter { } function fillSlot0(PoolId id) private view returns (Pool.Slot0 memory slot0) { - //TODO: extsload when storage is stable + //TODO: extsload when storage is stable? (slot0.sqrtPriceX96, slot0.tick,,) = poolManager.getSlot0(id); return slot0; @@ -106,14 +106,13 @@ contract Quoter is IQuoter { ) = _quoteExactInput(abi.decode(swapInfo.params, (ExactInputParams))); assembly { - // function storeArray(offset, length) -> result { - // switch exponent - // case 0 { result := 1 } - // case 1 { result := base } - // default { - // result := power(mul(base, base), div(exponent, 2)) - // switch mod(exponent, 2) - // case 1 { result := mul(base, result) } + // function storeArray(offset, length, array) { + // mstore(offset, length) + // offset := add(offset, 0x20) + // for { let i := 0 } lt(i, length) { i := add(i, 1) } { + // let value := mload(add(array, add(mul(i, 0x20), 0x20))) + // mstore(offset, value) + // offset := add(offset, 0x20) // } // } @@ -136,7 +135,7 @@ contract Quoter is IQuoter { mstore(ptr, initializedTicksOffset) ptr := add(ptr, 0x20) - // storing length + contents of dynamic arrays + //storing length + contents of dynamic arrays mstore(ptr, deltaLength) ptr := add(ptr, 0x20) for { let i := 0 } lt(i, deltaLength) { i := add(i, 1) } { @@ -162,7 +161,6 @@ contract Quoter is IQuoter { } revert(originalPtr, sub(ptr, originalPtr)) - //revert(ptr, add(mul(0x20, add(add(deltaLength, sqrtPriceLength), initializedTicksLength)), 0x60)) } } else { revert InvalidQuoteType(); diff --git a/test/Quoter.t.sol b/test/Quoter.t.sol index 73768a9f..73b1d4ff 100644 --- a/test/Quoter.t.sol +++ b/test/Quoter.t.sol @@ -271,11 +271,6 @@ contract QuoterTest is Test, Deployers { function testQuoter_quoteExactInput_2to1() public { tokenPath.push(token2); tokenPath.push(token1); - console.logString("===== testQuoter_quoteExactInput_2to1 ======"); - console.logString("Token2: "); - console.logAddress(address(token2)); - console.logString("Token1: "); - console.logAddress(address(token1)); ExactInputParams memory params = getExactInputParams(tokenPath, 10000); ( @@ -283,9 +278,7 @@ contract QuoterTest is Test, Deployers { uint160[] memory sqrtPriceX96AfterList, uint32[] memory initializedTicksCrossedList ) = quoter.quoteExactInput(params); - logDeltas(deltaAmounts); assertEq(-deltaAmounts[1], 9871); - logSqrtPrices(sqrtPriceX96AfterList); assertEq(sqrtPriceX96AfterList[0], 80018067294531553039351583520); assertEq(initializedTicksCrossedList[0], 0); } @@ -302,9 +295,6 @@ contract QuoterTest is Test, Deployers { uint32[] memory initializedTicksCrossedList ) = quoter.quoteExactInput(params); - logDeltas(deltaAmounts); - logSqrtPrices(sqrtPriceX96AfterList); - assertEq(-deltaAmounts[2], 9745); assertEq(sqrtPriceX96AfterList[0], 78461846509168490764501028180); assertEq(sqrtPriceX96AfterList[1], 80007846861567212939802016351);