@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,291 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "ERC7984HolderCapHookModule",
4
+ "sourceName": "contracts/token/ERC7984/utils/ERC7984HolderCapHookModule.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "uint64",
10
+ "name": "maxHolderCount",
11
+ "type": "uint64"
12
+ }
13
+ ],
14
+ "name": "ERC7984HolderCapHookModuleInvalidMaxHolderCount",
15
+ "type": "error"
16
+ },
17
+ {
18
+ "inputs": [],
19
+ "name": "ERC7984HolderCapHookModuleTotalSupplyInitialized",
20
+ "type": "error"
21
+ },
22
+ {
23
+ "inputs": [
24
+ {
25
+ "internalType": "address",
26
+ "name": "token",
27
+ "type": "address"
28
+ }
29
+ ],
30
+ "name": "ERC7984HookModuleAlreadyInstalled",
31
+ "type": "error"
32
+ },
33
+ {
34
+ "inputs": [
35
+ {
36
+ "internalType": "address",
37
+ "name": "token",
38
+ "type": "address"
39
+ }
40
+ ],
41
+ "name": "ERC7984HookModuleNotInstalled",
42
+ "type": "error"
43
+ },
44
+ {
45
+ "inputs": [
46
+ {
47
+ "internalType": "address",
48
+ "name": "account",
49
+ "type": "address"
50
+ }
51
+ ],
52
+ "name": "ERC7984HookModuleUnauthorizedAccount",
53
+ "type": "error"
54
+ },
55
+ {
56
+ "inputs": [
57
+ {
58
+ "internalType": "euint64",
59
+ "name": "amount",
60
+ "type": "bytes32"
61
+ },
62
+ {
63
+ "internalType": "address",
64
+ "name": "user",
65
+ "type": "address"
66
+ }
67
+ ],
68
+ "name": "ERC7984HookModuleUnauthorizedUseOfEncryptedAmount",
69
+ "type": "error"
70
+ },
71
+ {
72
+ "anonymous": false,
73
+ "inputs": [
74
+ {
75
+ "indexed": true,
76
+ "internalType": "address",
77
+ "name": "token",
78
+ "type": "address"
79
+ },
80
+ {
81
+ "indexed": false,
82
+ "internalType": "uint64",
83
+ "name": "newMaxHolderCount",
84
+ "type": "uint64"
85
+ }
86
+ ],
87
+ "name": "ERC7984HolderCapHookModuleMaxHolderCountSet",
88
+ "type": "event"
89
+ },
90
+ {
91
+ "anonymous": false,
92
+ "inputs": [
93
+ {
94
+ "indexed": true,
95
+ "internalType": "address",
96
+ "name": "token",
97
+ "type": "address"
98
+ },
99
+ {
100
+ "indexed": true,
101
+ "internalType": "address",
102
+ "name": "from",
103
+ "type": "address"
104
+ },
105
+ {
106
+ "indexed": true,
107
+ "internalType": "address",
108
+ "name": "to",
109
+ "type": "address"
110
+ },
111
+ {
112
+ "indexed": false,
113
+ "internalType": "euint64",
114
+ "name": "encryptedAmount",
115
+ "type": "bytes32"
116
+ },
117
+ {
118
+ "indexed": false,
119
+ "internalType": "ebool",
120
+ "name": "result",
121
+ "type": "bytes32"
122
+ },
123
+ {
124
+ "indexed": false,
125
+ "internalType": "bytes32",
126
+ "name": "context",
127
+ "type": "bytes32"
128
+ }
129
+ ],
130
+ "name": "ERC7984HookModuleResult",
131
+ "type": "event"
132
+ },
133
+ {
134
+ "inputs": [
135
+ {
136
+ "internalType": "address",
137
+ "name": "token",
138
+ "type": "address"
139
+ }
140
+ ],
141
+ "name": "holderCount",
142
+ "outputs": [
143
+ {
144
+ "internalType": "euint64",
145
+ "name": "",
146
+ "type": "bytes32"
147
+ }
148
+ ],
149
+ "stateMutability": "view",
150
+ "type": "function"
151
+ },
152
+ {
153
+ "inputs": [
154
+ {
155
+ "internalType": "address",
156
+ "name": "token",
157
+ "type": "address"
158
+ }
159
+ ],
160
+ "name": "maxHolderCount",
161
+ "outputs": [
162
+ {
163
+ "internalType": "uint64",
164
+ "name": "",
165
+ "type": "uint64"
166
+ }
167
+ ],
168
+ "stateMutability": "view",
169
+ "type": "function"
170
+ },
171
+ {
172
+ "inputs": [
173
+ {
174
+ "internalType": "bytes",
175
+ "name": "initData",
176
+ "type": "bytes"
177
+ }
178
+ ],
179
+ "name": "onInstall",
180
+ "outputs": [],
181
+ "stateMutability": "nonpayable",
182
+ "type": "function"
183
+ },
184
+ {
185
+ "inputs": [
186
+ {
187
+ "internalType": "bytes",
188
+ "name": "deinitData",
189
+ "type": "bytes"
190
+ }
191
+ ],
192
+ "name": "onUninstall",
193
+ "outputs": [],
194
+ "stateMutability": "nonpayable",
195
+ "type": "function"
196
+ },
197
+ {
198
+ "inputs": [
199
+ {
200
+ "internalType": "address",
201
+ "name": "from",
202
+ "type": "address"
203
+ },
204
+ {
205
+ "internalType": "address",
206
+ "name": "to",
207
+ "type": "address"
208
+ },
209
+ {
210
+ "internalType": "euint64",
211
+ "name": "encryptedAmount",
212
+ "type": "bytes32"
213
+ }
214
+ ],
215
+ "name": "postTransfer",
216
+ "outputs": [],
217
+ "stateMutability": "nonpayable",
218
+ "type": "function"
219
+ },
220
+ {
221
+ "inputs": [
222
+ {
223
+ "internalType": "address",
224
+ "name": "from",
225
+ "type": "address"
226
+ },
227
+ {
228
+ "internalType": "address",
229
+ "name": "to",
230
+ "type": "address"
231
+ },
232
+ {
233
+ "internalType": "euint64",
234
+ "name": "encryptedAmount",
235
+ "type": "bytes32"
236
+ }
237
+ ],
238
+ "name": "preTransfer",
239
+ "outputs": [
240
+ {
241
+ "internalType": "ebool",
242
+ "name": "",
243
+ "type": "bytes32"
244
+ }
245
+ ],
246
+ "stateMutability": "nonpayable",
247
+ "type": "function"
248
+ },
249
+ {
250
+ "inputs": [
251
+ {
252
+ "internalType": "address",
253
+ "name": "token",
254
+ "type": "address"
255
+ },
256
+ {
257
+ "internalType": "uint64",
258
+ "name": "maxHolderCount_",
259
+ "type": "uint64"
260
+ }
261
+ ],
262
+ "name": "setMaxHolderCount",
263
+ "outputs": [],
264
+ "stateMutability": "nonpayable",
265
+ "type": "function"
266
+ },
267
+ {
268
+ "inputs": [
269
+ {
270
+ "internalType": "bytes4",
271
+ "name": "interfaceId",
272
+ "type": "bytes4"
273
+ }
274
+ ],
275
+ "name": "supportsInterface",
276
+ "outputs": [
277
+ {
278
+ "internalType": "bool",
279
+ "name": "",
280
+ "type": "bool"
281
+ }
282
+ ],
283
+ "stateMutability": "view",
284
+ "type": "function"
285
+ }
286
+ ],
287
+ "bytecode": "0x6080604052348015600e575f5ffd5b506112a28061001c5f395ff3fe608060405234801561000f575f5ffd5b5060043610610085575f3560e01c80636d61fe70116100585780636d61fe70146101325780637813e7f5146101455780638a91b0e31461016d578063cf02427814610180575f5ffd5b806301ffc9a714610089578063088fedf1146100b1578063239d2c7d146100d257806332d26c061461011d575b5f5ffd5b61009c61009736600461103f565b610193565b60405190151581526020015b60405180910390f35b6100c46100bf366004611081565b6101c9565b6040519081526020016100a8565b6101046100e03660046110ba565b6001600160a01b03165f9081526001602052604090205467ffffffffffffffff1690565b60405167ffffffffffffffff90911681526020016100a8565b61013061012b366004611081565b610232565b005b6101306101403660046110d3565b610282565b6100c46101533660046110ba565b6001600160a01b03165f9081526002602052604090205490565b61013061017b3660046110d3565b6102ce565b61013061018e366004611158565b610315565b5f6001600160e01b0319821663376b73d960e21b14806101c357506301ffc9a760e01b6001600160e01b03198316145b92915050565b5f6101d482336103b1565b8233909161020c5760405163c664688160e01b815260048101929092526001600160a01b031660248201526044015b60405180910390fd5b50505f61021b338686866103bc565b905061022781336105aa565b5090505b9392505050565b61023c81336103b1565b8133909161026f5760405163c664688160e01b815260048101929092526001600160a01b03166024820152604401610203565b505061027d338484846105cd565b505050565b335f8181526020819052604090205460ff16156102be5760405163d1f301d960e01b81526001600160a01b039091166004820152602401610203565b506102ca3383836107a1565b5050565b335f8181526020819052604090205460ff1661030957604051631c73188f60e11b81526001600160a01b039091166004820152602401610203565b506102ca338383610867565b6040516307feec1960e21b81523360048201526001600160a01b03831690631ffbb06490602401602060405180830381865afa158015610357573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061037b9190611189565b33906103a6576040516357a8db8960e01b81526001600160a01b039091166004820152602401610203565b506102ca82826108bf565b5f61022b8383610963565b5f6001600160a01b03831615806103e45750836001600160a01b0316836001600160a01b0316145b156103fa576103f360016109e7565b90506105a2565b60405163344ff10160e01b81526001600160a01b0385811660048301525f919087169063344ff10190602401602060405180830381865afa158015610441573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061046591906111a8565b60405163344ff10160e01b81526001600160a01b0386811660048301529192505f9188169063344ff10190602401602060405180830381865afa1580156104ae573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104d291906111a8565b90506104de8783610a02565b6104e88782610a02565b5f6104f25f610a55565b90505f6105546105306105198b6001600160a01b03165f9081526002602052604090205490565b61052b610526888b610a6b565b610a99565b610ab6565b61054f6105266105408787610a6b565b61054a8b88610ae4565b610b12565b610b40565b90505f610588826105838c6001600160a01b03165f9081526001602052604090205467ffffffffffffffff1690565b610b6e565b905061059a8161054a8c8c8c8c610b96565b955050505050505b949350505050565b5f826105bc576105b95f6109e7565b92505b6105c68383610baa565b5090919050565b816001600160a01b0316836001600160a01b0316031561079b5760405163344ff10160e01b81526001600160a01b0384811660048301525f919086169063344ff10190602401602060405180830381865afa15801561062e573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061065291906111a8565b60405163344ff10160e01b81526001600160a01b0385811660048301529192505f9187169063344ff10190602401602060405180830381865afa15801561069b573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106bf91906111a8565b90506106cb8683610a02565b6106d58682610a02565b5f6106df5f610a55565b90505f6106ec8583610ae4565b90505f61070d896001600160a01b03165f9081526002602052604090205490565b90506001600160a01b03871615610740575f61072d8361054a878a610a6b565b905061073c8261054f83610a99565b9150505b6001600160a01b03881615610771575f61075e8361054a8887610a6b565b905061076d8261052b83610a99565b9150505b6001600160a01b0389165f90815260026020526040902081905561079481610c1e565b5050505050505b50505050565b610809836001600160a01b031663540952276040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107e0573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061080491906111a8565b151590565b15610827576040516374f6661760e11b815260040160405180910390fd5b61084e836001600160a01b03165f908152602081905260409020805460ff19166001179055565b5f61085b828401846111bf565b905061079b84826108bf565b61088b836001600160a01b03165f908152602081905260409020805460ff19169055565b50506001600160a01b03165f908152600160209081526040808320805467ffffffffffffffff191690556002909152812055565b8067ffffffffffffffff81166108f55760405163e8487f8f60e01b815267ffffffffffffffff9091166004820152602401610203565b506001600160a01b0382165f81815260016020908152604091829020805467ffffffffffffffff191667ffffffffffffffff861690811790915591519182527ff32c1e99c1dd4b312a3cbb595eeef5ef988ac8eb87de166c5328241329e0c4d7910160405180910390a25050565b5f805f51602061124d5f395f51905f5280546040516382027b6d60e01b8152600481018790526001600160a01b0386811660248301529293509116906382027b6d90604401602060405180830381865afa1580156109c3573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105a29190611189565b5f6101c3826109f6575f6109f9565b60015b60ff165f610c3e565b80610a0b575050565b610a1581836103b1565b81839091610a485760405163c664688160e01b815260048101929092526001600160a01b03166024820152604401610203565b50506102ca82825f610ccd565b5f6101c38267ffffffffffffffff166005610c3e565b5f82610a7d57610a7a5f610a55565b92505b81610a8e57610a8b5f610a55565b91505b61022b83835f610d0e565b5f81610aab57610aa85f6109e7565b91505b6101c3826005610dbb565b5f82610ac857610ac55f610a55565b92505b81610ad957610ad65f610a55565b91505b61022b83835f610e0a565b5f82610af657610af35f610a55565b92505b81610b0757610b045f610a55565b91505b61022b83835f610e6d565b5f82610b2457610b215f6109e7565b92505b81610b3557610b325f6109e7565b91505b61022b83835f610ed0565b5f82610b5257610b4f5f610a55565b92505b81610b6357610b605f610a55565b91505b61022b83835f610f33565b5f82610b8057610b7d5f610a55565b92505b61022b8367ffffffffffffffff84166001610f96565b5f610ba160016109e7565b95945050505050565b5f51602061124d5f395f51905f528054604051630f8e573b60e21b8152600481018590526001600160a01b03848116602483015290911690633e395cec906044015b5f604051808303815f87803b158015610c03575f5ffd5b505af1158015610c15573d5f5f3e3d5ffd5b50505050505050565b5f81610c3057610c2d5f610a55565b91505b610c3a8230610ff9565b5090565b5f51602061122d5f395f51905f5254604051639cd07acb60e01b81525f915f51602061124d5f395f51905f52916001600160a01b0390911690639cd07acb90610c8d90879087906004016111f8565b6020604051808303815f875af1158015610ca9573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105a291906111a8565b811561027d576040516306d4a79960e01b81526004810183905230602482015281151560448201526001600160a01b038416906306d4a79990606401610bec565b5f5f8215610d215750600160f81b610d24565b505f5b5f51602061122d5f395f51905f525460405163f77f3f1d60e01b81525f51602061124d5f395f51905f52916001600160a01b03169063f77f3f1d90610d719089908990879060040161120c565b6020604051808303815f875af1158015610d8d573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610db191906111a8565b9695505050505050565b5f51602061122d5f395f51905f52546040516307227b9160e21b81525f915f51602061124d5f395f51905f52916001600160a01b0390911690631c89ee4490610c8d90879087906004016111f8565b5f5f8215610e1d5750600160f81b610e20565b505f5b5f51602061122d5f395f51905f52546040516303056db360e31b81525f51602061124d5f395f51905f52916001600160a01b03169063182b6d9890610d719089908990879060040161120c565b5f5f8215610e805750600160f81b610e83565b505f5b5f51602061122d5f395f51905f52546040516336024b2f60e21b81525f51602061124d5f395f51905f52916001600160a01b03169063d8092cbc90610d719089908990879060040161120c565b5f5f8215610ee35750600160f81b610ee6565b505f5b5f51602061122d5f395f51905f525460405163d99882d560e01b81525f51602061124d5f395f51905f52916001600160a01b03169063d99882d590610d719089908990879060040161120c565b5f5f8215610f465750600160f81b610f49565b505f5b5f51602061122d5f395f51905f525460405163022f65e760e31b81525f51602061124d5f395f51905f52916001600160a01b03169063117b2f3890610d719089908990879060040161120c565b5f5f8215610fa95750600160f81b610fac565b505f5b5f51602061122d5f395f51905f5254604051631d44e90160e21b81525f51602061124d5f395f51905f52916001600160a01b031690637513a40490610d719089908990879060040161120c565b5f51602061124d5f395f51905f528054604051635ca4b5b160e11b8152600481018590526001600160a01b0384811660248301529091169063b9496b6290604401610bec565b5f6020828403121561104f575f5ffd5b81356001600160e01b03198116811461022b575f5ffd5b80356001600160a01b038116811461107c575f5ffd5b919050565b5f5f5f60608486031215611093575f5ffd5b61109c84611066565b92506110aa60208501611066565b9150604084013590509250925092565b5f602082840312156110ca575f5ffd5b61022b82611066565b5f5f602083850312156110e4575f5ffd5b823567ffffffffffffffff8111156110fa575f5ffd5b8301601f8101851361110a575f5ffd5b803567ffffffffffffffff811115611120575f5ffd5b856020828401011115611131575f5ffd5b6020919091019590945092505050565b803567ffffffffffffffff8116811461107c575f5ffd5b5f5f60408385031215611169575f5ffd5b61117283611066565b915061118060208401611141565b90509250929050565b5f60208284031215611199575f5ffd5b8151801515811461022b575f5ffd5b5f602082840312156111b8575f5ffd5b5051919050565b5f602082840312156111cf575f5ffd5b61022b82611141565b605481106111f457634e487b7160e01b5f52602160045260245ffd5b9052565b8281526040810161022b60208301846111d8565b92835260208301919091526001600160f81b03191660408201526060019056fe9e7b61f58c47dc699ac88507c4f5bb9f121c03808c5676a8078fe583e46497019e7b61f58c47dc699ac88507c4f5bb9f121c03808c5676a8078fe583e4649700a26469706673582212206932a403ef0e3ca967a493fa7d20cde2094339e09321f8db7e6bc8d7299ef52664736f6c634300081b0033",
288
+ "deployedBytecode": "0x608060405234801561000f575f5ffd5b5060043610610085575f3560e01c80636d61fe70116100585780636d61fe70146101325780637813e7f5146101455780638a91b0e31461016d578063cf02427814610180575f5ffd5b806301ffc9a714610089578063088fedf1146100b1578063239d2c7d146100d257806332d26c061461011d575b5f5ffd5b61009c61009736600461103f565b610193565b60405190151581526020015b60405180910390f35b6100c46100bf366004611081565b6101c9565b6040519081526020016100a8565b6101046100e03660046110ba565b6001600160a01b03165f9081526001602052604090205467ffffffffffffffff1690565b60405167ffffffffffffffff90911681526020016100a8565b61013061012b366004611081565b610232565b005b6101306101403660046110d3565b610282565b6100c46101533660046110ba565b6001600160a01b03165f9081526002602052604090205490565b61013061017b3660046110d3565b6102ce565b61013061018e366004611158565b610315565b5f6001600160e01b0319821663376b73d960e21b14806101c357506301ffc9a760e01b6001600160e01b03198316145b92915050565b5f6101d482336103b1565b8233909161020c5760405163c664688160e01b815260048101929092526001600160a01b031660248201526044015b60405180910390fd5b50505f61021b338686866103bc565b905061022781336105aa565b5090505b9392505050565b61023c81336103b1565b8133909161026f5760405163c664688160e01b815260048101929092526001600160a01b03166024820152604401610203565b505061027d338484846105cd565b505050565b335f8181526020819052604090205460ff16156102be5760405163d1f301d960e01b81526001600160a01b039091166004820152602401610203565b506102ca3383836107a1565b5050565b335f8181526020819052604090205460ff1661030957604051631c73188f60e11b81526001600160a01b039091166004820152602401610203565b506102ca338383610867565b6040516307feec1960e21b81523360048201526001600160a01b03831690631ffbb06490602401602060405180830381865afa158015610357573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061037b9190611189565b33906103a6576040516357a8db8960e01b81526001600160a01b039091166004820152602401610203565b506102ca82826108bf565b5f61022b8383610963565b5f6001600160a01b03831615806103e45750836001600160a01b0316836001600160a01b0316145b156103fa576103f360016109e7565b90506105a2565b60405163344ff10160e01b81526001600160a01b0385811660048301525f919087169063344ff10190602401602060405180830381865afa158015610441573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061046591906111a8565b60405163344ff10160e01b81526001600160a01b0386811660048301529192505f9188169063344ff10190602401602060405180830381865afa1580156104ae573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104d291906111a8565b90506104de8783610a02565b6104e88782610a02565b5f6104f25f610a55565b90505f6105546105306105198b6001600160a01b03165f9081526002602052604090205490565b61052b610526888b610a6b565b610a99565b610ab6565b61054f6105266105408787610a6b565b61054a8b88610ae4565b610b12565b610b40565b90505f610588826105838c6001600160a01b03165f9081526001602052604090205467ffffffffffffffff1690565b610b6e565b905061059a8161054a8c8c8c8c610b96565b955050505050505b949350505050565b5f826105bc576105b95f6109e7565b92505b6105c68383610baa565b5090919050565b816001600160a01b0316836001600160a01b0316031561079b5760405163344ff10160e01b81526001600160a01b0384811660048301525f919086169063344ff10190602401602060405180830381865afa15801561062e573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061065291906111a8565b60405163344ff10160e01b81526001600160a01b0385811660048301529192505f9187169063344ff10190602401602060405180830381865afa15801561069b573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106bf91906111a8565b90506106cb8683610a02565b6106d58682610a02565b5f6106df5f610a55565b90505f6106ec8583610ae4565b90505f61070d896001600160a01b03165f9081526002602052604090205490565b90506001600160a01b03871615610740575f61072d8361054a878a610a6b565b905061073c8261054f83610a99565b9150505b6001600160a01b03881615610771575f61075e8361054a8887610a6b565b905061076d8261052b83610a99565b9150505b6001600160a01b0389165f90815260026020526040902081905561079481610c1e565b5050505050505b50505050565b610809836001600160a01b031663540952276040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107e0573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061080491906111a8565b151590565b15610827576040516374f6661760e11b815260040160405180910390fd5b61084e836001600160a01b03165f908152602081905260409020805460ff19166001179055565b5f61085b828401846111bf565b905061079b84826108bf565b61088b836001600160a01b03165f908152602081905260409020805460ff19169055565b50506001600160a01b03165f908152600160209081526040808320805467ffffffffffffffff191690556002909152812055565b8067ffffffffffffffff81166108f55760405163e8487f8f60e01b815267ffffffffffffffff9091166004820152602401610203565b506001600160a01b0382165f81815260016020908152604091829020805467ffffffffffffffff191667ffffffffffffffff861690811790915591519182527ff32c1e99c1dd4b312a3cbb595eeef5ef988ac8eb87de166c5328241329e0c4d7910160405180910390a25050565b5f805f51602061124d5f395f51905f5280546040516382027b6d60e01b8152600481018790526001600160a01b0386811660248301529293509116906382027b6d90604401602060405180830381865afa1580156109c3573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105a29190611189565b5f6101c3826109f6575f6109f9565b60015b60ff165f610c3e565b80610a0b575050565b610a1581836103b1565b81839091610a485760405163c664688160e01b815260048101929092526001600160a01b03166024820152604401610203565b50506102ca82825f610ccd565b5f6101c38267ffffffffffffffff166005610c3e565b5f82610a7d57610a7a5f610a55565b92505b81610a8e57610a8b5f610a55565b91505b61022b83835f610d0e565b5f81610aab57610aa85f6109e7565b91505b6101c3826005610dbb565b5f82610ac857610ac55f610a55565b92505b81610ad957610ad65f610a55565b91505b61022b83835f610e0a565b5f82610af657610af35f610a55565b92505b81610b0757610b045f610a55565b91505b61022b83835f610e6d565b5f82610b2457610b215f6109e7565b92505b81610b3557610b325f6109e7565b91505b61022b83835f610ed0565b5f82610b5257610b4f5f610a55565b92505b81610b6357610b605f610a55565b91505b61022b83835f610f33565b5f82610b8057610b7d5f610a55565b92505b61022b8367ffffffffffffffff84166001610f96565b5f610ba160016109e7565b95945050505050565b5f51602061124d5f395f51905f528054604051630f8e573b60e21b8152600481018590526001600160a01b03848116602483015290911690633e395cec906044015b5f604051808303815f87803b158015610c03575f5ffd5b505af1158015610c15573d5f5f3e3d5ffd5b50505050505050565b5f81610c3057610c2d5f610a55565b91505b610c3a8230610ff9565b5090565b5f51602061122d5f395f51905f5254604051639cd07acb60e01b81525f915f51602061124d5f395f51905f52916001600160a01b0390911690639cd07acb90610c8d90879087906004016111f8565b6020604051808303815f875af1158015610ca9573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105a291906111a8565b811561027d576040516306d4a79960e01b81526004810183905230602482015281151560448201526001600160a01b038416906306d4a79990606401610bec565b5f5f8215610d215750600160f81b610d24565b505f5b5f51602061122d5f395f51905f525460405163f77f3f1d60e01b81525f51602061124d5f395f51905f52916001600160a01b03169063f77f3f1d90610d719089908990879060040161120c565b6020604051808303815f875af1158015610d8d573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610db191906111a8565b9695505050505050565b5f51602061122d5f395f51905f52546040516307227b9160e21b81525f915f51602061124d5f395f51905f52916001600160a01b0390911690631c89ee4490610c8d90879087906004016111f8565b5f5f8215610e1d5750600160f81b610e20565b505f5b5f51602061122d5f395f51905f52546040516303056db360e31b81525f51602061124d5f395f51905f52916001600160a01b03169063182b6d9890610d719089908990879060040161120c565b5f5f8215610e805750600160f81b610e83565b505f5b5f51602061122d5f395f51905f52546040516336024b2f60e21b81525f51602061124d5f395f51905f52916001600160a01b03169063d8092cbc90610d719089908990879060040161120c565b5f5f8215610ee35750600160f81b610ee6565b505f5b5f51602061122d5f395f51905f525460405163d99882d560e01b81525f51602061124d5f395f51905f52916001600160a01b03169063d99882d590610d719089908990879060040161120c565b5f5f8215610f465750600160f81b610f49565b505f5b5f51602061122d5f395f51905f525460405163022f65e760e31b81525f51602061124d5f395f51905f52916001600160a01b03169063117b2f3890610d719089908990879060040161120c565b5f5f8215610fa95750600160f81b610fac565b505f5b5f51602061122d5f395f51905f5254604051631d44e90160e21b81525f51602061124d5f395f51905f52916001600160a01b031690637513a40490610d719089908990879060040161120c565b5f51602061124d5f395f51905f528054604051635ca4b5b160e11b8152600481018590526001600160a01b0384811660248301529091169063b9496b6290604401610bec565b5f6020828403121561104f575f5ffd5b81356001600160e01b03198116811461022b575f5ffd5b80356001600160a01b038116811461107c575f5ffd5b919050565b5f5f5f60608486031215611093575f5ffd5b61109c84611066565b92506110aa60208501611066565b9150604084013590509250925092565b5f602082840312156110ca575f5ffd5b61022b82611066565b5f5f602083850312156110e4575f5ffd5b823567ffffffffffffffff8111156110fa575f5ffd5b8301601f8101851361110a575f5ffd5b803567ffffffffffffffff811115611120575f5ffd5b856020828401011115611131575f5ffd5b6020919091019590945092505050565b803567ffffffffffffffff8116811461107c575f5ffd5b5f5f60408385031215611169575f5ffd5b61117283611066565b915061118060208401611141565b90509250929050565b5f60208284031215611199575f5ffd5b8151801515811461022b575f5ffd5b5f602082840312156111b8575f5ffd5b5051919050565b5f602082840312156111cf575f5ffd5b61022b82611141565b605481106111f457634e487b7160e01b5f52602160045260245ffd5b9052565b8281526040810161022b60208301846111d8565b92835260208301919091526001600160f81b03191660408201526060019056fe9e7b61f58c47dc699ac88507c4f5bb9f121c03808c5676a8078fe583e46497019e7b61f58c47dc699ac88507c4f5bb9f121c03808c5676a8078fe583e4649700a26469706673582212206932a403ef0e3ca967a493fa7d20cde2094339e09321f8db7e6bc8d7299ef52664736f6c634300081b0033",
289
+ "linkReferences": {},
290
+ "deployedLinkReferences": {}
291
+ }
@@ -0,0 +1,200 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "ERC7984HookModule",
4
+ "sourceName": "contracts/token/ERC7984/utils/ERC7984HookModule.sol",
5
+ "abi": [
6
+ {
7
+ "inputs": [
8
+ {
9
+ "internalType": "address",
10
+ "name": "token",
11
+ "type": "address"
12
+ }
13
+ ],
14
+ "name": "ERC7984HookModuleAlreadyInstalled",
15
+ "type": "error"
16
+ },
17
+ {
18
+ "inputs": [
19
+ {
20
+ "internalType": "address",
21
+ "name": "token",
22
+ "type": "address"
23
+ }
24
+ ],
25
+ "name": "ERC7984HookModuleNotInstalled",
26
+ "type": "error"
27
+ },
28
+ {
29
+ "inputs": [
30
+ {
31
+ "internalType": "address",
32
+ "name": "account",
33
+ "type": "address"
34
+ }
35
+ ],
36
+ "name": "ERC7984HookModuleUnauthorizedAccount",
37
+ "type": "error"
38
+ },
39
+ {
40
+ "inputs": [
41
+ {
42
+ "internalType": "euint64",
43
+ "name": "amount",
44
+ "type": "bytes32"
45
+ },
46
+ {
47
+ "internalType": "address",
48
+ "name": "user",
49
+ "type": "address"
50
+ }
51
+ ],
52
+ "name": "ERC7984HookModuleUnauthorizedUseOfEncryptedAmount",
53
+ "type": "error"
54
+ },
55
+ {
56
+ "anonymous": false,
57
+ "inputs": [
58
+ {
59
+ "indexed": true,
60
+ "internalType": "address",
61
+ "name": "token",
62
+ "type": "address"
63
+ },
64
+ {
65
+ "indexed": true,
66
+ "internalType": "address",
67
+ "name": "from",
68
+ "type": "address"
69
+ },
70
+ {
71
+ "indexed": true,
72
+ "internalType": "address",
73
+ "name": "to",
74
+ "type": "address"
75
+ },
76
+ {
77
+ "indexed": false,
78
+ "internalType": "euint64",
79
+ "name": "encryptedAmount",
80
+ "type": "bytes32"
81
+ },
82
+ {
83
+ "indexed": false,
84
+ "internalType": "ebool",
85
+ "name": "result",
86
+ "type": "bytes32"
87
+ },
88
+ {
89
+ "indexed": false,
90
+ "internalType": "bytes32",
91
+ "name": "context",
92
+ "type": "bytes32"
93
+ }
94
+ ],
95
+ "name": "ERC7984HookModuleResult",
96
+ "type": "event"
97
+ },
98
+ {
99
+ "inputs": [
100
+ {
101
+ "internalType": "bytes",
102
+ "name": "initData",
103
+ "type": "bytes"
104
+ }
105
+ ],
106
+ "name": "onInstall",
107
+ "outputs": [],
108
+ "stateMutability": "nonpayable",
109
+ "type": "function"
110
+ },
111
+ {
112
+ "inputs": [
113
+ {
114
+ "internalType": "bytes",
115
+ "name": "deinitData",
116
+ "type": "bytes"
117
+ }
118
+ ],
119
+ "name": "onUninstall",
120
+ "outputs": [],
121
+ "stateMutability": "nonpayable",
122
+ "type": "function"
123
+ },
124
+ {
125
+ "inputs": [
126
+ {
127
+ "internalType": "address",
128
+ "name": "from",
129
+ "type": "address"
130
+ },
131
+ {
132
+ "internalType": "address",
133
+ "name": "to",
134
+ "type": "address"
135
+ },
136
+ {
137
+ "internalType": "euint64",
138
+ "name": "encryptedAmount",
139
+ "type": "bytes32"
140
+ }
141
+ ],
142
+ "name": "postTransfer",
143
+ "outputs": [],
144
+ "stateMutability": "nonpayable",
145
+ "type": "function"
146
+ },
147
+ {
148
+ "inputs": [
149
+ {
150
+ "internalType": "address",
151
+ "name": "from",
152
+ "type": "address"
153
+ },
154
+ {
155
+ "internalType": "address",
156
+ "name": "to",
157
+ "type": "address"
158
+ },
159
+ {
160
+ "internalType": "euint64",
161
+ "name": "encryptedAmount",
162
+ "type": "bytes32"
163
+ }
164
+ ],
165
+ "name": "preTransfer",
166
+ "outputs": [
167
+ {
168
+ "internalType": "ebool",
169
+ "name": "",
170
+ "type": "bytes32"
171
+ }
172
+ ],
173
+ "stateMutability": "nonpayable",
174
+ "type": "function"
175
+ },
176
+ {
177
+ "inputs": [
178
+ {
179
+ "internalType": "bytes4",
180
+ "name": "interfaceId",
181
+ "type": "bytes4"
182
+ }
183
+ ],
184
+ "name": "supportsInterface",
185
+ "outputs": [
186
+ {
187
+ "internalType": "bool",
188
+ "name": "",
189
+ "type": "bool"
190
+ }
191
+ ],
192
+ "stateMutability": "view",
193
+ "type": "function"
194
+ }
195
+ ],
196
+ "bytecode": "0x",
197
+ "deployedBytecode": "0x",
198
+ "linkReferences": {},
199
+ "deployedLinkReferences": {}
200
+ }