@openzeppelin/confidential-contracts 0.4.0 → 0.5.0-rc.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 (39) hide show
  1. package/build/contracts/BatcherConfidential.json +5 -0
  2. package/build/contracts/CheckpointsConfidential.json +2 -2
  3. package/build/contracts/ERC7984.json +6 -28
  4. package/build/contracts/ERC7984BalanceCapHookModule.json +277 -0
  5. package/build/contracts/ERC7984ERC20Wrapper.json +6 -28
  6. package/build/contracts/ERC7984Freezable.json +6 -28
  7. package/build/contracts/ERC7984HolderCapHookModule.json +291 -0
  8. package/build/contracts/ERC7984HookModule.json +200 -0
  9. package/build/contracts/ERC7984Hooked.json +832 -0
  10. package/build/contracts/ERC7984IdentityCheck.json +691 -0
  11. package/build/contracts/ERC7984ObserverAccess.json +6 -28
  12. package/build/contracts/ERC7984Omnibus.json +6 -28
  13. package/build/contracts/ERC7984Restricted.json +6 -28
  14. package/build/contracts/ERC7984Rwa.json +61 -29
  15. package/build/contracts/ERC7984Utils.json +2 -2
  16. package/build/contracts/ERC7984Votes.json +6 -28
  17. package/build/contracts/FHESafeMath.json +2 -2
  18. package/build/contracts/IERC7984HookModule.json +151 -0
  19. package/build/contracts/IERC7984Rwa.json +87 -0
  20. package/build/contracts/IIdentityRegistry.json +30 -0
  21. package/finance/BatcherConfidential.sol +7 -3
  22. package/governance/utils/VotesConfidential.sol +2 -2
  23. package/interfaces/IERC7984HookModule.sol +39 -0
  24. package/interfaces/IERC7984Receiver.sol +3 -1
  25. package/interfaces/IERC7984Rwa.sol +28 -1
  26. package/package.json +1 -1
  27. package/token/ERC7984/ERC7984.sol +39 -28
  28. package/token/ERC7984/extensions/ERC7984ERC20Wrapper.sol +3 -3
  29. package/token/ERC7984/extensions/ERC7984Freezable.sol +3 -7
  30. package/token/ERC7984/extensions/ERC7984Hooked.sol +158 -0
  31. package/token/ERC7984/extensions/ERC7984IdentityCheck.sol +58 -0
  32. package/token/ERC7984/extensions/ERC7984Restricted.sol +3 -3
  33. package/token/ERC7984/extensions/ERC7984Rwa.sol +65 -28
  34. package/token/ERC7984/utils/ERC7984BalanceCapHookModule.sol +92 -0
  35. package/token/ERC7984/utils/ERC7984HolderCapHookModule.sol +145 -0
  36. package/token/ERC7984/utils/ERC7984HookModule.sol +170 -0
  37. package/utils/FHESafeMath.sol +26 -1
  38. package/utils/HandleAccessManager.sol +5 -3
  39. package/utils/structs/CheckpointsConfidential.sol +1 -2
