Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
saucepoint committed Mar 25, 2024
1 parent 15d698c commit 8f2f808
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
[submodule "contracts/lib/v4-core"]
path = contracts/lib/v4-core
url = https://github.com/uniswap/v4-core
[submodule "contracts/lib/v4-periphery"]
path = contracts/lib/v4-periphery
url = https://github.com/uniswap/v4-periphery
[submodule "forge-lib/v4-core"]
path = forge-lib/v4-core
url = https://github.com/uniswap/v4-core
Expand Down
3 changes: 2 additions & 1 deletion remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ forge-std/=forge-lib/v4-core/lib/forge-std/src/
hardhat/=forge-lib/v4-core/node_modules/hardhat/
openzeppelin-contracts/=forge-lib/v4-core/lib/openzeppelin-contracts/contracts/
solmate/=forge-lib/v4-core/lib/solmate/src/
v4-core/=forge-lib/v4-core/
v4-core/=forge-lib/v4-core/
forge-lib/v4-periphery:@uniswap/v4-core/=forge-lib/v4-core/
10 changes: 5 additions & 5 deletions src/pages/quoter/Quoter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {IPoolManager} from "v4-core/src/interfaces/IPoolManager.sol";
import {PoolKey} from "v4-core/src/types/PoolKey.sol";
import {BalanceDelta} from "v4-core/src/types/BalanceDelta.sol";
import {PoolId, PoolIdLibrary} from "v4-core/src/types/PoolId.sol";
import {Constants} from "v4-core/src/../test/utils/Constants.sol";
import {Constants} from "v4-core/test/utils/Constants.sol";
import {CurrencyLibrary, Currency} from "v4-core/src/types/Currency.sol";
import {Deployers} from "v4-core/src/../test/utils/Deployers.sol";
import {Deployers} from "v4-core/test/utils/Deployers.sol";
import {IQuoter} from "v4-periphery/interfaces/IQuoter.sol";
import {Quoter} from "v4-periphery/lens/Quoter.sol";

Expand Down Expand Up @@ -58,7 +58,7 @@ contract QuoterTest is Test, Deployers {
console2.log("Quoted output amount: ", int256(outputAmount));

// Perform a test swap
BalanceDelta swapDelta = swap(poolKey, int256(uint256(amountIn)), zeroForOne, ZERO_BYTES);
BalanceDelta swapDelta = swap(poolKey, zeroForOne, int256(uint256(amountIn)), ZERO_BYTES);

// quote agrees with the actual swap
assertEq(outputAmount, swapDelta.amount1());
Expand All @@ -80,9 +80,9 @@ contract QuoterTest is Test, Deployers {
console2.log("Quoted input amount: ", int256(inputAmount));

// Perform a exact-output swap
BalanceDelta swapDelta = swap(poolKey, -int256(uint256(amountOut)), zeroForOne, ZERO_BYTES);
BalanceDelta swapDelta = swap(poolKey, zeroForOne, -int256(uint256(amountOut)), ZERO_BYTES);
assertEq(inputAmount, swapDelta.amount0());
(uint160 sqrtPriceX96,,) = manager.getSlot0(poolId);
(uint160 sqrtPriceX96,,,) = manager.getSlot0(poolId);
assertEq(sqrtPriceX96After, sqrtPriceX96);
}
}

0 comments on commit 8f2f808

Please sign in to comment.