@cofhe/mock-contracts 0.6.1 → 0.7.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.
package/src/MockACL.ts CHANGED
@@ -165,12 +165,12 @@ export const MockACLArtifact = {
165
165
  },
166
166
  {
167
167
  type: 'function',
168
- name: 'checkPermitValidity',
168
+ name: 'checkPermissionValidity',
169
169
  inputs: [
170
170
  {
171
- name: 'permission',
171
+ name: 'acp',
172
172
  type: 'tuple',
173
- internalType: 'struct Permission',
173
+ internalType: 'struct ACP',
174
174
  components: [
175
175
  {
176
176
  name: 'issuer',
@@ -188,15 +188,30 @@ export const MockACLArtifact = {
188
188
  internalType: 'address',
189
189
  },
190
190
  {
191
- name: 'validatorId',
191
+ name: 'revokerData',
192
192
  type: 'uint256',
193
193
  internalType: 'uint256',
194
194
  },
195
195
  {
196
- name: 'validatorContract',
196
+ name: 'revokerContract',
197
197
  type: 'address',
198
198
  internalType: 'address',
199
199
  },
200
+ {
201
+ name: 'scope',
202
+ type: 'uint8',
203
+ internalType: 'uint8',
204
+ },
205
+ {
206
+ name: 'contracts',
207
+ type: 'address[]',
208
+ internalType: 'address[]',
209
+ },
210
+ {
211
+ name: 'handles',
212
+ type: 'bytes32[]',
213
+ internalType: 'bytes32[]',
214
+ },
200
215
  {
201
216
  name: 'sealingKey',
202
217
  type: 'bytes32',
@@ -231,6 +246,19 @@ export const MockACLArtifact = {
231
246
  outputs: [],
232
247
  stateMutability: 'nonpayable',
233
248
  },
249
+ {
250
+ type: 'function',
251
+ name: 'defaultRevokerContract',
252
+ inputs: [],
253
+ outputs: [
254
+ {
255
+ name: '',
256
+ type: 'address',
257
+ internalType: 'address',
258
+ },
259
+ ],
260
+ stateMutability: 'view',
261
+ },
234
262
  {
235
263
  type: 'function',
236
264
  name: 'delegateAccount',
@@ -417,9 +445,9 @@ export const MockACLArtifact = {
417
445
  name: 'isAllowedWithPermission',
418
446
  inputs: [
419
447
  {
420
- name: 'permission',
448
+ name: 'acp',
421
449
  type: 'tuple',
422
- internalType: 'struct Permission',
450
+ internalType: 'struct ACP',
423
451
  components: [
424
452
  {
425
453
  name: 'issuer',
@@ -437,15 +465,30 @@ export const MockACLArtifact = {
437
465
  internalType: 'address',
438
466
  },
439
467
  {
440
- name: 'validatorId',
468
+ name: 'revokerData',
441
469
  type: 'uint256',
442
470
  internalType: 'uint256',
443
471
  },
444
472
  {
445
- name: 'validatorContract',
473
+ name: 'revokerContract',
446
474
  type: 'address',
447
475
  internalType: 'address',
448
476
  },
477
+ {
478
+ name: 'scope',
479
+ type: 'uint8',
480
+ internalType: 'uint8',
481
+ },
482
+ {
483
+ name: 'contracts',
484
+ type: 'address[]',
485
+ internalType: 'address[]',
486
+ },
487
+ {
488
+ name: 'handles',
489
+ type: 'bytes32[]',
490
+ internalType: 'bytes32[]',
491
+ },
449
492
  {
450
493
  name: 'sealingKey',
451
494
  type: 'bytes32',
@@ -502,6 +545,91 @@ export const MockACLArtifact = {
502
545
  ],
503
546
  stateMutability: 'view',
504
547
  },
548
+ {
549
+ type: 'function',
550
+ name: 'receiveCtHash',
551
+ inputs: [
552
+ {
553
+ name: 'handle',
554
+ type: 'uint256',
555
+ internalType: 'uint256',
556
+ },
557
+ {
558
+ name: 'expectedSharer',
559
+ type: 'address',
560
+ internalType: 'address',
561
+ },
562
+ {
563
+ name: 'receiver',
564
+ type: 'address',
565
+ internalType: 'address',
566
+ },
567
+ ],
568
+ outputs: [],
569
+ stateMutability: 'nonpayable',
570
+ },
571
+ {
572
+ type: 'function',
573
+ name: 'setDefaultRevokerContract',
574
+ inputs: [
575
+ {
576
+ name: 'newAddress',
577
+ type: 'address',
578
+ internalType: 'address',
579
+ },
580
+ ],
581
+ outputs: [],
582
+ stateMutability: 'nonpayable',
583
+ },
584
+ {
585
+ type: 'function',
586
+ name: 'setShareRegistry',
587
+ inputs: [
588
+ {
589
+ name: 'newAddress',
590
+ type: 'address',
591
+ internalType: 'address',
592
+ },
593
+ ],
594
+ outputs: [],
595
+ stateMutability: 'nonpayable',
596
+ },
597
+ {
598
+ type: 'function',
599
+ name: 'shareCtHash',
600
+ inputs: [
601
+ {
602
+ name: 'handle',
603
+ type: 'uint256',
604
+ internalType: 'uint256',
605
+ },
606
+ {
607
+ name: 'sharer',
608
+ type: 'address',
609
+ internalType: 'address',
610
+ },
611
+ {
612
+ name: 'receiver',
613
+ type: 'address',
614
+ internalType: 'address',
615
+ },
616
+ ],
617
+ outputs: [],
618
+ stateMutability: 'nonpayable',
619
+ },
620
+ {
621
+ type: 'function',
622
+ name: 'shareRegistry',
623
+ inputs: [],
624
+ outputs: [
625
+ {
626
+ name: '',
627
+ type: 'address',
628
+ internalType: 'address',
629
+ },
630
+ ],
631
+ stateMutability: 'view',
632
+ },
505
633
  {
506
634
  type: 'event',
507
635
  name: 'AllowedForDecryption',
@@ -515,6 +643,25 @@ export const MockACLArtifact = {
515
643
  ],
516
644
  anonymous: false,
517
645
  },
646
+ {
647
+ type: 'event',
648
+ name: 'DefaultRevokerContractUpdated',
649
+ inputs: [
650
+ {
651
+ name: 'oldAddress',
652
+ type: 'address',
653
+ indexed: false,
654
+ internalType: 'address',
655
+ },
656
+ {
657
+ name: 'newAddress',
658
+ type: 'address',
659
+ indexed: false,
660
+ internalType: 'address',
661
+ },
662
+ ],
663
+ anonymous: false,
664
+ },
518
665
  {
519
666
  type: 'event',
520
667
  name: 'EIP712DomainChanged',
@@ -546,6 +693,25 @@ export const MockACLArtifact = {
546
693
  ],
547
694
  anonymous: false,
548
695
  },
696
+ {
697
+ type: 'event',
698
+ name: 'ShareRegistryUpdated',
699
+ inputs: [
700
+ {
701
+ name: 'oldAddress',
702
+ type: 'address',
703
+ indexed: false,
704
+ internalType: 'address',
705
+ },
706
+ {
707
+ name: 'newAddress',
708
+ type: 'address',
709
+ indexed: false,
710
+ internalType: 'address',
711
+ },
712
+ ],
713
+ anonymous: false,
714
+ },
549
715
  {
550
716
  type: 'error',
551
717
  name: 'AlreadyDelegated',
@@ -567,6 +733,22 @@ export const MockACLArtifact = {
567
733
  name: 'InvalidShortString',
568
734
  inputs: [],
569
735
  },
736
+ {
737
+ type: 'error',
738
+ name: 'NotShared',
739
+ inputs: [
740
+ {
741
+ name: 'handle',
742
+ type: 'uint256',
743
+ internalType: 'uint256',
744
+ },
745
+ {
746
+ name: 'receiver',
747
+ type: 'address',
748
+ internalType: 'address',
749
+ },
750
+ ],
751
+ },
570
752
  {
571
753
  type: 'error',
572
754
  name: 'PermissionInvalid_Disabled',
@@ -614,5 +796,21 @@ export const MockACLArtifact = {
614
796
  },
615
797
  ],
616
798
  },
799
+ {
800
+ type: 'error',
801
+ name: 'UnexpectedSharer',
802
+ inputs: [
803
+ {
804
+ name: 'expected',
805
+ type: 'address',
806
+ internalType: 'address',
807
+ },
808
+ {
809
+ name: 'actual',
810
+ type: 'address',
811
+ internalType: 'address',
812
+ },
813
+ ],
814
+ },
617
815
  ],
618
816
  } as const satisfies MockArtifact;
@@ -140,6 +140,52 @@ export const MockTaskManagerArtifact = {
140
140
  outputs: [],
141
141
  stateMutability: 'nonpayable',
142
142
  },
143
+ {
144
+ type: 'function',
145
+ name: 'batchVerifyInputs',
146
+ inputs: [
147
+ {
148
+ name: 'inputs',
149
+ type: 'tuple[]',
150
+ internalType: 'struct UnsignedEncryptedInput[]',
151
+ components: [
152
+ {
153
+ name: 'ctHash',
154
+ type: 'uint256',
155
+ internalType: 'uint256',
156
+ },
157
+ {
158
+ name: 'securityZone',
159
+ type: 'uint8',
160
+ internalType: 'uint8',
161
+ },
162
+ {
163
+ name: 'utype',
164
+ type: 'uint8',
165
+ internalType: 'uint8',
166
+ },
167
+ ],
168
+ },
169
+ {
170
+ name: 'sender',
171
+ type: 'address',
172
+ internalType: 'address',
173
+ },
174
+ {
175
+ name: 'signature',
176
+ type: 'bytes',
177
+ internalType: 'bytes',
178
+ },
179
+ ],
180
+ outputs: [
181
+ {
182
+ name: '',
183
+ type: 'uint256[]',
184
+ internalType: 'uint256[]',
185
+ },
186
+ ],
187
+ stateMutability: 'nonpayable',
188
+ },
143
189
  {
144
190
  type: 'function',
145
191
  name: 'createDecryptTask',
@@ -397,9 +443,9 @@ export const MockTaskManagerArtifact = {
397
443
  name: 'isAllowedWithPermission',
398
444
  inputs: [
399
445
  {
400
- name: 'permission',
446
+ name: 'acp',
401
447
  type: 'tuple',
402
- internalType: 'struct Permission',
448
+ internalType: 'struct ACP',
403
449
  components: [
404
450
  {
405
451
  name: 'issuer',
@@ -417,15 +463,30 @@ export const MockTaskManagerArtifact = {
417
463
  internalType: 'address',
418
464
  },
419
465
  {
420
- name: 'validatorId',
466
+ name: 'revokerData',
421
467
  type: 'uint256',
422
468
  internalType: 'uint256',
423
469
  },
424
470
  {
425
- name: 'validatorContract',
471
+ name: 'revokerContract',
426
472
  type: 'address',
427
473
  internalType: 'address',
428
474
  },
475
+ {
476
+ name: 'scope',
477
+ type: 'uint8',
478
+ internalType: 'uint8',
479
+ },
480
+ {
481
+ name: 'contracts',
482
+ type: 'address[]',
483
+ internalType: 'address[]',
484
+ },
485
+ {
486
+ name: 'handles',
487
+ type: 'bytes32[]',
488
+ internalType: 'bytes32[]',
489
+ },
429
490
  {
430
491
  name: 'sealingKey',
431
492
  type: 'bytes32',
@@ -568,6 +629,24 @@ export const MockTaskManagerArtifact = {
568
629
  outputs: [],
569
630
  stateMutability: 'nonpayable',
570
631
  },
632
+ {
633
+ type: 'function',
634
+ name: 'receiveCtHash',
635
+ inputs: [
636
+ {
637
+ name: 'ctHash',
638
+ type: 'uint256',
639
+ internalType: 'uint256',
640
+ },
641
+ {
642
+ name: 'expectedSharer',
643
+ type: 'address',
644
+ internalType: 'address',
645
+ },
646
+ ],
647
+ outputs: [],
648
+ stateMutability: 'nonpayable',
649
+ },
571
650
  {
572
651
  type: 'function',
573
652
  name: 'removeFirstLetter',
@@ -696,6 +775,24 @@ export const MockTaskManagerArtifact = {
696
775
  outputs: [],
697
776
  stateMutability: 'nonpayable',
698
777
  },
778
+ {
779
+ type: 'function',
780
+ name: 'shareCtHash',
781
+ inputs: [
782
+ {
783
+ name: 'ctHash',
784
+ type: 'uint256',
785
+ internalType: 'uint256',
786
+ },
787
+ {
788
+ name: 'receiver',
789
+ type: 'address',
790
+ internalType: 'address',
791
+ },
792
+ ],
793
+ outputs: [],
794
+ stateMutability: 'nonpayable',
795
+ },
699
796
  {
700
797
  type: 'function',
701
798
  name: 'sliceString',
@@ -841,52 +938,6 @@ export const MockTaskManagerArtifact = {
841
938
  ],
842
939
  stateMutability: 'view',
843
940
  },
844
- {
845
- type: 'function',
846
- name: 'verifyInput',
847
- inputs: [
848
- {
849
- name: 'input',
850
- type: 'tuple',
851
- internalType: 'struct EncryptedInput',
852
- components: [
853
- {
854
- name: 'ctHash',
855
- type: 'uint256',
856
- internalType: 'uint256',
857
- },
858
- {
859
- name: 'securityZone',
860
- type: 'uint8',
861
- internalType: 'uint8',
862
- },
863
- {
864
- name: 'utype',
865
- type: 'uint8',
866
- internalType: 'uint8',
867
- },
868
- {
869
- name: 'signature',
870
- type: 'bytes',
871
- internalType: 'bytes',
872
- },
873
- ],
874
- },
875
- {
876
- name: 'sender',
877
- type: 'address',
878
- internalType: 'address',
879
- },
880
- ],
881
- outputs: [
882
- {
883
- name: '',
884
- type: 'uint256',
885
- internalType: 'uint256',
886
- },
887
- ],
888
- stateMutability: 'nonpayable',
889
- },
890
941
  {
891
942
  type: 'event',
892
943
  name: 'DecryptionResult',
@@ -27,7 +27,7 @@ export const MockThresholdNetworkArtifact = {
27
27
  },
28
28
  {
29
29
  type: 'function',
30
- name: 'decryptForTxWithPermit',
30
+ name: 'decryptForTxWithACP',
31
31
  inputs: [
32
32
  {
33
33
  name: 'ctHash',
@@ -35,9 +35,9 @@ export const MockThresholdNetworkArtifact = {
35
35
  internalType: 'uint256',
36
36
  },
37
37
  {
38
- name: 'permission',
38
+ name: 'acp',
39
39
  type: 'tuple',
40
- internalType: 'struct Permission',
40
+ internalType: 'struct ACP',
41
41
  components: [
42
42
  {
43
43
  name: 'issuer',
@@ -55,15 +55,30 @@ export const MockThresholdNetworkArtifact = {
55
55
  internalType: 'address',
56
56
  },
57
57
  {
58
- name: 'validatorId',
58
+ name: 'revokerData',
59
59
  type: 'uint256',
60
60
  internalType: 'uint256',
61
61
  },
62
62
  {
63
- name: 'validatorContract',
63
+ name: 'revokerContract',
64
64
  type: 'address',
65
65
  internalType: 'address',
66
66
  },
67
+ {
68
+ name: 'scope',
69
+ type: 'uint8',
70
+ internalType: 'uint8',
71
+ },
72
+ {
73
+ name: 'contracts',
74
+ type: 'address[]',
75
+ internalType: 'address[]',
76
+ },
77
+ {
78
+ name: 'handles',
79
+ type: 'bytes32[]',
80
+ internalType: 'bytes32[]',
81
+ },
67
82
  {
68
83
  name: 'sealingKey',
69
84
  type: 'bytes32',
@@ -103,7 +118,7 @@ export const MockThresholdNetworkArtifact = {
103
118
  },
104
119
  {
105
120
  type: 'function',
106
- name: 'decryptForTxWithoutPermit',
121
+ name: 'decryptForTxWithoutACP',
107
122
  inputs: [
108
123
  {
109
124
  name: 'ctHash',
@@ -241,9 +256,9 @@ export const MockThresholdNetworkArtifact = {
241
256
  internalType: 'uint256',
242
257
  },
243
258
  {
244
- name: 'permission',
259
+ name: 'acp',
245
260
  type: 'tuple',
246
- internalType: 'struct Permission',
261
+ internalType: 'struct ACP',
247
262
  components: [
248
263
  {
249
264
  name: 'issuer',
@@ -261,15 +276,30 @@ export const MockThresholdNetworkArtifact = {
261
276
  internalType: 'address',
262
277
  },
263
278
  {
264
- name: 'validatorId',
279
+ name: 'revokerData',
265
280
  type: 'uint256',
266
281
  internalType: 'uint256',
267
282
  },
268
283
  {
269
- name: 'validatorContract',
284
+ name: 'revokerContract',
270
285
  type: 'address',
271
286
  internalType: 'address',
272
287
  },
288
+ {
289
+ name: 'scope',
290
+ type: 'uint8',
291
+ internalType: 'uint8',
292
+ },
293
+ {
294
+ name: 'contracts',
295
+ type: 'address[]',
296
+ internalType: 'address[]',
297
+ },
298
+ {
299
+ name: 'handles',
300
+ type: 'bytes32[]',
301
+ internalType: 'bytes32[]',
302
+ },
273
303
  {
274
304
  name: 'sealingKey',
275
305
  type: 'bytes32',
@@ -322,9 +352,9 @@ export const MockThresholdNetworkArtifact = {
322
352
  internalType: 'uint256',
323
353
  },
324
354
  {
325
- name: 'permission',
355
+ name: 'acp',
326
356
  type: 'tuple',
327
- internalType: 'struct Permission',
357
+ internalType: 'struct ACP',
328
358
  components: [
329
359
  {
330
360
  name: 'issuer',
@@ -342,15 +372,30 @@ export const MockThresholdNetworkArtifact = {
342
372
  internalType: 'address',
343
373
  },
344
374
  {
345
- name: 'validatorId',
375
+ name: 'revokerData',
346
376
  type: 'uint256',
347
377
  internalType: 'uint256',
348
378
  },
349
379
  {
350
- name: 'validatorContract',
380
+ name: 'revokerContract',
351
381
  type: 'address',
352
382
  internalType: 'address',
353
383
  },
384
+ {
385
+ name: 'scope',
386
+ type: 'uint8',
387
+ internalType: 'uint8',
388
+ },
389
+ {
390
+ name: 'contracts',
391
+ type: 'address[]',
392
+ internalType: 'address[]',
393
+ },
394
+ {
395
+ name: 'handles',
396
+ type: 'bytes32[]',
397
+ internalType: 'bytes32[]',
398
+ },
354
399
  {
355
400
  name: 'sealingKey',
356
401
  type: 'bytes32',
package/src/index.ts CHANGED
@@ -1,6 +1,15 @@
1
1
  export * from './types';
2
2
  export * from './MockTaskManager';
3
3
  export * from './MockACL';
4
+ export * from './ACPTimestampRevoker';
5
+ export * from './ACPShareRegistry';
4
6
  export * from './MockZkVerifier';
5
7
  export * from './MockThresholdNetwork';
6
- export type { MockACL, MockTaskManager, MockThresholdNetwork, MockZkVerifier } from './typechain-types';
8
+ export type {
9
+ MockACL,
10
+ MockTaskManager,
11
+ MockThresholdNetwork,
12
+ MockZkVerifier,
13
+ ACPTimestampRevoker,
14
+ ACPShareRegistry,
15
+ } from './typechain-types';