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