@openzeppelin/confidential-contracts 0.2.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 (35) hide show
  1. package/build/contracts/Checkpoints.json +2 -2
  2. package/build/contracts/CheckpointsConfidential.json +2 -2
  3. package/build/contracts/{ConfidentialFungibleToken.json → ERC7984.json} +87 -58
  4. package/build/contracts/{ConfidentialFungibleTokenERC20Wrapper.json → ERC7984ERC20Wrapper.json} +143 -59
  5. package/build/contracts/ERC7984Freezable.json +700 -0
  6. package/build/contracts/ERC7984ObserverAccess.json +710 -0
  7. package/build/contracts/ERC7984Omnibus.json +1028 -0
  8. package/build/contracts/ERC7984Restricted.json +711 -0
  9. package/build/contracts/ERC7984Rwa.json +1385 -0
  10. package/build/contracts/{ConfidentialFungibleTokenUtils.json → ERC7984Utils.json} +4 -4
  11. package/build/contracts/{ConfidentialFungibleTokenVotes.json → ERC7984Votes.json} +142 -113
  12. package/build/contracts/FHESafeMath.json +2 -2
  13. package/build/contracts/{IConfidentialFungibleToken.json → IERC7984.json} +26 -7
  14. package/build/contracts/{IConfidentialFungibleTokenReceiver.json → IERC7984Receiver.json} +2 -2
  15. package/build/contracts/IERC7984Rwa.json +797 -0
  16. package/build/contracts/VestingWalletConfidentialFactory.json +2 -2
  17. package/finance/ERC7821WithExecutor.sol +3 -4
  18. package/finance/VestingWalletCliffConfidential.sol +3 -4
  19. package/finance/VestingWalletConfidential.sol +8 -12
  20. package/finance/VestingWalletConfidentialFactory.sol +7 -12
  21. package/interfaces/{IConfidentialFungibleToken.sol → IERC7984.sol} +6 -5
  22. package/interfaces/{IConfidentialFungibleTokenReceiver.sol → IERC7984Receiver.sol} +3 -3
  23. package/interfaces/IERC7984Rwa.sol +63 -0
  24. package/package.json +4 -4
  25. package/token/{ConfidentialFungibleToken.sol → ERC7984/ERC7984.sol} +81 -82
  26. package/token/{extensions/ConfidentialFungibleTokenERC20Wrapper.sol → ERC7984/extensions/ERC7984ERC20Wrapper.sol} +40 -35
  27. package/token/ERC7984/extensions/ERC7984Freezable.sol +75 -0
  28. package/token/ERC7984/extensions/ERC7984ObserverAccess.sol +63 -0
  29. package/token/ERC7984/extensions/ERC7984Omnibus.sol +209 -0
  30. package/token/ERC7984/extensions/ERC7984Restricted.sol +110 -0
  31. package/token/ERC7984/extensions/ERC7984Rwa.sol +248 -0
  32. package/token/{extensions/ConfidentialFungibleTokenVotes.sol → ERC7984/extensions/ERC7984Votes.sol} +8 -14
  33. package/token/{utils/ConfidentialFungibleTokenUtils.sol → ERC7984/utils/ERC7984Utils.sol} +14 -13
  34. package/utils/FHESafeMath.sol +45 -7
  35. package/utils/structs/temporary-Checkpoints.sol +2 -2
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "_format": "hh-sol-artifact-1",
3
- "contractName": "ConfidentialFungibleTokenUtils",
4
- "sourceName": "contracts/token/utils/ConfidentialFungibleTokenUtils.sol",
3
+ "contractName": "ERC7984Utils",
4
+ "sourceName": "contracts/token/ERC7984/utils/ERC7984Utils.sol",
5
5
  "abi": [],
