@juicedollar/jusd 3.0.0 → 4.0.0

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 (47) hide show
  1. package/contracts/Leadrate.sol +1 -1
  2. package/contracts/{MintingHubV2 → MintingHubV3}/MintingHub.sol +93 -100
  3. package/contracts/{MintingHubV2 → MintingHubV3}/Position.sol +20 -13
  4. package/contracts/{MintingHubV2 → MintingHubV3}/PositionRoller.sol +17 -37
  5. package/contracts/{MintingHubV2 → MintingHubV3}/interface/IMintingHub.sol +2 -2
  6. package/contracts/{MintingHubV2 → MintingHubV3}/interface/IPosition.sol +3 -3
  7. package/contracts/Savings.sol +36 -6
  8. package/contracts/interface/ISavingsJUSD.sol +10 -1
  9. package/contracts/test/PositionExpirationTest.sol +17 -38
  10. package/contracts/test/PositionRollingTest.sol +3 -3
  11. package/contracts/test/ReentrantAttacker.sol +1 -1
  12. package/dist/index.d.mts +5609 -3568
  13. package/dist/index.d.ts +5609 -3568
  14. package/dist/index.js +9360 -6681
  15. package/dist/index.mjs +9350 -6675
  16. package/exports/abis/shared/Equity.ts +1286 -0
  17. package/exports/abis/shared/JuiceDollar.ts +1366 -0
  18. package/exports/abis/shared/StablecoinBridge.ts +279 -0
  19. package/exports/abis/utils/StartUSD.ts +213 -213
  20. package/exports/abis/{core → v2}/FrontendGateway.ts +1 -1
  21. package/exports/abis/{core → v2}/MintingHubGateway.ts +1 -1
  22. package/exports/abis/{MintingHubV2 → v2}/PositionRoller.ts +1 -1
  23. package/exports/abis/{core → v2}/SavingsGateway.ts +1 -1
  24. package/exports/abis/{core → v2}/SavingsVaultJUSD.ts +1 -1
  25. package/exports/abis/v3/MintingHub.ts +1024 -0
  26. package/exports/abis/v3/Position.ts +1142 -0
  27. package/exports/abis/v3/PositionFactory.ts +90 -0
  28. package/exports/abis/v3/PositionRoller.ts +255 -0
  29. package/exports/abis/v3/Savings.ts +553 -0
  30. package/exports/abis/v3/SavingsVaultJUSD.ts +925 -0
  31. package/exports/address.config.ts +43 -15
  32. package/exports/index.ts +22 -14
  33. package/package.json +9 -9
  34. package/contracts/gateway/FrontendGateway.sol +0 -224
  35. package/contracts/gateway/MintingHubGateway.sol +0 -82
  36. package/contracts/gateway/SavingsGateway.sol +0 -51
  37. package/contracts/gateway/interface/IFrontendGateway.sol +0 -49
  38. package/contracts/gateway/interface/IMintingHubGateway.sol +0 -12
  39. package/exports/abis/core/Equity.ts +0 -1286
  40. package/exports/abis/core/JuiceDollar.ts +0 -1366
  41. package/exports/abis/utils/MintingHubV2.ts +0 -888
  42. package/exports/abis/utils/Savings.ts +0 -453
  43. package/exports/abis/utils/StablecoinBridge.ts +0 -279
  44. /package/contracts/{MintingHubV2 → MintingHubV3}/PositionFactory.sol +0 -0
  45. /package/contracts/{MintingHubV2 → MintingHubV3}/interface/IPositionFactory.sol +0 -0
  46. /package/exports/abis/{MintingHubV2 → v2}/PositionFactoryV2.ts +0 -0
  47. /package/exports/abis/{MintingHubV2 → v2}/PositionV2.ts +0 -0
