@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
@@ -90,11 +90,6 @@
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",
@@ -102,13 +97,27 @@
102
97
  },
103
98
  {
104
99
  "inputs": [],
105
- "name": "NoHandleFoundForRequestID",
100
+ "name": "Unauthorized",
106
101
  "type": "error"
107
102
  },
108
103
  {
109
- "inputs": [],
110
- "name": "Unauthorized",
111
- "type": "error"
104
+ "anonymous": false,
105
+ "inputs": [
106
+ {
107
+ "indexed": true,
108
+ "internalType": "euint64",
109
+ "name": "encryptedAmount",
110
+ "type": "bytes32"
111
+ },
112
+ {
113
+ "indexed": true,
114
+ "internalType": "address",
115
+ "name": "requester",
116
+ "type": "address"
117
+ }
118
+ ],
119
+ "name": "AmountDiscloseRequested",
120
+ "type": "event"
112
121
  },
113
122
  {
114
123
  "anonymous": false,
@@ -154,19 +163,6 @@
154
163
  "name": "ConfidentialTransfer",
155
164
  "type": "event"
156
165
  },
157
- {
158
- "anonymous": false,
159
- "inputs": [
160
- {
161
- "indexed": true,
162
- "internalType": "uint256",
163
- "name": "requestID",
164
- "type": "uint256"
165
- }
166
- ],
167
- "name": "DecryptionFulfilled",
168
- "type": "event"
169
- },
170
166
  {
171
167
  "anonymous": false,
172
168
  "inputs": [
@@ -217,6 +213,25 @@
217
213
  "name": "OperatorSet",
218
214
  "type": "event"
219
215
  },
216
+ {
217
+ "anonymous": false,
218
+ "inputs": [
219
+ {
220
+ "indexed": false,
221
+ "internalType": "bytes32[]",
222
+ "name": "handlesList",
223
+ "type": "bytes32[]"
224
+ },
225
+ {
226
+ "indexed": false,
227
+ "internalType": "bytes",
228
+ "name": "abiEncodedCleartexts",
229
+ "type": "bytes"
230
+ }
231
+ ],
232
+ "name": "PublicDecryptionVerified",
233
+ "type": "event"
234
+ },
220
235
  {
221
236
  "inputs": [
222
237
  {
@@ -533,24 +548,11 @@
533
548
  "internalType": "euint64",
534
549
  "name": "encryptedAmount",
535
550
  "type": "bytes32"
536
- }
537
- ],
538
- "name": "discloseEncryptedAmount",
539
- "outputs": [],
540
- "stateMutability": "nonpayable",
541
- "type": "function"
542
- },
543
- {
544
- "inputs": [
545
- {
546
- "internalType": "uint256",
547
- "name": "requestId",
548
- "type": "uint256"
549
551
  },
550
552
  {
551
- "internalType": "bytes",
552
- "name": "cleartexts",
553
- "type": "bytes"
553
+ "internalType": "uint64",
554
+ "name": "cleartextAmount",
555
+ "type": "uint64"
554
556
  },
555
557
  {
556
558
  "internalType": "bytes",
@@ -558,7 +560,7 @@
558
560
  "type": "bytes"
559
561
  }
560
562
  ],
561
- "name": "finalizeDiscloseEncryptedAmount",
563
+ "name": "discloseEncryptedAmount",
562
564
  "outputs": [],
563
565
  "stateMutability": "nonpayable",
564
566
  "type": "function"
@@ -619,6 +621,19 @@
619
621
  "stateMutability": "view",
620
622
  "type": "function"
621
623
  },
624
+ {
625
+ "inputs": [
626
+ {
627
+ "internalType": "euint64",
628
+ "name": "encryptedAmount",
629
+ "type": "bytes32"
630
+ }
631
+ ],
632
+ "name": "requestDiscloseEncryptedAmount",
633
+ "outputs": [],
634
+ "stateMutability": "nonpayable",
635
+ "type": "function"
636
+ },
622
637
  {
623
638
  "inputs": [
624
639
  {
@@ -655,6 +670,25 @@
655
670
  "stateMutability": "nonpayable",
656
671
  "type": "function"
657
672
  },
673
+ {
674
+ "inputs": [
675
+ {
676
+ "internalType": "bytes4",
677
+ "name": "interfaceId",
678
+ "type": "bytes4"
679
+ }
680
+ ],
681
+ "name": "supportsInterface",
682
+ "outputs": [
683
+ {
684
+ "internalType": "bool",
685
+ "name": "",
686
+ "type": "bool"
687
+ }
688
+ ],
689
+ "stateMutability": "view",
690
+ "type": "function"
691
+ },
658
692
  {
659
693
  "inputs": [],
660
694
  "name": "symbol",
@@ -106,20 +106,29 @@
106
106
  "name": "ERC7984ZeroBalance",
107
107
  "type": "error"
108
108
  },
109
- {
110
- "inputs": [],
111
- "name": "HandlesAlreadySavedForRequestID",
112
- "type": "error"
113
- },
114
109
  {
115
110
  "inputs": [],
116
111
  "name": "InvalidKMSSignatures",
117
112
  "type": "error"
118
113
  },
119
114
  {
120
- "inputs": [],
121
- "name": "NoHandleFoundForRequestID",
122
- "type": "error"
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"
123
132
  },
124
133
  {
125
134
  "anonymous": false,
@@ -165,19 +174,6 @@
165
174
  "name": "ConfidentialTransfer",
166
175
  "type": "event"
167
176
  },
168
- {
169
- "anonymous": false,
170
- "inputs": [
171
- {
172
- "indexed": true,
173
- "internalType": "uint256",
174
- "name": "requestID",
175
- "type": "uint256"
176
- }
177
- ],
178
- "name": "DecryptionFulfilled",
179
- "type": "event"
180
- },
181
177
  {
182
178
  "anonymous": false,
183
179
  "inputs": [
@@ -240,6 +236,25 @@
240
236
  "name": "OperatorSet",
241
237
  "type": "event"
242
238
  },
239
+ {
240
+ "anonymous": false,
241
+ "inputs": [
242
+ {
243
+ "indexed": false,
244
+ "internalType": "bytes32[]",
245
+ "name": "handlesList",
246
+ "type": "bytes32[]"
247
+ },
248
+ {
249
+ "indexed": false,
250
+ "internalType": "bytes",
251
+ "name": "abiEncodedCleartexts",
252
+ "type": "bytes"
253
+ }
254
+ ],
255
+ "name": "PublicDecryptionVerified",
256
+ "type": "event"
257
+ },
243
258
  {
244
259
  "inputs": [
245
260
  {
@@ -888,24 +903,11 @@
888
903
  "internalType": "euint64",
889
904
  "name": "encryptedAmount",
890
905
  "type": "bytes32"
891
- }
892
- ],
893
- "name": "discloseEncryptedAmount",
894
- "outputs": [],
895
- "stateMutability": "nonpayable",
896
- "type": "function"
897
- },
898
- {
899
- "inputs": [
900
- {
901
- "internalType": "uint256",
902
- "name": "requestId",
903
- "type": "uint256"
904
906
  },
905
907
  {
906
- "internalType": "bytes",
907
- "name": "cleartexts",
908
- "type": "bytes"
908
+ "internalType": "uint64",
909
+ "name": "cleartextAmount",
910
+ "type": "uint64"
909
911
  },
910
912
  {
911
913
  "internalType": "bytes",
@@ -913,7 +915,7 @@
913
915
  "type": "bytes"
914
916
  }
915
917
  ],
916
- "name": "finalizeDiscloseEncryptedAmount",
918
+ "name": "discloseEncryptedAmount",
917
919
  "outputs": [],
918
920
  "stateMutability": "nonpayable",
919
921
  "type": "function"
@@ -955,6 +957,19 @@
955
957
  "stateMutability": "view",
956
958
  "type": "function"
957
959
  },
960
+ {
961
+ "inputs": [
962
+ {
963
+ "internalType": "euint64",
964
+ "name": "encryptedAmount",
965
+ "type": "bytes32"
966
+ }
967
+ ],
968
+ "name": "requestDiscloseEncryptedAmount",
969
+ "outputs": [],
970
+ "stateMutability": "nonpayable",
971
+ "type": "function"
972
+ },
958
973
  {
959
974
  "inputs": [
960
975
  {
@@ -973,6 +988,25 @@
973
988
  "stateMutability": "nonpayable",
974
989
  "type": "function"
975
990
  },
991
+ {
992
+ "inputs": [
993
+ {
994
+ "internalType": "bytes4",
995
+ "name": "interfaceId",
996
+ "type": "bytes4"
997
+ }
998
+ ],
999
+ "name": "supportsInterface",
1000
+ "outputs": [
1001
+ {
1002
+ "internalType": "bool",
1003
+ "name": "",
1004
+ "type": "bool"
1005
+ }
1006
+ ],
1007
+ "stateMutability": "view",
1008
+ "type": "function"
1009
+ },
976
1010
  {
977
1011
  "inputs": [],
978
1012
  "name": "symbol",
@@ -90,21 +90,11 @@
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
- {
104
- "inputs": [],
105
- "name": "NoHandleFoundForRequestID",
106
- "type": "error"
107
- },
108
98
  {
109
99
  "inputs": [
110
100
  {
@@ -116,6 +106,25 @@
116
106
  "name": "UserRestricted",
117
107
  "type": "error"
118
108
  },
109
+ {
110
+ "anonymous": false,
111
+ "inputs": [
112
+ {
113
+ "indexed": true,
114
+ "internalType": "euint64",
115
+ "name": "encryptedAmount",
116
+ "type": "bytes32"
117
+ },
118
+ {
119
+ "indexed": true,
120
+ "internalType": "address",
121
+ "name": "requester",
122
+ "type": "address"
123
+ }
124
+ ],
125
+ "name": "AmountDiscloseRequested",
126
+ "type": "event"
127
+ },
119
128
  {
120
129
  "anonymous": false,
121
130
  "inputs": [
@@ -160,19 +169,6 @@
160
169
  "name": "ConfidentialTransfer",
161
170
  "type": "event"
162
171
  },
163
- {
164
- "anonymous": false,
165
- "inputs": [
166
- {
167
- "indexed": true,
168
- "internalType": "uint256",
169
- "name": "requestID",
170
- "type": "uint256"
171
- }
172
- ],
173
- "name": "DecryptionFulfilled",
174
- "type": "event"
175
- },
176
172
  {
177
173
  "anonymous": false,
178
174
  "inputs": [
@@ -198,6 +194,25 @@
198
194
  "name": "OperatorSet",
199
195
  "type": "event"
200
196
  },
197
+ {
198
+ "anonymous": false,
199
+ "inputs": [
200
+ {
201
+ "indexed": false,
202
+ "internalType": "bytes32[]",
203
+ "name": "handlesList",
204
+ "type": "bytes32[]"
205
+ },
206
+ {
207
+ "indexed": false,
208
+ "internalType": "bytes",
209
+ "name": "abiEncodedCleartexts",
210
+ "type": "bytes"
211
+ }
212
+ ],
213
+ "name": "PublicDecryptionVerified",
214
+ "type": "event"
215
+ },
201
216
  {
202
217
  "anonymous": false,
203
218
  "inputs": [
@@ -533,24 +548,11 @@
533
548
  "internalType": "euint64",
534
549
  "name": "encryptedAmount",
535
550
  "type": "bytes32"
536
- }
537
- ],
538
- "name": "discloseEncryptedAmount",
539
- "outputs": [],
540
- "stateMutability": "nonpayable",
541
- "type": "function"
542
- },
543
- {
544
- "inputs": [
545
- {
546
- "internalType": "uint256",
547
- "name": "requestId",
548
- "type": "uint256"
549
551
  },
550
552
  {
551
- "internalType": "bytes",
552
- "name": "cleartexts",
553
- "type": "bytes"
553
+ "internalType": "uint64",
554
+ "name": "cleartextAmount",
555
+ "type": "uint64"
554
556
  },
555
557
  {
556
558
  "internalType": "bytes",
@@ -558,7 +560,7 @@
558
560
  "type": "bytes"
559
561
  }
560
562
  ],
561
- "name": "finalizeDiscloseEncryptedAmount",
563
+ "name": "discloseEncryptedAmount",
562
564
  "outputs": [],
563
565
  "stateMutability": "nonpayable",
564
566
  "type": "function"
@@ -638,6 +640,19 @@
638
640
  "stateMutability": "view",
639
641
  "type": "function"
640
642
  },
643
+ {
644
+ "inputs": [
645
+ {
646
+ "internalType": "euint64",
647
+ "name": "encryptedAmount",
648
+ "type": "bytes32"
649
+ }
650
+ ],
651
+ "name": "requestDiscloseEncryptedAmount",
652
+ "outputs": [],
653
+ "stateMutability": "nonpayable",
654
+ "type": "function"
655
+ },
641
656
  {
642
657
  "inputs": [
643
658
  {
@@ -656,6 +671,25 @@
656
671
  "stateMutability": "nonpayable",
657
672
  "type": "function"
658
673
  },
674
+ {
675
+ "inputs": [
676
+ {
677
+ "internalType": "bytes4",
678
+ "name": "interfaceId",
679
+ "type": "bytes4"
680
+ }
681
+ ],
682
+ "name": "supportsInterface",
683
+ "outputs": [
684
+ {
685
+ "internalType": "bool",
686
+ "name": "",
687
+ "type": "bool"
688
+ }
689
+ ],
690
+ "stateMutability": "view",
691
+ "type": "function"
692
+ },
659
693
  {
660
694
  "inputs": [],
661
695
  "name": "symbol",
@@ -137,21 +137,11 @@
137
137
  "name": "FailedCall",
138
138
  "type": "error"
139
139
  },
140
- {
141
- "inputs": [],
142
- "name": "HandlesAlreadySavedForRequestID",
143
- "type": "error"
144
- },
145
140
  {
146
141
  "inputs": [],
147
142
  "name": "InvalidKMSSignatures",
148
143
  "type": "error"
149
144
  },
150
- {
151
- "inputs": [],
152
- "name": "NoHandleFoundForRequestID",
153
- "type": "error"
154
- },
155
145
  {
156
146
  "inputs": [
157
147
  {
@@ -163,6 +153,25 @@
163
153
  "name": "UserRestricted",
164
154
  "type": "error"
165
155
  },
156
+ {
157
+ "anonymous": false,
158
+ "inputs": [
159
+ {
160
+ "indexed": true,
161
+ "internalType": "euint64",
162
+ "name": "encryptedAmount",
163
+ "type": "bytes32"
164
+ },
165
+ {
166
+ "indexed": true,
167
+ "internalType": "address",
168
+ "name": "requester",
169
+ "type": "address"
170
+ }
171
+ ],
172
+ "name": "AmountDiscloseRequested",
173
+ "type": "event"
174
+ },
166
175
  {
167
176
  "anonymous": false,
168
177
  "inputs": [
@@ -207,19 +216,6 @@
207
216
  "name": "ConfidentialTransfer",
208
217
  "type": "event"
209
218
  },
210
- {
211
- "anonymous": false,
212
- "inputs": [
213
- {
214
- "indexed": true,
215
- "internalType": "uint256",
216
- "name": "requestID",
217
- "type": "uint256"
218
- }
219
- ],
220
- "name": "DecryptionFulfilled",
221
- "type": "event"
222
- },
223
219
  {
224
220
  "anonymous": false,
225
221
  "inputs": [
@@ -258,6 +254,25 @@
258
254
  "name": "Paused",
259
255
  "type": "event"
260
256
  },
257
+ {
258
+ "anonymous": false,
259
+ "inputs": [
260
+ {
261
+ "indexed": false,
262
+ "internalType": "bytes32[]",
263
+ "name": "handlesList",
264
+ "type": "bytes32[]"
265
+ },
266
+ {
267
+ "indexed": false,
268
+ "internalType": "bytes",
269
+ "name": "abiEncodedCleartexts",
270
+ "type": "bytes"
271
+ }
272
+ ],
273
+ "name": "PublicDecryptionVerified",
274
+ "type": "event"
275
+ },
261
276
  {
262
277
  "anonymous": false,
263
278
  "inputs": [
@@ -896,24 +911,11 @@
896
911
  "internalType": "euint64",
897
912
  "name": "encryptedAmount",
898
913
  "type": "bytes32"
899
- }
900
- ],
901
- "name": "discloseEncryptedAmount",
902
- "outputs": [],
903
- "stateMutability": "nonpayable",
904
- "type": "function"
905
- },
906
- {
907
- "inputs": [
908
- {
909
- "internalType": "uint256",
910
- "name": "requestId",
911
- "type": "uint256"
912
914
  },
913
915
  {
914
- "internalType": "bytes",
915
- "name": "cleartexts",
916
- "type": "bytes"
916
+ "internalType": "uint64",
917
+ "name": "cleartextAmount",
918
+ "type": "uint64"
917
919
  },
918
920
  {
919
921
  "internalType": "bytes",
@@ -921,7 +923,7 @@
921
923
  "type": "bytes"
922
924
  }
923
925
  ],
924
- "name": "finalizeDiscloseEncryptedAmount",
926
+ "name": "discloseEncryptedAmount",
925
927
  "outputs": [],
926
928
  "stateMutability": "nonpayable",
927
929
  "type": "function"
@@ -1233,6 +1235,19 @@
1233
1235
  "stateMutability": "nonpayable",
1234
1236
  "type": "function"
1235
1237
  },
1238
+ {
1239
+ "inputs": [
1240
+ {
1241
+ "internalType": "euint64",
1242
+ "name": "encryptedAmount",
1243
+ "type": "bytes32"
1244
+ }
1245
+ ],
1246
+ "name": "requestDiscloseEncryptedAmount",
1247
+ "outputs": [],
1248
+ "stateMutability": "nonpayable",
1249
+ "type": "function"
1250
+ },
1236
1251
  {
1237
1252
  "inputs": [
1238
1253
  {
@@ -3,8 +3,8 @@
3
3
  "contractName": "ERC7984Utils",
4
4
  "sourceName": "contracts/token/ERC7984/utils/ERC7984Utils.sol",
5
5
  "abi": [],
6
- "bytecode": "0x60556032600b8282823980515f1a607314602657634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220b4891dcde8aaacec3327be515359ef9cc33c1d928ec5c294f483d2d0ed31407a64736f6c634300081d0033",
7
- "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220b4891dcde8aaacec3327be515359ef9cc33c1d928ec5c294f483d2d0ed31407a64736f6c634300081d0033",
6
+ "bytecode": "0x60556032600b8282823980515f1a607314602657634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea26469706673582212200d4cd0d6ce8e98df1c91b36ce74d41d9a6e942eddaafad2aa57cfe8b957c52b764736f6c634300081d0033",
7
+ "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040525f5ffdfea26469706673582212200d4cd0d6ce8e98df1c91b36ce74d41d9a6e942eddaafad2aa57cfe8b957c52b764736f6c634300081d0033",
8
8
  "linkReferences": {},
9
9
  "deployedLinkReferences": {}
10
10
  }