@openzeppelin/confidential-contracts 0.3.0-rc.0 → 0.3.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 (32) hide show
  1. package/build/contracts/Checkpoints.json +2 -2
  2. package/build/contracts/CheckpointsConfidential.json +2 -2
  3. package/build/contracts/ERC7984.json +72 -38
  4. package/build/contracts/ERC7984ERC20Wrapper.json +159 -39
  5. package/build/contracts/ERC7984Freezable.json +72 -38
  6. package/build/contracts/ERC7984ObserverAccess.json +73 -39
  7. package/build/contracts/ERC7984Omnibus.json +72 -38
  8. package/build/contracts/ERC7984Restricted.json +74 -40
  9. package/build/contracts/ERC7984Rwa.json +55 -40
  10. package/build/contracts/ERC7984Utils.json +2 -2
  11. package/build/contracts/ERC7984Votes.json +80 -46
  12. package/build/contracts/FHESafeMath.json +2 -2
  13. package/build/contracts/IERC7984.json +19 -0
  14. package/finance/ERC7821WithExecutor.sol +3 -4
  15. package/finance/VestingWalletCliffConfidential.sol +3 -4
  16. package/finance/VestingWalletConfidential.sol +3 -4
  17. package/finance/VestingWalletConfidentialFactory.sol +1 -1
  18. package/interfaces/IERC7984.sol +4 -3
  19. package/interfaces/IERC7984Receiver.sol +1 -1
  20. package/interfaces/IERC7984Rwa.sol +2 -3
  21. package/package.json +2 -2
  22. package/token/ERC7984/ERC7984.sol +32 -25
  23. package/token/ERC7984/extensions/ERC7984ERC20Wrapper.sol +87 -40
  24. package/token/ERC7984/extensions/ERC7984Freezable.sol +13 -4
  25. package/token/ERC7984/extensions/ERC7984ObserverAccess.sol +2 -2
  26. package/token/ERC7984/extensions/ERC7984Omnibus.sol +3 -3
  27. package/token/ERC7984/extensions/ERC7984Restricted.sol +3 -11
  28. package/token/ERC7984/extensions/ERC7984Rwa.sol +38 -26
  29. package/token/ERC7984/extensions/ERC7984Votes.sol +1 -1
  30. package/token/ERC7984/utils/ERC7984Utils.sol +3 -2
  31. package/utils/FHESafeMath.sol +5 -2
  32. package/utils/structs/temporary-Checkpoints.sol +1 -1
@@ -9,8 +9,8 @@
9
9
  "type": "error"
10
10
  }
11
11
  ],
12
- "bytecode": "0x60556032600b8282823980515f1a607314602657634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea264697066735822122079eead797832085a81a92fa51124aa6bf840688c01a0f83ca6179b0698645ff164736f6c634300081d0033",
13
- "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040525f5ffdfea264697066735822122079eead797832085a81a92fa51124aa6bf840688c01a0f83ca6179b0698645ff164736f6c634300081d0033",
12
+ "bytecode": "0x60556032600b8282823980515f1a607314602657634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea26469706673582212207ac2b5a91bbe8d5c2edc50cd6b8ca65dda1c06dc3baad1b46f94f6cc976f083064736f6c634300081d0033",
13
+ "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040525f5ffdfea26469706673582212207ac2b5a91bbe8d5c2edc50cd6b8ca65dda1c06dc3baad1b46f94f6cc976f083064736f6c634300081d0033",
14
14
  "linkReferences": {},
15
15
  "deployedLinkReferences": {}
16
16
  }
@@ -3,8 +3,8 @@
3
3
  "contractName": "CheckpointsConfidential",
4
4
  "sourceName": "contracts/utils/structs/CheckpointsConfidential.sol",
5
5
  "abi": [],
