|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | +pragma solidity 0.6.10; |
| 3 | +pragma experimental ABIEncoderV2; |
| 4 | + |
| 5 | +interface ISwapRouter02 { |
| 6 | + struct IncreaseLiquidityParams { |
| 7 | + address token0; |
| 8 | + address token1; |
| 9 | + uint256 tokenId; |
| 10 | + uint256 amount0Min; |
| 11 | + uint256 amount1Min; |
| 12 | + } |
| 13 | + |
| 14 | + struct MintParams { |
| 15 | + address token0; |
| 16 | + address token1; |
| 17 | + uint24 fee; |
| 18 | + int24 tickLower; |
| 19 | + int24 tickUpper; |
| 20 | + uint256 amount0Min; |
| 21 | + uint256 amount1Min; |
| 22 | + address recipient; |
| 23 | + } |
| 24 | + |
| 25 | + struct ExactInputParams { |
| 26 | + bytes path; |
| 27 | + address recipient; |
| 28 | + uint256 amountIn; |
| 29 | + uint256 amountOutMinimum; |
| 30 | + } |
| 31 | + |
| 32 | + struct ExactInputSingleParams { |
| 33 | + address tokenIn; |
| 34 | + address tokenOut; |
| 35 | + uint24 fee; |
| 36 | + address recipient; |
| 37 | + uint256 amountIn; |
| 38 | + uint256 amountOutMinimum; |
| 39 | + uint160 sqrtPriceLimitX96; |
| 40 | + } |
| 41 | + |
| 42 | + struct ExactOutputParams { |
| 43 | + bytes path; |
| 44 | + address recipient; |
| 45 | + uint256 amountOut; |
| 46 | + uint256 amountInMaximum; |
| 47 | + } |
| 48 | + |
| 49 | + struct ExactOutputSingleParams { |
| 50 | + address tokenIn; |
| 51 | + address tokenOut; |
| 52 | + uint24 fee; |
| 53 | + address recipient; |
| 54 | + uint256 amountOut; |
| 55 | + uint256 amountInMaximum; |
| 56 | + uint160 sqrtPriceLimitX96; |
| 57 | + } |
| 58 | + |
| 59 | + function WETH9() external view returns (address); |
| 60 | + function approveMax(address token) external payable; |
| 61 | + function approveMaxMinusOne(address token) external payable; |
| 62 | + function approveZeroThenMax(address token) external payable; |
| 63 | + function approveZeroThenMaxMinusOne(address token) external payable; |
| 64 | + function callPositionManager(bytes memory data) external payable returns (bytes memory result); |
| 65 | + function checkOracleSlippage( |
| 66 | + bytes[] memory paths, |
| 67 | + uint128[] memory amounts, |
| 68 | + uint24 maximumTickDivergence, |
| 69 | + uint32 secondsAgo |
| 70 | + ) external view; |
| 71 | + function checkOracleSlippage(bytes memory path, uint24 maximumTickDivergence, uint32 secondsAgo) external view; |
| 72 | + function exactInput(ExactInputParams memory params) external payable returns (uint256 amountOut); |
| 73 | + function exactInputSingle(ExactInputSingleParams memory params) external payable returns (uint256 amountOut); |
| 74 | + function exactOutput(ExactOutputParams memory params) external payable returns (uint256 amountIn); |
| 75 | + function exactOutputSingle(ExactOutputSingleParams memory params) external payable returns (uint256 amountIn); |
| 76 | + function factory() external view returns (address); |
| 77 | + function factoryV2() external view returns (address); |
| 78 | + function getApprovalType(address token, uint256 amount) external returns (uint8); |
| 79 | + function increaseLiquidity(IncreaseLiquidityParams memory params) external payable returns (bytes memory result); |
| 80 | + function mint(MintParams memory params) external payable returns (bytes memory result); |
| 81 | + function multicall(bytes32 previousBlockhash, bytes[] memory data) external payable returns (bytes[] memory); |
| 82 | + function multicall(uint256 deadline, bytes[] memory data) external payable returns (bytes[] memory); |
| 83 | + function multicall(bytes[] memory data) external payable returns (bytes[] memory results); |
| 84 | + function positionManager() external view returns (address); |
| 85 | + function pull(address token, uint256 value) external payable; |
| 86 | + function refundETH() external payable; |
| 87 | + function selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) |
| 88 | + external |
| 89 | + payable; |
| 90 | + function selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) |
| 91 | + external |
| 92 | + payable; |
| 93 | + function selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) |
| 94 | + external |
| 95 | + payable; |
| 96 | + function selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) |
| 97 | + external |
| 98 | + payable; |
| 99 | + function swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] memory path, address to) |
| 100 | + external |
| 101 | + payable |
| 102 | + returns (uint256 amountOut); |
| 103 | + function swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] memory path, address to) |
| 104 | + external |
| 105 | + payable |
| 106 | + returns (uint256 amountIn); |
| 107 | + function sweepToken(address token, uint256 amountMinimum, address recipient) external payable; |
| 108 | + function sweepToken(address token, uint256 amountMinimum) external payable; |
| 109 | + function sweepTokenWithFee(address token, uint256 amountMinimum, uint256 feeBips, address feeRecipient) |
| 110 | + external |
| 111 | + payable; |
| 112 | + function sweepTokenWithFee( |
| 113 | + address token, |
| 114 | + uint256 amountMinimum, |
| 115 | + address recipient, |
| 116 | + uint256 feeBips, |
| 117 | + address feeRecipient |
| 118 | + ) external payable; |
| 119 | + function uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes memory _data) external; |
| 120 | + function unwrapWETH9(uint256 amountMinimum, address recipient) external payable; |
| 121 | + function unwrapWETH9(uint256 amountMinimum) external payable; |
| 122 | + function unwrapWETH9WithFee(uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient) |
| 123 | + external |
| 124 | + payable; |
| 125 | + function unwrapWETH9WithFee(uint256 amountMinimum, uint256 feeBips, address feeRecipient) external payable; |
| 126 | + function wrapETH(uint256 value) external payable; |
| 127 | +} |
0 commit comments