6
- "bytecode": "0x60556032600b8282823980515f1a607314602657634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220b16578e84785381452ea9c7ec4dfc058f69cc926edb04fddadfe0ed26ee6f7d264736f6c634300081d0033",
7
- "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220b16578e84785381452ea9c7ec4dfc058f69cc926edb04fddadfe0ed26ee6f7d264736f6c634300081d0033",
6
+ "bytecode": "0x60556032600b8282823980515f1a607314602657634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea26469706673582212200d4cd0d6ce8e98df1c91b36ce74d41d9a6e942eddaafad2aa57cfe8b957c52b764736f6c634300081d0033",
7
+ "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040525f5ffdfea26469706673582212200d4cd0d6ce8e98df1c91b36ce74d41d9a6e942eddaafad2aa57cfe8b957c52b764736f6c634300081d0033",
8
8
  "linkReferences": {},
9
9
  "deployedLinkReferences": {}
10
10
  }
@@ -1,13 +1,61 @@
1
1
  {
2
2
  "_format": "hh-sol-artifact-1",
3
- "contractName": "ConfidentialFungibleTokenVotes",
4
- "sourceName": "contracts/token/extensions/ConfidentialFungibleTokenVotes.sol",
3
+ "contractName": "ERC7984Votes",
4
+ "sourceName": "contracts/token/ERC7984/extensions/ERC7984Votes.sol",
5
5
  "abi": [
6
6
  {
7
7
  "inputs": [],
8
8
  "name": "CheckpointUnorderedInsertion",
9
9
  "type": "error"
10
10
  },
11
+ {
12
+ "inputs": [],
13
+ "name": "ECDSAInvalidSignature",
14
+ "type": "error"
15
+ },
16
+ {
17
+ "inputs": [
18
+ {
19
+ "internalType": "uint256",
20
+ "name": "length",
21
+ "type": "uint256"
22
+ }
23
+ ],
24
+ "name": "ECDSAInvalidSignatureLength",
25
+ "type": "error"
26
+ },
27
+ {
28
+ "inputs": [
29
+ {
30
+ "internalType": "bytes32",
31
+ "name": "s",
32
+ "type": "bytes32"
33
+ }
34
+ ],
35
+ "name": "ECDSAInvalidSignatureS",
36
+ "type": "error"
37
+ },
38
+ {
39
+ "inputs": [
40
+ {
41
+ "internalType": "uint256",
42
+ "name": "timepoint",
43
+ "type": "uint256"
44
+ },
45
+ {
46
+ "internalType": "uint48",
47
+ "name": "clock",
48
+ "type": "uint48"
49
+ }
50
+ ],
51
+ "name": "ERC5805FutureLookup",
52
+ "type": "error"
53
+ },
54
+ {
55
+ "inputs": [],
56
+ "name": "ERC6372InconsistentClock",
57
+ "type": "error"
58
+ },
11
59
  {
12
60
  "inputs": [
13
61
  {
@@ -16,7 +64,7 @@
16
64
  "type": "uint256"
17
65
  }
18
66
  ],
19
- "name": "ConfidentialFungibleTokenInvalidGatewayRequest",
67
+ "name": "ERC7984InvalidGatewayRequest",
20
68
  "type": "error"
21
69
  },
22
70
  {
@@ -27,7 +75,7 @@
27
75
  "type": "address"
28
76
  }
29
77
  ],
30
- "name": "ConfidentialFungibleTokenInvalidReceiver",
78
+ "name": "ERC7984InvalidReceiver",
31
79
  "type": "error"
32
80
  },
33
81
  {
@@ -38,7 +86,7 @@
38
86
  "type": "address"
39
87
  }
40
88
  ],
41
- "name": "ConfidentialFungibleTokenInvalidSender",
89
+ "name": "ERC7984InvalidSender",
42
90
  "type": "error"
43
91
  },
44
92
  {
@@ -49,7 +97,7 @@
49
97
  "type": "address"
50
98
  }
51
99
  ],
52
- "name": "ConfidentialFungibleTokenUnauthorizedCaller",
100
+ "name": "ERC7984UnauthorizedCaller",
53
101
  "type": "error"
54
102
  },