6
- "bytecode": "0x60556032600b8282823980515f1a607314602657634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220eacaef2c6ced14716bab1d8e885c0bb083ed4a6d7b3270f4d53eaef5249639d564736f6c634300081d0033",
7
- "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220eacaef2c6ced14716bab1d8e885c0bb083ed4a6d7b3270f4d53eaef5249639d564736f6c634300081d0033",
6
+ "bytecode": "0x60556032600b8282823980515f1a607314602657634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea26469706673582212209fe3666278f6df29897de987f7b0712add3bf9ef20aa8543f2e8a089c0d423ea64736f6c634300081d0033",
7
+ "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040525f5ffdfea26469706673582212209fe3666278f6df29897de987f7b0712add3bf9ef20aa8543f2e8a089c0d423ea64736f6c634300081d0033",
8
8
  "linkReferences": {},
9
9
  "deployedLinkReferences": {}
10
10
  }
@@ -90,20 +90,29 @@
90
90
  "name": "ERC7984ZeroBalance",
91
91
  "type": "error"
92
92
  },
93
- {
94
- "inputs": [],
95
- "name": "HandlesAlreadySavedForRequestID",
96
- "type": "error"
97
- },
98
93
  {
99
94
  "inputs": [],
100
95
  "name": "InvalidKMSSignatures",
101
96
  "type": "error"
102
97
  },
103
98
  {
104
- "inputs": [],
105
- "name": "NoHandleFoundForRequestID",
106
- "type": "error"
99
+ "anonymous": false,
100
+ "inputs": [
101
+ {
102
+ "indexed": true,
103
+ "internalType": "euint64",
104
+ "name": "encryptedAmount",
105
+ "type": "bytes32"
106
+ },
107
+ {
108
+ "indexed": true,
109
+ "internalType": "address",
110
+ "name": "requester",
111
+ "type": "address"
112
+ }
113
+ ],
114
+ "name": "AmountDiscloseRequested",
115
+ "type": "event"
107
116
  },
108
117
  {
109
118
  "anonymous": false,
@@ -149,19 +158,6 @@
149
158
  "name": "ConfidentialTransfer",
150
159
  "type": "event"
151
160
  },
