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