@gearbox-protocol/sdk 2.1.25 → 2.1.27

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.
@@ -1,26 +0,0 @@
1
- // SPDX-License-Identifier: UNLICENSED
2
- // Gearbox. Generalized leverage protocol that allows to take leverage and then use it across other DeFi protocols and platforms in a composable way.
3
- // (c) Gearbox Foundation, 2023
4
- pragma solidity ^0.8.17;
5
-
6
- enum PriceFeedType {
7
- CHAINLINK_ORACLE,
8
- YEARN_ORACLE,
9
- CURVE_2LP_ORACLE,
10
- CURVE_3LP_ORACLE,
11
- CURVE_4LP_ORACLE,
12
- ZERO_ORACLE,
13
- WSTETH_ORACLE,
14
- BOUNDED_ORACLE,
15
- COMPOSITE_ORACLE,
16
- WRAPPED_AAVE_V2_ORACLE,
17
- COMPOUND_V2_ORACLE,
18
- BALANCER_STABLE_LP_ORACLE,
19
- BALANCER_WEIGHTED_LP_ORACLE,
20
- CURVE_CRYPTO_ORACLE,
21
- THE_SAME_AS,
22
- REDSTONE_ORACLE,
23
- ERC4626_VAULT_ORACLE,
24
- NETWORK_DEPENDENT,
25
- CURVE_USD_ORACLE
26
- }
@@ -1,423 +0,0 @@
1
- // SPDX-License-Identifier: UNLICENSED
2
- // Gearbox. Generalized leverage protocol that allows to take leverage and then use it across other DeFi protocols and platforms in a composable way.
3
- // (c) Gearbox Foundation, 2023
4
- pragma solidity ^0.8.17;
5
-
6
- import {Test} from "forge-std/Test.sol";
7
- import {Contracts} from "./ContractType.sol";
8
-
9
- struct ContractData {
10
- Contracts id;
11
- address addr;
12
- string name;
13
- }
14
-
15
- interface ISupportedContracts {
16
- function addressOf(Contracts c) external view returns (address);
17
-
18
- function nameOf(Contracts c) external view returns (string memory);
19
-
20
- function contractIndex(address) external view returns (Contracts);
21
-
22
- function contractCount() external view returns (uint256);
23
- }
24
-
25
- contract SupportedContracts is Test, ISupportedContracts {
26
- mapping(Contracts => address) public override addressOf;
27
- mapping(Contracts => string) public override nameOf;
28
- mapping(address => Contracts) public override contractIndex;
29
- mapping(uint256 => ContractData[]) public contractDataByNetwork;
30
-
31
- uint256 public override contractCount;
32
-
33
- constructor(uint256 _chainId) {
34
- contractDataByNetwork[1].push(
35
- ContractData({
36
- id: Contracts.UNISWAP_V2_ROUTER,
37
- addr: 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D,
38
- name: "UNISWAP_V2_ROUTER"
39
- })
40
- );
41
- contractDataByNetwork[1].push(
42
- ContractData({
43
- id: Contracts.UNISWAP_V3_ROUTER,
44
- addr: 0xE592427A0AEce92De3Edee1F18E0157C05861564,
45
- name: "UNISWAP_V3_ROUTER"
46
- })
47
- );
48
- contractDataByNetwork[1].push(
49
- ContractData({
50
- id: Contracts.SUSHISWAP_ROUTER,
51
- addr: 0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F,
52
- name: "SUSHISWAP_ROUTER"
53
- })
54
- );
55
- contractDataByNetwork[1].push(
56
- ContractData({
57
- id: Contracts.CURVE_3CRV_POOL,
58
- addr: 0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7,
59
- name: "CURVE_3CRV_POOL"
60
- })
61
- );
62
- contractDataByNetwork[1].push(
63
- ContractData({
64
- id: Contracts.CURVE_FRAX_USDC_POOL,
65
- addr: 0xDcEF968d416a41Cdac0ED8702fAC8128A64241A2,
66
- name: "CURVE_FRAX_USDC_POOL"
67
- })
68
- );
69
- contractDataByNetwork[1].push(
70
- ContractData({
71
- id: Contracts.CURVE_STETH_GATEWAY,
72
- addr: 0xEf0D72C594b28252BF7Ea2bfbF098792430815b1,
73
- name: "CURVE_STETH_GATEWAY"
74
- })
75
- );
76
- contractDataByNetwork[1].push(
77
- ContractData({
78
- id: Contracts.CURVE_FRAX_POOL,
79
- addr: 0xd632f22692FaC7611d2AA1C0D552930D43CAEd3B,
80
- name: "CURVE_FRAX_POOL"
81
- })
82
- );
83
- contractDataByNetwork[1].push(
84
- ContractData({
85
- id: Contracts.CURVE_LUSD_POOL,
86
- addr: 0xEd279fDD11cA84bEef15AF5D39BB4d4bEE23F0cA,
87
- name: "CURVE_LUSD_POOL"
88
- })
89
- );
90
- contractDataByNetwork[1].push(
91
- ContractData({
92
- id: Contracts.CURVE_SUSD_POOL,
93
- addr: 0xA5407eAE9Ba41422680e2e00537571bcC53efBfD,
94
- name: "CURVE_SUSD_POOL"
95
- })
96
- );
97
- contractDataByNetwork[1].push(
98
- ContractData({
99
- id: Contracts.CURVE_SUSD_DEPOSIT,
100
- addr: 0xFCBa3E75865d2d561BE8D220616520c171F12851,
101
- name: "CURVE_SUSD_DEPOSIT"
102
- })
103
- );
104
- contractDataByNetwork[1].push(
105
- ContractData({
106
- id: Contracts.CURVE_GUSD_POOL,
107
- addr: 0x4f062658EaAF2C1ccf8C8e36D6824CDf41167956,
108
- name: "CURVE_GUSD_POOL"
109
- })
110
- );
111
- contractDataByNetwork[1].push(
112
- ContractData({
113
- id: Contracts.CURVE_MIM_POOL,
114
- addr: 0x5a6A4D54456819380173272A5E8E9B9904BdF41B,
115
- name: "CURVE_MIM_POOL"
116
- })
117
- );
118
- contractDataByNetwork[1].push(
119
- ContractData({
120
- id: Contracts.CURVE_OHMFRAXBP_POOL,
121
- addr: 0xFc1e8bf3E81383Ef07Be24c3FD146745719DE48D,
122
- name: "CURVE_OHMFRAXBP_POOL"
123
- })
124
- );
125
- contractDataByNetwork[1].push(
126
- ContractData({
127
- id: Contracts.CURVE_CRVETH_POOL,
128
- addr: 0x8301AE4fc9c624d1D396cbDAa1ed877821D7C511,
129
- name: "CURVE_CRVETH_POOL"
130
- })
131
- );
132
- contractDataByNetwork[1].push(
133
- ContractData({
134
- id: Contracts.CURVE_CVXETH_POOL,
135
- addr: 0xB576491F1E6e5E62f1d8F26062Ee822B40B0E0d4,
136
- name: "CURVE_CVXETH_POOL"
137
- })
138
- );
139
- contractDataByNetwork[1].push(
140
- ContractData({
141
- id: Contracts.CURVE_3CRYPTO_POOL,
142
- addr: 0xf5f5B97624542D72A9E06f04804Bf81baA15e2B4,
143
- name: "CURVE_3CRYPTO_POOL"
144
- })
145
- );
146
- contractDataByNetwork[1].push(
147
- ContractData({
148
- id: Contracts.CURVE_LDOETH_POOL,
149
- addr: 0x9409280DC1e6D33AB7A8C6EC03e5763FB61772B5,
150
- name: "CURVE_LDOETH_POOL"
151
- })
152
- );
153
- contractDataByNetwork[1].push(
154
- ContractData({
155
- id: Contracts.CURVE_GEAR_POOL,
156
- addr: 0x0E9B5B092caD6F1c5E6bc7f89Ffe1abb5c95F1C2,
157
- name: "CURVE_GEAR_POOL"
158
- })
159
- );
160
- contractDataByNetwork[1].push(
161
- ContractData({
162
- id: Contracts.CURVE_CRVUSD_USDC_POOL,
163
- addr: 0x4DEcE678ceceb27446b35C672dC7d61F30bAD69E,
164
- name: "CURVE_CRVUSD_USDC_POOL"
165
- })
166
- );
167
- contractDataByNetwork[1].push(
168
- ContractData({
169
- id: Contracts.CURVE_CRVUSD_USDT_POOL,
170
- addr: 0x390f3595bCa2Df7d23783dFd126427CCeb997BF4,
171
- name: "CURVE_CRVUSD_USDT_POOL"
172
- })
173
- );
174
- contractDataByNetwork[1].push(
175
- ContractData({
176
- id: Contracts.CURVE_CRVUSD_FRAX_POOL,
177
- addr: 0x0CD6f267b2086bea681E922E19D40512511BE538,
178
- name: "CURVE_CRVUSD_FRAX_POOL"
179
- })
180
- );
181
- contractDataByNetwork[1].push(
182
- ContractData({
183
- id: Contracts.CURVE_TRI_CRV_POOL,
184
- addr: 0x4eBdF703948ddCEA3B11f675B4D1Fba9d2414A14,
185
- name: "CURVE_TRI_CRV_POOL"
186
- })
187
- );
188
- contractDataByNetwork[1].push(
189
- ContractData({
190
- id: Contracts.YEARN_DAI_VAULT,
191
- addr: 0xdA816459F1AB5631232FE5e97a05BBBb94970c95,
192
- name: "YEARN_DAI_VAULT"
193
- })
194
- );
195
- contractDataByNetwork[1].push(
196
- ContractData({
197
- id: Contracts.YEARN_USDC_VAULT,
198
- addr: 0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE,
199
- name: "YEARN_USDC_VAULT"
200
- })
201
- );
202
- contractDataByNetwork[1].push(
203
- ContractData({
204
- id: Contracts.YEARN_WETH_VAULT,
205
- addr: 0xa258C4606Ca8206D8aA700cE2143D7db854D168c,
206
- name: "YEARN_WETH_VAULT"
207
- })
208
- );
209
- contractDataByNetwork[1].push(
210
- ContractData({
211
- id: Contracts.YEARN_WBTC_VAULT,
212
- addr: 0xA696a63cc78DfFa1a63E9E50587C197387FF6C7E,
213
- name: "YEARN_WBTC_VAULT"
214
- })
215
- );
216
- contractDataByNetwork[1].push(
217
- ContractData({
218
- id: Contracts.YEARN_CURVE_FRAX_VAULT,
219
- addr: 0xB4AdA607B9d6b2c9Ee07A275e9616B84AC560139,
220
- name: "YEARN_CURVE_FRAX_VAULT"
221
- })
222
- );
223
- contractDataByNetwork[1].push(
224
- ContractData({
225
- id: Contracts.YEARN_CURVE_STETH_VAULT,
226
- addr: 0xdCD90C7f6324cfa40d7169ef80b12031770B4325,
227
- name: "YEARN_CURVE_STETH_VAULT"
228
- })
229
- );
230
- contractDataByNetwork[1].push(
231
- ContractData({
232
- id: Contracts.CONVEX_BOOSTER,
233
- addr: 0xF403C135812408BFbE8713b5A23a04b3D48AAE31,
234
- name: "CONVEX_BOOSTER"
235
- })
236
- );
237
- contractDataByNetwork[1].push(
238
- ContractData({
239
- id: Contracts.CONVEX_3CRV_POOL,
240
- addr: 0x689440f2Ff927E1f24c72F1087E1FAF471eCe1c8,
241
- name: "CONVEX_3CRV_POOL"
242
- })
243
- );
244
- contractDataByNetwork[1].push(
245
- ContractData({
246
- id: Contracts.CONVEX_FRAX_USDC_POOL,
247
- addr: 0x7e880867363A7e321f5d260Cade2B0Bb2F717B02,
248
- name: "CONVEX_FRAX_USDC_POOL"
249
- })
250
- );
251
- contractDataByNetwork[1].push(
252
- ContractData({
253
- id: Contracts.CONVEX_GUSD_POOL,
254
- addr: 0x7A7bBf95C44b144979360C3300B54A7D34b44985,
255
- name: "CONVEX_GUSD_POOL"
256
- })
257
- );
258
- contractDataByNetwork[1].push(
259
- ContractData({
260
- id: Contracts.CONVEX_SUSD_POOL,
261
- addr: 0x22eE18aca7F3Ee920D01F25dA85840D12d98E8Ca,
262
- name: "CONVEX_SUSD_POOL"
263
- })
264
- );
265
- contractDataByNetwork[1].push(
266
- ContractData({
267
- id: Contracts.CONVEX_STECRV_POOL,
268
- addr: 0x0A760466E1B4621579a82a39CB56Dda2F4E70f03,
269
- name: "CONVEX_STECRV_POOL"
270
- })
271
- );
272
- contractDataByNetwork[1].push(
273
- ContractData({
274
- id: Contracts.CONVEX_FRAX3CRV_POOL,
275
- addr: 0xB900EF131301B307dB5eFcbed9DBb50A3e209B2e,
276
- name: "CONVEX_FRAX3CRV_POOL"
277
- })
278
- );
279
- contractDataByNetwork[1].push(
280
- ContractData({
281
- id: Contracts.CONVEX_LUSD3CRV_POOL,
282
- addr: 0x2ad92A7aE036a038ff02B96c88de868ddf3f8190,
283
- name: "CONVEX_LUSD3CRV_POOL"
284
- })
285
- );
286
- contractDataByNetwork[1].push(
287
- ContractData({
288
- id: Contracts.CONVEX_CLAIM_ZAP,
289
- addr: 0x92Cf9E5e4D1Dfbf7dA0d2BB3e884a68416a65070,
290
- name: "CONVEX_CLAIM_ZAP"
291
- })
292
- );
293
- contractDataByNetwork[1].push(
294
- ContractData({
295
- id: Contracts.CONVEX_OHMFRAXBP_POOL,
296
- addr: 0x27A8c58e3DE84280826d615D80ddb33930383fE9,
297
- name: "CONVEX_OHMFRAXBP_POOL"
298
- })
299
- );
300
- contractDataByNetwork[1].push(
301
- ContractData({
302
- id: Contracts.CONVEX_MIM3CRV_POOL,
303
- addr: 0xFd5AbF66b003881b88567EB9Ed9c651F14Dc4771,
304
- name: "CONVEX_MIM3CRV_POOL"
305
- })
306
- );
307
- contractDataByNetwork[1].push(
308
- ContractData({
309
- id: Contracts.CONVEX_CRVETH_POOL,
310
- addr: 0x085A2054c51eA5c91dbF7f90d65e728c0f2A270f,
311
- name: "CONVEX_CRVETH_POOL"
312
- })
313
- );
314
- contractDataByNetwork[1].push(
315
- ContractData({
316
- id: Contracts.CONVEX_CVXETH_POOL,
317
- addr: 0xb1Fb0BA0676A1fFA83882c7F4805408bA232C1fA,
318
- name: "CONVEX_CVXETH_POOL"
319
- })
320
- );
321
- contractDataByNetwork[1].push(
322
- ContractData({
323
- id: Contracts.CONVEX_3CRYPTO_POOL,
324
- addr: 0xb05262D4aaAA38D0Af4AaB244D446ebDb5afd4A7,
325
- name: "CONVEX_3CRYPTO_POOL"
326
- })
327
- );
328
- contractDataByNetwork[1].push(
329
- ContractData({
330
- id: Contracts.CONVEX_LDOETH_POOL,
331
- addr: 0x8CA990E954611E5E3d2cc51C013fCC372c8c1D38,
332
- name: "CONVEX_LDOETH_POOL"
333
- })
334
- );
335
- contractDataByNetwork[1].push(
336
- ContractData({
337
- id: Contracts.LIDO_STETH_GATEWAY,
338
- addr: 0x6f4b4aB5142787c05b7aB9A9692A0f46b997C29D,
339
- name: "LIDO_STETH_GATEWAY"
340
- })
341
- );
342
- contractDataByNetwork[1].push(
343
- ContractData({
344
- id: Contracts.LIDO_WSTETH,
345
- addr: 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0,
346
- name: "LIDO_WSTETH"
347
- })
348
- );
349
- contractDataByNetwork[1].push(
350
- ContractData({
351
- id: Contracts.BALANCER_VAULT,
352
- addr: 0xBA12222222228d8Ba445958a75a0704d566BF2C8,
353
- name: "BALANCER_VAULT"
354
- })
355
- );
356
- contractDataByNetwork[1].push(
357
- ContractData({
358
- id: Contracts.UNIVERSAL_ADAPTER,
359
- addr: 0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC,
360
- name: "UNIVERSAL_ADAPTER"
361
- })
362
- );
363
-
364
- contractDataByNetwork[42161].push(
365
- ContractData({
366
- id: Contracts.CURVE_CRVUSD_USDC_POOL,
367
- addr: 0x4DEcE678ceceb27446b35C672dC7d61F30bAD69E,
368
- name: "CURVE_CRVUSD_USDC_POOL"
369
- })
370
- );
371
- contractDataByNetwork[42161].push(
372
- ContractData({
373
- id: Contracts.CURVE_CRVUSD_USDT_POOL,
374
- addr: 0x390f3595bCa2Df7d23783dFd126427CCeb997BF4,
375
- name: "CURVE_CRVUSD_USDT_POOL"
376
- })
377
- );
378
- contractDataByNetwork[42161].push(
379
- ContractData({
380
- id: Contracts.CURVE_CRVUSD_FRAX_POOL,
381
- addr: 0x0CD6f267b2086bea681E922E19D40512511BE538,
382
- name: "CURVE_CRVUSD_FRAX_POOL"
383
- })
384
- );
385
- contractDataByNetwork[42161].push(
386
- ContractData({
387
- id: Contracts.CURVE_TRI_CRV_POOL,
388
- addr: 0x4eBdF703948ddCEA3B11f675B4D1Fba9d2414A14,
389
- name: "CURVE_TRI_CRV_POOL"
390
- })
391
- );
392
-
393
- contractDataByNetwork[42161].push(
394
- ContractData({
395
- id: Contracts.LIDO_WSTETH,
396
- addr: 0x5979D7b546E38E414F7E9822514be443A4800529,
397
- name: "LIDO_WSTETH"
398
- })
399
- );
400
-
401
- contractDataByNetwork[42161].push(
402
- ContractData({
403
- id: Contracts.UNIVERSAL_ADAPTER,
404
- addr: 0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC,
405
- name: "UNIVERSAL_ADAPTER"
406
- })
407
- );
408
-
409
- ContractData[] storage cd = contractDataByNetwork[_chainId];
410
-
411
- uint256 len = cd.length;
412
- contractCount = len;
413
- unchecked {
414
- for (uint256 i; i < len; ++i) {
415
- addressOf[cd[i].id] = cd[i].addr;
416
- nameOf[cd[i].id] = cd[i].name;
417
- contractIndex[cd[i].addr] = cd[i].id;
418
-
419
- vm.label(cd[i].addr, cd[i].name);
420
- }
421
- }
422
- }
423
- }
@@ -1,135 +0,0 @@
1
- // SPDX-License-Identifier: UNLICENSED
2
- // Gearbox. Generalized leverage protocol that allows to take leverage and then use it across other DeFi protocols and platforms in a composable way.
3
- // (c) Gearbox Foundation, 2023
4
- pragma solidity ^0.8.17;
5
-
6
- /// @dev c-Tokens and LUNA are added for unit test purposes
7
- enum Tokens {
8
- NO_TOKEN,
9
- LUNA,
10
- _1INCH,
11
- AAVE,
12
- COMP,
13
- CRV,
14
- DAI,
15
- DPI,
16
- FEI,
17
- LINK,
18
- SNX,
19
- UNI,
20
- USDC,
21
- USDT,
22
- WBTC,
23
- WETH,
24
- YFI,
25
- STETH,
26
- wstETH,
27
- CVX,
28
- FRAX,
29
- FXS,
30
- LDO,
31
- LUSD,
32
- sUSD,
33
- GUSD,
34
- LQTY,
35
- OHM,
36
- MIM,
37
- SPELL,
38
- GMX,
39
- ARB,
40
- RDNT,
41
- BAL,
42
- SHIB,
43
- crvUSD,
44
- MKR,
45
- RPL,
46
- APE,
47
- _3Crv,
48
- crvFRAX,
49
- steCRV,
50
- crvPlain3andSUSD,
51
- crvCRVETH,
52
- crvCVXETH,
53
- crvUSDTWBTCWETH,
54
- LDOETH,
55
- crvUSDUSDC,
56
- crvUSDUSDT,
57
- crvUSDFRAX,
58
- crvUSDETHCRV,
59
- FRAX3CRV,
60
- LUSD3CRV,
61
- gusd3CRV,
62
- MIM_3LP3CRV,
63
- OHMFRAXBP,
64
- cvx3Crv,
65
- cvxcrvFRAX,
66
- cvxsteCRV,
67
- cvxFRAX3CRV,
68
- cvxLUSD3CRV,
69
- cvxcrvPlain3andSUSD,
70
- cvxgusd3CRV,
71
- cvxOHMFRAXBP,
72
- cvxMIM_3LP3CRV,
73
- cvxcrvCRVETH,
74
- cvxcrvCVXETH,
75
- cvxcrvUSDTWBTCWETH,
76
- cvxLDOETH,
77
- stkcvx3Crv,
78
- stkcvxcrvFRAX,
79
- stkcvxsteCRV,
80
- stkcvxFRAX3CRV,
81
- stkcvxLUSD3CRV,
82
- stkcvxcrvPlain3andSUSD,
83
- stkcvxgusd3CRV,
84
- stkcvxOHMFRAXBP,
85
- stkcvxMIM_3LP3CRV,
86
- stkcvxcrvCRVETH,
87
- stkcvxcrvCVXETH,
88
- stkcvxcrvUSDTWBTCWETH,
89
- stkcvxLDOETH,
90
- yvDAI,
91
- yvUSDC,
92
- yvWETH,
93
- yvWBTC,
94
- yvCurve_stETH,
95
- yvCurve_FRAX,
96
- _50OHM_50DAI,
97
- _50OHM_50WETH,
98
- OHM_wstETH,
99
- aDAI,
100
- aUSDC,
101
- aUSDT,
102
- aWETH,
103
- waDAI,
104
- waUSDC,
105
- waUSDT,
106
- waWETH,
107
- cDAI,
108
- cUSDC,
109
- cUSDT,
110
- cWETH,
111
- cLINK,
112
- dDAI,
113
- dUSDC,
114
- dWBTC,
115
- dWETH,
116
- dwstETH,
117
- dFRAX,
118
- GEAR
119
- }
120
-
121
- enum TokenType {
122
- NO_TOKEN,
123
- NORMAL_TOKEN,
124
- CURVE_LP_TOKEN,
125
- YEARN_ON_NORMAL_TOKEN,
126
- YEARN_ON_CURVE_TOKEN,
127
- CONVEX_LP_TOKEN,
128
- CONVEX_STAKED_TOKEN,
129
- DIESEL_LP_TOKEN,
130
- GEAR_TOKEN,
131
- COMPOUND_V2_C_TOKEN,
132
- BALANCER_LP_TOKEN,
133
- AAVE_V2_A_TOKEN,
134
- WRAPPED_AAVE_V2_TOKEN
135
- }