@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,132 @@
1
+ export const IMorphoChainlinkOracleV2_ABI = [
2
+ {
3
+ inputs: [],
4
+ name: 'BASE_FEED_1',
5
+ outputs: [
6
+ {
7
+ internalType: 'contract AggregatorV3Interface',
8
+ name: '',
9
+ type: 'address',
10
+ },
11
+ ],
12
+ stateMutability: 'view',
13
+ type: 'function',
14
+ },
15
+ {
16
+ inputs: [],
17
+ name: 'BASE_FEED_2',
18
+ outputs: [
19
+ {
20
+ internalType: 'contract AggregatorV3Interface',
21
+ name: '',
22
+ type: 'address',
23
+ },
24
+ ],
25
+ stateMutability: 'view',
26
+ type: 'function',
27
+ },
28
+ {
29
+ inputs: [],
30
+ name: 'BASE_VAULT',
31
+ outputs: [
32
+ {
33
+ internalType: 'contract IERC4626',
34
+ name: '',
35
+ type: 'address',
36
+ },
37
+ ],
38
+ stateMutability: 'view',
39
+ type: 'function',
40
+ },
41
+ {
42
+ inputs: [],
43
+ name: 'BASE_VAULT_CONVERSION_SAMPLE',
44
+ outputs: [
45
+ {
46
+ internalType: 'uint256',
47
+ name: '',
48
+ type: 'uint256',
49
+ },
50
+ ],
51
+ stateMutability: 'view',
52
+ type: 'function',
53
+ },
54
+ {
55
+ inputs: [],
56
+ name: 'QUOTE_FEED_1',
57
+ outputs: [
58
+ {
59
+ internalType: 'contract AggregatorV3Interface',
60
+ name: '',
61
+ type: 'address',
62
+ },
63
+ ],
64
+ stateMutability: 'view',
65
+ type: 'function',
66
+ },
67
+ {
68
+ inputs: [],
69
+ name: 'QUOTE_FEED_2',
70
+ outputs: [
71
+ {
72
+ internalType: 'contract AggregatorV3Interface',
73
+ name: '',
74
+ type: 'address',
75
+ },
76
+ ],
77
+ stateMutability: 'view',
78
+ type: 'function',
79
+ },
80
+ {
81
+ inputs: [],
82
+ name: 'QUOTE_VAULT',
83
+ outputs: [
84
+ {
85
+ internalType: 'contract IERC4626',
86
+ name: '',
87
+ type: 'address',
88
+ },
89
+ ],
90
+ stateMutability: 'view',
91
+ type: 'function',
92
+ },
93
+ {
94
+ inputs: [],
95
+ name: 'QUOTE_VAULT_CONVERSION_SAMPLE',
96
+ outputs: [
97
+ {
98
+ internalType: 'uint256',
99
+ name: '',
100
+ type: 'uint256',
101
+ },
102
+ ],
103
+ stateMutability: 'view',
104
+ type: 'function',
105
+ },
106
+ {
107
+ inputs: [],
108
+ name: 'SCALE_FACTOR',
109
+ outputs: [
110
+ {
111
+ internalType: 'uint256',
112
+ name: '',
113
+ type: 'uint256',
114
+ },
115
+ ],
116
+ stateMutability: 'view',
117
+ type: 'function',
118
+ },
119
+ {
120
+ inputs: [],
121
+ name: 'price',
122
+ outputs: [
123
+ {
124
+ internalType: 'uint256',
125
+ name: '',
126
+ type: 'uint256',
127
+ },
128
+ ],
129
+ stateMutability: 'view',
130
+ type: 'function',
131
+ },
132
+ ] as const;
@@ -0,0 +1,109 @@
1
+ export const IMorphoChainlinkOracleV2Factory_ABI = [
2
+ {
3
+ anonymous: false,
4
+ inputs: [
5
+ {
6
+ indexed: false,
7
+ internalType: 'address',
8
+ name: 'caller',
9
+ type: 'address',
10
+ },
11
+ {
12
+ indexed: false,
13
+ internalType: 'address',
14
+ name: 'oracle',
15
+ type: 'address',
16
+ },
17
+ ],
18
+ name: 'CreateMorphoChainlinkOracleV2',
19
+ type: 'event',
20
+ },
21
+ {
22
+ inputs: [
23
+ {
24
+ internalType: 'contract IERC4626',
25
+ name: 'baseVault',
26
+ type: 'address',
27
+ },
28
+ {
29
+ internalType: 'uint256',
30
+ name: 'baseVaultConversionSample',
31
+ type: 'uint256',
32
+ },
33
+ {
34
+ internalType: 'contract AggregatorV3Interface',
35
+ name: 'baseFeed1',
36
+ type: 'address',
37
+ },
38
+ {
39
+ internalType: 'contract AggregatorV3Interface',
40
+ name: 'baseFeed2',
41
+ type: 'address',
42
+ },
43
+ {
44
+ internalType: 'uint256',
45
+ name: 'baseTokenDecimals',
46
+ type: 'uint256',
47
+ },
48
+ {
49
+ internalType: 'contract IERC4626',
50
+ name: 'quoteVault',
51
+ type: 'address',
52
+ },
53
+ {
54
+ internalType: 'uint256',
55
+ name: 'quoteVaultConversionSample',
56
+ type: 'uint256',
57
+ },
58
+ {
59
+ internalType: 'contract AggregatorV3Interface',
60
+ name: 'quoteFeed1',
61
+ type: 'address',
62
+ },
63
+ {
64
+ internalType: 'contract AggregatorV3Interface',
65
+ name: 'quoteFeed2',
66
+ type: 'address',
67
+ },
68
+ {
69
+ internalType: 'uint256',
70
+ name: 'quoteTokenDecimals',
71
+ type: 'uint256',
72
+ },
73
+ {
74
+ internalType: 'bytes32',
75
+ name: 'salt',
76
+ type: 'bytes32',
77
+ },
78
+ ],
79
+ name: 'createMorphoChainlinkOracleV2',
80
+ outputs: [
81
+ {
82
+ internalType: 'contract MorphoChainlinkOracleV2',
83
+ name: 'oracle',
84
+ type: 'address',
85
+ },
86
+ ],
87
+ stateMutability: 'nonpayable',
88
+ type: 'function',
89
+ },
90
+ {
91
+ inputs: [
92
+ {
93
+ internalType: 'address',
94
+ name: 'target',
95
+ type: 'address',
96
+ },
97
+ ],
98
+ name: 'isMorphoChainlinkOracleV2',
99
+ outputs: [
100
+ {
101
+ internalType: 'bool',
102
+ name: '',
103
+ type: 'bool',
104
+ },
105
+ ],
106
+ stateMutability: 'view',
107
+ type: 'function',
108
+ },
109
+ ] as const;
@@ -0,0 +1,20 @@
1
+ export const IMorphoFlashLoanCallback_ABI = [
2
+ {
3
+ inputs: [
4
+ {
5
+ internalType: 'uint256',
6
+ name: 'assets',
7
+ type: 'uint256',
8
+ },
9
+ {
10
+ internalType: 'bytes',
11
+ name: 'data',
12
+ type: 'bytes',
13
+ },
14
+ ],
15
+ name: 'onMorphoFlashLoan',
16
+ outputs: [],
17
+ stateMutability: 'nonpayable',
18
+ type: 'function',
19
+ },
20
+ ] as const;
@@ -0,0 +1,20 @@
1
+ export const IMorphoLiquidateCallback_ABI = [
2
+ {
3
+ inputs: [
4
+ {
5
+ internalType: 'uint256',
6
+ name: 'repaidAssets',
7
+ type: 'uint256',
8
+ },
9
+ {
10
+ internalType: 'bytes',
11
+ name: 'data',
12
+ type: 'bytes',
13
+ },
14
+ ],
15
+ name: 'onMorphoLiquidate',
16
+ outputs: [],
17
+ stateMutability: 'nonpayable',
18
+ type: 'function',
19
+ },
20
+ ] as const;
@@ -0,0 +1,20 @@
1
+ export const IMorphoRepayCallback_ABI = [
2
+ {
3
+ inputs: [
4
+ {
5
+ internalType: 'uint256',
6
+ name: 'assets',
7
+ type: 'uint256',
8
+ },
9
+ {
10
+ internalType: 'bytes',
11
+ name: 'data',
12
+ type: 'bytes',
13
+ },
14
+ ],
15
+ name: 'onMorphoRepay',
16
+ outputs: [],
17
+ stateMutability: 'nonpayable',
18
+ type: 'function',
19
+ },
20
+ ] as const;