@juicedollar/jusd 3.0.1 → 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 +9361 -6680
  15. package/dist/index.mjs +9351 -6674
  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 +44 -16
  32. package/exports/index.ts +22 -14
  33. package/package.json +7 -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
@@ -1,453 +0,0 @@
1
- export const SavingsABI = [
2
- {
3
- inputs: [
4
- {
5
- internalType: 'contract IJuiceDollar',
6
- name: 'jusd_',
7
- type: 'address',
8
- },
9
- {
10
- internalType: 'uint24',
11
- name: 'initialRatePPM',
12
- type: 'uint24',
13
- },
14
- ],
15
- stateMutability: 'nonpayable',
16
- type: 'constructor',
17
- },
18
- {
19
- inputs: [],
20
- name: 'ChangeNotReady',
21
- type: 'error',
22
- },
23
- {
24
- inputs: [],
25
- name: 'ModuleDisabled',
26
- type: 'error',
27
- },
28
- {
29
- inputs: [],
30
- name: 'NoPendingChange',
31
- type: 'error',
32
- },
33
- {
34
- anonymous: false,
35
- inputs: [
36
- {
37
- indexed: true,
38
- internalType: 'address',
39
- name: 'account',
40
- type: 'address',
41
- },
42
- {
43
- indexed: false,
44
- internalType: 'uint256',
45
- name: 'interest',
46
- type: 'uint256',
47
- },
48
- ],
49
- name: 'InterestCollected',
50
- type: 'event',
51
- },
52
- {
53
- anonymous: false,
54
- inputs: [
55
- {
56
- indexed: false,
57
- internalType: 'uint24',
58
- name: 'newRate',
59
- type: 'uint24',
60
- },
61
- ],
62
- name: 'RateChanged',
63
- type: 'event',
64
- },
65
- {
66
- anonymous: false,
67
- inputs: [
68
- {
69
- indexed: false,
70
- internalType: 'address',
71
- name: 'who',
72
- type: 'address',
73
- },
74
- {
75
- indexed: false,
76
- internalType: 'uint24',
77
- name: 'nextRate',
78
- type: 'uint24',
79
- },
80
- {
81
- indexed: false,
82
- internalType: 'uint40',
83
- name: 'nextChange',
84
- type: 'uint40',
85
- },
86
- ],
87
- name: 'RateProposed',
88
- type: 'event',
89
- },
90
- {
91
- anonymous: false,
92
- inputs: [
93
- {
94
- indexed: true,
95
- internalType: 'address',
96
- name: 'account',
97
- type: 'address',
98
- },
99
- {
100
- indexed: false,
101
- internalType: 'uint192',
102
- name: 'amount',
103
- type: 'uint192',
104
- },
105
- ],
106
- name: 'Saved',
107
- type: 'event',
108
- },
109
- {
110
- anonymous: false,
111
- inputs: [
112
- {
113
- indexed: true,
114
- internalType: 'address',
115
- name: 'account',
116
- type: 'address',
117
- },
118
- {
119
- indexed: false,
120
- internalType: 'uint192',
121
- name: 'amount',
122
- type: 'uint192',
123
- },
124
- ],
125
- name: 'Withdrawn',
126
- type: 'event',
127
- },
128
- {
129
- inputs: [
130
- {
131
- internalType: 'address',
132
- name: 'accountOwner',
133
- type: 'address',
134
- },
135
- ],
136
- name: 'accruedInterest',
137
- outputs: [
138
- {
139
- internalType: 'uint192',
140
- name: '',
141
- type: 'uint192',
142
- },
143
- ],
144
- stateMutability: 'view',
145
- type: 'function',
146
- },
147
- {
148
- inputs: [
149
- {
150
- internalType: 'address',
151
- name: 'accountOwner',
152
- type: 'address',
153
- },
154
- {
155
- internalType: 'uint256',
156
- name: 'timestamp',
157
- type: 'uint256',
158
- },
159
- ],
160
- name: 'accruedInterest',
161
- outputs: [
162
- {
163
- internalType: 'uint192',
164
- name: '',
165
- type: 'uint192',
166
- },
167
- ],
168
- stateMutability: 'view',
169
- type: 'function',
170
- },
171
- {
172
- inputs: [
173
- {
174
- internalType: 'uint192',
175
- name: 'targetAmount',
176
- type: 'uint192',
177
- },
178
- ],
179
- name: 'adjust',
180
- outputs: [],
181
- stateMutability: 'nonpayable',
182
- type: 'function',
183
- },
184
- {
185
- inputs: [],
186
- name: 'applyChange',
187
- outputs: [],
188
- stateMutability: 'nonpayable',
189
- type: 'function',
190
- },
191
- {
192
- inputs: [
193
- {
194
- components: [
195
- {
196
- internalType: 'uint192',
197
- name: 'saved',
198
- type: 'uint192',
199
- },
200
- {
201
- internalType: 'uint64',
202
- name: 'ticks',
203
- type: 'uint64',
204
- },
205
- ],
206
- internalType: 'struct Savings.Account',
207
- name: 'account',
208
- type: 'tuple',
209
- },
210
- {
211
- internalType: 'uint64',
212
- name: 'ticks',
213
- type: 'uint64',
214
- },
215
- ],
216
- name: 'calculateInterest',
217
- outputs: [
218
- {
219
- internalType: 'uint192',
220
- name: '',
221
- type: 'uint192',
222
- },
223
- ],
224
- stateMutability: 'view',
225
- type: 'function',
226
- },
227
- {
228
- inputs: [],
229
- name: 'currentRatePPM',
230
- outputs: [
231
- {
232
- internalType: 'uint24',
233
- name: '',
234
- type: 'uint24',
235
- },
236
- ],
237
- stateMutability: 'view',
238
- type: 'function',
239
- },
240
- {
241
- inputs: [],
242
- name: 'currentTicks',
243
- outputs: [
244
- {
245
- internalType: 'uint64',
246
- name: '',
247
- type: 'uint64',
248
- },
249
- ],
250
- stateMutability: 'view',
251
- type: 'function',
252
- },
253
- {
254
- inputs: [],
255
- name: 'equity',
256
- outputs: [
257
- {
258
- internalType: 'contract IReserve',
259
- name: '',
260
- type: 'address',
261
- },
262
- ],
263
- stateMutability: 'view',
264
- type: 'function',
265
- },
266
- {
267
- inputs: [],
268
- name: 'jusd',
269
- outputs: [
270
- {
271
- internalType: 'contract IERC20',
272
- name: '',
273
- type: 'address',
274
- },
275
- ],
276
- stateMutability: 'view',
277
- type: 'function',
278
- },
279
- {
280
- inputs: [],
281
- name: 'nextChange',
282
- outputs: [
283
- {
284
- internalType: 'uint40',
285
- name: '',
286
- type: 'uint40',
287
- },
288
- ],
289
- stateMutability: 'view',
290
- type: 'function',
291
- },
292
- {
293
- inputs: [],
294
- name: 'nextRatePPM',
295
- outputs: [
296
- {
297
- internalType: 'uint24',
298
- name: '',
299
- type: 'uint24',
300
- },
301
- ],
302
- stateMutability: 'view',
303
- type: 'function',
304
- },
305
- {
306
- inputs: [
307
- {
308
- internalType: 'uint24',
309
- name: 'newRatePPM_',
310
- type: 'uint24',
311
- },
312
- {
313
- internalType: 'address[]',
314
- name: 'helpers',
315
- type: 'address[]',
316
- },
317
- ],
318
- name: 'proposeChange',
319
- outputs: [],
320
- stateMutability: 'nonpayable',
321
- type: 'function',
322
- },
323
- {
324
- inputs: [
325
- {
326
- internalType: 'address',
327
- name: 'owner',
328
- type: 'address',
329
- },
330
- ],
331
- name: 'refreshBalance',
332
- outputs: [
333
- {
334
- internalType: 'uint192',
335
- name: '',
336
- type: 'uint192',
337
- },
338
- ],
339
- stateMutability: 'nonpayable',
340
- type: 'function',
341
- },
342
- {
343
- inputs: [],
344
- name: 'refreshMyBalance',
345
- outputs: [
346
- {
347
- internalType: 'uint192',
348
- name: '',
349
- type: 'uint192',
350
- },
351
- ],
352
- stateMutability: 'nonpayable',
353
- type: 'function',
354
- },
355
- {
356
- inputs: [
357
- {
358
- internalType: 'address',
359
- name: 'owner',
360
- type: 'address',
361
- },
362
- {
363
- internalType: 'uint192',
364
- name: 'amount',
365
- type: 'uint192',
366
- },
367
- ],
368
- name: 'save',
369
- outputs: [],
370
- stateMutability: 'nonpayable',
371
- type: 'function',
372
- },
373
- {
374
- inputs: [
375
- {
376
- internalType: 'uint192',
377
- name: 'amount',
378
- type: 'uint192',
379
- },
380
- ],
381
- name: 'save',
382
- outputs: [],
383
- stateMutability: 'nonpayable',
384
- type: 'function',
385
- },
386
- {
387
- inputs: [
388
- {
389
- internalType: 'address',
390
- name: '',
391
- type: 'address',
392
- },
393
- ],
394
- name: 'savings',
395
- outputs: [
396
- {
397
- internalType: 'uint192',
398
- name: 'saved',
399
- type: 'uint192',
400
- },
401
- {
402
- internalType: 'uint64',
403
- name: 'ticks',
404
- type: 'uint64',
405
- },
406
- ],
407
- stateMutability: 'view',
408
- type: 'function',
409
- },
410
- {
411
- inputs: [
412
- {
413
- internalType: 'uint256',
414
- name: 'timestamp',
415
- type: 'uint256',
416
- },
417
- ],
418
- name: 'ticks',
419
- outputs: [
420
- {
421
- internalType: 'uint64',
422
- name: '',
423
- type: 'uint64',
424
- },
425
- ],
426
- stateMutability: 'view',
427
- type: 'function',
428
- },
429
- {
430
- inputs: [
431
- {
432
- internalType: 'address',
433
- name: 'target',
434
- type: 'address',
435
- },
436
- {
437
- internalType: 'uint192',
438
- name: 'amount',
439
- type: 'uint192',
440
- },
441
- ],
442
- name: 'withdraw',
443
- outputs: [
444
- {
445
- internalType: 'uint256',
446
- name: '',
447
- type: 'uint256',
448
- },
449
- ],
450
- stateMutability: 'nonpayable',
451
- type: 'function',
452
- },
453
- ] as const;
@@ -1,279 +0,0 @@
1
- export const StablecoinBridgeABI = [
2
- {
3
- inputs: [
4
- {
5
- internalType: 'address',
6
- name: 'other',
7
- type: 'address',
8
- },
9
- {
10
- internalType: 'address',
11
- name: 'JUSDAddress',
12
- type: 'address',
13
- },
14
- {
15
- internalType: 'uint256',
16
- name: 'limit_',
17
- type: 'uint256',
18
- },
19
- {
20
- internalType: 'uint256',
21
- name: 'weeks_',
22
- type: 'uint256',
23
- },
24
- ],
25
- stateMutability: 'nonpayable',
26
- type: 'constructor',
27
- },
28
- {
29
- inputs: [],
30
- name: 'AlreadyStopped',
31
- type: 'error',
32
- },
33
- {
34
- inputs: [
35
- {
36
- internalType: 'uint256',
37
- name: 'time',
38
- type: 'uint256',
39
- },
40
- {
41
- internalType: 'uint256',
42
- name: 'expiration',
43
- type: 'uint256',
44
- },
45
- ],
46
- name: 'Expired',
47
- type: 'error',
48
- },
49
- {
50
- inputs: [
51
- {
52
- internalType: 'uint256',
53
- name: 'amount',
54
- type: 'uint256',
55
- },
56
- {
57
- internalType: 'uint256',
58
- name: 'limit',
59
- type: 'uint256',
60
- },
61
- ],
62
- name: 'Limit',
63
- type: 'error',
64
- },
65
- {
66
- inputs: [],
67
- name: 'NoGovernance',
68
- type: 'error',
69
- },
70
- {
71
- inputs: [],
72
- name: 'NotQualified',
73
- type: 'error',
74
- },
75
- {
76
- inputs: [
77
- {
78
- internalType: 'address',
79
- name: 'token',
80
- type: 'address',
81
- },
82
- ],
83
- name: 'SafeERC20FailedOperation',
84
- type: 'error',
85
- },
86
- {
87
- inputs: [],
88
- name: 'Stopped',
89
- type: 'error',
90
- },
91
- {
92
- inputs: [
93
- {
94
- internalType: 'address',
95
- name: 'token',
96
- type: 'address',
97
- },
98
- ],
99
- name: 'UnsupportedToken',
100
- type: 'error',
101
- },
102
- {
103
- anonymous: false,
104
- inputs: [
105
- {
106
- indexed: true,
107
- internalType: 'address',
108
- name: 'caller',
109
- type: 'address',
110
- },
111
- {
112
- indexed: false,
113
- internalType: 'string',
114
- name: 'message',
115
- type: 'string',
116
- },
117
- ],
118
- name: 'EmergencyStopped',
119
- type: 'event',
120
- },
121
- {
122
- inputs: [],
123
- name: 'JUSD',
124
- outputs: [
125
- {
126
- internalType: 'contract IJuiceDollar',
127
- name: '',
128
- type: 'address',
129
- },
130
- ],
131
- stateMutability: 'view',
132
- type: 'function',
133
- },
134
- {
135
- inputs: [
136
- {
137
- internalType: 'uint256',
138
- name: 'amount',
139
- type: 'uint256',
140
- },
141
- ],
142
- name: 'burn',
143
- outputs: [],
144
- stateMutability: 'nonpayable',
145
- type: 'function',
146
- },
147
- {
148
- inputs: [
149
- {
150
- internalType: 'address',
151
- name: 'target',
152
- type: 'address',
153
- },
154
- {
155
- internalType: 'uint256',
156
- name: 'amount',
157
- type: 'uint256',
158
- },
159
- ],
160
- name: 'burnAndSend',
161
- outputs: [],
162
- stateMutability: 'nonpayable',
163
- type: 'function',
164
- },
165
- {
166
- inputs: [
167
- {
168
- internalType: 'address[]',
169
- name: '_helpers',
170
- type: 'address[]',
171
- },
172
- {
173
- internalType: 'string',
174
- name: '_message',
175
- type: 'string',
176
- },
177
- ],
178
- name: 'emergencyStop',
179
- outputs: [],
180
- stateMutability: 'nonpayable',
181
- type: 'function',
182
- },
183
- {
184
- inputs: [],
185
- name: 'horizon',
186
- outputs: [
187
- {
188
- internalType: 'uint256',
189
- name: '',
190
- type: 'uint256',
191
- },
192
- ],
193
- stateMutability: 'view',
194
- type: 'function',
195
- },
196
- {
197
- inputs: [],
198
- name: 'limit',
199
- outputs: [
200
- {
201
- internalType: 'uint256',
202
- name: '',
203
- type: 'uint256',
204
- },
205
- ],
206
- stateMutability: 'view',
207
- type: 'function',
208
- },
209
- {
210
- inputs: [
211
- {
212
- internalType: 'uint256',
213
- name: 'amount',
214
- type: 'uint256',
215
- },
216
- ],
217
- name: 'mint',
218
- outputs: [],
219
- stateMutability: 'nonpayable',
220
- type: 'function',
221
- },
222
- {
223
- inputs: [
224
- {
225
- internalType: 'address',
226
- name: 'target',
227
- type: 'address',
228
- },
229
- {
230
- internalType: 'uint256',
231
- name: 'amount',
232
- type: 'uint256',
233
- },
234
- ],
235
- name: 'mintTo',
236
- outputs: [],
237
- stateMutability: 'nonpayable',
238
- type: 'function',
239
- },
240
- {
241
- inputs: [],
242
- name: 'minted',
243
- outputs: [
244
- {
245
- internalType: 'uint256',
246
- name: '',
247
- type: 'uint256',
248
- },
249
- ],
250
- stateMutability: 'view',
251
- type: 'function',
252
- },
253
- {
254
- inputs: [],
255
- name: 'stopped',
256
- outputs: [
257
- {
258
- internalType: 'bool',
259
- name: '',
260
- type: 'bool',
261
- },
262
- ],
263
- stateMutability: 'view',
264
- type: 'function',
265
- },
266
- {
267
- inputs: [],
268
- name: 'usd',
269
- outputs: [
270
- {
271
- internalType: 'contract IERC20',
272
- name: '',
273
- type: 'address',
274
- },
275
- ],
276
- stateMutability: 'view',
277
- type: 'function',
278
- },
279
- ] as const;