@gooddollar/goodcollective-contracts 1.1.0 → 1.3.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 (72) hide show
  1. package/README.md +14 -1
  2. package/contracts/DirectPayments/DirectPaymentsFactory.sol +23 -15
  3. package/contracts/DirectPayments/DirectPaymentsLibrary.sol +54 -0
  4. package/contracts/DirectPayments/DirectPaymentsPool.sol +25 -41
  5. package/contracts/GoodCollective/GoodCollectiveSuperApp.sol +89 -61
  6. package/contracts/GoodCollective/IGoodCollectiveSuperApp.sol +12 -0
  7. package/contracts/Interfaces.sol +25 -0
  8. package/contracts/UBI/UBIPool.sol +103 -90
  9. package/contracts/UBI/UBIPoolFactory.sol +24 -10
  10. package/contracts/test/HelperLibraryTest.sol +16 -0
  11. package/contracts/utils/HelperLibrary.sol +109 -8
  12. package/package.json +4 -3
  13. package/releases/deployment.json +22797 -431
  14. package/typechain-types/@uniswap/index.ts +0 -2
  15. package/typechain-types/contracts/DirectPayments/DirectPaymentsFactory.ts +56 -9
  16. package/typechain-types/contracts/DirectPayments/DirectPaymentsPool.sol/DirectPaymentsPool.ts +187 -9
  17. package/typechain-types/contracts/GoodCollective/GoodCollectiveSuperApp.ts +150 -6
  18. package/typechain-types/contracts/{UBI/MultiClaimModule.sol/IClaimable.ts → GoodCollective/IGoodCollectiveSuperApp.sol/IGoodCollectiveSuperApp.ts} +24 -23
  19. package/typechain-types/contracts/GoodCollective/{GoodCollectiveSuperApp.sol → IGoodCollectiveSuperApp.sol}/index.ts +1 -1
  20. package/typechain-types/contracts/GoodCollective/index.ts +3 -2
  21. package/typechain-types/contracts/{UBI/UBIPool.sol → Interfaces.sol}/IIdentityV2.ts +1 -1
  22. package/typechain-types/contracts/{UBI/UBIPool.sol → Interfaces.sol}/IMembersValidator.ts +1 -1
  23. package/typechain-types/contracts/{UBI/UBIPool.sol → Interfaces.sol}/index.ts +0 -1
  24. package/typechain-types/contracts/UBI/{UBIPool.sol/UBIPool.ts → UBIPool.ts} +325 -78
  25. package/typechain-types/contracts/UBI/UBIPoolFactory.ts +95 -33
  26. package/typechain-types/contracts/UBI/index.ts +1 -4
  27. package/typechain-types/contracts/index.ts +4 -0
  28. package/typechain-types/contracts/test/HelperLibraryTest.ts +147 -0
  29. package/typechain-types/{@uniswap/v3-periphery/contracts/interfaces → contracts/test}/index.ts +1 -1
  30. package/typechain-types/contracts/utils/HelperLibrary.ts +46 -4
  31. package/typechain-types/factories/@uniswap/index.ts +0 -1
  32. package/typechain-types/factories/contracts/DirectPayments/DirectPaymentsFactory__factory.ts +25 -2
  33. package/typechain-types/factories/contracts/DirectPayments/DirectPaymentsPool.sol/DirectPaymentsPool__factory.ts +128 -1
  34. package/typechain-types/factories/contracts/GoodCollective/GoodCollectiveSuperApp__factory.ts +105 -1
  35. package/typechain-types/factories/contracts/GoodCollective/IGoodCollectiveSuperApp.sol/IGoodCollectiveSuperApp__factory.ts +48 -0
  36. package/typechain-types/factories/contracts/GoodCollective/{GoodCollectiveSuperApp.sol → IGoodCollectiveSuperApp.sol}/IRegistry__factory.ts +1 -1
  37. package/typechain-types/factories/contracts/GoodCollective/{GoodCollectiveSuperApp.sol → IGoodCollectiveSuperApp.sol}/index.ts +1 -1
  38. package/typechain-types/factories/contracts/GoodCollective/index.ts +2 -1
  39. package/typechain-types/factories/contracts/{UBI/UBIPool.sol → Interfaces.sol}/IIdentityV2__factory.ts +1 -1
  40. package/typechain-types/factories/contracts/{UBI/UBIPool.sol → Interfaces.sol}/IMembersValidator__factory.ts +1 -1
  41. package/typechain-types/factories/contracts/{UBI/UBIPool.sol → Interfaces.sol}/index.ts +0 -1
  42. package/typechain-types/factories/contracts/UBI/UBIPoolFactory__factory.ts +76 -4
  43. package/typechain-types/factories/contracts/UBI/UBIPool__factory.ts +2052 -0
  44. package/typechain-types/factories/contracts/UBI/index.ts +1 -2
  45. package/typechain-types/factories/contracts/index.ts +2 -0
  46. package/typechain-types/factories/contracts/test/HelperLibraryTest__factory.ts +154 -0
  47. package/typechain-types/{@uniswap/v3-periphery → factories/contracts/test}/index.ts +1 -2
  48. package/typechain-types/factories/contracts/utils/HelperLibrary__factory.ts +31 -1
  49. package/typechain-types/hardhat.d.ts +18 -36
  50. package/typechain-types/index.ts +10 -14
  51. package/contracts/UBI/MultiClaimModule.sol +0 -78
  52. package/typechain-types/@gooddollar/goodprotocol/contracts/token/FeesFormula.sol/IFeesFormula.ts +0 -115
  53. package/typechain-types/@gooddollar/goodprotocol/contracts/token/FeesFormula.sol/index.ts +0 -4
  54. package/typechain-types/@uniswap/v3-periphery/contracts/index.ts +0 -5
  55. package/typechain-types/@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.ts +0 -369
  56. package/typechain-types/contracts/GoodCollective/GoodCollectiveSuperApp.sol/GoodCollectiveSuperApp.ts +0 -1000
  57. package/typechain-types/contracts/UBI/MultiClaimModule.sol/IModule.ts +0 -196
  58. package/typechain-types/contracts/UBI/MultiClaimModule.sol/MultiClaimModule.ts +0 -242
  59. package/typechain-types/contracts/UBI/MultiClaimModule.sol/index.ts +0 -6
  60. package/typechain-types/factories/@gooddollar/goodprotocol/contracts/token/FeesFormula.sol/IFeesFormula__factory.ts +0 -60
  61. package/typechain-types/factories/@gooddollar/goodprotocol/contracts/token/FeesFormula.sol/index.ts +0 -4
  62. package/typechain-types/factories/@uniswap/v3-periphery/contracts/index.ts +0 -4
  63. package/typechain-types/factories/@uniswap/v3-periphery/contracts/interfaces/ISwapRouter__factory.ts +0 -263
  64. package/typechain-types/factories/@uniswap/v3-periphery/contracts/interfaces/index.ts +0 -4
  65. package/typechain-types/factories/@uniswap/v3-periphery/index.ts +0 -4
  66. package/typechain-types/factories/contracts/GoodCollective/GoodCollectiveSuperApp.sol/GoodCollectiveSuperApp__factory.ts +0 -728
  67. package/typechain-types/factories/contracts/UBI/MultiClaimModule.sol/IClaimable__factory.ts +0 -33
  68. package/typechain-types/factories/contracts/UBI/MultiClaimModule.sol/IModule__factory.ts +0 -84
  69. package/typechain-types/factories/contracts/UBI/MultiClaimModule.sol/MultiClaimModule__factory.ts +0 -150
  70. package/typechain-types/factories/contracts/UBI/MultiClaimModule.sol/index.ts +0 -6
  71. package/typechain-types/factories/contracts/UBI/UBIPool.sol/UBIPool__factory.ts +0 -1835
  72. /package/typechain-types/contracts/GoodCollective/{GoodCollectiveSuperApp.sol → IGoodCollectiveSuperApp.sol}/IRegistry.ts +0 -0
