@@ -9,10 +9,12 @@ interface IKSSwapRouterV3 {
99 /// @param targets The targets to transfer the input token to
1010 /// @param amounts The amounts to transfer to the targets
1111 struct InputTokenData {
12- // length = 5 * 32: IERC20Permit, use ERC20 `transferFrom`
13- // length = 6 * 32: IDaiLikePermit, use ERC20 `transferFrom`
14- // length = 0: use ERC20 `transferFrom`
15- // otherwise: use Permit2 `transferFrom`
12+ // Permit method selection:
13+ // length = 5 * 32: use ERC20 `permit`
14+ // length = 6 * 32: use DAI `permit`
15+ // Transfer method selection:
16+ // length == 0: use Permit2 `transferFrom`
17+ // length != 0: use ERC20 `transferFrom`
1618 bytes permitData;
1719 address [] feeRecipients;
1820 uint256 [] fees;
@@ -31,32 +33,37 @@ interface IKSSwapRouterV3 {
3133 }
3234
3335 /// @notice Contains the parameters for a swap
34- /// @param permit2Data The data to call permit2 with
3536 /// @param inputTokens The input tokens
36- /// @param inputAmounts The input amounts
37+ /// @param inputAmounts The input amounts (only used for fee calculation)
3738 /// @param inputData The additional data for the input tokens
3839 /// @param outputTokens The output tokens
3940 /// @param outputData The additional data for the output tokens
41+ /// @param permit2Data The data to call permit2 with
4042 /// @param executor The executor to call
4143 /// @param executorData The data to pass to the executor
4244 /// @param recipient The recipient of the output tokens
45+ /// @param deadline The deadline for the swap
4346 /// @param clientData The client data
4447 struct SwapParams {
45- bytes permit2Data;
4648 address [] inputTokens;
4749 uint256 [] inputAmounts;
4850 InputTokenData[] inputData;
4951 address [] outputTokens;
5052 OutputTokenData[] outputData;
53+ bytes permit2Data;
5154 address executor;
5255 bytes executorData;
5356 address recipient;
57+ uint256 deadline;
5458 bytes clientData;
5559 }
5660
5761 /// @notice Entry point for swapping
5862 /// @param params The parameters for the swap
59- function swap (SwapParams calldata params ) external payable ;
63+ function swap (SwapParams calldata params )
64+ external
65+ payable
66+ returns (uint256 [] memory outputAmounts , uint256 gasUsed );
6067
6168 /// @notice Returns the address of who called the swap function
6269 function msgSender () external view returns (address );
0 commit comments