@@ -0,0 +1,90 @@
1
+ export const PositionFactoryV3ABI = [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "address",
6
+ "name": "_parent",
7
+ "type": "address"
8
+ }
9
+ ],
10
+ "name": "clonePosition",
11
+ "outputs": [
12
+ {
13
+ "internalType": "address",
14
+ "name": "",
15
+ "type": "address"
16
+ }
17
+ ],
18
+ "stateMutability": "nonpayable",
19
+ "type": "function"
20
+ },
21
+ {
22
+ "inputs": [
23
+ {
24
+ "internalType": "address",
25
+ "name": "_owner",
26
+ "type": "address"
27
+ },
28
+ {
29
+ "internalType": "address",
30
+ "name": "_jusd",
31
+ "type": "address"
32
+ },
33
+ {
34
+ "internalType": "address",
35
+ "name": "_collateral",
36
+ "type": "address"
37
+ },
38
+ {
39
+ "internalType": "uint256",
40
+ "name": "_minCollateral",
41
+ "type": "uint256"
42
+ },
43
+ {
44
+ "internalType": "uint256",
45
+ "name": "_initialLimit",
46
+ "type": "uint256"
47
+ },
48
+ {
49
+ "internalType": "uint40",
50
+ "name": "_initPeriod",
51
+ "type": "uint40"
52
+ },
53
+ {
54
+ "internalType": "uint40",
55
+ "name": "_duration",
56
+ "type": "uint40"
57
+ },
58
+ {
59
+ "internalType": "uint40",
60
+ "name": "_challengePeriod",
61
+ "type": "uint40"
62
+ },
63
+ {
64
+ "internalType": "uint24",
65
+ "name": "_riskPremiumPPM",
66
+ "type": "uint24"
67
+ },
68
+ {
69
+ "internalType": "uint256",
70
+ "name": "_liqPrice",
71
+ "type": "uint256"
72
+ },
73
+ {
74
+ "internalType": "uint24",
75
+ "name": "_reserve",
76
+ "type": "uint24"
77
+ }
78
+ ],
79
+ "name": "createNewPosition",
80
+ "outputs": [
81
+ {
82
+ "internalType": "address",
83
+ "name": "",
84
+ "type": "address"
85
+ }
86
+ ],
87
+ "stateMutability": "nonpayable",
88
+ "type": "function"
89
+ }
90
+ ] as const;
@@ -0,0 +1,255 @@
1
+ export const PositionRollerV3ABI = [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "address",
6
+ "name": "jusd_",
7
+ "type": "address"
8
+ }
9
+ ],
10
+ "stateMutability": "nonpayable",
11
+ "type": "constructor"
12
+ },
13
+ {
14
+ "inputs": [],
15
+ "name": "NativeTransferFailed",
16
+ "type": "error"
17
+ },
18
+ {
19
+ "inputs": [
20
+ {
21
+ "internalType": "address",
22
+ "name": "pos",
23
+ "type": "address"
24
+ }
25
+ ],
26
+ "name": "NotOwner",
27
+ "type": "error"
28
+ },
29
+ {
30
+ "inputs": [
31
+ {
32
+ "internalType": "address",
33
+ "name": "pos",
34
+ "type": "address"
35
+ }
36
+ ],
37
+ "name": "NotPosition",
38
+ "type": "error"
39
+ },
40
+ {
41
+ "anonymous": false,
42
+ "inputs": [
43
+ {
44
+ "indexed": false,
45
+ "internalType": "address",
46
+ "name": "source",
47
+ "type": "address"
48
+ },
49
+ {
50
+ "indexed": false,
51
+ "internalType": "uint256",
52
+ "name": "collWithdraw",
53
+ "type": "uint256"
54
+ },
55
+ {
56
+ "indexed": false,
57
+ "internalType": "uint256",
58
+ "name": "repay",
59
+ "type": "uint256"
60
+ },
61
+ {
62
+ "indexed": false,
63
+ "internalType": "address",
64
+ "name": "target",
65
+ "type": "address"
66
+ },
67
+ {
68
+ "indexed": false,
69
+ "internalType": "uint256",
70
+ "name": "collDeposit",
71
+ "type": "uint256"
72
+ },
73
+ {
74
+ "indexed": false,
75
+ "internalType": "uint256",
76
+ "name": "mint",
77
+ "type": "uint256"
78
+ }
79
+ ],
80
+ "name": "Roll",
81
+ "type": "event"
82
+ },
83
+ {
84
+ "inputs": [
85
+ {
86
+ "internalType": "contract IPosition",
87
+ "name": "source",
88
+ "type": "address"
89
+ },
90
+ {
91
+ "internalType": "uint256",
92
+ "name": "repay",
93
+ "type": "uint256"
94
+ },
95
+ {
96
+ "internalType": "uint256",
97
+ "name": "collWithdraw",
98
+ "type": "uint256"
99
+ },
100
+ {
101
+ "internalType": "contract IPosition",
102
+ "name": "target",
103
+ "type": "address"
104
+ },
105
+ {
106
+ "internalType": "uint256",
107
+ "name": "mint",
108
+ "type": "uint256"
109
+ },
110
+ {
111
+ "internalType": "uint256",
112
+ "name": "collDeposit",
113
+ "type": "uint256"
114
+ },
115
+ {
116
+ "internalType": "uint40",
117
+ "name": "expiration",
118
+ "type": "uint40"
119
+ }
120
+ ],
121
+ "name": "roll",
122
+ "outputs": [],
123
+ "stateMutability": "nonpayable",
124
+ "type": "function"
125
+ },
126
+ {
127
+ "inputs": [
128
+ {
129
+ "internalType": "contract IPosition",
130
+ "name": "source",
131
+ "type": "address"
132
+ },
133
+ {
134
+ "internalType": "contract IPosition",
135
+ "name": "target",
136
+ "type": "address"
137
+ }
138
+ ],
139
+ "name": "rollFully",
140
+ "outputs": [],
141
+ "stateMutability": "nonpayable",
142
+ "type": "function"
143
+ },
144
+ {
145
+ "inputs": [
146
+ {
147
+ "internalType": "contract IPosition",
148
+ "name": "source",
149
+ "type": "address"
150
+ },
151
+ {
152
+ "internalType": "contract IPosition",
153
+ "name": "target",
154
+ "type": "address"
155
+ }
156
+ ],
157
+ "name": "rollFullyNative",
158
+ "outputs": [],
159
+ "stateMutability": "payable",
160
+ "type": "function"
161
+ },
162
+ {
163
+ "inputs": [
164
+ {
165
+ "internalType": "contract IPosition",
166
+ "name": "source",
167
+ "type": "address"
168
+ },
169
+ {
170
+ "internalType": "contract IPosition",
171
+ "name": "target",
172
+ "type": "address"
173
+ },
174
+ {
175
+ "internalType": "uint40",
176
+ "name": "expiration",
177
+ "type": "uint40"
178
+ }
179
+ ],
180
+ "name": "rollFullyNativeWithExpiration",
181
+ "outputs": [],
182
+ "stateMutability": "payable",
183
+ "type": "function"
184
+ },
185
+ {
186
+ "inputs": [
187
+ {
188
+ "internalType": "contract IPosition",
189
+ "name": "source",
190
+ "type": "address"
191
+ },
192
+ {
193
+ "internalType": "contract IPosition",
194
+ "name": "target",
195
+ "type": "address"
196
+ },
197
+ {
198
+ "internalType": "uint40",
199
+ "name": "expiration",
200
+ "type": "uint40"
201
+ }
202
+ ],
203
+ "name": "rollFullyWithExpiration",
204
+ "outputs": [],
205
+ "stateMutability": "nonpayable",
206
+ "type": "function"
207
+ },
208
+ {
209
+ "inputs": [
210
+ {
211
+ "internalType": "contract IPosition",
212
+ "name": "source",
213
+ "type": "address"
214
+ },
215
+ {
216
+ "internalType": "uint256",
217
+ "name": "repay",
218
+ "type": "uint256"
219
+ },
220
+ {
221
+ "internalType": "uint256",
222
+ "name": "collWithdraw",
223
+ "type": "uint256"
224
+ },
225
+ {
226
+ "internalType": "contract IPosition",
227
+ "name": "target",
228
+ "type": "address"
229
+ },
230
+ {
231
+ "internalType": "uint256",
232
+ "name": "mint",
233
+ "type": "uint256"
234
+ },
235
+ {
236
+ "internalType": "uint256",
237
+ "name": "collDeposit",
238
+ "type": "uint256"
239
+ },
240
+ {
241
+ "internalType": "uint40",
242
+ "name": "expiration",
243
+ "type": "uint40"
244
+ }
245
+ ],
246
+ "name": "rollNative",
247
+ "outputs": [],
248
+ "stateMutability": "payable",
249
+ "type": "function"
250
+ },
251
+ {
252
+ "stateMutability": "payable",
253
+ "type": "receive"
254
+ }
255
+ ] as const;