@paraswap/dex-lib 2.16.2-balancer-v2-buy → 2.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/abi/uniswap-v3/UniswapV3Pool.abi.json +363 -67
- package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +119 -23
- package/build/abi/uniswap-v3/pancakeswap-v3/PancakeswapV3QuoterV2.abi.json +285 -0
- package/build/abi/uniswap-v3/pancakeswap-v3/PancakeswapV3Router.abi.json +583 -0
- package/build/config.js +5 -5
- package/build/config.js.map +1 -1
- package/build/dex/balancer-v2/balancer-v2.d.ts +8 -2
- package/build/dex/balancer-v2/balancer-v2.js +7 -1
- package/build/dex/balancer-v2/balancer-v2.js.map +1 -1
- package/build/dex/balancer-v2/config.d.ts +7 -2
- package/build/dex/balancer-v2/config.js +30 -20
- package/build/dex/balancer-v2/config.js.map +1 -1
- package/build/dex/index.js +2 -0
- package/build/dex/index.js.map +1 -1
- package/build/dex/uniswap-v3/config.js +38 -0
- package/build/dex/uniswap-v3/config.js.map +1 -1
- package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.d.ts +12 -0
- package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.js +23 -0
- package/build/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.js.map +1 -0
- package/build/dex/uniswap-v3/types.d.ts +3 -0
- package/build/dex/uniswap-v3/types.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3-pool.d.ts +2 -1
- package/build/dex/uniswap-v3/uniswap-v3-pool.js +3 -2
- package/build/dex/uniswap-v3/uniswap-v3-pool.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3.js +6 -3
- package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/uniswap-v3/UniswapV3Pool.abi.json +363 -67
- package/src/abi/uniswap-v3/UniswapV3Quoter.abi.json +119 -23
- package/src/abi/uniswap-v3/pancakeswap-v3/PancakeswapV3QuoterV2.abi.json +285 -0
- package/src/abi/uniswap-v3/pancakeswap-v3/PancakeswapV3Router.abi.json +583 -0
- package/src/config.ts +5 -6
- package/src/dex/balancer-v2/balancer-v2-e2e.test.ts +7 -14
- package/src/dex/balancer-v2/balancer-v2.ts +4 -1
- package/src/dex/balancer-v2/config.ts +35 -23
- package/src/dex/index.ts +2 -0
- package/src/dex/uniswap-v3/config.ts +46 -0
- package/src/dex/uniswap-v3/forks/pancakeswap-v3/pancakeswap-v3.ts +28 -0
- package/src/dex/uniswap-v3/types.ts +3 -0
- package/src/dex/uniswap-v3/uniswap-v3-e2e.test.ts +156 -0
- package/src/dex/uniswap-v3/uniswap-v3-pool.ts +3 -2
- package/src/dex/uniswap-v3/uniswap-v3.ts +7 -3
- package/.idea/aws.xml +0 -17
- package/.idea/codeStyles/Project.xml +0 -19
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/paraswap-dex-lib.iml +0 -9
- package/.idea/runConfigurations.xml +0 -10
- package/.idea/vcs.xml +0 -6
- package/build/abi/woo-fi/WooFeeManager.abi.json +0 -318
- package/build/abi/woo-fi/WooPP.abi.json +0 -548
- package/build/abi/woo-fi/Wooracle.abi.json +0 -260
- package/build/dex/aave-v3/tokens/arbitrum.json +0 -50
- package/build/dex/aave-v3/tokens/avalanche.json +0 -74
- package/build/dex/aave-v3/tokens/fantom.json +0 -62
- package/build/dex/aave-v3/tokens/optimism.json +0 -50
- package/build/dex/aave-v3/tokens/polygon.json +0 -116
- package/build/dex/quickswap-v3.d.ts +0 -21
- package/build/dex/quickswap-v3.js +0 -40
- package/build/dex/quickswap-v3.js.map +0 -1
- package/build/dex/woo-fi/config.d.ts +0 -4
- package/build/dex/woo-fi/config.js +0 -141
- package/build/dex/woo-fi/config.js.map +0 -1
- package/build/dex/woo-fi/constants.d.ts +0 -5
- package/build/dex/woo-fi/constants.js +0 -20
- package/build/dex/woo-fi/constants.js.map +0 -1
- package/build/dex/woo-fi/types.d.ts +0 -48
- package/build/dex/woo-fi/types.js +0 -3
- package/build/dex/woo-fi/types.js.map +0 -1
- package/build/dex/woo-fi/woo-fi-decimal-math.d.ts +0 -14
- package/build/dex/woo-fi/woo-fi-decimal-math.js +0 -42
- package/build/dex/woo-fi/woo-fi-decimal-math.js.map +0 -1
- package/build/dex/woo-fi/woo-fi-math.d.ts +0 -31
- package/build/dex/woo-fi/woo-fi-math.js +0 -300
- package/build/dex/woo-fi/woo-fi-math.js.map +0 -1
- package/build/dex/woo-fi/woo-fi.d.ts +0 -65
- package/build/dex/woo-fi/woo-fi.js +0 -480
- package/build/dex/woo-fi/woo-fi.js.map +0 -1
|
@@ -0,0 +1,583 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{
|
|
5
|
+
"internalType": "address",
|
|
6
|
+
"name": "_deployer",
|
|
7
|
+
"type": "address"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"internalType": "address",
|
|
11
|
+
"name": "_factory",
|
|
12
|
+
"type": "address"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"internalType": "address",
|
|
16
|
+
"name": "_WETH9",
|
|
17
|
+
"type": "address"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"stateMutability": "nonpayable",
|
|
21
|
+
"type": "constructor"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"inputs": [],
|
|
25
|
+
"name": "WETH9",
|
|
26
|
+
"outputs": [
|
|
27
|
+
{
|
|
28
|
+
"internalType": "address",
|
|
29
|
+
"name": "",
|
|
30
|
+
"type": "address"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"stateMutability": "view",
|
|
34
|
+
"type": "function"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"inputs": [],
|
|
38
|
+
"name": "deployer",
|
|
39
|
+
"outputs": [
|
|
40
|
+
{
|
|
41
|
+
"internalType": "address",
|
|
42
|
+
"name": "",
|
|
43
|
+
"type": "address"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"stateMutability": "view",
|
|
47
|
+
"type": "function"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"inputs": [
|
|
51
|
+
{
|
|
52
|
+
"components": [
|
|
53
|
+
{
|
|
54
|
+
"internalType": "bytes",
|
|
55
|
+
"name": "path",
|
|
56
|
+
"type": "bytes"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"internalType": "address",
|
|
60
|
+
"name": "recipient",
|
|
61
|
+
"type": "address"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"internalType": "uint256",
|
|
65
|
+
"name": "deadline",
|
|
66
|
+
"type": "uint256"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"internalType": "uint256",
|
|
70
|
+
"name": "amountIn",
|
|
71
|
+
"type": "uint256"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"internalType": "uint256",
|
|
75
|
+
"name": "amountOutMinimum",
|
|
76
|
+
"type": "uint256"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"internalType": "struct ISwapRouter.ExactInputParams",
|
|
80
|
+
"name": "params",
|
|
81
|
+
"type": "tuple"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"name": "exactInput",
|
|
85
|
+
"outputs": [
|
|
86
|
+
{
|
|
87
|
+
"internalType": "uint256",
|
|
88
|
+
"name": "amountOut",
|
|
89
|
+
"type": "uint256"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"stateMutability": "payable",
|
|
93
|
+
"type": "function"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"inputs": [
|
|
97
|
+
{
|
|
98
|
+
"components": [
|
|
99
|
+
{
|
|
100
|
+
"internalType": "address",
|
|
101
|
+
"name": "tokenIn",
|
|
102
|
+
"type": "address"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"internalType": "address",
|
|
106
|
+
"name": "tokenOut",
|
|
107
|
+
"type": "address"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"internalType": "uint24",
|
|
111
|
+
"name": "fee",
|
|
112
|
+
"type": "uint24"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"internalType": "address",
|
|
116
|
+
"name": "recipient",
|
|
117
|
+
"type": "address"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"internalType": "uint256",
|
|
121
|
+
"name": "deadline",
|
|
122
|
+
"type": "uint256"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"internalType": "uint256",
|
|
126
|
+
"name": "amountIn",
|
|
127
|
+
"type": "uint256"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"internalType": "uint256",
|
|
131
|
+
"name": "amountOutMinimum",
|
|
132
|
+
"type": "uint256"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"internalType": "uint160",
|
|
136
|
+
"name": "sqrtPriceLimitX96",
|
|
137
|
+
"type": "uint160"
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"internalType": "struct ISwapRouter.ExactInputSingleParams",
|
|
141
|
+
"name": "params",
|
|
142
|
+
"type": "tuple"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"name": "exactInputSingle",
|
|
146
|
+
"outputs": [
|
|
147
|
+
{
|
|
148
|
+
"internalType": "uint256",
|
|
149
|
+
"name": "amountOut",
|
|
150
|
+
"type": "uint256"
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"stateMutability": "payable",
|
|
154
|
+
"type": "function"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"inputs": [
|
|
158
|
+
{
|
|
159
|
+
"components": [
|
|
160
|
+
{
|
|
161
|
+
"internalType": "bytes",
|
|
162
|
+
"name": "path",
|
|
163
|
+
"type": "bytes"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"internalType": "address",
|
|
167
|
+
"name": "recipient",
|
|
168
|
+
"type": "address"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"internalType": "uint256",
|
|
172
|
+
"name": "deadline",
|
|
173
|
+
"type": "uint256"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"internalType": "uint256",
|
|
177
|
+
"name": "amountOut",
|
|
178
|
+
"type": "uint256"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"internalType": "uint256",
|
|
182
|
+
"name": "amountInMaximum",
|
|
183
|
+
"type": "uint256"
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
"internalType": "struct ISwapRouter.ExactOutputParams",
|
|
187
|
+
"name": "params",
|
|
188
|
+
"type": "tuple"
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"name": "exactOutput",
|
|
192
|
+
"outputs": [
|
|
193
|
+
{
|
|
194
|
+
"internalType": "uint256",
|
|
195
|
+
"name": "amountIn",
|
|
196
|
+
"type": "uint256"
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"stateMutability": "payable",
|
|
200
|
+
"type": "function"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"inputs": [
|
|
204
|
+
{
|
|
205
|
+
"components": [
|
|
206
|
+
{
|
|
207
|
+
"internalType": "address",
|
|
208
|
+
"name": "tokenIn",
|
|
209
|
+
"type": "address"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"internalType": "address",
|
|
213
|
+
"name": "tokenOut",
|
|
214
|
+
"type": "address"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"internalType": "uint24",
|
|
218
|
+
"name": "fee",
|
|
219
|
+
"type": "uint24"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"internalType": "address",
|
|
223
|
+
"name": "recipient",
|
|
224
|
+
"type": "address"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"internalType": "uint256",
|
|
228
|
+
"name": "deadline",
|
|
229
|
+
"type": "uint256"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"internalType": "uint256",
|
|
233
|
+
"name": "amountOut",
|
|
234
|
+
"type": "uint256"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"internalType": "uint256",
|
|
238
|
+
"name": "amountInMaximum",
|
|
239
|
+
"type": "uint256"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"internalType": "uint160",
|
|
243
|
+
"name": "sqrtPriceLimitX96",
|
|
244
|
+
"type": "uint160"
|
|
245
|
+
}
|
|
246
|
+
],
|
|
247
|
+
"internalType": "struct ISwapRouter.ExactOutputSingleParams",
|
|
248
|
+
"name": "params",
|
|
249
|
+
"type": "tuple"
|
|
250
|
+
}
|
|
251
|
+
],
|
|
252
|
+
"name": "exactOutputSingle",
|
|
253
|
+
"outputs": [
|
|
254
|
+
{
|
|
255
|
+
"internalType": "uint256",
|
|
256
|
+
"name": "amountIn",
|
|
257
|
+
"type": "uint256"
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
"stateMutability": "payable",
|
|
261
|
+
"type": "function"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"inputs": [],
|
|
265
|
+
"name": "factory",
|
|
266
|
+
"outputs": [
|
|
267
|
+
{
|
|
268
|
+
"internalType": "address",
|
|
269
|
+
"name": "",
|
|
270
|
+
"type": "address"
|
|
271
|
+
}
|
|
272
|
+
],
|
|
273
|
+
"stateMutability": "view",
|
|
274
|
+
"type": "function"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"inputs": [
|
|
278
|
+
{
|
|
279
|
+
"internalType": "bytes[]",
|
|
280
|
+
"name": "data",
|
|
281
|
+
"type": "bytes[]"
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
"name": "multicall",
|
|
285
|
+
"outputs": [
|
|
286
|
+
{
|
|
287
|
+
"internalType": "bytes[]",
|
|
288
|
+
"name": "results",
|
|
289
|
+
"type": "bytes[]"
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
"stateMutability": "payable",
|
|
293
|
+
"type": "function"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"inputs": [
|
|
297
|
+
{
|
|
298
|
+
"internalType": "int256",
|
|
299
|
+
"name": "amount0Delta",
|
|
300
|
+
"type": "int256"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"internalType": "int256",
|
|
304
|
+
"name": "amount1Delta",
|
|
305
|
+
"type": "int256"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"internalType": "bytes",
|
|
309
|
+
"name": "_data",
|
|
310
|
+
"type": "bytes"
|
|
311
|
+
}
|
|
312
|
+
],
|
|
313
|
+
"name": "pancakeV3SwapCallback",
|
|
314
|
+
"outputs": [],
|
|
315
|
+
"stateMutability": "nonpayable",
|
|
316
|
+
"type": "function"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"inputs": [],
|
|
320
|
+
"name": "refundETH",
|
|
321
|
+
"outputs": [],
|
|
322
|
+
"stateMutability": "payable",
|
|
323
|
+
"type": "function"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"inputs": [
|
|
327
|
+
{
|
|
328
|
+
"internalType": "address",
|
|
329
|
+
"name": "token",
|
|
330
|
+
"type": "address"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"internalType": "uint256",
|
|
334
|
+
"name": "value",
|
|
335
|
+
"type": "uint256"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"internalType": "uint256",
|
|
339
|
+
"name": "deadline",
|
|
340
|
+
"type": "uint256"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"internalType": "uint8",
|
|
344
|
+
"name": "v",
|
|
345
|
+
"type": "uint8"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"internalType": "bytes32",
|
|
349
|
+
"name": "r",
|
|
350
|
+
"type": "bytes32"
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"internalType": "bytes32",
|
|
354
|
+
"name": "s",
|
|
355
|
+
"type": "bytes32"
|
|
356
|
+
}
|
|
357
|
+
],
|
|
358
|
+
"name": "selfPermit",
|
|
359
|
+
"outputs": [],
|
|
360
|
+
"stateMutability": "payable",
|
|
361
|
+
"type": "function"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"inputs": [
|
|
365
|
+
{
|
|
366
|
+
"internalType": "address",
|
|
367
|
+
"name": "token",
|
|
368
|
+
"type": "address"
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"internalType": "uint256",
|
|
372
|
+
"name": "nonce",
|
|
373
|
+
"type": "uint256"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"internalType": "uint256",
|
|
377
|
+
"name": "expiry",
|
|
378
|
+
"type": "uint256"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"internalType": "uint8",
|
|
382
|
+
"name": "v",
|
|
383
|
+
"type": "uint8"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"internalType": "bytes32",
|
|
387
|
+
"name": "r",
|
|
388
|
+
"type": "bytes32"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"internalType": "bytes32",
|
|
392
|
+
"name": "s",
|
|
393
|
+
"type": "bytes32"
|
|
394
|
+
}
|
|
395
|
+
],
|
|
396
|
+
"name": "selfPermitAllowed",
|
|
397
|
+
"outputs": [],
|
|
398
|
+
"stateMutability": "payable",
|
|
399
|
+
"type": "function"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"inputs": [
|
|
403
|
+
{
|
|
404
|
+
"internalType": "address",
|
|
405
|
+
"name": "token",
|
|
406
|
+
"type": "address"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"internalType": "uint256",
|
|
410
|
+
"name": "nonce",
|
|
411
|
+
"type": "uint256"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"internalType": "uint256",
|
|
415
|
+
"name": "expiry",
|
|
416
|
+
"type": "uint256"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"internalType": "uint8",
|
|
420
|
+
"name": "v",
|
|
421
|
+
"type": "uint8"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"internalType": "bytes32",
|
|
425
|
+
"name": "r",
|
|
426
|
+
"type": "bytes32"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"internalType": "bytes32",
|
|
430
|
+
"name": "s",
|
|
431
|
+
"type": "bytes32"
|
|
432
|
+
}
|
|
433
|
+
],
|
|
434
|
+
"name": "selfPermitAllowedIfNecessary",
|
|
435
|
+
"outputs": [],
|
|
436
|
+
"stateMutability": "payable",
|
|
437
|
+
"type": "function"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"inputs": [
|
|
441
|
+
{
|
|
442
|
+
"internalType": "address",
|
|
443
|
+
"name": "token",
|
|
444
|
+
"type": "address"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"internalType": "uint256",
|
|
448
|
+
"name": "value",
|
|
449
|
+
"type": "uint256"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"internalType": "uint256",
|
|
453
|
+
"name": "deadline",
|
|
454
|
+
"type": "uint256"
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"internalType": "uint8",
|
|
458
|
+
"name": "v",
|
|
459
|
+
"type": "uint8"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"internalType": "bytes32",
|
|
463
|
+
"name": "r",
|
|
464
|
+
"type": "bytes32"
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
"internalType": "bytes32",
|
|
468
|
+
"name": "s",
|
|
469
|
+
"type": "bytes32"
|
|
470
|
+
}
|
|
471
|
+
],
|
|
472
|
+
"name": "selfPermitIfNecessary",
|
|
473
|
+
"outputs": [],
|
|
474
|
+
"stateMutability": "payable",
|
|
475
|
+
"type": "function"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"inputs": [
|
|
479
|
+
{
|
|
480
|
+
"internalType": "address",
|
|
481
|
+
"name": "token",
|
|
482
|
+
"type": "address"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"internalType": "uint256",
|
|
486
|
+
"name": "amountMinimum",
|
|
487
|
+
"type": "uint256"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"internalType": "address",
|
|
491
|
+
"name": "recipient",
|
|
492
|
+
"type": "address"
|
|
493
|
+
}
|
|
494
|
+
],
|
|
495
|
+
"name": "sweepToken",
|
|
496
|
+
"outputs": [],
|
|
497
|
+
"stateMutability": "payable",
|
|
498
|
+
"type": "function"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
"inputs": [
|
|
502
|
+
{
|
|
503
|
+
"internalType": "address",
|
|
504
|
+
"name": "token",
|
|
505
|
+
"type": "address"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"internalType": "uint256",
|
|
509
|
+
"name": "amountMinimum",
|
|
510
|
+
"type": "uint256"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"internalType": "address",
|
|
514
|
+
"name": "recipient",
|
|
515
|
+
"type": "address"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"internalType": "uint256",
|
|
519
|
+
"name": "feeBips",
|
|
520
|
+
"type": "uint256"
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
"internalType": "address",
|
|
524
|
+
"name": "feeRecipient",
|
|
525
|
+
"type": "address"
|
|
526
|
+
}
|
|
527
|
+
],
|
|
528
|
+
"name": "sweepTokenWithFee",
|
|
529
|
+
"outputs": [],
|
|
530
|
+
"stateMutability": "payable",
|
|
531
|
+
"type": "function"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"inputs": [
|
|
535
|
+
{
|
|
536
|
+
"internalType": "uint256",
|
|
537
|
+
"name": "amountMinimum",
|
|
538
|
+
"type": "uint256"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"internalType": "address",
|
|
542
|
+
"name": "recipient",
|
|
543
|
+
"type": "address"
|
|
544
|
+
}
|
|
545
|
+
],
|
|
546
|
+
"name": "unwrapWETH9",
|
|
547
|
+
"outputs": [],
|
|
548
|
+
"stateMutability": "payable",
|
|
549
|
+
"type": "function"
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
"inputs": [
|
|
553
|
+
{
|
|
554
|
+
"internalType": "uint256",
|
|
555
|
+
"name": "amountMinimum",
|
|
556
|
+
"type": "uint256"
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
"internalType": "address",
|
|
560
|
+
"name": "recipient",
|
|
561
|
+
"type": "address"
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
"internalType": "uint256",
|
|
565
|
+
"name": "feeBips",
|
|
566
|
+
"type": "uint256"
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
"internalType": "address",
|
|
570
|
+
"name": "feeRecipient",
|
|
571
|
+
"type": "address"
|
|
572
|
+
}
|
|
573
|
+
],
|
|
574
|
+
"name": "unwrapWETH9WithFee",
|
|
575
|
+
"outputs": [],
|
|
576
|
+
"stateMutability": "payable",
|
|
577
|
+
"type": "function"
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
"stateMutability": "payable",
|
|
581
|
+
"type": "receive"
|
|
582
|
+
}
|
|
583
|
+
]
|
package/src/config.ts
CHANGED
|
@@ -40,17 +40,17 @@ const baseConfigs: { [network: number]: BaseConfig } = {
|
|
|
40
40
|
nativeTokenSymbol: 'ETH',
|
|
41
41
|
wrappedNativeTokenAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
42
42
|
hasEIP1559: true,
|
|
43
|
-
augustusAddress: '
|
|
43
|
+
augustusAddress: '0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57',
|
|
44
44
|
augustusRFQAddress: '0xe92b586627ccA7a83dC919cc7127196d70f55a06',
|
|
45
45
|
tokenTransferProxyAddress: '0x216b4b4ba9f3e719726886d34a177484278bfcae',
|
|
46
46
|
multicallV2Address: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696',
|
|
47
47
|
privateHttpProvider: process.env.HTTP_PROVIDER_1,
|
|
48
48
|
adapterAddresses: {
|
|
49
|
-
Adapter01: '
|
|
50
|
-
Adapter02: '
|
|
49
|
+
Adapter01: '0x9bE264469eF954c139Da4A45Cf76CbCC5e3A6A73',
|
|
50
|
+
Adapter02: '0xFC2Ba6E830a04C25e207B8214b26d8C713F6881F',
|
|
51
51
|
Adapter03: '0x7c7f62e5ba00783f57b39df0530e32c195696a57',
|
|
52
|
-
Adapter04: '
|
|
53
|
-
BuyAdapter: '
|
|
52
|
+
Adapter04: '0x21ab8aeb35bfc0b3fd84ca810b0aa85938357be2',
|
|
53
|
+
BuyAdapter: '0x760870be538e7b4E2110e2890473CC17ADB1fdC1',
|
|
54
54
|
},
|
|
55
55
|
uniswapV2ExchangeRouterAddress:
|
|
56
56
|
'0xF9234CB08edb93c0d4a4d4c70cC3FfD070e78e07',
|
|
@@ -313,7 +313,6 @@ export function generateConfig(network: number): Config {
|
|
|
313
313
|
if (!baseConfig) {
|
|
314
314
|
throw new Error(`No configuration found for network ${network}`);
|
|
315
315
|
}
|
|
316
|
-
|
|
317
316
|
const nativeTokenName =
|
|
318
317
|
baseConfig.nativeTokenName || baseConfig.nativeTokenSymbol;
|
|
319
318
|
if (!baseConfig.privateHttpProvider) {
|
|
@@ -2,10 +2,9 @@ import dotenv from 'dotenv';
|
|
|
2
2
|
dotenv.config();
|
|
3
3
|
|
|
4
4
|
import { testE2E } from '../../../tests/utils-e2e';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Tokens, Holders } from '../../../tests/constants-e2e';
|
|
6
|
+
import { Network, ContractMethod, SwapSide } from '../../constants';
|
|
7
7
|
import { StaticJsonRpcProvider } from '@ethersproject/providers';
|
|
8
|
-
|
|
9
8
|
import { generateConfig } from '../../config';
|
|
10
9
|
|
|
11
10
|
jest.setTimeout(50 * 1000);
|
|
@@ -31,18 +30,12 @@ describe('BalancerV2 E2E', () => {
|
|
|
31
30
|
ContractMethod.megaSwap,
|
|
32
31
|
],
|
|
33
32
|
],
|
|
34
|
-
[
|
|
35
|
-
SwapSide.BUY,
|
|
36
|
-
[
|
|
37
|
-
ContractMethod.simpleBuy, ContractMethod.buy,
|
|
38
|
-
],
|
|
39
|
-
]
|
|
40
33
|
]);
|
|
41
34
|
|
|
42
|
-
const pairs: { name: string;
|
|
35
|
+
const pairs: { name: string; sellAmount: string }[][] = [
|
|
43
36
|
[
|
|
44
|
-
{ name: 'USDC',
|
|
45
|
-
{ name: 'dUSDC',
|
|
37
|
+
{ name: 'USDC', sellAmount: '1000000000' },
|
|
38
|
+
{ name: 'dUSDC', sellAmount: '1000000000' },
|
|
46
39
|
],
|
|
47
40
|
];
|
|
48
41
|
|
|
@@ -56,7 +49,7 @@ describe('BalancerV2 E2E', () => {
|
|
|
56
49
|
tokens[pair[0].name],
|
|
57
50
|
tokens[pair[1].name],
|
|
58
51
|
holders[pair[0].name],
|
|
59
|
-
pair[0].
|
|
52
|
+
pair[0].sellAmount,
|
|
60
53
|
side,
|
|
61
54
|
dexKey,
|
|
62
55
|
contractMethod,
|
|
@@ -69,7 +62,7 @@ describe('BalancerV2 E2E', () => {
|
|
|
69
62
|
tokens[pair[1].name],
|
|
70
63
|
tokens[pair[0].name],
|
|
71
64
|
holders[pair[1].name],
|
|
72
|
-
pair[1].
|
|
65
|
+
pair[1].sellAmount,
|
|
73
66
|
side,
|
|
74
67
|
dexKey,
|
|
75
68
|
contractMethod,
|
|
@@ -618,7 +618,8 @@ export class BalancerV2
|
|
|
618
618
|
}
|
|
619
619
|
|
|
620
620
|
getAdapters(side: SwapSide): { name: string; index: number }[] | null {
|
|
621
|
-
|
|
621
|
+
if (side === SwapSide.BUY) return null;
|
|
622
|
+
return this.adapters;
|
|
622
623
|
}
|
|
623
624
|
|
|
624
625
|
async getPoolIdentifiers(
|
|
@@ -627,6 +628,7 @@ export class BalancerV2
|
|
|
627
628
|
side: SwapSide,
|
|
628
629
|
blockNumber: number,
|
|
629
630
|
): Promise<string[]> {
|
|
631
|
+
if (side === SwapSide.BUY) return [];
|
|
630
632
|
const _from = this.dexHelper.config.wrapETH(from);
|
|
631
633
|
const _to = this.dexHelper.config.wrapETH(to);
|
|
632
634
|
|
|
@@ -674,6 +676,7 @@ export class BalancerV2
|
|
|
674
676
|
blockNumber: number,
|
|
675
677
|
limitPools?: string[],
|
|
676
678
|
): Promise<null | ExchangePrices<BalancerV2Data>> {
|
|
679
|
+
if (side === SwapSide.BUY) return null;
|
|
677
680
|
try {
|
|
678
681
|
const _from = this.dexHelper.config.wrapETH(from);
|
|
679
682
|
const _to = this.dexHelper.config.wrapETH(to);
|