|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity ^0.8.23; |
| 3 | + |
| 4 | +interface ISolidlyRouter { |
| 5 | + /// @notice calculates the CREATE2 address for a pair without making any external calls |
| 6 | + /// @param tokenA the address of tokenA |
| 7 | + /// @param tokenB the address of tokenB |
| 8 | + /// @param stable if the pair is using the stable curve |
| 9 | + /// @return pair address of the pair |
| 10 | + function pairFor(address tokenA, address tokenB, bool stable) external view returns (address pair); |
| 11 | + |
| 12 | + /// @notice performs calculations to determine the expected state when adding liquidity |
| 13 | + /// @param tokenA the address of tokenA |
| 14 | + /// @param tokenB the address of tokenB |
| 15 | + /// @param stable if the pair is using the stable curve |
| 16 | + /// @param amountADesired amount of tokenA desired to be added |
| 17 | + /// @param amountBDesired amount of tokenB desired to be added |
| 18 | + /// @return amountA amount of tokenA added |
| 19 | + /// @return amountB amount of tokenB added |
| 20 | + /// @return liquidity liquidity value added |
| 21 | + function quoteAddLiquidity( |
| 22 | + address tokenA, |
| 23 | + address tokenB, |
| 24 | + bool stable, |
| 25 | + uint amountADesired, |
| 26 | + uint amountBDesired |
| 27 | + ) external view returns (uint amountA, uint amountB, uint liquidity); |
| 28 | + |
| 29 | + /// @param tokenA the address of tokenA |
| 30 | + /// @param tokenB the address of tokenB |
| 31 | + /// @param stable if the pair is using the stable curve |
| 32 | + /// @param liquidity liquidity value to remove |
| 33 | + /// @return amountA amount of tokenA removed |
| 34 | + /// @return amountB amount of tokenB removed |
| 35 | + function quoteRemoveLiquidity( |
| 36 | + address tokenA, |
| 37 | + address tokenB, |
| 38 | + bool stable, |
| 39 | + uint liquidity |
| 40 | + ) external view returns (uint amountA, uint amountB); |
| 41 | + |
| 42 | + /// @param tokenA the address of tokenA |
| 43 | + /// @param tokenB the address of tokenB |
| 44 | + /// @param stable if the pair is using the stable curve |
| 45 | + /// @param amountADesired amount of tokenA desired to be added |
| 46 | + /// @param amountBDesired amount of tokenB desired to be added |
| 47 | + /// @param amountAMin slippage for tokenA calculated from this param |
| 48 | + /// @param amountBMin slippage for tokenB calculated from this param |
| 49 | + /// @param to the address the liquidity tokens should be minted to |
| 50 | + /// @param deadline timestamp deadline |
| 51 | + /// @return amountA amount of tokenA used |
| 52 | + /// @return amountB amount of tokenB used |
| 53 | + /// @return liquidity amount of liquidity minted |
| 54 | + function addLiquidity( |
| 55 | + address tokenA, |
| 56 | + address tokenB, |
| 57 | + bool stable, |
| 58 | + uint amountADesired, |
| 59 | + uint amountBDesired, |
| 60 | + uint amountAMin, |
| 61 | + uint amountBMin, |
| 62 | + address to, |
| 63 | + uint deadline |
| 64 | + ) external returns (uint amountA, uint amountB, uint liquidity); |
| 65 | + |
| 66 | + /// @param token the address of token |
| 67 | + /// @param stable if the pair is using the stable curve |
| 68 | + /// @param amountTokenDesired desired amount for token |
| 69 | + /// @param amountTokenMin slippage for token |
| 70 | + /// @param amountETHMin minimum amount of ETH added (slippage) |
| 71 | + /// @param to the address the liquidity tokens should be minted to |
| 72 | + /// @param deadline timestamp deadline |
| 73 | + /// @return amountToken amount of the token used |
| 74 | + /// @return amountETH amount of ETH used |
| 75 | + /// @return liquidity amount of liquidity minted |
| 76 | + function addLiquidityETH( |
| 77 | + address token, |
| 78 | + bool stable, |
| 79 | + uint amountTokenDesired, |
| 80 | + uint amountTokenMin, |
| 81 | + uint amountETHMin, |
| 82 | + address to, |
| 83 | + uint deadline |
| 84 | + ) external payable returns (uint amountToken, uint amountETH, uint liquidity); |
| 85 | + |
| 86 | + /// @param tokenA the address of tokenA |
| 87 | + /// @param tokenB the address of tokenB |
| 88 | + /// @param stable if the pair is using the stable curve |
| 89 | + /// @param amountADesired amount of tokenA desired to be added |
| 90 | + /// @param amountBDesired amount of tokenB desired to be added |
| 91 | + /// @param amountAMin slippage for tokenA calculated from this param |
| 92 | + /// @param amountBMin slippage for tokenB calculated from this param |
| 93 | + /// @param to the address the liquidity tokens should be minted to |
| 94 | + /// @param deadline timestamp deadline |
| 95 | + /// @return amountA amount of tokenA used |
| 96 | + /// @return amountB amount of tokenB used |
| 97 | + /// @return liquidity amount of liquidity minted |
| 98 | + function addLiquidityAndStake( |
| 99 | + address tokenA, |
| 100 | + address tokenB, |
| 101 | + bool stable, |
| 102 | + uint amountADesired, |
| 103 | + uint amountBDesired, |
| 104 | + uint amountAMin, |
| 105 | + uint amountBMin, |
| 106 | + address to, |
| 107 | + uint deadline |
| 108 | + ) external returns (uint amountA, uint amountB, uint liquidity); |
| 109 | + |
| 110 | + /// @notice adds liquidity to a legacy pair using ETH, and stakes it into a gauge on "to's" behalf |
| 111 | + /// @param token the address of token |
| 112 | + /// @param stable if the pair is using the stable curve |
| 113 | + /// @param amountTokenDesired amount of token to be used |
| 114 | + /// @param amountTokenMin slippage of token |
| 115 | + /// @param amountETHMin slippage of ETH |
| 116 | + /// @param to the address the liquidity tokens should be minted to |
| 117 | + /// @param deadline timestamp deadline |
| 118 | + /// @return amountA amount of tokenA used |
| 119 | + /// @return amountB amount of tokenB used |
| 120 | + /// @return liquidity amount of liquidity minted |
| 121 | + function addLiquidityETHAndStake( |
| 122 | + address token, |
| 123 | + bool stable, |
| 124 | + uint amountTokenDesired, |
| 125 | + uint amountTokenMin, |
| 126 | + uint amountETHMin, |
| 127 | + address to, |
| 128 | + uint deadline |
| 129 | + ) external payable returns (uint amountA, uint amountB, uint liquidity); |
| 130 | + |
| 131 | + /// @param tokenA the address of tokenA |
| 132 | + /// @param tokenB the address of tokenB |
| 133 | + /// @param stable if the pair is using the stable curve |
| 134 | + /// @param liquidity amount of LP tokens to remove |
| 135 | + /// @param amountAMin slippage of tokenA |
| 136 | + /// @param amountBMin slippage of tokenB |
| 137 | + /// @param to the address the liquidity tokens should be minted to |
| 138 | + /// @param deadline timestamp deadline |
| 139 | + /// @return amountA amount of tokenA used |
| 140 | + /// @return amountB amount of tokenB used |
| 141 | + function removeLiquidity( |
| 142 | + address tokenA, |
| 143 | + address tokenB, |
| 144 | + bool stable, |
| 145 | + uint liquidity, |
| 146 | + uint amountAMin, |
| 147 | + uint amountBMin, |
| 148 | + address to, |
| 149 | + uint deadline |
| 150 | + ) external returns (uint amountA, uint amountB); |
| 151 | + |
| 152 | + /// @param token address of the token |
| 153 | + /// @param stable if the pair is using the stable curve |
| 154 | + /// @param liquidity liquidity tokens to remove |
| 155 | + /// @param amountTokenMin slippage of token |
| 156 | + /// @param amountETHMin slippage of ETH |
| 157 | + /// @param to the address the liquidity tokens should be minted to |
| 158 | + /// @param deadline timestamp deadline |
| 159 | + /// @return amountToken amount of token used |
| 160 | + /// @return amountETH amount of ETH used |
| 161 | + function removeLiquidityETH( |
| 162 | + address token, |
| 163 | + bool stable, |
| 164 | + uint liquidity, |
| 165 | + uint amountTokenMin, |
| 166 | + uint amountETHMin, |
| 167 | + address to, |
| 168 | + uint deadline |
| 169 | + ) external returns (uint amountToken, uint amountETH); |
| 170 | +} |
0 commit comments