@usdu-core/usdu-core 0.0.1

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.
Files changed (107) hide show
  1. package/.claude/settings.local.json +12 -0
  2. package/.env.example +6 -0
  3. package/.prettierrc.json +7 -0
  4. package/LICENSE +674 -0
  5. package/README.md +244 -0
  6. package/contracts/curve/CurveAdapterV1.sol +310 -0
  7. package/contracts/curve/CurveAdapterV1_1.sol +198 -0
  8. package/contracts/curve/helpers/ICurveStableSwapNG.json +566 -0
  9. package/contracts/curve/helpers/ICurveStableSwapNG.sol +177 -0
  10. package/contracts/deploy/VaultDeployer.sol +110 -0
  11. package/contracts/morpho/MorphoAdapterV1.sol +255 -0
  12. package/contracts/morpho/MorphoAdapterV1_1.sol +137 -0
  13. package/contracts/morpho/MorphoAdapterV1_2.sol +126 -0
  14. package/contracts/morpho/helpers/AggregatorV3Interface.sol +24 -0
  15. package/contracts/morpho/helpers/ChainlinkDataFeedLib.sol +36 -0
  16. package/contracts/morpho/helpers/ConstantsLib.sol +20 -0
  17. package/contracts/morpho/helpers/ErrorsLib.sol +17 -0
  18. package/contracts/morpho/helpers/IERC4626.sol +6 -0
  19. package/contracts/morpho/helpers/IMetaMorphoV1_1.sol +229 -0
  20. package/contracts/morpho/helpers/IMetaMorphoV1_1Factory.sol +32 -0
  21. package/contracts/morpho/helpers/IMorpho.sol +361 -0
  22. package/contracts/morpho/helpers/IMorphoCallbacks.sol +52 -0
  23. package/contracts/morpho/helpers/IMorphoChainlinkOracleV2.sol +39 -0
  24. package/contracts/morpho/helpers/IMorphoChainlinkOracleV2Factory.sol +56 -0
  25. package/contracts/morpho/helpers/IOracle.sol +15 -0
  26. package/contracts/morpho/helpers/MarketParamsLib.sol +21 -0
  27. package/contracts/morpho/helpers/MathLib.sol +45 -0
  28. package/contracts/morpho/helpers/Morpho.sol.bak +517 -0
  29. package/contracts/morpho/helpers/MorphoChainlinkOracleV2.sol +157 -0
  30. package/contracts/morpho/helpers/PendingLib.sol +47 -0
  31. package/contracts/morpho/helpers/SharesMathLib.sol +45 -0
  32. package/contracts/morpho/helpers/VaultLib.sol +18 -0
  33. package/contracts/reward/RewardDistributionV1.sol +110 -0
  34. package/contracts/reward/RewardRouterV0.sol +63 -0
  35. package/contracts/reward/Rewards.example.json +72 -0
  36. package/contracts/stablecoin/IStablecoin.sol +211 -0
  37. package/contracts/stablecoin/IStablecoinMetadata.sol +27 -0
  38. package/contracts/stablecoin/IStablecoinModifier.sol +52 -0
  39. package/contracts/stablecoin/Stablecoin.sol +376 -0
  40. package/contracts/stablecoin/libraries/ConstantsLib.sol +13 -0
  41. package/contracts/stablecoin/libraries/ErrorsLib.sol +45 -0
  42. package/contracts/stablecoin/libraries/EventsLib.sol +74 -0
  43. package/contracts/stablecoin/libraries/PendingLib.sol +38 -0
  44. package/contracts/vault/VaultAdapterRecoverV1.sol +29 -0
  45. package/contracts/vault/VaultAdapterV1.sol +126 -0
  46. package/dist/index.d.mts +16154 -0
  47. package/dist/index.d.ts +16154 -0
  48. package/dist/index.js +21134 -0
  49. package/dist/index.mjs +21061 -0
  50. package/docs/CoreVault: Integration of new Markets.md +197 -0
  51. package/docs/CoreVault: SupplyQueue.md +11 -0
  52. package/docs/Markets USDC Vault.md +35 -0
  53. package/docs/Markets USDU Vault.md +89 -0
  54. package/docs/Markets WETH Vault.md +35 -0
  55. package/docs/Overview.drawio +117 -0
  56. package/exports/abis/curve/CurveAdapterV1.ts +599 -0
  57. package/exports/abis/curve/CurveAdapterV1_1.ts +609 -0
  58. package/exports/abis/curve/CurveAdapterV1_2.ts +721 -0
  59. package/exports/abis/curve/helper/ICurveStableSwapNG.ts +1589 -0
  60. package/exports/abis/morpho/MorphoAdapterV1.ts +516 -0
  61. package/exports/abis/morpho/MorphoAdapterV1_1.ts +489 -0
  62. package/exports/abis/morpho/MorphoAdapterV1_2.ts +459 -0
  63. package/exports/abis/morpho/helper/AggregatorV3Interface.ts +113 -0
  64. package/exports/abis/morpho/helper/IMetaMorphoV1_1.ts +1483 -0
  65. package/exports/abis/morpho/helper/IMetaMorphoV1_1Base.ts +607 -0
  66. package/exports/abis/morpho/helper/IMetaMorphoV1_1StaticTyping.ts +696 -0
  67. package/exports/abis/morpho/helper/IMorpho.ts +1024 -0
  68. package/exports/abis/morpho/helper/IMorphoBase.ts +886 -0
  69. package/exports/abis/morpho/helper/IMorphoChainlinkOracleV2.ts +132 -0
  70. package/exports/abis/morpho/helper/IMorphoChainlinkOracleV2Factory.ts +109 -0
  71. package/exports/abis/morpho/helper/IMorphoFlashLoanCallback.ts +20 -0
  72. package/exports/abis/morpho/helper/IMorphoLiquidateCallback.ts +20 -0
  73. package/exports/abis/morpho/helper/IMorphoRepayCallback.ts +20 -0
  74. package/exports/abis/morpho/helper/IMorphoStaticTyping.ts +1003 -0
  75. package/exports/abis/morpho/helper/IMorphoSupplyCallback.ts +20 -0
  76. package/exports/abis/morpho/helper/IMorphoSupplyCollateralCallback.ts +20 -0
  77. package/exports/abis/morpho/helper/IMulticall.ts +21 -0
  78. package/exports/abis/morpho/helper/IOracle.ts +15 -0
  79. package/exports/abis/morpho/helper/IOwnable.ts +55 -0
  80. package/exports/abis/morpho/helper/MorphoChainlinkOracleV2.ts +188 -0
  81. package/exports/abis/openzeppelin/ERC20.ts +310 -0
  82. package/exports/abis/openzeppelin/ERC20Permit.ts +520 -0
  83. package/exports/abis/openzeppelin/IERC20.ts +185 -0
  84. package/exports/abis/openzeppelin/IERC20Metadata.ts +224 -0
  85. package/exports/abis/openzeppelin/IERC20Permit.ts +77 -0
  86. package/exports/abis/openzeppelin/IERC4626.ts +614 -0
  87. package/exports/abis/reward/RewardDistributionV1.ts +246 -0
  88. package/exports/abis/stablecoin/ErrorsLib.ts +114 -0
  89. package/exports/abis/stablecoin/EventsLib.ts +372 -0
  90. package/exports/abis/stablecoin/IStablecoin.ts +642 -0
  91. package/exports/abis/stablecoin/IStablecoinMetadata.ts +856 -0
  92. package/exports/abis/stablecoin/IStablecoinModifier.ts +15 -0
  93. package/exports/abis/stablecoin/Stablecoin.ts +1922 -0
  94. package/exports/abis/termmax/ITermMaxVault.ts +2335 -0
  95. package/exports/abis/vault/VaultAdapterRecoverV1.ts +490 -0
  96. package/exports/abis/vault/VaultAdapterV1.ts +459 -0
  97. package/exports/address.config.ts +113 -0
  98. package/exports/address.types.ts +130 -0
  99. package/exports/index.ts +61 -0
  100. package/hardhat.config.ts +231 -0
  101. package/helper/store.args.ts +17 -0
  102. package/helper/wallet.info.ts +3 -0
  103. package/helper/wallet.ts +41 -0
  104. package/install-macos.sh +46 -0
  105. package/package.json +73 -0
  106. package/tsconfig.json +15 -0
  107. package/tsup.config.ts +10 -0
