Skip to content

Commit

Permalink
Add test for UniV2 multihop
Browse files Browse the repository at this point in the history
  • Loading branch information
duncancmt committed Oct 24, 2023
1 parent bc6230c commit 85a0eba
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .forge-snapshots/settler_uniswapV2_USDC-WETH.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
160506
160489
2 changes: 1 addition & 1 deletion .forge-snapshots/settler_uniswapV2_USDT-WETH.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
153015
142580
1 change: 1 addition & 0 deletions .forge-snapshots/settler_uniswapV2_multihop_DAI-WETH.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
193513
1 change: 1 addition & 0 deletions .forge-snapshots/settler_uniswapV2_multihop_USDC-WETH.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
217364
1 change: 1 addition & 0 deletions .forge-snapshots/settler_uniswapV2_multihop_USDT-WETH.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
199455
19 changes: 19 additions & 0 deletions test/integration/SettlerPairTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,25 @@ abstract contract SettlerPairTest is BasePairTest {
snapEnd();
}

function testSettler_uniswapV2_multihop() public {
address wBTC = 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599;
bytes[] memory actions = ActionDataBuilder.build(
_getDefaultFromPermit2Action(),
abi.encodeCall(
ISettlerActions.UNISWAPV2_SWAP,
(FROM, 10_000, 0, bytes.concat(uniswapV2Path(), bytes1(0x00), bytes20(uint160(wBTC))))
)
);

Settler _settler = settler;
vm.startPrank(FROM);
snapStartName("settler_uniswapV2_multihop");
_settler.execute(
actions, Settler.AllowedSlippage({buyToken: address(0), recipient: address(0), minAmountOut: 0 ether})
);
snapEnd();
}

function testSettler_curveV2_fee() public skipIf(getCurveV2PoolData().pool == address(0)) {
ICurveV2Pool.CurveV2PoolData memory poolData = getCurveV2PoolData();

Expand Down

0 comments on commit 85a0eba

Please sign in to comment.