152
- {
153
- "anonymous": false,
154
- "inputs": [
155
- {
156
- "indexed": true,
157
- "internalType": "uint256",
158
- "name": "requestID",
159
- "type": "uint256"
160
- }
161
- ],
162
- "name": "DecryptionFulfilled",
163
- "type": "event"
164
- },
165
161
  {
166
162
  "anonymous": false,
167
163
  "inputs": [
@@ -187,6 +183,25 @@
187
183
  "name": "OperatorSet",
188
184
  "type": "event"
189
185
  },
186
+ {
187
+ "anonymous": false,
188
+ "inputs": [
189
+ {
190
+ "indexed": false,
191
+ "internalType": "bytes32[]",
192
+ "name": "handlesList",
193
+ "type": "bytes32[]"
194
+ },
195
+ {
196
+ "indexed": false,
197
+ "internalType": "bytes",
198
+ "name": "abiEncodedCleartexts",
199
+ "type": "bytes"
200
+ }
201
+ ],
202
+ "name": "PublicDecryptionVerified",
203
+ "type": "event"
204
+ },
190
205
  {
191
206
  "inputs": [
192
207
  {
@@ -503,24 +518,11 @@
503
518
  "internalType": "euint64",
504
519
  "name": "encryptedAmount",
505
520
  "type": "bytes32"
506
- }
507
- ],
508
- "name": "discloseEncryptedAmount",
509
- "outputs": [],
510
- "stateMutability": "nonpayable",
511
- "type": "function"
512
- },
513
- {
514
- "inputs": [
515
- {
516
- "internalType": "uint256",
517
- "name": "requestId",
518
- "type": "uint256"
519
521
  },
520
522
  {
521
- "internalType": "bytes",
522
- "name": "cleartexts",
523
- "type": "bytes"
523
+ "internalType": "uint64",
524
+ "name": "cleartextAmount",
525
+ "type": "uint64"
524
526
  },
525
527
  {
526
528
  "internalType": "bytes",
@@ -528,7 +530,7 @@
528
530
  "type": "bytes"
529
531
  }
530
532
  ],
531
- "name": "finalizeDiscloseEncryptedAmount",
533
+ "name": "discloseEncryptedAmount",
532
534
  "outputs": [],
533
535
  "stateMutability": "nonpayable",
534
536
  "type": "function"
@@ -570,6 +572,19 @@
570
572
  "stateMutability": "view",
571
573
  "type": "function"
572
574
  },
575
+ {
576
+ "inputs": [
577
+ {
578
+ "internalType": "euint64",
579
+ "name": "encryptedAmount",
580
+ "type": "bytes32"
581
+ }
582
+ ],
583
+ "name": "requestDiscloseEncryptedAmount",
584
+ "outputs": [],
585
+ "stateMutability": "nonpayable",
586
+ "type": "function"
587
+ },
573
588
  {
574
589
  "inputs": [
575
590
  {
@@ -588,6 +603,25 @@
588
603
  "stateMutability": "nonpayable",
589
604
  "type": "function"
590
605
  },
606
+ {
607
+ "inputs": [
608
+ {
609
+ "internalType": "bytes4",
610
+ "name": "interfaceId",
611
+ "type": "bytes4"
612
+ }
613
+ ],
614
+ "name": "supportsInterface",
615
+ "outputs": [
616
+ {
617
+ "internalType": "bool",
618
+ "name": "",
619
+ "type": "bool"
620
+ }
621
+ ],
622
+ "stateMutability": "view",
623
+ "type": "function"
624
+ },
591
625
  {
592
626
  "inputs": [],
593
627
  "name": "symbol",
@@ -36,6 +36,11 @@
36
36
  "name": "ERC7984InvalidSender",
37
37
  "type": "error"
38
38
  },
39
+ {
40
+ "inputs": [],
41
+ "name": "ERC7984TotalSupplyOverflow",
42
+ "type": "error"
43
+ },
39
44
  {
40
45
  "inputs": [
41
46
  {
@@ -90,19 +95,20 @@
90
95
  "name": "ERC7984ZeroBalance",
91
96
  "type": "error"
92
97
  },
93
- {
94
- "inputs": [],
95
- "name": "HandlesAlreadySavedForRequestID",
96
- "type": "error"
97
- },
98
98
  {
99
99
  "inputs": [],
100
100
  "name": "InvalidKMSSignatures",
101
101
  "type": "error"
102
102
  },
103
103
  {
104
- "inputs": [],
105
- "name": "NoHandleFoundForRequestID",
104
+ "inputs": [
105
+ {
106
+ "internalType": "euint64",
107
+ "name": "amount",
108
+ "type": "bytes32"
109
+ }
110
+ ],
111
+ "name": "InvalidUnwrapRequest",
106
112
  "type": "error"
107
113
  },
108
114
  {
@@ -132,6 +138,25 @@
132
138
  "name": "SafeERC20FailedOperation",
133
139
  "type": "error"
134
140
  },
141
+ {
142
+ "anonymous": false,
143
+ "inputs": [
144
+ {
145
+ "indexed": true,
146
+ "internalType": "euint64",
147
+ "name": "encryptedAmount",
148
+ "type": "bytes32"
149
+ },
150
+ {
151
+ "indexed": true,
152
+ "internalType": "address",
153
+ "name": "requester",
154
+ "type": "address"
155
+ }
156
+ ],
157
+ "name": "AmountDiscloseRequested",
158
+ "type": "event"
159
+ },
135
160
  {
136
161
  "anonymous": false,
137
162
  "inputs": [
@@ -181,12 +206,43 @@
181
206
  "inputs": [
182
207
  {
183
208
  "indexed": true,
184
- "internalType": "uint256",
185
- "name": "requestID",
186
- "type": "uint256"
209
+ "internalType": "address",
210
+ "name": "holder",
211
+ "type": "address"
212
+ },
213
+ {
214
+ "indexed": true,
215
+ "internalType": "address",
216
+ "name": "operator",
217
+ "type": "address"
218
+ },
219
+ {
220
+ "indexed": false,
221
+ "internalType": "uint48",
222
+ "name": "until",
223
+ "type": "uint48"
224
+ }
225
+ ],
226
+ "name": "OperatorSet",
227
+ "type": "event"
228
+ },
229
+ {
230
+ "anonymous": false,
231
+ "inputs": [
232
+ {
233
+ "indexed": false,
234
+ "internalType": "bytes32[]",
235
+ "name": "handlesList",
236
+ "type": "bytes32[]"
237
+ },
238
+ {
239
+ "indexed": false,
240
+ "internalType": "bytes",
241
+ "name": "abiEncodedCleartexts",
242
+ "type": "bytes"
187
243
  }
188
244
  ],
189
- "name": "DecryptionFulfilled",
245
+ "name": "PublicDecryptionVerified",
190
246
  "type": "event"
191
247
  },
192
248
  {
@@ -195,23 +251,42 @@
195
251
  {
196
252
  "indexed": true,
197
253
  "internalType": "address",
198
- "name": "holder",
254
+ "name": "receiver",
199
255
  "type": "address"
200
256
  },
257
+ {
258
+ "indexed": false,
259
+ "internalType": "euint64",
260
+ "name": "encryptedAmount",
261
+ "type": "bytes32"
262
+ },
263
+ {
264
+ "indexed": false,
265
+ "internalType": "uint64",
266
+ "name": "cleartextAmount",
267
+ "type": "uint64"
268
+ }
269
+ ],
270
+ "name": "UnwrapFinalized",
271
+ "type": "event"
272
+ },
273
+ {
274
+ "anonymous": false,
275
+ "inputs": [
201
276
  {
202
277
  "indexed": true,
203
278
  "internalType": "address",
204
- "name": "operator",
279
+ "name": "receiver",
205
280
  "type": "address"
206
281
  },
207
282
  {
208
283
  "indexed": false,
209
- "internalType": "uint48",
210
- "name": "until",
211
- "type": "uint48"
284
+ "internalType": "euint64",
285
+ "name": "amount",
286
+ "type": "bytes32"
212
287
  }
213
288
  ],
214
- "name": "OperatorSet",
289
+ "name": "UnwrapRequested",
215
290
  "type": "event"
216
291
  },
217
292
  {
@@ -530,6 +605,16 @@
530
605
  "internalType": "euint64",
531
606
  "name": "encryptedAmount",
532
607
  "type": "bytes32"
608
+ },
609
+ {
610
+ "internalType": "uint64",
611
+ "name": "cleartextAmount",
612
+ "type": "uint64"
613
+ },
614
+ {
615
+ "internalType": "bytes",
616
+ "name": "decryptionProof",
617
+ "type": "bytes"
533
618
  }
534
619
  ],
535
620
  "name": "discloseEncryptedAmount",
@@ -540,14 +625,14 @@
540
625
  {
541
626
  "inputs": [
542
627
  {
543
- "internalType": "uint256",
544
- "name": "requestId",
545
- "type": "uint256"
628
+ "internalType": "euint64",
629
+ "name": "burntAmount",
630
+ "type": "bytes32"
546
631
  },
547
632
  {
548
- "internalType": "bytes",
549
- "name": "cleartexts",
550
- "type": "bytes"
633
+ "internalType": "uint64",
634
+ "name": "burntAmountCleartext",
635
+ "type": "uint64"
551
636
  },
552
637
  {
553
638
  "internalType": "bytes",
@@ -555,32 +640,22 @@
555
640
  "type": "bytes"
556
641
  }
557
642
  ],
558
- "name": "finalizeDiscloseEncryptedAmount",
643
+ "name": "finalizeUnwrap",
559
644
  "outputs": [],
560
645
  "stateMutability": "nonpayable",
561
646
  "type": "function"
562
647
  },
563
648
  {
564
- "inputs": [
649
+ "inputs": [],
650
+ "name": "inferredTotalSupply",
651
+ "outputs": [
565
652
  {
566
653
  "internalType": "uint256",
567
- "name": "requestID",
654
+ "name": "",
568
655
  "type": "uint256"
569
- },
570
- {
571
- "internalType": "bytes",
572
- "name": "cleartexts",
573
- "type": "bytes"
574
- },
575
- {
576
- "internalType": "bytes",
577
- "name": "decryptionProof",
578
- "type": "bytes"
579
656
  }
580
657
  ],
581
- "name": "finalizeUnwrap",
582
- "outputs": [],
583
- "stateMutability": "nonpayable",
658
+ "stateMutability": "view",
584
659
  "type": "function"
585
660
  },
586
661
  {
@@ -607,6 +682,19 @@
607
682
  "stateMutability": "view",
608
683
  "type": "function"
609
684
  },
685
+ {
686
+ "inputs": [],
687
+ "name": "maxTotalSupply",
688
+ "outputs": [
689
+ {
690
+ "internalType": "uint256",
691
+ "name": "",
692
+ "type": "uint256"
693
+ }
694
+ ],
695
+ "stateMutability": "view",
696
+ "type": "function"
697
+ },
610
698
  {
611
699
  "inputs": [],
612
700
  "name": "name",
@@ -667,6 +755,19 @@
667
755
  "stateMutability": "view",
668
756
  "type": "function"
669
757
  },
758
+ {
759
+ "inputs": [
760
+ {
761
+ "internalType": "euint64",
762
+ "name": "encryptedAmount",
763
+ "type": "bytes32"
764
+ }
765
+ ],
766
+ "name": "requestDiscloseEncryptedAmount",
767
+ "outputs": [],
768
+ "stateMutability": "nonpayable",
769
+ "type": "function"
770
+ },
670
771
  {
671
772
  "inputs": [
672
773
  {
@@ -685,6 +786,25 @@
685
786
  "stateMutability": "nonpayable",
686
787
  "type": "function"
687
788
  },
789
+ {
790
+ "inputs": [
791
+ {
792
+ "internalType": "bytes4",
793
+ "name": "interfaceId",
794
+ "type": "bytes4"
795
+ }
796
+ ],
797
+ "name": "supportsInterface",
798
+ "outputs": [
799
+ {
800
+ "internalType": "bool",
801
+ "name": "",
802
+ "type": "bool"
803
+ }
804
+ ],
805
+ "stateMutability": "view",
806
+ "type": "function"
807
+ },
688
808
  {
689
809
  "inputs": [],
690
810
  "name": "symbol",
@@ -90,20 +90,29 @@
90
90
  "name": "ERC7984ZeroBalance",
91
91
  "type": "error"
92
92
  },
93
- {
94
- "inputs": [],
95
- "name": "HandlesAlreadySavedForRequestID",
96
- "type": "error"
97
- },
98
93
  {
99
94
  "inputs": [],
100
95
  "name": "InvalidKMSSignatures",
101
96
  "type": "error"
102
97
  },
103
98
  {
104
- "inputs": [],
105
- "name": "NoHandleFoundForRequestID",
106
- "type": "error"
99
+ "anonymous": false,
100
+ "inputs": [
101
+ {
102
+ "indexed": true,
103
+ "internalType": "euint64",
104
+ "name": "encryptedAmount",
105
+ "type": "bytes32"
106
+ },
107
+ {
108
+ "indexed": true,
109
+ "internalType": "address",
110
+ "name": "requester",
111
+ "type": "address"
112
+ }
113
+ ],
114
+ "name": "AmountDiscloseRequested",
115
+ "type": "event"
107
116
  },
108
117
  {
109
118
  "anonymous": false,
@@ -149,19 +158,6 @@
149
158
  "name": "ConfidentialTransfer",
150
159
  "type": "event"
151
160
  },
152
- {
153
- "anonymous": false,
154
- "inputs": [
155
- {
156
- "indexed": true,
157
- "internalType": "uint256",
158
- "name": "requestID",
159
- "type": "uint256"
160
- }
161
- ],
162
- "name": "DecryptionFulfilled",
163
- "type": "event"
164
- },
165
161
  {
166
162
  "anonymous": false,
167
163
  "inputs": [
@@ -187,6 +183,25 @@
187
183
  "name": "OperatorSet",
188
184
  "type": "event"
189
185
  },
186
+ {
187
+ "anonymous": false,
188
+ "inputs": [
189
+ {
190
+ "indexed": false,
191
+ "internalType": "bytes32[]",
192
+ "name": "handlesList",
193
+ "type": "bytes32[]"
194
+ },
195
+ {
196
+ "indexed": false,
197
+ "internalType": "bytes",
198
+ "name": "abiEncodedCleartexts",
199
+ "type": "bytes"
200
+ }
201
+ ],
202
+ "name": "PublicDecryptionVerified",
203
+ "type": "event"
204
+ },
190
205
  {
191
206
  "anonymous": false,
192
207
  "inputs": [
@@ -560,24 +575,11 @@
560
575
  "internalType": "euint64",
561
576
  "name": "encryptedAmount",
562
577
  "type": "bytes32"
563
- }
564
- ],
565
- "name": "discloseEncryptedAmount",
566
- "outputs": [],
567
- "stateMutability": "nonpayable",
568
- "type": "function"
569
- },
570
- {
571
- "inputs": [
572
- {
573
- "internalType": "uint256",
574
- "name": "requestId",
575
- "type": "uint256"
576
578
  },
577
579
  {
578
- "internalType": "bytes",
579
- "name": "cleartexts",
580
- "type": "bytes"
580
+ "internalType": "uint64",
581
+ "name": "cleartextAmount",
582
+ "type": "uint64"
581
583
  },
582
584
  {
583
585
  "internalType": "bytes",
@@ -585,7 +587,7 @@
585
587
  "type": "bytes"
586
588
  }
587
589
  ],
588
- "name": "finalizeDiscloseEncryptedAmount",
590
+ "name": "discloseEncryptedAmount",
589
591
  "outputs": [],
590
592
  "stateMutability": "nonpayable",
591
593
  "type": "function"
@@ -627,6 +629,19 @@
627
629
  "stateMutability": "view",
628
630
  "type": "function"
629
631
  },
632
+ {
633
+ "inputs": [
634
+ {
635
+ "internalType": "euint64",
636
+ "name": "encryptedAmount",
637
+ "type": "bytes32"
638
+ }
639
+ ],
640
+ "name": "requestDiscloseEncryptedAmount",
641
+ "outputs": [],
642
+ "stateMutability": "nonpayable",
643
+ "type": "function"
644
+ },
630
645
  {
631
646
  "inputs": [
632
647
  {
@@ -645,6 +660,25 @@
645
660
  "stateMutability": "nonpayable",
646
661
  "type": "function"
647
662
  },
663
+ {
664
+ "inputs": [
665
+ {
666
+ "internalType": "bytes4",
667
+ "name": "interfaceId",
668
+ "type": "bytes4"
669
+ }
670
+ ],
671
+ "name": "supportsInterface",
672
+ "outputs": [
673
+ {
674
+ "internalType": "bool",
675
+ "name": "",
676
+ "type": "bool"
677
+ }
678
+ ],
679
+ "stateMutability": "view",
680
+ "type": "function"
681
+ },
648
682
  {
649
683
  "inputs": [],
650
684
  "name": "symbol",