@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,607 @@
1
+ export const IMetaMorphoV1_1Base_ABI = [
2
+ {
3
+ inputs: [],
4
+ name: 'DECIMALS_OFFSET',
5
+ outputs: [
6
+ {
7
+ internalType: 'uint8',
8
+ name: '',
9
+ type: 'uint8',
10
+ },
11
+ ],
12
+ stateMutability: 'view',
13
+ type: 'function',
14
+ },
15
+ {
16
+ inputs: [],
17
+ name: 'MORPHO',
18
+ outputs: [
19
+ {
20
+ internalType: 'contract IMorpho',
21
+ name: '',
22
+ type: 'address',
23
+ },
24
+ ],
25
+ stateMutability: 'view',
26
+ type: 'function',
27
+ },
28
+ {
29
+ inputs: [
30
+ {
31
+ components: [
32
+ {
33
+ internalType: 'address',
34
+ name: 'loanToken',
35
+ type: 'address',
36
+ },
37
+ {
38
+ internalType: 'address',
39
+ name: 'collateralToken',
40
+ type: 'address',
41
+ },
42
+ {
43
+ internalType: 'address',
44
+ name: 'oracle',
45
+ type: 'address',
46
+ },
47
+ {
48
+ internalType: 'address',
49
+ name: 'irm',
50
+ type: 'address',
51
+ },
52
+ {
53
+ internalType: 'uint256',
54
+ name: 'lltv',
55
+ type: 'uint256',
56
+ },
57
+ ],
58
+ internalType: 'struct MarketParams',
59
+ name: 'marketParams',
60
+ type: 'tuple',
61
+ },
62
+ ],
63
+ name: 'acceptCap',
64
+ outputs: [],
65
+ stateMutability: 'nonpayable',
66
+ type: 'function',
67
+ },
68
+ {
69
+ inputs: [],
70
+ name: 'acceptGuardian',
71
+ outputs: [],
72
+ stateMutability: 'nonpayable',
73
+ type: 'function',
74
+ },
75
+ {
76
+ inputs: [],
77
+ name: 'acceptTimelock',
78
+ outputs: [],
79
+ stateMutability: 'nonpayable',
80
+ type: 'function',
81
+ },
82
+ {
83
+ inputs: [],
84
+ name: 'curator',
85
+ outputs: [
86
+ {
87
+ internalType: 'address',
88
+ name: '',
89
+ type: 'address',
90
+ },
91
+ ],
92
+ stateMutability: 'view',
93
+ type: 'function',
94
+ },
95
+ {
96
+ inputs: [],
97
+ name: 'fee',
98
+ outputs: [
99
+ {
100
+ internalType: 'uint96',
101
+ name: '',
102
+ type: 'uint96',
103
+ },
104
+ ],
105
+ stateMutability: 'view',
106
+ type: 'function',
107
+ },
108
+ {
109
+ inputs: [],
110
+ name: 'feeRecipient',
111
+ outputs: [
112
+ {
113
+ internalType: 'address',
114
+ name: '',
115
+ type: 'address',
116
+ },
117
+ ],
118
+ stateMutability: 'view',
119
+ type: 'function',
120
+ },
121
+ {
122
+ inputs: [],
123
+ name: 'guardian',
124
+ outputs: [
125
+ {
126
+ internalType: 'address',
127
+ name: '',
128
+ type: 'address',
129
+ },
130
+ ],
131
+ stateMutability: 'view',
132
+ type: 'function',
133
+ },
134
+ {
135
+ inputs: [
136
+ {
137
+ internalType: 'address',
138
+ name: 'target',
139
+ type: 'address',
140
+ },
141
+ ],
142
+ name: 'isAllocator',
143
+ outputs: [
144
+ {
145
+ internalType: 'bool',
146
+ name: '',
147
+ type: 'bool',
148
+ },
149
+ ],
150
+ stateMutability: 'view',
151
+ type: 'function',
152
+ },
153
+ {
154
+ inputs: [],
155
+ name: 'lastTotalAssets',
156
+ outputs: [
157
+ {
158
+ internalType: 'uint256',
159
+ name: '',
160
+ type: 'uint256',
161
+ },
162
+ ],
163
+ stateMutability: 'view',
164
+ type: 'function',
165
+ },
166
+ {
167
+ inputs: [],
168
+ name: 'lostAssets',
169
+ outputs: [
170
+ {
171
+ internalType: 'uint256',
172
+ name: '',
173
+ type: 'uint256',
174
+ },
175
+ ],
176
+ stateMutability: 'view',
177
+ type: 'function',
178
+ },
179
+ {
180
+ inputs: [
181
+ {
182
+ components: [
183
+ {
184
+ components: [
185
+ {
186
+ internalType: 'address',
187
+ name: 'loanToken',
188
+ type: 'address',
189
+ },
190
+ {
191
+ internalType: 'address',
192
+ name: 'collateralToken',
193
+ type: 'address',
194
+ },
195
+ {
196
+ internalType: 'address',
197
+ name: 'oracle',
198
+ type: 'address',
199
+ },
200
+ {
201
+ internalType: 'address',
202
+ name: 'irm',
203
+ type: 'address',
204
+ },
205
+ {
206
+ internalType: 'uint256',
207
+ name: 'lltv',
208
+ type: 'uint256',
209
+ },
210
+ ],
211
+ internalType: 'struct MarketParams',
212
+ name: 'marketParams',
213
+ type: 'tuple',
214
+ },
215
+ {
216
+ internalType: 'uint256',
217
+ name: 'assets',
218
+ type: 'uint256',
219
+ },
220
+ ],
221
+ internalType: 'struct MarketAllocation[]',
222
+ name: 'allocations',
223
+ type: 'tuple[]',
224
+ },
225
+ ],
226
+ name: 'reallocate',
227
+ outputs: [],
228
+ stateMutability: 'nonpayable',
229
+ type: 'function',
230
+ },
231
+ {
232
+ inputs: [
233
+ {
234
+ internalType: 'Id',
235
+ name: 'id',
236
+ type: 'bytes32',
237
+ },
238
+ ],
239
+ name: 'revokePendingCap',
240
+ outputs: [],
241
+ stateMutability: 'nonpayable',
242
+ type: 'function',
243
+ },
244
+ {
245
+ inputs: [],
246
+ name: 'revokePendingGuardian',
247
+ outputs: [],
248
+ stateMutability: 'nonpayable',
249
+ type: 'function',
250
+ },
251
+ {
252
+ inputs: [
253
+ {
254
+ internalType: 'Id',
255
+ name: 'id',
256
+ type: 'bytes32',
257
+ },
258
+ ],
259
+ name: 'revokePendingMarketRemoval',
260
+ outputs: [],
261
+ stateMutability: 'nonpayable',
262
+ type: 'function',
263
+ },
264
+ {
265
+ inputs: [],
266
+ name: 'revokePendingTimelock',
267
+ outputs: [],
268
+ stateMutability: 'nonpayable',
269
+ type: 'function',
270
+ },
271
+ {
272
+ inputs: [
273
+ {
274
+ internalType: 'address',
275
+ name: 'newCurator',
276
+ type: 'address',
277
+ },
278
+ ],
279
+ name: 'setCurator',
280
+ outputs: [],
281
+ stateMutability: 'nonpayable',
282
+ type: 'function',
283
+ },
284
+ {
285
+ inputs: [
286
+ {
287
+ internalType: 'uint256',
288
+ name: 'newFee',
289
+ type: 'uint256',
290
+ },
291
+ ],
292
+ name: 'setFee',
293
+ outputs: [],
294
+ stateMutability: 'nonpayable',
295
+ type: 'function',
296
+ },
297
+ {
298
+ inputs: [
299
+ {
300
+ internalType: 'address',
301
+ name: 'newFeeRecipient',
302
+ type: 'address',
303
+ },
304
+ ],
305
+ name: 'setFeeRecipient',
306
+ outputs: [],
307
+ stateMutability: 'nonpayable',
308
+ type: 'function',
309
+ },
310
+ {
311
+ inputs: [
312
+ {
313
+ internalType: 'address',
314
+ name: 'newAllocator',
315
+ type: 'address',
316
+ },
317
+ {
318
+ internalType: 'bool',
319
+ name: 'newIsAllocator',
320
+ type: 'bool',
321
+ },
322
+ ],
323
+ name: 'setIsAllocator',
324
+ outputs: [],
325
+ stateMutability: 'nonpayable',
326
+ type: 'function',
327
+ },
328
+ {
329
+ inputs: [
330
+ {
331
+ internalType: 'string',
332
+ name: 'newName',
333
+ type: 'string',
334
+ },
335
+ ],
336
+ name: 'setName',
337
+ outputs: [],
338
+ stateMutability: 'nonpayable',
339
+ type: 'function',
340
+ },
341
+ {
342
+ inputs: [
343
+ {
344
+ internalType: 'address',
345
+ name: 'newSkimRecipient',
346
+ type: 'address',
347
+ },
348
+ ],
349
+ name: 'setSkimRecipient',
350
+ outputs: [],
351
+ stateMutability: 'nonpayable',
352
+ type: 'function',
353
+ },
354
+ {
355
+ inputs: [
356
+ {
357
+ internalType: 'Id[]',
358
+ name: 'newSupplyQueue',
359
+ type: 'bytes32[]',
360
+ },
361
+ ],
362
+ name: 'setSupplyQueue',
363
+ outputs: [],
364
+ stateMutability: 'nonpayable',
365
+ type: 'function',
366
+ },
367
+ {
368
+ inputs: [
369
+ {
370
+ internalType: 'string',
371
+ name: 'newSymbol',
372
+ type: 'string',
373
+ },
374
+ ],
375
+ name: 'setSymbol',
376
+ outputs: [],
377
+ stateMutability: 'nonpayable',
378
+ type: 'function',
379
+ },
380
+ {
381
+ inputs: [
382
+ {
383
+ internalType: 'address',
384
+ name: '',
385
+ type: 'address',
386
+ },
387
+ ],
388
+ name: 'skim',
389
+ outputs: [],
390
+ stateMutability: 'nonpayable',
391
+ type: 'function',
392
+ },
393
+ {
394
+ inputs: [],
395
+ name: 'skimRecipient',
396
+ outputs: [
397
+ {
398
+ internalType: 'address',
399
+ name: '',
400
+ type: 'address',
401
+ },
402
+ ],
403
+ stateMutability: 'view',
404
+ type: 'function',
405
+ },
406
+ {
407
+ inputs: [
408
+ {
409
+ components: [
410
+ {
411
+ internalType: 'address',
412
+ name: 'loanToken',
413
+ type: 'address',
414
+ },
415
+ {
416
+ internalType: 'address',
417
+ name: 'collateralToken',
418
+ type: 'address',
419
+ },
420
+ {
421
+ internalType: 'address',
422
+ name: 'oracle',
423
+ type: 'address',
424
+ },
425
+ {
426
+ internalType: 'address',
427
+ name: 'irm',
428
+ type: 'address',
429
+ },
430
+ {
431
+ internalType: 'uint256',
432
+ name: 'lltv',
433
+ type: 'uint256',
434
+ },
435
+ ],
436
+ internalType: 'struct MarketParams',
437
+ name: 'marketParams',
438
+ type: 'tuple',
439
+ },
440
+ {
441
+ internalType: 'uint256',
442
+ name: 'newSupplyCap',
443
+ type: 'uint256',
444
+ },
445
+ ],
446
+ name: 'submitCap',
447
+ outputs: [],
448
+ stateMutability: 'nonpayable',
449
+ type: 'function',
450
+ },
451
+ {
452
+ inputs: [
453
+ {
454
+ internalType: 'address',
455
+ name: 'newGuardian',
456
+ type: 'address',
457
+ },
458
+ ],
459
+ name: 'submitGuardian',
460
+ outputs: [],
461
+ stateMutability: 'nonpayable',
462
+ type: 'function',
463
+ },
464
+ {
465
+ inputs: [
466
+ {
467
+ components: [
468
+ {
469
+ internalType: 'address',
470
+ name: 'loanToken',
471
+ type: 'address',
472
+ },
473
+ {
474
+ internalType: 'address',
475
+ name: 'collateralToken',
476
+ type: 'address',
477
+ },
478
+ {
479
+ internalType: 'address',
480
+ name: 'oracle',
481
+ type: 'address',
482
+ },
483
+ {
484
+ internalType: 'address',
485
+ name: 'irm',
486
+ type: 'address',
487
+ },
488
+ {
489
+ internalType: 'uint256',
490
+ name: 'lltv',
491
+ type: 'uint256',
492
+ },
493
+ ],
494
+ internalType: 'struct MarketParams',
495
+ name: 'marketParams',
496
+ type: 'tuple',
497
+ },
498
+ ],
499
+ name: 'submitMarketRemoval',
500
+ outputs: [],
501
+ stateMutability: 'nonpayable',
502
+ type: 'function',
503
+ },
504
+ {
505
+ inputs: [
506
+ {
507
+ internalType: 'uint256',
508
+ name: 'newTimelock',
509
+ type: 'uint256',
510
+ },
511
+ ],
512
+ name: 'submitTimelock',
513
+ outputs: [],
514
+ stateMutability: 'nonpayable',
515
+ type: 'function',
516
+ },
517
+ {
518
+ inputs: [
519
+ {
520
+ internalType: 'uint256',
521
+ name: '',
522
+ type: 'uint256',
523
+ },
524
+ ],
525
+ name: 'supplyQueue',
526
+ outputs: [
527
+ {
528
+ internalType: 'Id',
529
+ name: '',
530
+ type: 'bytes32',
531
+ },
532
+ ],
533
+ stateMutability: 'view',
534
+ type: 'function',
535
+ },
536
+ {
537
+ inputs: [],
538
+ name: 'supplyQueueLength',
539
+ outputs: [
540
+ {
541
+ internalType: 'uint256',
542
+ name: '',
543
+ type: 'uint256',
544
+ },
545
+ ],
546
+ stateMutability: 'view',
547
+ type: 'function',
548
+ },
549
+ {
550
+ inputs: [],
551
+ name: 'timelock',
552
+ outputs: [
553
+ {
554
+ internalType: 'uint256',
555
+ name: '',
556
+ type: 'uint256',
557
+ },
558
+ ],
559
+ stateMutability: 'view',
560
+ type: 'function',
561
+ },
562
+ {
563
+ inputs: [
564
+ {
565
+ internalType: 'uint256[]',
566
+ name: 'indexes',
567
+ type: 'uint256[]',
568
+ },
569
+ ],
570
+ name: 'updateWithdrawQueue',
571
+ outputs: [],
572
+ stateMutability: 'nonpayable',
573
+ type: 'function',
574
+ },
575
+ {
576
+ inputs: [
577
+ {
578
+ internalType: 'uint256',
579
+ name: '',
580
+ type: 'uint256',
581
+ },
582
+ ],
583
+ name: 'withdrawQueue',
584
+ outputs: [
585
+ {
586
+ internalType: 'Id',
587
+ name: '',
588
+ type: 'bytes32',
589
+ },
590
+ ],
591
+ stateMutability: 'view',
592
+ type: 'function',
593
+ },
594
+ {
595
+ inputs: [],
596
+ name: 'withdrawQueueLength',
597
+ outputs: [
598
+ {
599
+ internalType: 'uint256',
600
+ name: '',
601
+ type: 'uint256',
602
+ },
603
+ ],
604
+ stateMutability: 'view',
605
+ type: 'function',
606
+ },
607
+ ] as const;