@openzeppelin/confidential-contracts 0.3.0-rc.0 → 0.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 (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 +129 -40
  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 +28 -21
  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",
@@ -90,19 +90,20 @@
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",
99
+ "inputs": [
100
+ {
101
+ "internalType": "euint64",
102
+ "name": "amount",
103
+ "type": "bytes32"
104
+ }
105
+ ],
106
+ "name": "InvalidUnwrapRequest",
106
107
  "type": "error"
107
108
  },
108
109
  {
@@ -132,6 +133,25 @@
132
133
  "name": "SafeERC20FailedOperation",
133
134
  "type": "error"
134
135
  },
136
+ {
137
+ "anonymous": false,
138
+ "inputs": [
139
+ {
140
+ "indexed": true,
141
+ "internalType": "euint64",
142
+ "name": "encryptedAmount",
143
+ "type": "bytes32"
144
+ },
145
+ {
146
+ "indexed": true,
147
+ "internalType": "address",
148
+ "name": "requester",
149
+ "type": "address"
150
+ }
151
+ ],
152
+ "name": "AmountDiscloseRequested",
153
+ "type": "event"
154
+ },
135
155
  {
136
156
  "anonymous": false,
137
157
  "inputs": [
@@ -181,12 +201,43 @@
181
201
  "inputs": [
182
202
  {
183
203
  "indexed": true,
184
- "internalType": "uint256",
185
- "name": "requestID",
186
- "type": "uint256"
204
+ "internalType": "address",
205
+ "name": "holder",
206
+ "type": "address"
207
+ },
208
+ {
209
+ "indexed": true,
210
+ "internalType": "address",
211
+ "name": "operator",
212
+ "type": "address"
213
+ },
214
+ {
215
+ "indexed": false,
216
+ "internalType": "uint48",
217
+ "name": "until",
218
+ "type": "uint48"
219
+ }
220
+ ],
221
+ "name": "OperatorSet",
222
+ "type": "event"
223
+ },
224
+ {
225
+ "anonymous": false,
226
+ "inputs": [
227
+ {
228
+ "indexed": false,
229
+ "internalType": "bytes32[]",
230
+ "name": "handlesList",
231
+ "type": "bytes32[]"
232
+ },
233
+ {
234
+ "indexed": false,
235
+ "internalType": "bytes",
236
+ "name": "abiEncodedCleartexts",
237
+ "type": "bytes"
187
238
  }
188
239
  ],
189
- "name": "DecryptionFulfilled",
240
+ "name": "PublicDecryptionVerified",
190
241
  "type": "event"
191
242
  },
192
243
  {
@@ -195,23 +246,42 @@
195
246
  {
196
247
  "indexed": true,
197
248
  "internalType": "address",
198
- "name": "holder",
249
+ "name": "receiver",
199
250
  "type": "address"
200
251
  },
252
+ {
253
+ "indexed": false,
254
+ "internalType": "euint64",
255
+ "name": "encryptedAmount",
256
+ "type": "bytes32"
257
+ },
258
+ {
259
+ "indexed": false,
260
+ "internalType": "uint64",
261
+ "name": "cleartextAmount",
262
+ "type": "uint64"
263
+ }
264
+ ],
265
+ "name": "UnwrapFinalized",
266
+ "type": "event"
267
+ },
268
+ {
269
+ "anonymous": false,
270
+ "inputs": [
201
271
  {
202
272
  "indexed": true,
203
273
  "internalType": "address",
204
- "name": "operator",
274
+ "name": "receiver",
205
275
  "type": "address"
206
276
  },
207
277
  {
208
278
  "indexed": false,
209
- "internalType": "uint48",
210
- "name": "until",
211
- "type": "uint48"
279
+ "internalType": "euint64",
280
+ "name": "amount",
281
+ "type": "bytes32"
212
282
  }
213
283
  ],
214
- "name": "OperatorSet",
284
+ "name": "UnwrapRequested",
215
285
  "type": "event"
216
286
  },
217
287
  {
@@ -530,24 +600,11 @@
530
600
  "internalType": "euint64",
531
601
  "name": "encryptedAmount",
532
602
  "type": "bytes32"
533
- }
534
- ],
535
- "name": "discloseEncryptedAmount",
536
- "outputs": [],
537
- "stateMutability": "nonpayable",
538
- "type": "function"
539
- },
540
- {
541
- "inputs": [
542
- {
543
- "internalType": "uint256",
544
- "name": "requestId",
545
- "type": "uint256"
546
603
  },
547
604
  {
548
- "internalType": "bytes",
549
- "name": "cleartexts",
550
- "type": "bytes"
605
+ "internalType": "uint64",
606
+ "name": "cleartextAmount",
607
+ "type": "uint64"
551
608
  },
552
609
  {
553
610
  "internalType": "bytes",
@@ -555,7 +612,7 @@
555
612
  "type": "bytes"
556
613
  }
557
614
  ],
558
- "name": "finalizeDiscloseEncryptedAmount",
615
+ "name": "discloseEncryptedAmount",
559
616
  "outputs": [],
560
617
  "stateMutability": "nonpayable",
561
618
  "type": "function"
@@ -563,14 +620,14 @@
563
620
  {
564
621
  "inputs": [
565
622
  {
566
- "internalType": "uint256",
567
- "name": "requestID",
568
- "type": "uint256"
623
+ "internalType": "euint64",
624
+ "name": "burntAmount",
625
+ "type": "bytes32"
569
626
  },
570
627
  {
571
- "internalType": "bytes",
572
- "name": "cleartexts",
573
- "type": "bytes"
628
+ "internalType": "uint64",
629
+ "name": "burntAmountCleartext",
630
+ "type": "uint64"
574
631
  },
575
632
  {
576
633
  "internalType": "bytes",
@@ -667,6 +724,19 @@
667
724
  "stateMutability": "view",
668
725
  "type": "function"
669
726
  },
727
+ {
728
+ "inputs": [
729
+ {
730
+ "internalType": "euint64",
731
+ "name": "encryptedAmount",
732
+ "type": "bytes32"
733
+ }
734
+ ],
735
+ "name": "requestDiscloseEncryptedAmount",
736
+ "outputs": [],
737
+ "stateMutability": "nonpayable",
738
+ "type": "function"
739
+ },
670
740
  {
671
741
  "inputs": [
672
742
  {
@@ -685,6 +755,25 @@
685
755
  "stateMutability": "nonpayable",
686
756
  "type": "function"
687
757
  },
758
+ {
759
+ "inputs": [
760
+ {
761
+ "internalType": "bytes4",
762
+ "name": "interfaceId",
763
+ "type": "bytes4"
764
+ }
765
+ ],
766
+ "name": "supportsInterface",
767
+ "outputs": [
768
+ {
769
+ "internalType": "bool",
770
+ "name": "",
771
+ "type": "bool"
772
+ }
773
+ ],
774
+ "stateMutability": "view",
775
+ "type": "function"
776
+ },
688
777
  {
689
778
  "inputs": [],
690
779
  "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",