diff --git a/evm/src/integral/IntegralSwapAdapter.sol b/evm/src/integral/IntegralSwapAdapter.sol index a79c75e..6f6d2f7 100644 --- a/evm/src/integral/IntegralSwapAdapter.sol +++ b/evm/src/integral/IntegralSwapAdapter.sol @@ -1,3 +1,4 @@ +/* // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.8.13; @@ -569,3 +570,4 @@ interface ITwapPair is ITwapERC20, IReserves { function getDepositAmount1In(uint256 amount1, bytes calldata data) external view returns (uint256 depositAmount1In); } +*/ \ No newline at end of file diff --git a/evm/test/IntegralSwapAdapter.t.sol b/evm/test/IntegralSwapAdapter.t.sol index d791b3d..e13cbc4 100644 --- a/evm/test/IntegralSwapAdapter.t.sol +++ b/evm/test/IntegralSwapAdapter.t.sol @@ -29,4 +29,22 @@ contract IntegralSwapAdapterTest is Test, ISwapAdapterTypes { } + function testPriceFuzzIntegral(uint256 amount0, uint256 amount1) public { + bytes32 pair = bytes32(bytes20(USDC_WETH_PAIR)); + uint256[] memory limits = adapter.getLimits(pair, USDC, WETH); + vm.assume(amount0 < limits[0]); + vm.assume(amount1 < limits[1]); + + uint256[] memory amounts = new uint256[](2); + amounts[0] = amount0; + amounts[1] = amount1; + + Fraction[] memory prices = adapter.price(pair, WETH, USDC, amounts); + + for (uint256 i = 0; i < prices.length; i++) { + assertGt(prices[i].numerator, 0); + assertGt(prices[i].denominator, 0); + } + } + }