@@ -0,0 +1,832 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "ERC7984Hooked",
4
+ "sourceName": "contracts/token/ERC7984/extensions/ERC7984Hooked.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "address",
10
+ "name": "module",
11
+ "type": "address"
12
+ }
13
+ ],
14
+ "name": "ERC7984HookedDuplicateModule",
15
+ "type": "error"
16
+ },
17
+ {
18
+ "inputs": [],
19
+ "name": "ERC7984HookedExceededMaxModules",
20
+ "type": "error"
21
+ },
22
+ {
23
+ "inputs": [
24
+ {
25
+ "internalType": "address",
26
+ "name": "module",
27
+ "type": "address"
28
+ }
29
+ ],
30
+ "name": "ERC7984HookedInvalidModule",
31
+ "type": "error"
32
+ },
33
+ {
34
+ "inputs": [
35
+ {
36
+ "internalType": "address",
37
+ "name": "module",
38
+ "type": "address"
39
+ }
40
+ ],
41
+ "name": "ERC7984HookedNonexistentModule",
42
+ "type": "error"
43
+ },
44
+ {
45
+ "inputs": [
46
+ {
47
+ "internalType": "address",
48
+ "name": "receiver",
49
+ "type": "address"
50
+ }
51
+ ],
52
+ "name": "ERC7984InvalidReceiver",
53
+ "type": "error"
54
+ },
55
+ {
56
+ "inputs": [
57
+ {
58
+ "internalType": "address",
59
+ "name": "sender",
60
+ "type": "address"
61
+ }
62
+ ],
63
+ "name": "ERC7984InvalidSender",
64
+ "type": "error"
65
+ },
66
+ {
67
+ "inputs": [
68
+ {
69
+ "internalType": "address",
70
+ "name": "caller",
71
+ "type": "address"
72
+ }
73
+ ],
74
+ "name": "ERC7984UnauthorizedCaller",
75
+ "type": "error"
76
+ },
77
+ {
78
+ "inputs": [
79
+ {
80
+ "internalType": "address",
81
+ "name": "holder",
82
+ "type": "address"
83
+ },
84
+ {
85
+ "internalType": "address",
86
+ "name": "spender",
87
+ "type": "address"
88
+ }
89
+ ],
90
+ "name": "ERC7984UnauthorizedSpender",
91
+ "type": "error"
92
+ },
93
+ {
94
+ "inputs": [
95
+ {
96
+ "internalType": "euint64",
97
+ "name": "amount",
98
+ "type": "bytes32"
99
+ },
100
+ {
101
+ "internalType": "address",
102
+ "name": "user",
103
+ "type": "address"
104
+ }
105
+ ],
106
+ "name": "ERC7984UnauthorizedUseOfEncryptedAmount",
107
+ "type": "error"
108
+ },
109
+ {
110
+ "inputs": [
111
+ {
112
+ "internalType": "bytes32",
113
+ "name": "handle",
114
+ "type": "bytes32"
115
+ },
116
+ {
117
+ "internalType": "address",
118
+ "name": "account",
119
+ "type": "address"
120
+ }
121
+ ],
122
+ "name": "HandleAccessManagerNotAllowed",
123
+ "type": "error"
124
+ },
125
+ {
126
+ "inputs": [],
127
+ "name": "InvalidKMSSignatures",
128
+ "type": "error"
129
+ },
130
+ {
131
+ "inputs": [
132
+ {
133
+ "internalType": "bytes32",
134
+ "name": "handle",
135
+ "type": "bytes32"
136
+ },
137
+ {
138
+ "internalType": "address",
139
+ "name": "sender",
140
+ "type": "address"
141
+ }
142
+ ],
143
+ "name": "SenderNotAllowedToUseHandle",
144
+ "type": "error"
145
+ },
146
+ {
147
+ "anonymous": false,
148
+ "inputs": [
149
+ {
150
+ "indexed": true,
151
+ "internalType": "euint64",
152
+ "name": "encryptedAmount",
153
+ "type": "bytes32"
154
+ },
155
+ {
156
+ "indexed": true,
157
+ "internalType": "address",
158
+ "name": "requester",
159
+ "type": "address"
160
+ }
161
+ ],
162
+ "name": "AmountDiscloseRequested",
163
+ "type": "event"
164
+ },
165
+ {
166
+ "anonymous": false,
167
+ "inputs": [
168
+ {
169
+ "indexed": true,
170
+ "internalType": "euint64",
171
+ "name": "encryptedAmount",
172
+ "type": "bytes32"
173
+ },
174
+ {
175
+ "indexed": false,
176
+ "internalType": "uint64",
177
+ "name": "amount",
178
+ "type": "uint64"
179
+ }
180
+ ],
181
+ "name": "AmountDisclosed",
182
+ "type": "event"
183
+ },
184
+ {
185
+ "anonymous": false,
186
+ "inputs": [
187
+ {
188
+ "indexed": true,
189
+ "internalType": "address",
190
+ "name": "from",
191
+ "type": "address"
192
+ },
193
+ {
194
+ "indexed": true,
195
+ "internalType": "address",
196
+ "name": "to",
197
+ "type": "address"
198
+ },
199
+ {
200
+ "indexed": true,
201
+ "internalType": "euint64",
202
+ "name": "amount",
203
+ "type": "bytes32"
204
+ }
205
+ ],
206
+ "name": "ConfidentialTransfer",
207
+ "type": "event"
208
+ },
209
+ {
210
+ "anonymous": false,
211
+ "inputs": [
212
+ {
213
+ "indexed": false,
214
+ "internalType": "address",
215
+ "name": "module",
216
+ "type": "address"
217
+ }
218
+ ],
219
+ "name": "ERC7984HookedModuleInstalled",
220
+ "type": "event"
221
+ },
222
+ {
223
+ "anonymous": false,
224
+ "inputs": [
225
+ {
226
+ "indexed": false,
227
+ "internalType": "address",
228
+ "name": "module",
229
+ "type": "address"
230
+ }
231
+ ],
232
+ "name": "ERC7984HookedModuleUninstalled",
233
+ "type": "event"
234
+ },
235
+ {
236
+ "anonymous": false,
237
+ "inputs": [
238
+ {
239
+ "indexed": true,
240
+ "internalType": "address",
241
+ "name": "holder",
242
+ "type": "address"
243
+ },
244
+ {
245
+ "indexed": true,
246
+ "internalType": "address",
247
+ "name": "operator",
248
+ "type": "address"
249
+ },
250
+ {
251
+ "indexed": false,
252
+ "internalType": "uint48",
253
+ "name": "until",
254
+ "type": "uint48"
255
+ }
256
+ ],
257
+ "name": "OperatorSet",
258
+ "type": "event"
259
+ },
260
+ {
261
+ "anonymous": false,
262
+ "inputs": [
263
+ {
264
+ "indexed": false,
265
+ "internalType": "bytes32[]",
266
+ "name": "handlesList",
267
+ "type": "bytes32[]"
268
+ },
269
+ {
270
+ "indexed": false,
271
+ "internalType": "bytes",
272
+ "name": "abiEncodedCleartexts",
273
+ "type": "bytes"
274
+ }
275
+ ],
276
+ "name": "PublicDecryptionVerified",
277
+ "type": "event"
278
+ },
279
+ {
280
+ "inputs": [
281
+ {
282
+ "internalType": "address",
283
+ "name": "account",
284
+ "type": "address"
285
+ }
286
+ ],
287
+ "name": "confidentialBalanceOf",
288
+ "outputs": [
289
+ {
290
+ "internalType": "euint64",
291
+ "name": "",
292
+ "type": "bytes32"
293
+ }
294
+ ],
295
+ "stateMutability": "view",
296
+ "type": "function"
297
+ },
298
+ {
299
+ "inputs": [],
300
+ "name": "confidentialTotalSupply",
301
+ "outputs": [
302
+ {
303
+ "internalType": "euint64",
304
+ "name": "",
305
+ "type": "bytes32"
306
+ }
307
+ ],
308
+ "stateMutability": "view",
309
+ "type": "function"
310
+ },
311
+ {
312
+ "inputs": [
313
+ {
314
+ "internalType": "address",
315
+ "name": "to",
316
+ "type": "address"
317
+ },
318
+ {
319
+ "internalType": "externalEuint64",
320
+ "name": "encryptedAmount",
321
+ "type": "bytes32"
322
+ },
323
+ {
324
+ "internalType": "bytes",
325
+ "name": "inputProof",
326
+ "type": "bytes"
327
+ }
328
+ ],
329
+ "name": "confidentialTransfer",
330
+ "outputs": [
331
+ {
332
+ "internalType": "euint64",
333
+ "name": "",
334
+ "type": "bytes32"
335
+ }
336
+ ],
337
+ "stateMutability": "nonpayable",
338
+ "type": "function"
339
+ },
340
+ {
341
+ "inputs": [
342
+ {
343
+ "internalType": "address",
344
+ "name": "to",
345
+ "type": "address"
346
+ },
347
+ {
348
+ "internalType": "euint64",
349
+ "name": "amount",
350
+ "type": "bytes32"
351
+ }
352
+ ],
353
+ "name": "confidentialTransfer",
354
+ "outputs": [
355
+ {
356
+ "internalType": "euint64",
357
+ "name": "",
358
+ "type": "bytes32"
359
+ }
360
+ ],
361
+ "stateMutability": "nonpayable",
362
+ "type": "function"
363
+ },
364
+ {
365
+ "inputs": [
366
+ {
367
+ "internalType": "address",
368
+ "name": "to",
369
+ "type": "address"
370
+ },
371
+ {
372
+ "internalType": "euint64",
373
+ "name": "amount",
374
+ "type": "bytes32"
375
+ },
376
+ {
377
+ "internalType": "bytes",
378
+ "name": "data",
379
+ "type": "bytes"
380
+ }
381
+ ],
382
+ "name": "confidentialTransferAndCall",
383
+ "outputs": [
384
+ {
385
+ "internalType": "euint64",
386
+ "name": "",
387
+ "type": "bytes32"
388
+ }
389
+ ],
390
+ "stateMutability": "nonpayable",
391
+ "type": "function"
392
+ },
393
+ {
394
+ "inputs": [
395
+ {
396
+ "internalType": "address",
397
+ "name": "to",
398
+ "type": "address"
399
+ },
400
+ {
401
+ "internalType": "externalEuint64",
402
+ "name": "encryptedAmount",
403
+ "type": "bytes32"
404
+ },
405
+ {
406
+ "internalType": "bytes",
407
+ "name": "inputProof",
408
+ "type": "bytes"
409
+ },
410
+ {
411
+ "internalType": "bytes",
412
+ "name": "data",
413
+ "type": "bytes"
414
+ }
415
+ ],
416
+ "name": "confidentialTransferAndCall",
417
+ "outputs": [
418
+ {
419
+ "internalType": "euint64",
420
+ "name": "",
421
+ "type": "bytes32"
422
+ }
423
+ ],
424
+ "stateMutability": "nonpayable",
425
+ "type": "function"
426
+ },
427
+ {
428
+ "inputs": [
429
+ {
430
+ "internalType": "address",
431
+ "name": "from",
432
+ "type": "address"
433
+ },
434
+ {
435
+ "internalType": "address",
436
+ "name": "to",
437
+ "type": "address"
438
+ },
439
+ {
440
+ "internalType": "externalEuint64",
441
+ "name": "encryptedAmount",
442
+ "type": "bytes32"
443
+ },
444
+ {
445
+ "internalType": "bytes",
446
+ "name": "inputProof",
447
+ "type": "bytes"
448
+ }
449
+ ],
450
+ "name": "confidentialTransferFrom",
451
+ "outputs": [
452
+ {
453
+ "internalType": "euint64",
454
+ "name": "",
455
+ "type": "bytes32"
456
+ }
457
+ ],
458
+ "stateMutability": "nonpayable",
459
+ "type": "function"
460
+ },
461
+ {
462
+ "inputs": [
463
+ {
464
+ "internalType": "address",
465
+ "name": "from",
466
+ "type": "address"
467
+ },
468
+ {
469
+ "internalType": "address",
470
+ "name": "to",
471
+ "type": "address"
472
+ },
473
+ {
474
+ "internalType": "euint64",
475
+ "name": "amount",
476
+ "type": "bytes32"
477
+ }
478
+ ],
479
+ "name": "confidentialTransferFrom",
480
+ "outputs": [
481
+ {
482
+ "internalType": "euint64",
483
+ "name": "",
484
+ "type": "bytes32"
485
+ }
486
+ ],
487
+ "stateMutability": "nonpayable",
488
+ "type": "function"
489
+ },
490
+ {
491
+ "inputs": [
492
+ {
493
+ "internalType": "address",
494
+ "name": "from",
495
+ "type": "address"
496
+ },
497
+ {
498
+ "internalType": "address",
499
+ "name": "to",
500
+ "type": "address"
501
+ },
502
+ {
503
+ "internalType": "externalEuint64",
504
+ "name": "encryptedAmount",
505
+ "type": "bytes32"
506
+ },
507
+ {
508
+ "internalType": "bytes",
509
+ "name": "inputProof",
510
+ "type": "bytes"
511
+ },
512
+ {
513
+ "internalType": "bytes",
514
+ "name": "data",
515
+ "type": "bytes"
516
+ }
517
+ ],
518
+ "name": "confidentialTransferFromAndCall",
519
+ "outputs": [
520
+ {
521
+ "internalType": "euint64",
522
+ "name": "",
523
+ "type": "bytes32"
524
+ }
525
+ ],
526
+ "stateMutability": "nonpayable",
527
+ "type": "function"
528
+ },
529
+ {
530
+ "inputs": [
531
+ {
532
+ "internalType": "address",
533
+ "name": "from",
534
+ "type": "address"
535
+ },
536
+ {
537
+ "internalType": "address",
538
+ "name": "to",
539
+ "type": "address"
540
+ },
541
+ {
542
+ "internalType": "euint64",
543
+ "name": "amount",
544
+ "type": "bytes32"
545
+ },
546
+ {
547
+ "internalType": "bytes",
548
+ "name": "data",
549
+ "type": "bytes"
550
+ }
551
+ ],
552
+ "name": "confidentialTransferFromAndCall",
553
+ "outputs": [
554
+ {
555
+ "internalType": "euint64",
556
+ "name": "",
557
+ "type": "bytes32"
558
+ }
559
+ ],
560
+ "stateMutability": "nonpayable",
561
+ "type": "function"
562
+ },
563
+ {
564
+ "inputs": [],
565
+ "name": "contractURI",
566
+ "outputs": [
567
+ {
568
+ "internalType": "string",
569
+ "name": "",
570
+ "type": "string"
571
+ }
572
+ ],
573
+ "stateMutability": "view",
574
+ "type": "function"
575
+ },
576
+ {
577
+ "inputs": [],
578
+ "name": "decimals",
579
+ "outputs": [
580
+ {
581
+ "internalType": "uint8",
582
+ "name": "",
583
+ "type": "uint8"
584
+ }
585
+ ],
586
+ "stateMutability": "view",
587
+ "type": "function"
588
+ },
589
+ {
590
+ "inputs": [
591
+ {
592
+ "internalType": "euint64",
593
+ "name": "encryptedAmount",
594
+ "type": "bytes32"
595
+ },
596
+ {
597
+ "internalType": "uint64",
598
+ "name": "cleartextAmount",
599
+ "type": "uint64"
600
+ },
601
+ {
602
+ "internalType": "bytes",
603
+ "name": "decryptionProof",
604
+ "type": "bytes"
605
+ }
606
+ ],
607
+ "name": "discloseEncryptedAmount",
608
+ "outputs": [],
609
+ "stateMutability": "nonpayable",
610
+ "type": "function"
611
+ },
612
+ {
613
+ "inputs": [
614
+ {
615
+ "internalType": "bytes32",
616
+ "name": "handle",
617
+ "type": "bytes32"
618
+ },
619
+ {
620
+ "internalType": "address",
621
+ "name": "account",
622
+ "type": "address"
623
+ },
624
+ {
625
+ "internalType": "bool",
626
+ "name": "persistent",
627
+ "type": "bool"
628
+ }
629
+ ],
630
+ "name": "getHandleAllowance",
631
+ "outputs": [],
632
+ "stateMutability": "nonpayable",
633
+ "type": "function"
634
+ },
635
+ {
636
+ "inputs": [
637
+ {
638
+ "internalType": "address",
639
+ "name": "module",
640
+ "type": "address"
641
+ },
642
+ {
643
+ "internalType": "bytes",
644
+ "name": "initData",
645
+ "type": "bytes"
646
+ }
647
+ ],
648
+ "name": "installModule",
649
+ "outputs": [],
650
+ "stateMutability": "nonpayable",
651
+ "type": "function"
652
+ },
653
+ {
654
+ "inputs": [
655
+ {
656
+ "internalType": "address",
657
+ "name": "module",
658
+ "type": "address"
659
+ }
660
+ ],
661
+ "name": "isModuleInstalled",
662
+ "outputs": [
663
+ {
664
+ "internalType": "bool",
665
+ "name": "",
666
+ "type": "bool"
667
+ }
668
+ ],
669
+ "stateMutability": "view",
670
+ "type": "function"
671
+ },
672
+ {
673
+ "inputs": [
674
+ {
675
+ "internalType": "address",
676
+ "name": "holder",
677
+ "type": "address"
678
+ },
679
+ {
680
+ "internalType": "address",
681
+ "name": "spender",
682
+ "type": "address"
683
+ }
684
+ ],
685
+ "name": "isOperator",
686
+ "outputs": [
687
+ {
688
+ "internalType": "bool",
689
+ "name": "",
690
+ "type": "bool"
691
+ }
692
+ ],
693
+ "stateMutability": "view",
694
+ "type": "function"
695
+ },
696
+ {
697
+ "inputs": [],
698
+ "name": "maxModules",
699
+ "outputs": [
700
+ {
701
+ "internalType": "uint256",
702
+ "name": "",
703
+ "type": "uint256"
704
+ }
705
+ ],
706
+ "stateMutability": "view",
707
+ "type": "function"
708
+ },
709
+ {
710
+ "inputs": [
711
+ {
712
+ "internalType": "uint256",
713
+ "name": "start",
714
+ "type": "uint256"
715
+ },
716
+ {
717
+ "internalType": "uint256",
718
+ "name": "end",
719
+ "type": "uint256"
720
+ }
721
+ ],
722
+ "name": "modules",
723
+ "outputs": [
724
+ {
725
+ "internalType": "address[]",
726
+ "name": "",
727
+ "type": "address[]"
728
+ }
729
+ ],
730
+ "stateMutability": "view",
731
+ "type": "function"
732
+ },
733
+ {
734
+ "inputs": [],
735
+ "name": "name",
736
+ "outputs": [
737
+ {
738
+ "internalType": "string",
739
+ "name": "",
740
+ "type": "string"
741
+ }
742
+ ],
743
+ "stateMutability": "view",
744
+ "type": "function"
745
+ },
746
+ {
747
+ "inputs": [
748
+ {
749
+ "internalType": "euint64",
750
+ "name": "encryptedAmount",
751
+ "type": "bytes32"
752
+ }
753
+ ],
754
+ "name": "requestDiscloseEncryptedAmount",
755
+ "outputs": [],
756
+ "stateMutability": "nonpayable",
757
+ "type": "function"
758
+ },
759
+ {
760
+ "inputs": [
761
+ {
762
+ "internalType": "address",
763
+ "name": "operator",
764
+ "type": "address"
765
+ },
766
+ {
767
+ "internalType": "uint48",
768
+ "name": "until",
769
+ "type": "uint48"
770
+ }
771
+ ],
772
+ "name": "setOperator",
773
+ "outputs": [],
774
+ "stateMutability": "nonpayable",
775
+ "type": "function"
776
+ },
777
+ {
778
+ "inputs": [
779
+ {
780
+ "internalType": "bytes4",
781
+ "name": "interfaceId",
782
+ "type": "bytes4"
783
+ }
784
+ ],
785
+ "name": "supportsInterface",
786
+ "outputs": [
787
+ {
788
+ "internalType": "bool",
789
+ "name": "",
790
+ "type": "bool"
791
+ }
792
+ ],
793
+ "stateMutability": "view",
794
+ "type": "function"
795
+ },
796
+ {
797
+ "inputs": [],
798
+ "name": "symbol",
799
+ "outputs": [
800
+ {
801
+ "internalType": "string",
802
+ "name": "",
803
+ "type": "string"
804
+ }
805
+ ],
806
+ "stateMutability": "view",
807
+ "type": "function"
808
+ },
809
+ {
810
+ "inputs": [
811
+ {
812
+ "internalType": "address",
813
+ "name": "module",
814
+ "type": "address"
815
+ },
816
+ {
817
+ "internalType": "bytes",
818
+ "name": "deinitData",
819
+ "type": "bytes"
820
+ }
821
+ ],
822
+ "name": "uninstallModule",
823
+ "outputs": [],
824
+ "stateMutability": "nonpayable",
825
+ "type": "function"
826
+ }
827
+ ],
828
+ "bytecode": "0x",
829
+ "deployedBytecode": "0x",
830
+ "linkReferences": {},
831
+ "deployedLinkReferences": {}
832
+ }