@juicedollar/jusd 3.0.1 → 4.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 (48) 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/TeamMinter.sol +68 -0
  9. package/contracts/interface/ISavingsJUSD.sol +10 -1
  10. package/contracts/test/PositionExpirationTest.sol +17 -38
  11. package/contracts/test/PositionRollingTest.sol +3 -3
  12. package/contracts/test/ReentrantAttacker.sol +1 -1
  13. package/dist/index.d.mts +5609 -3568
  14. package/dist/index.d.ts +5609 -3568
  15. package/dist/index.js +9380 -6699
  16. package/dist/index.mjs +9370 -6693
  17. package/exports/abis/shared/Equity.ts +1286 -0
  18. package/exports/abis/shared/JuiceDollar.ts +1366 -0
  19. package/exports/abis/shared/StablecoinBridge.ts +279 -0
  20. package/exports/abis/utils/StartUSD.ts +213 -213
  21. package/exports/abis/{core → v2}/FrontendGateway.ts +1 -1
  22. package/exports/abis/{core → v2}/MintingHubGateway.ts +1 -1
  23. package/exports/abis/{MintingHubV2 → v2}/PositionRoller.ts +1 -1
  24. package/exports/abis/{core → v2}/SavingsGateway.ts +1 -1
  25. package/exports/abis/{core → v2}/SavingsVaultJUSD.ts +1 -1
  26. package/exports/abis/v3/MintingHub.ts +1024 -0
  27. package/exports/abis/v3/Position.ts +1142 -0
  28. package/exports/abis/v3/PositionFactory.ts +90 -0
  29. package/exports/abis/v3/PositionRoller.ts +255 -0
  30. package/exports/abis/v3/Savings.ts +553 -0
  31. package/exports/abis/v3/SavingsVaultJUSD.ts +925 -0
  32. package/exports/address.config.ts +63 -35
  33. package/exports/index.ts +22 -14
  34. package/package.json +7 -9
  35. package/contracts/gateway/FrontendGateway.sol +0 -224
  36. package/contracts/gateway/MintingHubGateway.sol +0 -82
  37. package/contracts/gateway/SavingsGateway.sol +0 -51
  38. package/contracts/gateway/interface/IFrontendGateway.sol +0 -49
  39. package/contracts/gateway/interface/IMintingHubGateway.sol +0 -12
  40. package/exports/abis/core/Equity.ts +0 -1286
  41. package/exports/abis/core/JuiceDollar.ts +0 -1366
  42. package/exports/abis/utils/MintingHubV2.ts +0 -888
  43. package/exports/abis/utils/Savings.ts +0 -453
  44. package/exports/abis/utils/StablecoinBridge.ts +0 -279
  45. /package/contracts/{MintingHubV2 → MintingHubV3}/PositionFactory.sol +0 -0
  46. /package/contracts/{MintingHubV2 → MintingHubV3}/interface/IPositionFactory.sol +0 -0
  47. /package/exports/abis/{MintingHubV2 → v2}/PositionFactoryV2.ts +0 -0
  48. /package/exports/abis/{MintingHubV2 → v2}/PositionV2.ts +0 -0
