1
+ /*
2
+ Copyright 2022 Set Labs Inc.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ SPDX-License-Identifier: Apache License, Version 2.0
17
+ */
18
+
19
+ pragma solidity 0.6.10 ;
20
+
21
+ import "../../../interfaces/external/IUniswapV3Factory.sol " ;
22
+ import "../../../interfaces/IAmmAdapter.sol " ;
23
+ import "@openzeppelin/contracts/math/Math.sol " ;
24
+ import "@openzeppelin/contracts/math/SafeMath.sol " ;
25
+
26
+ /**
27
+ * @title UniswapV3AmmAdapter
28
+ * @author Zishan Sami
29
+ *
30
+ * Adapter for Uniswap V3 Router that encodes adding and removing liquidty
31
+ */
32
+ contract UniswapV3AmmAdapter is IAmmAdapter {
33
+ using SafeMath for uint256 ;
34
+
35
+ /* ============ External Getter Functions ============ */
36
+
37
+ /**
38
+ * Return calldata for the add liquidity call
39
+ *
40
+ * @param _setToken Address of the SetToken
41
+ * @param _pool Address of liquidity token
42
+ * @param _components Address array required to add liquidity
43
+ * @param _maxTokensIn AmountsIn desired to add liquidity
44
+ * @param _minLiquidity Min liquidity amount to add
45
+ */
46
+ function getProvideLiquidityCalldata (
47
+ address _setToken ,
48
+ address _pool ,
49
+ address [] calldata _components ,
50
+ uint256 [] calldata _maxTokensIn ,
51
+ uint256 _minLiquidity
52
+ )
53
+ external
54
+ view
55
+ override
56
+ returns (address target , uint256 value , bytes memory data )
57
+ {
58
+ //TODO
59
+ }
60
+
61
+ /**
62
+ * Return calldata for the add liquidity call for a single asset
63
+ */
64
+ function getProvideLiquiditySingleAssetCalldata (
65
+ address /*_setToken*/ ,
66
+ address /*_pool*/ ,
67
+ address /*_component*/ ,
68
+ uint256 /*_maxTokenIn*/ ,
69
+ uint256 /*_minLiquidity*/
70
+ )
71
+ external
72
+ view
73
+ override
74
+ returns (address /*target*/ , uint256 /*value*/ , bytes memory /*data*/ )
75
+ {
76
+ //TODO
77
+ }
78
+
79
+ /**
80
+ * Return calldata for the remove liquidity call
81
+ *
82
+ * @param _setToken Address of the SetToken
83
+ * @param _pool Address of liquidity token
84
+ * @param _components Address array required to remove liquidity
85
+ * @param _minTokensOut AmountsOut minimum to remove liquidity
86
+ * @param _liquidity Liquidity amount to remove
87
+ */
88
+ function getRemoveLiquidityCalldata (
89
+ address _setToken ,
90
+ address _pool ,
91
+ address [] calldata _components ,
92
+ uint256 [] calldata _minTokensOut ,
93
+ uint256 _liquidity
94
+ )
95
+ external
96
+ view
97
+ override
98
+ returns (address target , uint256 value , bytes memory data )
99
+ {
100
+ //TODO
101
+ }
102
+
103
+ /**
104
+ * Return calldata for the remove liquidity single asset call
105
+ */
106
+ function getRemoveLiquiditySingleAssetCalldata (
107
+ address /* _setToken */ ,
108
+ address /*_pool*/ ,
109
+ address /*_component*/ ,
110
+ uint256 /*_minTokenOut*/ ,
111
+ uint256 /*_liquidity*/
112
+ )
113
+ external
114
+ view
115
+ override
116
+ returns (address /*target*/ , uint256 /*value*/ , bytes memory /*data*/ )
117
+ {
118
+ //TODO
119
+ }
120
+
121
+ /**
122
+ * Returns the address of the spender
123
+ */
124
+ function getSpenderAddress (address /*_pool*/ )
125
+ external
126
+ view
127
+ override
128
+ returns (address spender )
129
+ {
130
+ //TODO
131
+ }
132
+
133
+ /**
134
+ * Verifies that this is a valid Uniswap V3 pool
135
+ *
136
+ * @param _pool Address of liquidity token
137
+ * @param _components Address array of supplied/requested tokens
138
+ */
139
+ function isValidPool (address _pool , address [] memory _components )
140
+ external
141
+ view
142
+ override
143
+ returns (bool )
144
+ {
145
+ //TODO
146
+ }
147
+ }
0 commit comments