@@ -1,728 +0,0 @@
1
- /* Autogenerated file. Do not edit manually. */
2
- /* tslint:disable */
3
- /* eslint-disable */
4
-
5
- import { Contract, Signer, utils } from "ethers";
6
- import type { Provider } from "@ethersproject/providers";
7
- import type {
8
- GoodCollectiveSuperApp,
9
- GoodCollectiveSuperAppInterface,
10
- } from "../../../../contracts/GoodCollective/GoodCollectiveSuperApp.sol/GoodCollectiveSuperApp";
11
-
12
- const _abi = [
13
- {
14
- inputs: [
15
- {
16
- internalType: "int96",
17
- name: "curFeeRate",
18
- type: "int96",
19
- },
20
- {
21
- internalType: "int96",
22
- name: "newFeeRate",
23
- type: "int96",
24
- },
25
- ],
26
- name: "FEE_FLOW_FAILED",
27
- type: "error",
28
- },
29
- {
30
- inputs: [
31
- {
32
- internalType: "int96",
33
- name: "flowRate",
34
- type: "int96",
35
- },
36
- ],
37
- name: "MIN_FLOWRATE",
38
- type: "error",
39
- },
40
- {
41
- inputs: [],
42
- name: "NotAcceptedSuperToken",
43
- type: "error",
44
- },
45
- {
46
- inputs: [],
47
- name: "NotImplemented",
48
- type: "error",
49
- },
50
- {
51
- inputs: [
52
- {
53
- internalType: "address",
54
- name: "",
55
- type: "address",
56
- },
57
- ],
58
- name: "ONLY_HOST_OR_SENDER",
59
- type: "error",
60
- },
61
- {
62
- inputs: [],
63
- name: "UNSUPPORTED_TOKEN",
64
- type: "error",
65
- },
66
- {
67
- inputs: [],
68
- name: "UnauthorizedHost",
69
- type: "error",
70
- },
71
- {
72
- inputs: [],
73
- name: "ZERO_ADDRESS",
74
- type: "error",
75
- },
76
- {
77
- inputs: [],
78
- name: "ZERO_AMOUNT",
79
- type: "error",
80
- },
81
- {
82
- anonymous: false,
83
- inputs: [
84
- {
85
- indexed: true,
86
- internalType: "address",
87
- name: "supporter",
88
- type: "address",
89
- },
90
- {
91
- indexed: false,
92
- internalType: "uint256",
93
- name: "previousContribution",
94
- type: "uint256",
95
- },
96
- {
97
- indexed: false,
98
- internalType: "uint256",
99
- name: "contribution",
100
- type: "uint256",
101
- },
102
- {
103
- indexed: false,
104
- internalType: "int96",
105
- name: "previousFlowRate",
106
- type: "int96",
107
- },
108
- {
109
- indexed: false,
110
- internalType: "int96",
111
- name: "flowRate",
112
- type: "int96",
113
- },
114
- {
115
- indexed: false,
116
- internalType: "bool",
117
- name: "isFlowUpdate",
118
- type: "bool",
119
- },
120
- ],
121
- name: "SupporterUpdated",
122
- type: "event",
123
- },
124
- {
125
- inputs: [],
126
- name: "CFAV1_TYPE",
127
- outputs: [
128
- {
129
- internalType: "bytes32",
130
- name: "",
131
- type: "bytes32",
132
- },
133
- ],
134
- stateMutability: "view",
135
- type: "function",
136
- },
137
- {
138
- inputs: [],
139
- name: "MIN_FLOW_RATE",
140
- outputs: [
141
- {
142
- internalType: "int96",
143
- name: "",
144
- type: "int96",
145
- },
146
- ],
147
- stateMutability: "view",
148
- type: "function",
149
- },
150
- {
151
- inputs: [
152
- {
153
- internalType: "contract ISuperToken",
154
- name: "superToken",
155
- type: "address",
156
- },
157
- {
158
- internalType: "address",
159
- name: "",
160
- type: "address",
161
- },
162
- {
163
- internalType: "bytes32",
164
- name: "",
165
- type: "bytes32",
166
- },
167
- {
168
- internalType: "bytes",
169
- name: "agreementData",
170
- type: "bytes",
171
- },
172
- {
173
- internalType: "bytes",
174
- name: "",
175
- type: "bytes",
176
- },
177
- {
178
- internalType: "bytes",
179
- name: "ctx",
180
- type: "bytes",
181
- },
182
- ],
183
- name: "afterAgreementCreated",
184
- outputs: [
185
- {
186
- internalType: "bytes",
187
- name: "newCtx",
188
- type: "bytes",
189
- },
190
- ],
191
- stateMutability: "nonpayable",
192
- type: "function",
193
- },
194
- {
195
- inputs: [
196
- {
197
- internalType: "contract ISuperToken",
198
- name: "superToken",
199
- type: "address",
200
- },
201
- {
202
- internalType: "address",
203
- name: "agreementClass",
204
- type: "address",
205
- },
206
- {
207
- internalType: "bytes32",
208
- name: "",
209
- type: "bytes32",
210
- },
211
- {
212
- internalType: "bytes",
213
- name: "agreementData",
214
- type: "bytes",
215
- },
216
- {
217
- internalType: "bytes",
218
- name: "cbdata",
219
- type: "bytes",
220
- },
221
- {
222
- internalType: "bytes",
223
- name: "ctx",
224
- type: "bytes",
225
- },
226
- ],
227
- name: "afterAgreementTerminated",
228
- outputs: [
229
- {
230
- internalType: "bytes",
231
- name: "newCtx",
232
- type: "bytes",
233
- },
234
- ],
235
- stateMutability: "nonpayable",
236
- type: "function",
237
- },
238
- {
239
- inputs: [
240
- {
241
- internalType: "contract ISuperToken",
242
- name: "superToken",
243
- type: "address",
244
- },
245
- {
246
- internalType: "address",
247
- name: "",
248
- type: "address",
249
- },
250
- {
251
- internalType: "bytes32",
252
- name: "",
253
- type: "bytes32",
254
- },
255
- {
256
- internalType: "bytes",
257
- name: "agreementData",
258
- type: "bytes",
259
- },
260
- {
261
- internalType: "bytes",
262
- name: "cbdata",
263
- type: "bytes",
264
- },
265
- {
266
- internalType: "bytes",
267
- name: "ctx",
268
- type: "bytes",
269
- },
270
- ],
271
- name: "afterAgreementUpdated",
272
- outputs: [
273
- {
274
- internalType: "bytes",
275
- name: "newCtx",
276
- type: "bytes",
277
- },
278
- ],
279
- stateMutability: "nonpayable",
280
- type: "function",
281
- },
282
- {
283
- inputs: [
284
- {
285
- internalType: "contract ISuperToken",
286
- name: "superToken",
287
- type: "address",
288
- },
289
- {
290
- internalType: "address",
291
- name: "agreementClass",
292
- type: "address",
293
- },
294
- {
295
- internalType: "bytes32",
296
- name: "",
297
- type: "bytes32",
298
- },
299
- {
300
- internalType: "bytes",
301
- name: "",
302
- type: "bytes",
303
- },
304
- {
305
- internalType: "bytes",
306
- name: "",
307
- type: "bytes",
308
- },
309
- ],
310
- name: "beforeAgreementCreated",
311
- outputs: [
312
- {
313
- internalType: "bytes",
314
- name: "",
315
- type: "bytes",
316
- },
317
- ],
318
- stateMutability: "view",
319
- type: "function",
320
- },
321
- {
322
- inputs: [
323
- {
324
- internalType: "contract ISuperToken",
325
- name: "superToken",
326
- type: "address",
327
- },
328
- {
329
- internalType: "address",
330
- name: "agreementClass",
331
- type: "address",
332
- },
333
- {
334
- internalType: "bytes32",
335
- name: "",
336
- type: "bytes32",
337
- },
338
- {
339
- internalType: "bytes",
340
- name: "agreementData",
341
- type: "bytes",
342
- },
343
- {
344
- internalType: "bytes",
345
- name: "",
346
- type: "bytes",
347
- },
348
- ],
349
- name: "beforeAgreementTerminated",
350
- outputs: [
351
- {
352
- internalType: "bytes",
353
- name: "",
354
- type: "bytes",
355
- },
356
- ],
357
- stateMutability: "view",
358
- type: "function",
359
- },
360
- {
361
- inputs: [
362
- {
363
- internalType: "contract ISuperToken",
364
- name: "superToken",
365
- type: "address",
366
- },
367
- {
368
- internalType: "address",
369
- name: "agreementClass",
370
- type: "address",
371
- },
372
- {
373
- internalType: "bytes32",
374
- name: "",
375
- type: "bytes32",
376
- },
377
- {
378
- internalType: "bytes",
379
- name: "agreementData",
380
- type: "bytes",
381
- },
382
- {
383
- internalType: "bytes",
384
- name: "",
385
- type: "bytes",
386
- },
387
- ],
388
- name: "beforeAgreementUpdated",
389
- outputs: [
390
- {
391
- internalType: "bytes",
392
- name: "",
393
- type: "bytes",
394
- },
395
- ],
396
- stateMutability: "view",
397
- type: "function",
398
- },
399
- {
400
- inputs: [],
401
- name: "cfaV1",
402
- outputs: [
403
- {
404
- internalType: "contract ISuperfluid",
405
- name: "host",
406
- type: "address",
407
- },
408
- {
409
- internalType: "contract IConstantFlowAgreementV1",
410
- name: "cfa",
411
- type: "address",
412
- },
413
- ],
414
- stateMutability: "view",
415
- type: "function",
416
- },
417
- {
418
- inputs: [
419
- {
420
- internalType: "address",
421
- name: "_user",
422
- type: "address",
423
- },
424
- ],
425
- name: "getRealtimeContribution",
426
- outputs: [
427
- {
428
- internalType: "uint256",
429
- name: "",
430
- type: "uint256",
431
- },
432
- ],
433
- stateMutability: "view",
434
- type: "function",
435
- },
436
- {
437
- inputs: [],
438
- name: "getRealtimeStats",
439
- outputs: [
440
- {
441
- internalType: "uint256",
442
- name: "netIncome",
443
- type: "uint256",
444
- },
445
- {
446
- internalType: "uint256",
447
- name: "totalFees",
448
- type: "uint256",
449
- },
450
- {
451
- internalType: "int96",
452
- name: "incomeFlowRate",
453
- type: "int96",
454
- },
455
- {
456
- internalType: "int96",
457
- name: "feeRate",
458
- type: "int96",
459
- },
460
- ],
461
- stateMutability: "view",
462
- type: "function",
463
- },
464
- {
465
- inputs: [],
466
- name: "getRegistry",
467
- outputs: [
468
- {
469
- internalType: "contract IRegistry",
470
- name: "",
471
- type: "address",
472
- },
473
- ],
474
- stateMutability: "view",
475
- type: "function",
476
- },
477
- {
478
- inputs: [
479
- {
480
- components: [
481
- {
482
- internalType: "address",
483
- name: "swapFrom",
484
- type: "address",
485
- },
486
- {
487
- internalType: "uint256",
488
- name: "amount",
489
- type: "uint256",
490
- },
491
- {
492
- internalType: "uint256",
493
- name: "minReturn",
494
- type: "uint256",
495
- },
496
- {
497
- internalType: "uint256",
498
- name: "deadline",
499
- type: "uint256",
500
- },
501
- {
502
- internalType: "bytes",
503
- name: "path",
504
- type: "bytes",
505
- },
506
- ],
507
- internalType: "struct HelperLibrary.SwapData",
508
- name: "_customData",
509
- type: "tuple",
510
- },
511
- {
512
- internalType: "address",
513
- name: "_sender",
514
- type: "address",
515
- },
516
- {
517
- internalType: "bytes",
518
- name: "_ctx",
519
- type: "bytes",
520
- },
521
- ],
522
- name: "handleSwap",
523
- outputs: [
524
- {
525
- internalType: "bytes",
526
- name: "",
527
- type: "bytes",
528
- },
529
- ],
530
- stateMutability: "nonpayable",
531
- type: "function",
532
- },
533
- {
534
- inputs: [],
535
- name: "host",
536
- outputs: [
537
- {
538
- internalType: "contract ISuperfluid",
539
- name: "",
540
- type: "address",
541
- },
542
- ],
543
- stateMutability: "view",
544
- type: "function",
545
- },
546
- {
547
- inputs: [
548
- {
549
- internalType: "contract ISuperToken",
550
- name: "_superToken",
551
- type: "address",
552
- },
553
- ],
554
- name: "isAcceptedSuperToken",
555
- outputs: [
556
- {
557
- internalType: "bool",
558
- name: "",
559
- type: "bool",
560
- },
561
- ],
562
- stateMutability: "view",
563
- type: "function",
564
- },
565
- {
566
- inputs: [
567
- {
568
- internalType: "address",
569
- name: "_sender",
570
- type: "address",
571
- },
572
- {
573
- internalType: "uint256",
574
- name: "_amount",
575
- type: "uint256",
576
- },
577
- {
578
- internalType: "bytes",
579
- name: "",
580
- type: "bytes",
581
- },
582
- ],
583
- name: "onTokenTransfer",
584
- outputs: [
585
- {
586
- internalType: "bool",
587
- name: "",
588
- type: "bool",
589
- },
590
- ],
591
- stateMutability: "nonpayable",
592
- type: "function",
593
- },
594
- {
595
- inputs: [],
596
- name: "stats",
597
- outputs: [
598
- {
599
- internalType: "uint256",
600
- name: "netIncome",
601
- type: "uint256",
602
- },
603
- {
604
- internalType: "uint256",
605
- name: "totalFees",
606
- type: "uint256",
607
- },
608
- {
609
- internalType: "uint256",
610
- name: "lastUpdate",
611
- type: "uint256",
612
- },
613
- {
614
- internalType: "address",
615
- name: "lastFeeRecipient",
616
- type: "address",
617
- },
618
- {
619
- internalType: "int96",
620
- name: "lastIncomeRate",
621
- type: "int96",
622
- },
623
- ],
624
- stateMutability: "view",
625
- type: "function",
626
- },
627
- {
628
- inputs: [],
629
- name: "superToken",
630
- outputs: [
631
- {
632
- internalType: "contract ISuperToken",
633
- name: "",
634
- type: "address",
635
- },
636
- ],
637
- stateMutability: "view",
638
- type: "function",
639
- },
640
- {
641
- inputs: [
642
- {
643
- internalType: "address",
644
- name: "_sender",
645
- type: "address",
646
- },
647
- {
648
- internalType: "uint256",
649
- name: "_amount",
650
- type: "uint256",
651
- },
652
- {
653
- internalType: "bytes",
654
- name: "_ctx",
655
- type: "bytes",
656
- },
657
- ],
658
- name: "support",
659
- outputs: [
660
- {
661
- internalType: "bytes",
662
- name: "",
663
- type: "bytes",
664
- },
665
- ],
666
- stateMutability: "nonpayable",
667
- type: "function",
668
- },
669
- {
670
- inputs: [
671
- {
672
- internalType: "address",
673
- name: "",
674
- type: "address",
675
- },
676
- ],
677
- name: "supporters",
678
- outputs: [
679
- {
680
- internalType: "uint256",
681
- name: "contribution",
682
- type: "uint256",
683
- },
684
- {
685
- internalType: "int96",
686
- name: "flowRate",
687
- type: "int96",
688
- },
689
- {
690
- internalType: "uint128",
691
- name: "lastUpdated",
692
- type: "uint128",
693
- },
694
- ],
695
- stateMutability: "view",
696
- type: "function",
697
- },
698
- {
699
- inputs: [],
700
- name: "swapRouter",
701
- outputs: [
702
- {
703
- internalType: "contract IV3SwapRouter",
704
- name: "",
705
- type: "address",
706
- },
707
- ],
708
- stateMutability: "view",
709
- type: "function",
710
- },
711
- ] as const;
712
-
713
- export class GoodCollectiveSuperApp__factory {
714
- static readonly abi = _abi;
715
- static createInterface(): GoodCollectiveSuperAppInterface {
716
- return new utils.Interface(_abi) as GoodCollectiveSuperAppInterface;
717
- }
718
- static connect(
719
- address: string,
720
- signerOrProvider: Signer | Provider
721
- ): GoodCollectiveSuperApp {
722
- return new Contract(
723
- address,
724
- _abi,
725
- signerOrProvider
726
- ) as GoodCollectiveSuperApp;
727
- }
728
- }