55
103
  {
@@ -65,7 +113,7 @@
65
113
  "type": "address"
66
114
  }
67
115
  ],
68
- "name": "ConfidentialFungibleTokenUnauthorizedSpender",
116
+ "name": "ERC7984UnauthorizedSpender",
69
117
  "type": "error"
70
118
  },
71
119
  {
@@ -81,7 +129,7 @@
81
129
  "type": "address"
82
130
  }
83
131
  ],
84
- "name": "ConfidentialFungibleTokenUnauthorizedUseOfEncryptedAmount",
132
+ "name": "ERC7984UnauthorizedUseOfEncryptedAmount",
85
133
  "type": "error"
86
134
  },
87
135
  {
@@ -92,60 +140,7 @@
92
140
  "type": "address"
93
141
  }
94
142
  ],
95
- "name": "ConfidentialFungibleTokenZeroBalance",
96
- "type": "error"
97
- },
98
- {
99
- "inputs": [],
100
- "name": "ECDSAInvalidSignature",
101
- "type": "error"
102
- },
103
- {
104
- "inputs": [
105
- {
106
- "internalType": "uint256",
107
- "name": "length",
108
- "type": "uint256"
109
- }
110
- ],
111
- "name": "ECDSAInvalidSignatureLength",
112
- "type": "error"
113
- },
114
- {
115
- "inputs": [
116
- {
117
- "internalType": "bytes32",
118
- "name": "s",
119
- "type": "bytes32"
120
- }
121
- ],
122
- "name": "ECDSAInvalidSignatureS",
123
- "type": "error"
124
- },
125
- {
126
- "inputs": [
127
- {
128
- "internalType": "uint256",
129
- "name": "timepoint",
130
- "type": "uint256"
131
- },
132
- {
133
- "internalType": "uint48",
134
- "name": "clock",
135
- "type": "uint48"
136
- }
137
- ],
138
- "name": "ERC5805FutureLookup",
139
- "type": "error"
140
- },
141
- {
142
- "inputs": [],
143
- "name": "ERC6372InconsistentClock",
144
- "type": "error"
145
- },
146
- {
147
- "inputs": [],
148
- "name": "HandlesAlreadySavedForRequestID",
143
+ "name": "ERC7984ZeroBalance",
149
144
  "type": "error"
150
145
  },
151
146
  {
@@ -174,11 +169,6 @@
174
169
  "name": "InvalidShortString",
175
170
  "type": "error"
176
171
  },
