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