@@ -0,0 +1,490 @@
1
+ export const VaultAdapterRecoverV1_ABI = [
2
+ {
3
+ inputs: [
4
+ {
5
+ internalType: 'contract Stablecoin',
6
+ name: '_stable',
7
+ type: 'address',
8
+ },
9
+ {
10
+ internalType: 'contract IERC4626',
11
+ name: '_vault',
12
+ type: 'address',
13
+ },
14
+ {
15
+ internalType: 'address[5]',
16
+ name: '_receivers',
17
+ type: 'address[5]',
18
+ },
19
+ {
20
+ internalType: 'uint32[5]',
21
+ name: '_weights',
22
+ type: 'uint32[5]',
23
+ },
24
+ ],
25
+ stateMutability: 'nonpayable',
26
+ type: 'constructor',
27
+ },
28
+ {
29
+ inputs: [],
30
+ name: 'AlreadyPending',
31
+ type: 'error',
32
+ },
33
+ {
34
+ inputs: [],
35
+ name: 'NoPendingValue',
36
+ type: 'error',
37
+ },
38
+ {
39
+ inputs: [
40
+ {
41
+ internalType: 'uint256',
42
+ name: 'assets',
43
+ type: 'uint256',
44
+ },
45
+ {
46
+ internalType: 'uint256',
47
+ name: 'minted',
48
+ type: 'uint256',
49
+ },
50
+ ],
51
+ name: 'NothingToReconcile',
52
+ type: 'error',
53
+ },
54
+ {
55
+ inputs: [
56
+ {
57
+ internalType: 'address',
58
+ name: 'token',
59
+ type: 'address',
60
+ },
61
+ ],
62
+ name: 'SafeERC20FailedOperation',
63
+ type: 'error',
64
+ },
65
+ {
66
+ inputs: [],
67
+ name: 'TimelockNotElapsed',
68
+ type: 'error',
69
+ },
70
+ {
71
+ anonymous: false,
72
+ inputs: [
73
+ {
74
+ indexed: false,
75
+ internalType: 'uint256',
76
+ name: 'amount',
77
+ type: 'uint256',
78
+ },
79
+ {
80
+ indexed: false,
81
+ internalType: 'uint256',
82
+ name: 'sharesCore',
83
+ type: 'uint256',
84
+ },
85
+ {
86
+ indexed: false,
87
+ internalType: 'uint256',
88
+ name: 'totalMinted',
89
+ type: 'uint256',
90
+ },
91
+ ],
92
+ name: 'Deposit',
93
+ type: 'event',
94
+ },
95
+ {
96
+ anonymous: false,
97
+ inputs: [
98
+ {
99
+ indexed: true,
100
+ internalType: 'address',
101
+ name: 'receiver',
102
+ type: 'address',
103
+ },
104
+ {
105
+ indexed: false,
106
+ internalType: 'uint256',
107
+ name: 'amount',
108
+ type: 'uint256',
109
+ },
110
+ {
111
+ indexed: false,
112
+ internalType: 'uint256',
113
+ name: 'ratio',
114
+ type: 'uint256',
115
+ },
116
+ ],
117
+ name: 'Distribution',
118
+ type: 'event',
119
+ },
120
+ {
121
+ anonymous: false,
122
+ inputs: [
123
+ {
124
+ indexed: false,
125
+ internalType: 'uint256',
126
+ name: 'amount',
127
+ type: 'uint256',
128
+ },
129
+ {
130
+ indexed: false,
131
+ internalType: 'uint256',
132
+ name: 'sharesCore',
133
+ type: 'uint256',
134
+ },
135
+ {
136
+ indexed: false,
137
+ internalType: 'uint256',
138
+ name: 'totalMinted',
139
+ type: 'uint256',
140
+ },
141
+ ],
142
+ name: 'Redeem',
143
+ type: 'event',
144
+ },
145
+ {
146
+ anonymous: false,
147
+ inputs: [
148
+ {
149
+ indexed: false,
150
+ internalType: 'uint256',
151
+ name: 'amount',
152
+ type: 'uint256',
153
+ },
154
+ {
155
+ indexed: false,
156
+ internalType: 'uint256',
157
+ name: 'totalRevenue',
158
+ type: 'uint256',
159
+ },
160
+ {
161
+ indexed: false,
162
+ internalType: 'uint256',
163
+ name: 'totalMinted',
164
+ type: 'uint256',
165
+ },
166
+ ],
167
+ name: 'Revenue',
168
+ type: 'event',
169
+ },
170
+ {
171
+ anonymous: false,
172
+ inputs: [
173
+ {
174
+ indexed: true,
175
+ internalType: 'address',
176
+ name: 'caller',
177
+ type: 'address',
178
+ },
179
+ ],
180
+ name: 'RevokeDistribution',
181
+ type: 'event',
182
+ },
183
+ {
184
+ anonymous: false,
185
+ inputs: [
186
+ {
187
+ indexed: true,
188
+ internalType: 'address',
189
+ name: 'caller',
190
+ type: 'address',
191
+ },
192
+ ],
193
+ name: 'SetDistribution',
194
+ type: 'event',
195
+ },
196
+ {
197
+ anonymous: false,
198
+ inputs: [
199
+ {
200
+ indexed: true,
201
+ internalType: 'address',
202
+ name: 'caller',
203
+ type: 'address',
204
+ },
205
+ {
206
+ indexed: false,
207
+ internalType: 'address[5]',
208
+ name: 'receivers',
209
+ type: 'address[5]',
210
+ },
211
+ {
212
+ indexed: false,
213
+ internalType: 'uint32[5]',
214
+ name: 'weights',
215
+ type: 'uint32[5]',
216
+ },
217
+ {
218
+ indexed: false,
219
+ internalType: 'uint256',
220
+ name: 'timelock',
221
+ type: 'uint256',
222
+ },
223
+ ],
224
+ name: 'SubmitDistribution',
225
+ type: 'event',
226
+ },
227
+ {
228
+ inputs: [],
229
+ name: 'applyDistribution',
230
+ outputs: [],
231
+ stateMutability: 'nonpayable',
232
+ type: 'function',
233
+ },
234
+ {
235
+ inputs: [
236
+ {
237
+ internalType: 'uint256',
238
+ name: 'amount',
239
+ type: 'uint256',
240
+ },
241
+ ],
242
+ name: 'deposit',
243
+ outputs: [],
244
+ stateMutability: 'nonpayable',
245
+ type: 'function',
246
+ },
247
+ {
248
+ inputs: [
249
+ {
250
+ internalType: 'uint256',
251
+ name: '',
252
+ type: 'uint256',
253
+ },
254
+ ],
255
+ name: 'pendingReceivers',
256
+ outputs: [
257
+ {
258
+ internalType: 'address',
259
+ name: '',
260
+ type: 'address',
261
+ },
262
+ ],
263
+ stateMutability: 'view',
264
+ type: 'function',
265
+ },
266
+ {
267
+ inputs: [],
268
+ name: 'pendingValidAt',
269
+ outputs: [
270
+ {
271
+ internalType: 'uint256',
272
+ name: '',
273
+ type: 'uint256',
274
+ },
275
+ ],
276
+ stateMutability: 'view',
277
+ type: 'function',
278
+ },
279
+ {
280
+ inputs: [
281
+ {
282
+ internalType: 'uint256',
283
+ name: '',
284
+ type: 'uint256',
285
+ },
286
+ ],
287
+ name: 'pendingWeights',
288
+ outputs: [
289
+ {
290
+ internalType: 'uint32',
291
+ name: '',
292
+ type: 'uint32',
293
+ },
294
+ ],
295
+ stateMutability: 'view',
296
+ type: 'function',
297
+ },
298
+ {
299
+ inputs: [
300
+ {
301
+ internalType: 'uint256',
302
+ name: '',
303
+ type: 'uint256',
304
+ },
305
+ ],
306
+ name: 'receivers',
307
+ outputs: [
308
+ {
309
+ internalType: 'address',
310
+ name: '',
311
+ type: 'address',
312
+ },
313
+ ],
314
+ stateMutability: 'view',
315
+ type: 'function',
316
+ },
317
+ {
318
+ inputs: [],
319
+ name: 'reconcile',
320
+ outputs: [],
321
+ stateMutability: 'nonpayable',
322
+ type: 'function',
323
+ },
324
+ {
325
+ inputs: [
326
+ {
327
+ internalType: 'address',
328
+ name: 'token',
329
+ type: 'address',
330
+ },
331
+ {
332
+ internalType: 'uint256',
333
+ name: 'amount',
334
+ type: 'uint256',
335
+ },
336
+ ],
337
+ name: 'recover',
338
+ outputs: [],
339
+ stateMutability: 'nonpayable',
340
+ type: 'function',
341
+ },
342
+ {
343
+ inputs: [
344
+ {
345
+ internalType: 'address',
346
+ name: 'token',
347
+ type: 'address',
348
+ },
349
+ ],
350
+ name: 'recoverAll',
351
+ outputs: [],
352
+ stateMutability: 'nonpayable',
353
+ type: 'function',
354
+ },
355
+ {
356
+ inputs: [
357
+ {
358
+ internalType: 'uint256',
359
+ name: 'sharesCore',
360
+ type: 'uint256',
361
+ },
362
+ ],
363
+ name: 'redeem',
364
+ outputs: [],
365
+ stateMutability: 'nonpayable',
366
+ type: 'function',
367
+ },
368
+ {
369
+ inputs: [],
370
+ name: 'revokePendingDistribution',
371
+ outputs: [],
372
+ stateMutability: 'nonpayable',
373
+ type: 'function',
374
+ },
375
+ {
376
+ inputs: [
377
+ {
378
+ internalType: 'address[5]',
379
+ name: '_receivers',
380
+ type: 'address[5]',
381
+ },
382
+ {
383
+ internalType: 'uint32[5]',
384
+ name: '_weights',
385
+ type: 'uint32[5]',
386
+ },
387
+ ],
388
+ name: 'setDistribution',
389
+ outputs: [],
390
+ stateMutability: 'nonpayable',
391
+ type: 'function',
392
+ },
393
+ {
394
+ inputs: [],
395
+ name: 'stable',
396
+ outputs: [
397
+ {
398
+ internalType: 'contract Stablecoin',
399
+ name: '',
400
+ type: 'address',
401
+ },
402
+ ],
403
+ stateMutability: 'view',
404
+ type: 'function',
405
+ },
406
+ {
407
+ inputs: [],
408
+ name: 'totalAssets',
409
+ outputs: [
410
+ {
411
+ internalType: 'uint256',
412
+ name: '',
413
+ type: 'uint256',
414
+ },
415
+ ],
416
+ stateMutability: 'view',
417
+ type: 'function',
418
+ },
419
+ {
420
+ inputs: [],
421
+ name: 'totalMinted',
422
+ outputs: [
423
+ {
424
+ internalType: 'uint256',
425
+ name: '',
426
+ type: 'uint256',
427
+ },
428
+ ],
429
+ stateMutability: 'view',
430
+ type: 'function',
431
+ },
432
+ {
433
+ inputs: [],
434
+ name: 'totalRevenue',
435
+ outputs: [
436
+ {
437
+ internalType: 'uint256',
438
+ name: '',
439
+ type: 'uint256',
440
+ },
441
+ ],
442
+ stateMutability: 'view',
443
+ type: 'function',
444
+ },
445
+ {
446
+ inputs: [],
447
+ name: 'totalWeights',
448
+ outputs: [
449
+ {
450
+ internalType: 'uint256',
451
+ name: '',
452
+ type: 'uint256',
453
+ },
454
+ ],
455
+ stateMutability: 'view',
456
+ type: 'function',
457
+ },
458
+ {
459
+ inputs: [],
460
+ name: 'vault',
461
+ outputs: [
462
+ {
463
+ internalType: 'contract IERC4626',
464
+ name: '',
465
+ type: 'address',
466
+ },
467
+ ],
468
+ stateMutability: 'view',
469
+ type: 'function',
470
+ },
471
+ {
472
+ inputs: [
473
+ {
474
+ internalType: 'uint256',
475
+ name: '',
476
+ type: 'uint256',
477
+ },
478
+ ],
479
+ name: 'weights',
480
+ outputs: [
481
+ {
482
+ internalType: 'uint32',
483
+ name: '',
484
+ type: 'uint32',
485
+ },
486
+ ],
487
+ stateMutability: 'view',
488
+ type: 'function',
489
+ },
490
+ ] as const;