@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,516 @@
1
+ export const MorphoAdapterV1_ABI = [
2
+ {
3
+ inputs: [
4
+ {
5
+ internalType: 'contract Stablecoin',
6
+ name: '_stable',
7
+ type: 'address',
8
+ },
9
+ {
10
+ internalType: 'contract IMetaMorphoV1_1',
11
+ name: '_core',
12
+ type: 'address',
13
+ },
14
+ {
15
+ internalType: 'contract IMetaMorphoV1_1',
16
+ name: '_staked',
17
+ type: 'address',
18
+ },
19
+ {
20
+ internalType: 'address[5]',
21
+ name: '_receivers',
22
+ type: 'address[5]',
23
+ },
24
+ {
25
+ internalType: 'uint32[5]',
26
+ name: '_weights',
27
+ type: 'uint32[5]',
28
+ },
29
+ ],
30
+ stateMutability: 'nonpayable',
31
+ type: 'constructor',
32
+ },
33
+ {
34
+ inputs: [],
35
+ name: 'AlreadyPending',
36
+ type: 'error',
37
+ },
38
+ {
39
+ inputs: [
40
+ {
41
+ internalType: 'address',
42
+ name: 'forwardedTo',
43
+ type: 'address',
44
+ },
45
+ ],
46
+ name: 'ForwardCallFailed',
47
+ type: 'error',
48
+ },
49
+ {
50
+ inputs: [
51
+ {
52
+ internalType: 'uint256',
53
+ name: 'receivers',
54
+ type: 'uint256',
55
+ },
56
+ {
57
+ internalType: 'uint256',
58
+ name: 'weights',
59
+ type: 'uint256',
60
+ },
61
+ ],
62
+ name: 'MismatchLength',
63
+ type: 'error',
64
+ },
65
+ {
66
+ inputs: [],
67
+ name: 'NoPendingValue',
68
+ type: 'error',
69
+ },
70
+ {
71
+ inputs: [
72
+ {
73
+ internalType: 'uint256',
74
+ name: 'assets',
75
+ type: 'uint256',
76
+ },
77
+ {
78
+ internalType: 'uint256',
79
+ name: 'minted',
80
+ type: 'uint256',
81
+ },
82
+ ],
83
+ name: 'NothingToReconcile',
84
+ type: 'error',
85
+ },
86
+ {
87
+ inputs: [
88
+ {
89
+ internalType: 'address',
90
+ name: 'token',
91
+ type: 'address',
92
+ },
93
+ ],
94
+ name: 'SafeERC20FailedOperation',
95
+ type: 'error',
96
+ },
97
+ {
98
+ inputs: [],
99
+ name: 'TimelockNotElapsed',
100
+ type: 'error',
101
+ },
102
+ {
103
+ anonymous: false,
104
+ inputs: [
105
+ {
106
+ indexed: false,
107
+ internalType: 'uint256',
108
+ name: 'amount',
109
+ type: 'uint256',
110
+ },
111
+ {
112
+ indexed: false,
113
+ internalType: 'uint256',
114
+ name: 'sharesCore',
115
+ type: 'uint256',
116
+ },
117
+ {
118
+ indexed: false,
119
+ internalType: 'uint256',
120
+ name: 'sharesStaked',
121
+ type: 'uint256',
122
+ },
123
+ {
124
+ indexed: false,
125
+ internalType: 'uint256',
126
+ name: 'totalMinted',
127
+ type: 'uint256',
128
+ },
129
+ ],
130
+ name: 'Deposit',
131
+ type: 'event',
132
+ },
133
+ {
134
+ anonymous: false,
135
+ inputs: [
136
+ {
137
+ indexed: true,
138
+ internalType: 'address',
139
+ name: 'receiver',
140
+ type: 'address',
141
+ },
142
+ {
143
+ indexed: false,
144
+ internalType: 'uint256',
145
+ name: 'amount',
146
+ type: 'uint256',
147
+ },
148
+ {
149
+ indexed: false,
150
+ internalType: 'uint256',
151
+ name: 'ratio',
152
+ type: 'uint256',
153
+ },
154
+ ],
155
+ name: 'Distribution',
156
+ type: 'event',
157
+ },
158
+ {
159
+ anonymous: false,
160
+ inputs: [
161
+ {
162
+ indexed: false,
163
+ internalType: 'uint256',
164
+ name: 'amount',
165
+ type: 'uint256',
166
+ },
167
+ {
168
+ indexed: false,
169
+ internalType: 'uint256',
170
+ name: 'sharesCore',
171
+ type: 'uint256',
172
+ },
173
+ {
174
+ indexed: false,
175
+ internalType: 'uint256',
176
+ name: 'sharesStaked',
177
+ type: 'uint256',
178
+ },
179
+ {
180
+ indexed: false,
181
+ internalType: 'uint256',
182
+ name: 'totalMinted',
183
+ type: 'uint256',
184
+ },
185
+ ],
186
+ name: 'Redeem',
187
+ type: 'event',
188
+ },
189
+ {
190
+ anonymous: false,
191
+ inputs: [
192
+ {
193
+ indexed: false,
194
+ internalType: 'uint256',
195
+ name: 'amount',
196
+ type: 'uint256',
197
+ },
198
+ {
199
+ indexed: false,
200
+ internalType: 'uint256',
201
+ name: 'totalRevenue',
202
+ type: 'uint256',
203
+ },
204
+ {
205
+ indexed: false,
206
+ internalType: 'uint256',
207
+ name: 'totalMinted',
208
+ type: 'uint256',
209
+ },
210
+ ],
211
+ name: 'Revenue',
212
+ type: 'event',
213
+ },
214
+ {
215
+ anonymous: false,
216
+ inputs: [
217
+ {
218
+ indexed: true,
219
+ internalType: 'address',
220
+ name: 'caller',
221
+ type: 'address',
222
+ },
223
+ ],
224
+ name: 'RevokeDistribution',
225
+ type: 'event',
226
+ },
227
+ {
228
+ anonymous: false,
229
+ inputs: [
230
+ {
231
+ indexed: true,
232
+ internalType: 'address',
233
+ name: 'caller',
234
+ type: 'address',
235
+ },
236
+ ],
237
+ name: 'SetDistribution',
238
+ type: 'event',
239
+ },
240
+ {
241
+ anonymous: false,
242
+ inputs: [
243
+ {
244
+ indexed: true,
245
+ internalType: 'address',
246
+ name: 'caller',
247
+ type: 'address',
248
+ },
249
+ {
250
+ indexed: false,
251
+ internalType: 'address[5]',
252
+ name: 'receivers',
253
+ type: 'address[5]',
254
+ },
255
+ {
256
+ indexed: false,
257
+ internalType: 'uint32[5]',
258
+ name: 'weights',
259
+ type: 'uint32[5]',
260
+ },
261
+ {
262
+ indexed: false,
263
+ internalType: 'uint256',
264
+ name: 'timelock',
265
+ type: 'uint256',
266
+ },
267
+ ],
268
+ name: 'SubmitDistribution',
269
+ type: 'event',
270
+ },
271
+ {
272
+ inputs: [],
273
+ name: 'applyDistribution',
274
+ outputs: [],
275
+ stateMutability: 'nonpayable',
276
+ type: 'function',
277
+ },
278
+ {
279
+ inputs: [],
280
+ name: 'core',
281
+ outputs: [
282
+ {
283
+ internalType: 'contract IMetaMorphoV1_1',
284
+ name: '',
285
+ type: 'address',
286
+ },
287
+ ],
288
+ stateMutability: 'view',
289
+ type: 'function',
290
+ },
291
+ {
292
+ inputs: [
293
+ {
294
+ internalType: 'uint256',
295
+ name: 'amount',
296
+ type: 'uint256',
297
+ },
298
+ ],
299
+ name: 'deposit',
300
+ outputs: [],
301
+ stateMutability: 'nonpayable',
302
+ type: 'function',
303
+ },
304
+ {
305
+ inputs: [
306
+ {
307
+ internalType: 'uint256',
308
+ name: '',
309
+ type: 'uint256',
310
+ },
311
+ ],
312
+ name: 'pendingReceivers',
313
+ outputs: [
314
+ {
315
+ internalType: 'address',
316
+ name: '',
317
+ type: 'address',
318
+ },
319
+ ],
320
+ stateMutability: 'view',
321
+ type: 'function',
322
+ },
323
+ {
324
+ inputs: [],
325
+ name: 'pendingValidAt',
326
+ outputs: [
327
+ {
328
+ internalType: 'uint256',
329
+ name: '',
330
+ type: 'uint256',
331
+ },
332
+ ],
333
+ stateMutability: 'view',
334
+ type: 'function',
335
+ },
336
+ {
337
+ inputs: [
338
+ {
339
+ internalType: 'uint256',
340
+ name: '',
341
+ type: 'uint256',
342
+ },
343
+ ],
344
+ name: 'pendingWeights',
345
+ outputs: [
346
+ {
347
+ internalType: 'uint32',
348
+ name: '',
349
+ type: 'uint32',
350
+ },
351
+ ],
352
+ stateMutability: 'view',
353
+ type: 'function',
354
+ },
355
+ {
356
+ inputs: [
357
+ {
358
+ internalType: 'uint256',
359
+ name: '',
360
+ type: 'uint256',
361
+ },
362
+ ],
363
+ name: 'receivers',
364
+ outputs: [
365
+ {
366
+ internalType: 'address',
367
+ name: '',
368
+ type: 'address',
369
+ },
370
+ ],
371
+ stateMutability: 'view',
372
+ type: 'function',
373
+ },
374
+ {
375
+ inputs: [],
376
+ name: 'reconcile',
377
+ outputs: [],
378
+ stateMutability: 'nonpayable',
379
+ type: 'function',
380
+ },
381
+ {
382
+ inputs: [
383
+ {
384
+ internalType: 'uint256',
385
+ name: 'sharesStaked',
386
+ type: 'uint256',
387
+ },
388
+ ],
389
+ name: 'redeem',
390
+ outputs: [],
391
+ stateMutability: 'nonpayable',
392
+ type: 'function',
393
+ },
394
+ {
395
+ inputs: [],
396
+ name: 'revokePendingDistribution',
397
+ outputs: [],
398
+ stateMutability: 'nonpayable',
399
+ type: 'function',
400
+ },
401
+ {
402
+ inputs: [
403
+ {
404
+ internalType: 'address[5]',
405
+ name: '_receivers',
406
+ type: 'address[5]',
407
+ },
408
+ {
409
+ internalType: 'uint32[5]',
410
+ name: '_weights',
411
+ type: 'uint32[5]',
412
+ },
413
+ ],
414
+ name: 'setDistribution',
415
+ outputs: [],
416
+ stateMutability: 'nonpayable',
417
+ type: 'function',
418
+ },
419
+ {
420
+ inputs: [],
421
+ name: 'stable',
422
+ outputs: [
423
+ {
424
+ internalType: 'contract Stablecoin',
425
+ name: '',
426
+ type: 'address',
427
+ },
428
+ ],
429
+ stateMutability: 'view',
430
+ type: 'function',
431
+ },
432
+ {
433
+ inputs: [],
434
+ name: 'staked',
435
+ outputs: [
436
+ {
437
+ internalType: 'contract IMetaMorphoV1_1',
438
+ name: '',
439
+ type: 'address',
440
+ },
441
+ ],
442
+ stateMutability: 'view',
443
+ type: 'function',
444
+ },
445
+ {
446
+ inputs: [],
447
+ name: 'totalAssets',
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: 'totalMinted',
461
+ outputs: [
462
+ {
463
+ internalType: 'uint256',
464
+ name: '',
465
+ type: 'uint256',
466
+ },
467
+ ],
468
+ stateMutability: 'view',
469
+ type: 'function',
470
+ },
471
+ {
472
+ inputs: [],
473
+ name: 'totalRevenue',
474
+ outputs: [
475
+ {
476
+ internalType: 'uint256',
477
+ name: '',
478
+ type: 'uint256',
479
+ },
480
+ ],
481
+ stateMutability: 'view',
482
+ type: 'function',
483
+ },
484
+ {
485
+ inputs: [],
486
+ name: 'totalWeights',
487
+ outputs: [
488
+ {
489
+ internalType: 'uint256',
490
+ name: '',
491
+ type: 'uint256',
492
+ },
493
+ ],
494
+ stateMutability: 'view',
495
+ type: 'function',
496
+ },
497
+ {
498
+ inputs: [
499
+ {
500
+ internalType: 'uint256',
501
+ name: '',
502
+ type: 'uint256',
503
+ },
504
+ ],
505
+ name: 'weights',
506
+ outputs: [
507
+ {
508
+ internalType: 'uint32',
509
+ name: '',
510
+ type: 'uint32',
511
+ },
512
+ ],
513
+ stateMutability: 'view',
514
+ type: 'function',
515
+ },
516
+ ] as const;