Skip to content

Commit

Permalink
Use permit2 from Permit2Lib
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongeric committed Sep 28, 2023
1 parent d3526ef commit acacd7e
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
197273
197283
Original file line number Diff line number Diff line change
@@ -1 +1 @@
207039
207049
Original file line number Diff line number Diff line change
@@ -1 +1 @@
260710
260720
Original file line number Diff line number Diff line change
@@ -1 +1 @@
190835
190845
2 changes: 1 addition & 1 deletion .forge-snapshots/SwapRouter02ExecutorExecute.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
250378
250324
Original file line number Diff line number Diff line change
@@ -1 +1 @@
111832
111778
2 changes: 1 addition & 1 deletion .forge-snapshots/SwapRouter02ExecutorPermitAndExecute.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
305831
305688
6 changes: 3 additions & 3 deletions test/executors/SwapRouter02Executor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ contract SwapRouter02ExecutorTest is Test, PermitSignature, GasSnapshot, DeployP
address signer = ecrecover(digest, v, r, s);
assertEq(signer, bob);

tokenInPermitData = PermitData(address(tokenIn), abi.encode(bob, address(permit2), amount, deadline, v, r, s));
tokenInPermitData = PermitData(ERC20(tokenIn), bob, address(permit2), amount, deadline, v, r, s);
// assert that swapper has not approved P2 yet
assertEq(tokenIn.allowance(bob, address(permit2)), 0);
}
Expand Down Expand Up @@ -216,7 +216,7 @@ contract SwapRouter02ExecutorTest is Test, PermitSignature, GasSnapshot, DeployP
multicallData[0] = abi.encodeWithSelector(ISwapRouter02.exactInput.selector, exactInputParams);

bytes[] memory data = new bytes[](2);
data[0] = abi.encodeWithSignature("permit((address,bytes))", tokenInPermitData);
data[0] = abi.encodeWithSignature("permit((address,address,address,uint256,uint256,uint8,bytes32,bytes32))", tokenInPermitData);
data[1] = abi.encodeWithSignature(
"execute((bytes,bytes),bytes)",
SignedOrder(abi.encode(order), signOrder(swapperPrivateKey, address(permit2), order)),
Expand Down Expand Up @@ -452,7 +452,7 @@ contract SwapRouter02ExecutorTest is Test, PermitSignature, GasSnapshot, DeployP
multicallData[0] = abi.encodeWithSelector(ISwapRouter02.exactInput.selector, exactInputParams);

bytes[] memory data = new bytes[](2);
data[0] = abi.encodeWithSignature("permit((address,bytes))", tokenInPermitData);
data[0] = abi.encodeWithSignature("permit((address,address,address,uint256,uint256,uint8,bytes32,bytes32))", tokenInPermitData);
data[1] = abi.encodeWithSignature(
"executeBatch((bytes,bytes)[],bytes)",
signedOrders,
Expand Down

0 comments on commit acacd7e

Please sign in to comment.