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