@@ -0,0 +1,553 @@
1
+ export const SavingsV3ABI = [
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": "uint192",
45
+ "name": "amount",
46
+ "type": "uint192"
47
+ }
48
+ ],
49
+ "name": "InterestClaimed",
50
+ "type": "event"
51
+ },
52
+ {
53
+ "anonymous": false,
54
+ "inputs": [
55
+ {
56
+ "indexed": true,
57
+ "internalType": "address",
58
+ "name": "account",
59
+ "type": "address"
60
+ },
61
+ {
62
+ "indexed": false,
63
+ "internalType": "uint256",
64
+ "name": "interest",
65
+ "type": "uint256"
66
+ },
67
+ {
68
+ "indexed": false,
69
+ "internalType": "bool",
70
+ "name": "compounded",
71
+ "type": "bool"
72
+ }
73
+ ],
74
+ "name": "InterestCollected",
75
+ "type": "event"
76
+ },
77
+ {
78
+ "anonymous": false,
79
+ "inputs": [
80
+ {
81
+ "indexed": false,
82
+ "internalType": "uint24",
83
+ "name": "newRate",
84
+ "type": "uint24"
85
+ }
86
+ ],
87
+ "name": "RateChanged",
88
+ "type": "event"
89
+ },
90
+ {
91
+ "anonymous": false,
92
+ "inputs": [
93
+ {
94
+ "indexed": false,
95
+ "internalType": "address",
96
+ "name": "who",
97
+ "type": "address"
98
+ },
99
+ {
100
+ "indexed": false,
101
+ "internalType": "uint24",
102
+ "name": "nextRate",
103
+ "type": "uint24"
104
+ },
105
+ {
106
+ "indexed": false,
107
+ "internalType": "uint40",
108
+ "name": "nextChange",
109
+ "type": "uint40"
110
+ }
111
+ ],
112
+ "name": "RateProposed",
113
+ "type": "event"
114
+ },
115
+ {
116
+ "anonymous": false,
117
+ "inputs": [
118
+ {
119
+ "indexed": true,
120
+ "internalType": "address",
121
+ "name": "account",
122
+ "type": "address"
123
+ },
124
+ {
125
+ "indexed": false,
126
+ "internalType": "uint192",
127
+ "name": "amount",
128
+ "type": "uint192"
129
+ }
130
+ ],
131
+ "name": "Saved",
132
+ "type": "event"
133
+ },
134
+ {
135
+ "anonymous": false,
136
+ "inputs": [
137
+ {
138
+ "indexed": true,
139
+ "internalType": "address",
140
+ "name": "account",
141
+ "type": "address"
142
+ },
143
+ {
144
+ "indexed": false,
145
+ "internalType": "uint192",
146
+ "name": "amount",
147
+ "type": "uint192"
148
+ }
149
+ ],
150
+ "name": "Withdrawn",
151
+ "type": "event"
152
+ },
153
+ {
154
+ "inputs": [
155
+ {
156
+ "internalType": "address",
157
+ "name": "accountOwner",
158
+ "type": "address"
159
+ }
160
+ ],
161
+ "name": "accruedInterest",
162
+ "outputs": [
163
+ {
164
+ "internalType": "uint192",
165
+ "name": "",
166
+ "type": "uint192"
167
+ }
168
+ ],
169
+ "stateMutability": "view",
170
+ "type": "function"
171
+ },
172
+ {
173
+ "inputs": [
174
+ {
175
+ "internalType": "address",
176
+ "name": "accountOwner",
177
+ "type": "address"
178
+ },
179
+ {
180
+ "internalType": "uint256",
181
+ "name": "timestamp",
182
+ "type": "uint256"
183
+ }
184
+ ],
185
+ "name": "accruedInterest",
186
+ "outputs": [
187
+ {
188
+ "internalType": "uint192",
189
+ "name": "",
190
+ "type": "uint192"
191
+ }
192
+ ],
193
+ "stateMutability": "view",
194
+ "type": "function"
195
+ },
196
+ {
197
+ "inputs": [
198
+ {
199
+ "internalType": "uint192",
200
+ "name": "targetAmount",
201
+ "type": "uint192"
202
+ }
203
+ ],
204
+ "name": "adjust",
205
+ "outputs": [],
206
+ "stateMutability": "nonpayable",
207
+ "type": "function"
208
+ },
209
+ {
210
+ "inputs": [],
211
+ "name": "applyChange",
212
+ "outputs": [],
213
+ "stateMutability": "nonpayable",
214
+ "type": "function"
215
+ },
216
+ {
217
+ "inputs": [
218
+ {
219
+ "components": [
220
+ {
221
+ "internalType": "uint192",
222
+ "name": "saved",
223
+ "type": "uint192"
224
+ },
225
+ {
226
+ "internalType": "uint64",
227
+ "name": "ticks",
228
+ "type": "uint64"
229
+ }
230
+ ],
231
+ "internalType": "struct Savings.Account",
232
+ "name": "account",
233
+ "type": "tuple"
234
+ },
235
+ {
236
+ "internalType": "uint64",
237
+ "name": "ticks",
238
+ "type": "uint64"
239
+ }
240
+ ],
241
+ "name": "calculateInterest",
242
+ "outputs": [
243
+ {
244
+ "internalType": "uint192",
245
+ "name": "",
246
+ "type": "uint192"
247
+ }
248
+ ],
249
+ "stateMutability": "view",
250
+ "type": "function"
251
+ },
252
+ {
253
+ "inputs": [
254
+ {
255
+ "internalType": "address",
256
+ "name": "target",
257
+ "type": "address"
258
+ }
259
+ ],
260
+ "name": "claimInterest",
261
+ "outputs": [
262
+ {
263
+ "internalType": "uint192",
264
+ "name": "",
265
+ "type": "uint192"
266
+ }
267
+ ],
268
+ "stateMutability": "nonpayable",
269
+ "type": "function"
270
+ },
271
+ {
272
+ "inputs": [
273
+ {
274
+ "internalType": "address",
275
+ "name": "",
276
+ "type": "address"
277
+ }
278
+ ],
279
+ "name": "claimableInterest",
280
+ "outputs": [
281
+ {
282
+ "internalType": "uint192",
283
+ "name": "",
284
+ "type": "uint192"
285
+ }
286
+ ],
287
+ "stateMutability": "view",
288
+ "type": "function"
289
+ },
290
+ {
291
+ "inputs": [],
292
+ "name": "currentRatePPM",
293
+ "outputs": [
294
+ {
295
+ "internalType": "uint24",
296
+ "name": "",
297
+ "type": "uint24"
298
+ }
299
+ ],
300
+ "stateMutability": "view",
301
+ "type": "function"
302
+ },
303
+ {
304
+ "inputs": [],
305
+ "name": "currentTicks",
306
+ "outputs": [
307
+ {
308
+ "internalType": "uint64",
309
+ "name": "",
310
+ "type": "uint64"
311
+ }
312
+ ],
313
+ "stateMutability": "view",
314
+ "type": "function"
315
+ },
316
+ {
317
+ "inputs": [],
318
+ "name": "equity",
319
+ "outputs": [
320
+ {
321
+ "internalType": "contract IReserve",
322
+ "name": "",
323
+ "type": "address"
324
+ }
325
+ ],
326
+ "stateMutability": "view",
327
+ "type": "function"
328
+ },
329
+ {
330
+ "inputs": [],
331
+ "name": "jusd",
332
+ "outputs": [
333
+ {
334
+ "internalType": "contract IERC20",
335
+ "name": "",
336
+ "type": "address"
337
+ }
338
+ ],
339
+ "stateMutability": "view",
340
+ "type": "function"
341
+ },
342
+ {
343
+ "inputs": [],
344
+ "name": "nextChange",
345
+ "outputs": [
346
+ {
347
+ "internalType": "uint40",
348
+ "name": "",
349
+ "type": "uint40"
350
+ }
351
+ ],
352
+ "stateMutability": "view",
353
+ "type": "function"
354
+ },
355
+ {
356
+ "inputs": [],
357
+ "name": "nextRatePPM",
358
+ "outputs": [
359
+ {
360
+ "internalType": "uint24",
361
+ "name": "",
362
+ "type": "uint24"
363
+ }
364
+ ],
365
+ "stateMutability": "view",
366
+ "type": "function"
367
+ },
368
+ {
369
+ "inputs": [
370
+ {
371
+ "internalType": "address",
372
+ "name": "",
373
+ "type": "address"
374
+ }
375
+ ],
376
+ "name": "nonCompounding",
377
+ "outputs": [
378
+ {
379
+ "internalType": "bool",
380
+ "name": "",
381
+ "type": "bool"
382
+ }
383
+ ],
384
+ "stateMutability": "view",
385
+ "type": "function"
386
+ },
387
+ {
388
+ "inputs": [
389
+ {
390
+ "internalType": "uint24",
391
+ "name": "newRatePPM_",
392
+ "type": "uint24"
393
+ },
394
+ {
395
+ "internalType": "address[]",
396
+ "name": "helpers",
397
+ "type": "address[]"
398
+ }
399
+ ],
400
+ "name": "proposeChange",
401
+ "outputs": [],
402
+ "stateMutability": "nonpayable",
403
+ "type": "function"
404
+ },
405
+ {
406
+ "inputs": [
407
+ {
408
+ "internalType": "address",
409
+ "name": "owner",
410
+ "type": "address"
411
+ }
412
+ ],
413
+ "name": "refreshBalance",
414
+ "outputs": [
415
+ {
416
+ "internalType": "uint192",
417
+ "name": "",
418
+ "type": "uint192"
419
+ }
420
+ ],
421
+ "stateMutability": "nonpayable",
422
+ "type": "function"
423
+ },
424
+ {
425
+ "inputs": [],
426
+ "name": "refreshMyBalance",
427
+ "outputs": [
428
+ {
429
+ "internalType": "uint192",
430
+ "name": "",
431
+ "type": "uint192"
432
+ }
433
+ ],
434
+ "stateMutability": "nonpayable",
435
+ "type": "function"
436
+ },
437
+ {
438
+ "inputs": [
439
+ {
440
+ "internalType": "uint192",
441
+ "name": "amount",
442
+ "type": "uint192"
443
+ },
444
+ {
445
+ "internalType": "bool",
446
+ "name": "compound",
447
+ "type": "bool"
448
+ }
449
+ ],
450
+ "name": "save",
451
+ "outputs": [],
452
+ "stateMutability": "nonpayable",
453
+ "type": "function"
454
+ },
455
+ {
456
+ "inputs": [
457
+ {
458
+ "internalType": "address",
459
+ "name": "owner",
460
+ "type": "address"
461
+ },
462
+ {
463
+ "internalType": "uint192",
464
+ "name": "amount",
465
+ "type": "uint192"
466
+ }
467
+ ],
468
+ "name": "save",
469
+ "outputs": [],
470
+ "stateMutability": "nonpayable",
471
+ "type": "function"
472
+ },
473
+ {
474
+ "inputs": [
475
+ {
476
+ "internalType": "uint192",
477
+ "name": "amount",
478
+ "type": "uint192"
479
+ }
480
+ ],
481
+ "name": "save",
482
+ "outputs": [],
483
+ "stateMutability": "nonpayable",
484
+ "type": "function"
485
+ },
486
+ {
487
+ "inputs": [
488
+ {
489
+ "internalType": "address",
490
+ "name": "",
491
+ "type": "address"
492
+ }
493
+ ],
494
+ "name": "savings",
495
+ "outputs": [
496
+ {
497
+ "internalType": "uint192",
498
+ "name": "saved",
499
+ "type": "uint192"
500
+ },
501
+ {
502
+ "internalType": "uint64",
503
+ "name": "ticks",
504
+ "type": "uint64"
505
+ }
506
+ ],
507
+ "stateMutability": "view",
508
+ "type": "function"
509
+ },
510
+ {
511
+ "inputs": [
512
+ {
513
+ "internalType": "uint256",
514
+ "name": "timestamp",
515
+ "type": "uint256"
516
+ }
517
+ ],
518
+ "name": "ticks",
519
+ "outputs": [
520
+ {
521
+ "internalType": "uint64",
522
+ "name": "",
523
+ "type": "uint64"
524
+ }
525
+ ],
526
+ "stateMutability": "view",
527
+ "type": "function"
528
+ },
529
+ {
530
+ "inputs": [
531
+ {
532
+ "internalType": "address",
533
+ "name": "target",
534
+ "type": "address"
535
+ },
536
+ {
537
+ "internalType": "uint192",
538
+ "name": "amount",
539
+ "type": "uint192"
540
+ }
541
+ ],
542
+ "name": "withdraw",
543
+ "outputs": [
544
+ {
545
+ "internalType": "uint256",
546
+ "name": "",
547
+ "type": "uint256"
548
+ }
549
+ ],
550
+ "stateMutability": "nonpayable",
551
+ "type": "function"
552
+ }
553
+ ] as const;