@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,691 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "ERC7984IdentityCheck",
4
+ "sourceName": "contracts/token/ERC7984/extensions/ERC7984IdentityCheck.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "address",
10
+ "name": "account",
11
+ "type": "address"
12
+ }
13
+ ],
14
+ "name": "ERC7984InvalidIdentity",
15
+ "type": "error"
16
+ },
17
+ {
18
+ "inputs": [
19
+ {
20
+ "internalType": "address",
21
+ "name": "registry",
22
+ "type": "address"
23
+ }
24
+ ],
25
+ "name": "ERC7984InvalidIdentityRegistry",
26
+ "type": "error"
27
+ },
28
+ {
29
+ "inputs": [
30
+ {
31
+ "internalType": "address",
32
+ "name": "receiver",
33
+ "type": "address"
34
+ }
35
+ ],
36
+ "name": "ERC7984InvalidReceiver",
37
+ "type": "error"
38
+ },
39
+ {
40
+ "inputs": [
41
+ {
42
+ "internalType": "address",
43
+ "name": "sender",
44
+ "type": "address"
45
+ }
46
+ ],
47
+ "name": "ERC7984InvalidSender",
48
+ "type": "error"
49
+ },
50
+ {
51
+ "inputs": [
52
+ {
53
+ "internalType": "address",
54
+ "name": "caller",
55
+ "type": "address"
56
+ }
57
+ ],
58
+ "name": "ERC7984UnauthorizedCaller",
59
+ "type": "error"
60
+ },
61
+ {
62
+ "inputs": [
63
+ {
64
+ "internalType": "address",
65
+ "name": "holder",
66
+ "type": "address"
67
+ },
68
+ {
69
+ "internalType": "address",
70
+ "name": "spender",
71
+ "type": "address"
72
+ }
73
+ ],
74
+ "name": "ERC7984UnauthorizedSpender",
75
+ "type": "error"
76
+ },
77
+ {
78
+ "inputs": [
79
+ {
80
+ "internalType": "euint64",
81
+ "name": "amount",
82
+ "type": "bytes32"
83
+ },
84
+ {
85
+ "internalType": "address",
86
+ "name": "user",
87
+ "type": "address"
88
+ }
89
+ ],
90
+ "name": "ERC7984UnauthorizedUseOfEncryptedAmount",
91
+ "type": "error"
92
+ },
93
+ {
94
+ "inputs": [],
95
+ "name": "InvalidKMSSignatures",
96
+ "type": "error"
97
+ },
98
+ {
99
+ "inputs": [
100
+ {
101
+ "internalType": "bytes32",
102
+ "name": "handle",
103
+ "type": "bytes32"
104
+ },
105
+ {
106
+ "internalType": "address",
107
+ "name": "sender",
108
+ "type": "address"
109
+ }
110
+ ],
111
+ "name": "SenderNotAllowedToUseHandle",
112
+ "type": "error"
113
+ },
114
+ {
115
+ "anonymous": false,
116
+ "inputs": [
117
+ {
118
+ "indexed": true,
119
+ "internalType": "euint64",
120
+ "name": "encryptedAmount",
121
+ "type": "bytes32"
122
+ },
123
+ {
124
+ "indexed": true,
125
+ "internalType": "address",
126
+ "name": "requester",
127
+ "type": "address"
128
+ }
129
+ ],
130
+ "name": "AmountDiscloseRequested",
131
+ "type": "event"
132
+ },
133
+ {
134
+ "anonymous": false,
135
+ "inputs": [
136
+ {
137
+ "indexed": true,
138
+ "internalType": "euint64",
139
+ "name": "encryptedAmount",
140
+ "type": "bytes32"
141
+ },
142
+ {
143
+ "indexed": false,
144
+ "internalType": "uint64",
145
+ "name": "amount",
146
+ "type": "uint64"
147
+ }
148
+ ],
149
+ "name": "AmountDisclosed",
150
+ "type": "event"
151
+ },
152
+ {
153
+ "anonymous": false,
154
+ "inputs": [
155
+ {
156
+ "indexed": true,
157
+ "internalType": "address",
158
+ "name": "from",
159
+ "type": "address"
160
+ },
161
+ {
162
+ "indexed": true,
163
+ "internalType": "address",
164
+ "name": "to",
165
+ "type": "address"
166
+ },
167
+ {
168
+ "indexed": true,
169
+ "internalType": "euint64",
170
+ "name": "amount",
171
+ "type": "bytes32"
172
+ }
173
+ ],
174
+ "name": "ConfidentialTransfer",
175
+ "type": "event"
176
+ },
177
+ {
178
+ "anonymous": false,
179
+ "inputs": [
180
+ {
181
+ "indexed": true,
182
+ "internalType": "address",
183
+ "name": "oldRegistry",
184
+ "type": "address"
185
+ },
186
+ {
187
+ "indexed": true,
188
+ "internalType": "address",
189
+ "name": "newRegistry",
190
+ "type": "address"
191
+ }
192
+ ],
193
+ "name": "IdentityRegistryUpdated",
194
+ "type": "event"
195
+ },
196
+ {
197
+ "anonymous": false,
198
+ "inputs": [
199
+ {
200
+ "indexed": true,
201
+ "internalType": "address",
202
+ "name": "holder",
203
+ "type": "address"
204
+ },
205
+ {
206
+ "indexed": true,
207
+ "internalType": "address",
208
+ "name": "operator",
209
+ "type": "address"
210
+ },
211
+ {
212
+ "indexed": false,
213
+ "internalType": "uint48",
214
+ "name": "until",
215
+ "type": "uint48"
216
+ }
217
+ ],
218
+ "name": "OperatorSet",
219
+ "type": "event"
220
+ },
221
+ {
222
+ "anonymous": false,
223
+ "inputs": [
224
+ {
225
+ "indexed": false,
226
+ "internalType": "bytes32[]",
227
+ "name": "handlesList",
228
+ "type": "bytes32[]"
229
+ },
230
+ {
231
+ "indexed": false,
232
+ "internalType": "bytes",
233
+ "name": "abiEncodedCleartexts",
234
+ "type": "bytes"
235
+ }
236
+ ],
237
+ "name": "PublicDecryptionVerified",
238
+ "type": "event"
239
+ },
240
+ {
241
+ "inputs": [
242
+ {
243
+ "internalType": "address",
244
+ "name": "account",
245
+ "type": "address"
246
+ }
247
+ ],
248
+ "name": "confidentialBalanceOf",
249
+ "outputs": [
250
+ {
251
+ "internalType": "euint64",
252
+ "name": "",
253
+ "type": "bytes32"
254
+ }
255
+ ],
256
+ "stateMutability": "view",
257
+ "type": "function"
258
+ },
259
+ {
260
+ "inputs": [],
261
+ "name": "confidentialTotalSupply",
262
+ "outputs": [
263
+ {
264
+ "internalType": "euint64",
265
+ "name": "",
266
+ "type": "bytes32"
267
+ }
268
+ ],
269
+ "stateMutability": "view",
270
+ "type": "function"
271
+ },
272
+ {
273
+ "inputs": [
274
+ {
275
+ "internalType": "address",
276
+ "name": "to",
277
+ "type": "address"
278
+ },
279
+ {
280
+ "internalType": "externalEuint64",
281
+ "name": "encryptedAmount",
282
+ "type": "bytes32"
283
+ },
284
+ {
285
+ "internalType": "bytes",
286
+ "name": "inputProof",
287
+ "type": "bytes"
288
+ }
289
+ ],
290
+ "name": "confidentialTransfer",
291
+ "outputs": [
292
+ {
293
+ "internalType": "euint64",
294
+ "name": "",
295
+ "type": "bytes32"
296
+ }
297
+ ],
298
+ "stateMutability": "nonpayable",
299
+ "type": "function"
300
+ },
301
+ {
302
+ "inputs": [
303
+ {
304
+ "internalType": "address",
305
+ "name": "to",
306
+ "type": "address"
307
+ },
308
+ {
309
+ "internalType": "euint64",
310
+ "name": "amount",
311
+ "type": "bytes32"
312
+ }
313
+ ],
314
+ "name": "confidentialTransfer",
315
+ "outputs": [
316
+ {
317
+ "internalType": "euint64",
318
+ "name": "",
319
+ "type": "bytes32"
320
+ }
321
+ ],
322
+ "stateMutability": "nonpayable",
323
+ "type": "function"
324
+ },
325
+ {
326
+ "inputs": [
327
+ {
328
+ "internalType": "address",
329
+ "name": "to",
330
+ "type": "address"
331
+ },
332
+ {
333
+ "internalType": "euint64",
334
+ "name": "amount",
335
+ "type": "bytes32"
336
+ },
337
+ {
338
+ "internalType": "bytes",
339
+ "name": "data",
340
+ "type": "bytes"
341
+ }
342
+ ],
343
+ "name": "confidentialTransferAndCall",
344
+ "outputs": [
345
+ {
346
+ "internalType": "euint64",
347
+ "name": "",
348
+ "type": "bytes32"
349
+ }
350
+ ],
351
+ "stateMutability": "nonpayable",
352
+ "type": "function"
353
+ },
354
+ {
355
+ "inputs": [
356
+ {
357
+ "internalType": "address",
358
+ "name": "to",
359
+ "type": "address"
360
+ },
361
+ {
362
+ "internalType": "externalEuint64",
363
+ "name": "encryptedAmount",
364
+ "type": "bytes32"
365
+ },
366
+ {
367
+ "internalType": "bytes",
368
+ "name": "inputProof",
369
+ "type": "bytes"
370
+ },
371
+ {
372
+ "internalType": "bytes",
373
+ "name": "data",
374
+ "type": "bytes"
375
+ }
376
+ ],
377
+ "name": "confidentialTransferAndCall",
378
+ "outputs": [
379
+ {
380
+ "internalType": "euint64",
381
+ "name": "",
382
+ "type": "bytes32"
383
+ }
384
+ ],
385
+ "stateMutability": "nonpayable",
386
+ "type": "function"
387
+ },
388
+ {
389
+ "inputs": [
390
+ {
391
+ "internalType": "address",
392
+ "name": "from",
393
+ "type": "address"
394
+ },
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
+ "name": "confidentialTransferFrom",
412
+ "outputs": [
413
+ {
414
+ "internalType": "euint64",
415
+ "name": "",
416
+ "type": "bytes32"
417
+ }
418
+ ],
419
+ "stateMutability": "nonpayable",
420
+ "type": "function"
421
+ },
422
+ {
423
+ "inputs": [
424
+ {
425
+ "internalType": "address",
426
+ "name": "from",
427
+ "type": "address"
428
+ },
429
+ {
430
+ "internalType": "address",
431
+ "name": "to",
432
+ "type": "address"
433
+ },
434
+ {
435
+ "internalType": "euint64",
436
+ "name": "amount",
437
+ "type": "bytes32"
438
+ }
439
+ ],
440
+ "name": "confidentialTransferFrom",
441
+ "outputs": [
442
+ {
443
+ "internalType": "euint64",
444
+ "name": "",
445
+ "type": "bytes32"
446
+ }
447
+ ],
448
+ "stateMutability": "nonpayable",
449
+ "type": "function"
450
+ },
451
+ {
452
+ "inputs": [
453
+ {
454
+ "internalType": "address",
455
+ "name": "from",
456
+ "type": "address"
457
+ },
458
+ {
459
+ "internalType": "address",
460
+ "name": "to",
461
+ "type": "address"
462
+ },
463
+ {
464
+ "internalType": "externalEuint64",
465
+ "name": "encryptedAmount",
466
+ "type": "bytes32"
467
+ },
468
+ {
469
+ "internalType": "bytes",
470
+ "name": "inputProof",
471
+ "type": "bytes"
472
+ },
473
+ {
474
+ "internalType": "bytes",
475
+ "name": "data",
476
+ "type": "bytes"
477
+ }
478
+ ],
479
+ "name": "confidentialTransferFromAndCall",
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": "euint64",
504
+ "name": "amount",
505
+ "type": "bytes32"
506
+ },
507
+ {
508
+ "internalType": "bytes",
509
+ "name": "data",
510
+ "type": "bytes"
511
+ }
512
+ ],
513
+ "name": "confidentialTransferFromAndCall",
514
+ "outputs": [
515
+ {
516
+ "internalType": "euint64",
517
+ "name": "",
518
+ "type": "bytes32"
519
+ }
520
+ ],
521
+ "stateMutability": "nonpayable",
522
+ "type": "function"
523
+ },
524
+ {
525
+ "inputs": [],
526
+ "name": "contractURI",
527
+ "outputs": [
528
+ {
529
+ "internalType": "string",
530
+ "name": "",
531
+ "type": "string"
532
+ }
533
+ ],
534
+ "stateMutability": "view",
535
+ "type": "function"
536
+ },
537
+ {
538
+ "inputs": [],
539
+ "name": "decimals",
540
+ "outputs": [
541
+ {
542
+ "internalType": "uint8",
543
+ "name": "",
544
+ "type": "uint8"
545
+ }
546
+ ],
547
+ "stateMutability": "view",
548
+ "type": "function"
549
+ },
550
+ {
551
+ "inputs": [
552
+ {
553
+ "internalType": "euint64",
554
+ "name": "encryptedAmount",
555
+ "type": "bytes32"
556
+ },
557
+ {
558
+ "internalType": "uint64",
559
+ "name": "cleartextAmount",
560
+ "type": "uint64"
561
+ },
562
+ {
563
+ "internalType": "bytes",
564
+ "name": "decryptionProof",
565
+ "type": "bytes"
566
+ }
567
+ ],
568
+ "name": "discloseEncryptedAmount",
569
+ "outputs": [],
570
+ "stateMutability": "nonpayable",
571
+ "type": "function"
572
+ },
573
+ {
574
+ "inputs": [],
575
+ "name": "identityRegistry",
576
+ "outputs": [
577
+ {
578
+ "internalType": "address",
579
+ "name": "",
580
+ "type": "address"
581
+ }
582
+ ],
583
+ "stateMutability": "view",
584
+ "type": "function"
585
+ },
586
+ {
587
+ "inputs": [
588
+ {
589
+ "internalType": "address",
590
+ "name": "holder",
591
+ "type": "address"
592
+ },
593
+ {
594
+ "internalType": "address",
595
+ "name": "spender",
596
+ "type": "address"
597
+ }
598
+ ],
599
+ "name": "isOperator",
600
+ "outputs": [
601
+ {
602
+ "internalType": "bool",
603
+ "name": "",
604
+ "type": "bool"
605
+ }
606
+ ],
607
+ "stateMutability": "view",
608
+ "type": "function"
609
+ },
610
+ {
611
+ "inputs": [],
612
+ "name": "name",
613
+ "outputs": [
614
+ {
615
+ "internalType": "string",
616
+ "name": "",
617
+ "type": "string"
618
+ }
619
+ ],
620
+ "stateMutability": "view",
621
+ "type": "function"
622
+ },
623
+ {
624
+ "inputs": [
625
+ {
626
+ "internalType": "euint64",
627
+ "name": "encryptedAmount",
628
+ "type": "bytes32"
629
+ }
630
+ ],
631
+ "name": "requestDiscloseEncryptedAmount",
632
+ "outputs": [],
633
+ "stateMutability": "nonpayable",
634
+ "type": "function"
635
+ },
636
+ {
637
+ "inputs": [
638
+ {
639
+ "internalType": "address",
640
+ "name": "operator",
641
+ "type": "address"
642
+ },
643
+ {
644
+ "internalType": "uint48",
645
+ "name": "until",
646
+ "type": "uint48"
647
+ }
648
+ ],
649
+ "name": "setOperator",
650
+ "outputs": [],
651
+ "stateMutability": "nonpayable",
652
+ "type": "function"
653
+ },
654
+ {
655
+ "inputs": [
656
+ {
657
+ "internalType": "bytes4",
658
+ "name": "interfaceId",
659
+ "type": "bytes4"
660
+ }
661
+ ],
662
+ "name": "supportsInterface",
663
+ "outputs": [
664
+ {
665
+ "internalType": "bool",
666
+ "name": "",
667
+ "type": "bool"
668
+ }
669
+ ],
670
+ "stateMutability": "view",
671
+ "type": "function"
672
+ },
673
+ {
674
+ "inputs": [],
675
+ "name": "symbol",
676
+ "outputs": [
677
+ {
678
+ "internalType": "string",
679
+ "name": "",
680
+ "type": "string"
681
+ }
682
+ ],
683
+ "stateMutability": "view",
684
+ "type": "function"
685
+ }
686
+ ],
687
+ "bytecode": "0x",
688
+ "deployedBytecode": "0x",
689
+ "linkReferences": {},
690
+ "deployedLinkReferences": {}
691
+ }