177
- {
178
- "inputs": [],
179
- "name": "NoHandleFoundForRequestID",
180
- "type": "error"
181
- },
182
172
  {
183
173
  "inputs": [
184
174
  {
@@ -206,11 +196,6 @@
206
196
  "name": "StringTooLong",
207
197
  "type": "error"
208
198
  },
209
- {
210
- "inputs": [],
211
- "name": "UnsupportedHandleType",
212
- "type": "error"
213
- },
214
199
  {
215
200
  "inputs": [
216
201
  {
@@ -222,6 +207,25 @@
222
207
  "name": "VotesExpiredSignature",
223
208
  "type": "error"
224
209
  },
210
+ {
211
+ "anonymous": false,
212
+ "inputs": [
213
+ {
214
+ "indexed": true,
215
+ "internalType": "euint64",
216
+ "name": "encryptedAmount",
217
+ "type": "bytes32"
218
+ },
219
+ {
220
+ "indexed": true,
221
+ "internalType": "address",
222
+ "name": "requester",
223
+ "type": "address"
224
+ }
225
+ ],
226
+ "name": "AmountDiscloseRequested",
227
+ "type": "event"
228
+ },
225
229
  {
226
230
  "anonymous": false,
227
231
  "inputs": [
@@ -266,19 +270,6 @@
266
270
  "name": "ConfidentialTransfer",
267
271
  "type": "event"
268
272
  },
269
- {
270
- "anonymous": false,
271
- "inputs": [
272
- {
273
- "indexed": true,
274
- "internalType": "uint256",
275
- "name": "requestID",
276
- "type": "uint256"
277
- }
278
- ],
279
- "name": "DecryptionFulfilled",
280
- "type": "event"
281
- },
282
273
  {
283
274
  "anonymous": false,
284
275
  "inputs": [
@@ -360,6 +351,25 @@
360
351
  "name": "OperatorSet",
361
352
  "type": "event"
362
353
  },
354
+ {
355
+ "anonymous": false,
356
+ "inputs": [
357
+ {
358
+ "indexed": false,
359
+ "internalType": "bytes32[]",
360
+ "name": "handlesList",
361
+ "type": "bytes32[]"
362
+ },
363
+ {
364
+ "indexed": false,
365
+ "internalType": "bytes",
366
+ "name": "abiEncodedCleartexts",
367
+ "type": "bytes"
368
+ }
369
+ ],
370
+ "name": "PublicDecryptionVerified",
371
+ "type": "event"
372
+ },
363
373
  {
364
374
  "inputs": [],
365
375
  "name": "CLOCK_MODE",
@@ -670,6 +680,19 @@
670
680
  "stateMutability": "nonpayable",
671
681
  "type": "function"
672
682
  },
683
+ {
684
+ "inputs": [],
685
+ "name": "contractURI",
686
+ "outputs": [
687
+ {
688
+ "internalType": "string",
689
+ "name": "",
690
+ "type": "string"
691
+ }
692
+ ],
693
+ "stateMutability": "view",
694
+ "type": "function"
695
+ },
673
696
  {
674
697
  "inputs": [],
675
698
  "name": "decimals",
@@ -759,6 +782,16 @@
759
782
  "internalType": "euint64",
760
783
  "name": "encryptedAmount",
761
784
  "type": "bytes32"
785
+ },
786
+ {
787
+ "internalType": "uint64",
788
+ "name": "cleartextAmount",
789
+ "type": "uint64"
790
+ },
791
+ {
792
+ "internalType": "bytes",
793
+ "name": "decryptionProof",
794
+ "type": "bytes"
762
795
  }
763
796
  ],
764
797
  "name": "discloseEncryptedAmount",
@@ -809,29 +842,6 @@
809
842
  "stateMutability": "view",
810
843
  "type": "function"
811
844
  },
812
- {
813
- "inputs": [
814
- {
815
- "internalType": "uint256",
816
- "name": "requestId",
817
- "type": "uint256"
818
- },
819
- {
820
- "internalType": "uint64",
821
- "name": "amount",
822
- "type": "uint64"
823
- },
824
- {
825
- "internalType": "bytes[]",
826
- "name": "signatures",
827
- "type": "bytes[]"
828
- }
829
- ],
830
- "name": "finalizeDiscloseEncryptedAmount",
831
- "outputs": [],
832
- "stateMutability": "nonpayable",
833
- "type": "function"
834
- },
835
845
  {
836
846
  "inputs": [
837
847
  {
@@ -973,6 +983,19 @@
973
983
  "stateMutability": "view",
974
984
  "type": "function"
975
985
  },
986
+ {
987
+ "inputs": [
988
+ {
989
+ "internalType": "euint64",
990
+ "name": "encryptedAmount",
991
+ "type": "bytes32"
992
+ }
993
+ ],
994
+ "name": "requestDiscloseEncryptedAmount",
995
+ "outputs": [],
996
+ "stateMutability": "nonpayable",
997
+ "type": "function"
998
+ },
976
999
  {
977
1000
  "inputs": [
978
1001
  {
@@ -992,13 +1015,19 @@
992
1015
  "type": "function"
993
1016
  },
994
1017
  {
995
- "inputs": [],
996
- "name": "symbol",
1018
+ "inputs": [
1019
+ {
1020
+ "internalType": "bytes4",
1021
+ "name": "interfaceId",
1022
+ "type": "bytes4"
1023
+ }
1024
+ ],
1025
+ "name": "supportsInterface",
997
1026
  "outputs": [
998
1027
  {
999
- "internalType": "string",
1028
+ "internalType": "bool",
1000
1029
  "name": "",
1001
- "type": "string"
1030
+ "type": "bool"
1002
1031
  }
1003
1032
  ],
1004
1033
  "stateMutability": "view",
@@ -1006,7 +1035,7 @@
1006
1035
  },
1007
1036
  {
1008
1037
  "inputs": [],
1009
- "name": "tokenURI",
1038
+ "name": "symbol",
1010
1039
  "outputs": [
1011
1040
  {
1012
1041
  "internalType": "string",
@@ -3,8 +3,8 @@
3
3
  "contractName": "FHESafeMath",
4
4
  "sourceName": "contracts/utils/FHESafeMath.sol",
5
5
  "abi": [],
6
- "bytecode": "0x60556032600b8282823980515f1a607314602657634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220169c9cbdfb2791e1d96b54361ac4446969846b7a58a8da1f7dba5af4fa757c7564736f6c634300081d0033",
7
- "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220169c9cbdfb2791e1d96b54361ac4446969846b7a58a8da1f7dba5af4fa757c7564736f6c634300081d0033",
6
+ "bytecode": "0x60556032600b8282823980515f1a607314602657634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220dfd2955b2f5c80c39629efab80b102628759176a07e6500f461ab8aaee7442c364736f6c634300081d0033",
7
+ "deployedBytecode": "0x730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220dfd2955b2f5c80c39629efab80b102628759176a07e6500f461ab8aaee7442c364736f6c634300081d0033",
8
8
  "linkReferences": {},
9
9
  "deployedLinkReferences": {}
10
10
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "_format": "hh-sol-artifact-1",
3
- "contractName": "IConfidentialFungibleToken",
4
- "sourceName": "contracts/interfaces/IConfidentialFungibleToken.sol",
3
+ "contractName": "IERC7984",
4
+ "sourceName": "contracts/interfaces/IERC7984.sol",
5
5
  "abi": [
6
6
  {
7
7
  "anonymous": false,
@@ -356,6 +356,19 @@
356
356
  "stateMutability": "nonpayable",
357
357
  "type": "function"
358
358
  },
359
+ {
360
+ "inputs": [],
361
+ "name": "contractURI",
362
+ "outputs": [
363
+ {
364
+ "internalType": "string",
365
+ "name": "",
366
+ "type": "string"
367
+ }
368
+ ],
369
+ "stateMutability": "view",
370
+ "type": "function"
371
+ },
359
372
  {
360
373
  "inputs": [],
361
374
  "name": "decimals",
@@ -425,13 +438,19 @@
425
438
  "type": "function"
426
439
  },
427
440
  {
428
- "inputs": [],
429
- "name": "symbol",
441
+ "inputs": [
442
+ {
443
+ "internalType": "bytes4",
444
+ "name": "interfaceId",
445
+ "type": "bytes4"
446
+ }
447
+ ],
448
+ "name": "supportsInterface",
430
449
  "outputs": [
431
450
  {
432
- "internalType": "string",
451
+ "internalType": "bool",
433
452
  "name": "",
434
- "type": "string"
453
+ "type": "bool"
435
454
  }
436
455
  ],
437
456
  "stateMutability": "view",
@@ -439,7 +458,7 @@
439
458
  },
440
459
  {
441
460
  "inputs": [],
442
- "name": "tokenURI",
461
+ "name": "symbol",
443
462
  "outputs": [
444
463
  {
445
464
  "internalType": "string",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "_format": "hh-sol-artifact-1",
3
- "contractName": "IConfidentialFungibleTokenReceiver",
4
- "sourceName": "contracts/interfaces/IConfidentialFungibleTokenReceiver.sol",
3
+ "contractName": "IERC7984Receiver",
4
+ "sourceName": "contracts/interfaces/IERC7984Receiver.sol",
5
5
  "abi": [
6
6
  {
7
7
  "inputs": [