@openzeppelin/confidential-contracts 0.4.1 → 0.5.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 (36) hide show
  1. package/build/contracts/BatcherConfidential.json +16 -0
  2. package/build/contracts/CheckpointsConfidential.json +2 -2
  3. package/build/contracts/ERC7984.json +6 -28
  4. package/build/contracts/ERC7984BalanceCapHookModule.json +242 -0
  5. package/build/contracts/ERC7984ERC20Wrapper.json +6 -28
  6. package/build/contracts/ERC7984Freezable.json +6 -28
  7. package/build/contracts/ERC7984HolderCapHookModule.json +256 -0
  8. package/build/contracts/ERC7984HookModule.json +165 -0
  9. package/build/contracts/ERC7984Hooked.json +827 -0
  10. package/build/contracts/ERC7984ObserverAccess.json +6 -28
  11. package/build/contracts/ERC7984Omnibus.json +6 -28
  12. package/build/contracts/ERC7984Restricted.json +6 -28
  13. package/build/contracts/ERC7984Rwa.json +61 -29
  14. package/build/contracts/ERC7984Utils.json +2 -2
  15. package/build/contracts/ERC7984Votes.json +6 -28
  16. package/build/contracts/FHESafeMath.json +2 -2
  17. package/build/contracts/IERC7984HookModule.json +138 -0
  18. package/build/contracts/IERC7984Rwa.json +87 -0
  19. package/finance/BatcherConfidential.sol +20 -5
  20. package/governance/utils/VotesConfidential.sol +2 -2
  21. package/interfaces/IERC7984HookModule.sol +32 -0
  22. package/interfaces/IERC7984Receiver.sol +3 -1
  23. package/interfaces/IERC7984Rwa.sol +28 -1
  24. package/package.json +1 -1
  25. package/token/ERC7984/ERC7984.sol +43 -29
  26. package/token/ERC7984/extensions/ERC7984ERC20Wrapper.sol +3 -3
  27. package/token/ERC7984/extensions/ERC7984Freezable.sol +3 -7
  28. package/token/ERC7984/extensions/ERC7984Hooked.sol +157 -0
  29. package/token/ERC7984/extensions/ERC7984Restricted.sol +3 -3
  30. package/token/ERC7984/extensions/ERC7984Rwa.sol +83 -28
  31. package/token/ERC7984/utils/ERC7984BalanceCapHookModule.sol +87 -0
  32. package/token/ERC7984/utils/ERC7984HolderCapHookModule.sol +141 -0
  33. package/token/ERC7984/utils/ERC7984HookModule.sol +131 -0
  34. package/utils/FHESafeMath.sol +26 -1
  35. package/utils/HandleAccessManager.sol +5 -3
  36. package/utils/structs/CheckpointsConfidential.sol +1 -2
@@ -0,0 +1,256 @@
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": "account",
27
+ "type": "address"
28
+ }
29
+ ],
30
+ "name": "ERC7984HookModuleUnauthorizedAccount",
31
+ "type": "error"
32
+ },
33
+ {
34
+ "inputs": [
35
+ {
36
+ "internalType": "euint64",
37
+ "name": "amount",
38
+ "type": "bytes32"
39
+ },
40
+ {
41
+ "internalType": "address",
42
+ "name": "user",
43
+ "type": "address"
44
+ }
45
+ ],
46
+ "name": "ERC7984HookModuleUnauthorizedUseOfEncryptedAmount",
47
+ "type": "error"
48
+ },
49
+ {
50
+ "anonymous": false,
51
+ "inputs": [
52
+ {
53
+ "indexed": true,
54
+ "internalType": "address",
55
+ "name": "token",
56
+ "type": "address"
57
+ },
58
+ {
59
+ "indexed": false,
60
+ "internalType": "uint64",
61
+ "name": "newMaxHolderCount",
62
+ "type": "uint64"
63
+ }
64
+ ],
65
+ "name": "ERC7984HolderCapHookModuleMaxHolderCountSet",
66
+ "type": "event"
67
+ },
68
+ {
69
+ "anonymous": false,
70
+ "inputs": [
71
+ {
72
+ "indexed": true,
73
+ "internalType": "address",
74
+ "name": "token",
75
+ "type": "address"
76
+ },
77
+ {
78
+ "indexed": true,
79
+ "internalType": "address",
80
+ "name": "from",
81
+ "type": "address"
82
+ },
83
+ {
84
+ "indexed": true,
85
+ "internalType": "address",
86
+ "name": "to",
87
+ "type": "address"
88
+ },
89
+ {
90
+ "indexed": false,
91
+ "internalType": "euint64",
92
+ "name": "encryptedAmount",
93
+ "type": "bytes32"
94
+ },
95
+ {
96
+ "indexed": false,
97
+ "internalType": "ebool",
98
+ "name": "result",
99
+ "type": "bytes32"
100
+ },
101
+ {
102
+ "indexed": false,
103
+ "internalType": "bytes32",
104
+ "name": "context",
105
+ "type": "bytes32"
106
+ }
107
+ ],
108
+ "name": "ERC7984HookModuleResult",
109
+ "type": "event"
110
+ },
111
+ {
112
+ "inputs": [
113
+ {
114
+ "internalType": "address",
115
+ "name": "token",
116
+ "type": "address"
117
+ }
118
+ ],
119
+ "name": "holderCount",
120
+ "outputs": [
121
+ {
122
+ "internalType": "euint64",
123
+ "name": "",
124
+ "type": "bytes32"
125
+ }
126
+ ],
127
+ "stateMutability": "view",
128
+ "type": "function"
129
+ },
130
+ {
131
+ "inputs": [
132
+ {
133
+ "internalType": "address",
134
+ "name": "token",
135
+ "type": "address"
136
+ }
137
+ ],
138
+ "name": "maxHolderCount",
139
+ "outputs": [
140
+ {
141
+ "internalType": "uint64",
142
+ "name": "",
143
+ "type": "uint64"
144
+ }
145
+ ],
146
+ "stateMutability": "view",
147
+ "type": "function"
148
+ },
149
+ {
150
+ "inputs": [
151
+ {
152
+ "internalType": "bytes",
153
+ "name": "initData",
154
+ "type": "bytes"
155
+ }
156
+ ],
157
+ "name": "onInstall",
158
+ "outputs": [],
159
+ "stateMutability": "nonpayable",
160
+ "type": "function"
161
+ },
162
+ {
163
+ "inputs": [
164
+ {
165
+ "internalType": "address",
166
+ "name": "from",
167
+ "type": "address"
168
+ },
169
+ {
170
+ "internalType": "address",
171
+ "name": "to",
172
+ "type": "address"
173
+ },
174
+ {
175
+ "internalType": "euint64",
176
+ "name": "encryptedAmount",
177
+ "type": "bytes32"
178
+ }
179
+ ],
180
+ "name": "postTransfer",
181
+ "outputs": [],
182
+ "stateMutability": "nonpayable",
183
+ "type": "function"
184
+ },
185
+ {
186
+ "inputs": [
187
+ {
188
+ "internalType": "address",
189
+ "name": "from",
190
+ "type": "address"
191
+ },
192
+ {
193
+ "internalType": "address",
194
+ "name": "to",
195
+ "type": "address"
196
+ },
197
+ {
198
+ "internalType": "euint64",
199
+ "name": "encryptedAmount",
200
+ "type": "bytes32"
201
+ }
202
+ ],
203
+ "name": "preTransfer",
204
+ "outputs": [
205
+ {
206
+ "internalType": "ebool",
207
+ "name": "",
208
+ "type": "bytes32"
209
+ }
210
+ ],
211
+ "stateMutability": "nonpayable",
212
+ "type": "function"
213
+ },
214
+ {
215
+ "inputs": [
216
+ {
217
+ "internalType": "address",
218
+ "name": "token",
219
+ "type": "address"
220
+ },
221
+ {
222
+ "internalType": "uint64",
223
+ "name": "maxHolderCount_",
224
+ "type": "uint64"
225
+ }
226
+ ],
227
+ "name": "setMaxHolderCount",
228
+ "outputs": [],
229
+ "stateMutability": "nonpayable",
230
+ "type": "function"
231
+ },
232
+ {
233
+ "inputs": [
234
+ {
235
+ "internalType": "bytes4",
236
+ "name": "interfaceId",
237
+ "type": "bytes4"
238
+ }
239
+ ],
240
+ "name": "supportsInterface",
241
+ "outputs": [
242
+ {
243
+ "internalType": "bool",
244
+ "name": "",
245
+ "type": "bool"
246
+ }
247
+ ],
248
+ "stateMutability": "view",
249
+ "type": "function"
250
+ }
251
+ ],
252
+ "bytecode": "0x6080604052348015600e575f5ffd5b5061118d8061001c5f395ff3fe608060405234801561000f575f5ffd5b506004361061007a575f3560e01c806332d26c061161005857806332d26c06146101125780636d61fe70146101275780637813e7f51461013a578063cf02427814610162575f5ffd5b806301ffc9a71461007e578063088fedf1146100a6578063239d2c7d146100c7575b5f5ffd5b61009161008c366004610f2a565b610175565b60405190151581526020015b60405180910390f35b6100b96100b4366004610f6c565b6101ab565b60405190815260200161009d565b6100f96100d5366004610fa5565b6001600160a01b03165f9081526020819052604090205467ffffffffffffffff1690565b60405167ffffffffffffffff909116815260200161009d565b610125610120366004610f6c565b610214565b005b610125610135366004610fbe565b610264565b6100b9610148366004610fa5565b6001600160a01b03165f9081526001602052604090205490565b610125610170366004611043565b610273565b5f6001600160e01b0319821663573c7f8760e01b14806101a557506301ffc9a760e01b6001600160e01b03198316145b92915050565b5f6101b6823361030f565b823390916101ee5760405163c664688160e01b815260048101929092526001600160a01b031660248201526044015b60405180910390fd5b50505f6101fd3386868661031a565b90506102098133610502565b5090505b9392505050565b61021e813361030f565b813390916102515760405163c664688160e01b815260048101929092526001600160a01b031660248201526044016101e5565b505061025f33848484610525565b505050565b61026f3383836106f9565b5050565b6040516307feec1960e21b81523360048201526001600160a01b03831690631ffbb06490602401602060405180830381865afa1580156102b5573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102d99190611074565b3390610304576040516357a8db8960e01b81526001600160a01b0390911660048201526024016101e5565b5061026f82826107ac565b5f61020d838361084e565b5f610327858585856108d2565b90506001600160a01b038316158015906103535750836001600160a01b0316836001600160a01b031614155b156104fa5760405163344ff10160e01b81526001600160a01b0385811660048301525f919087169063344ff10190602401602060405180830381865afa15801561039f573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103c39190611093565b60405163344ff10160e01b81526001600160a01b0386811660048301529192505f9188169063344ff10190602401602060405180830381865afa15801561040c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104309190611093565b905061043c87836108e6565b61044687826108e6565b5f6104505f610939565b90505f6104b261048e6104778b6001600160a01b03165f9081526001602052604090205490565b610489610484888b61094f565b61097d565b61099a565b6104ad61048461049e878761094f565b6104a88b886109c8565b6109f6565b610a24565b90505f6104e6826104e18c6001600160a01b03165f9081526020819052604090205467ffffffffffffffff1690565b610a52565b90506104f286826109f6565b955050505050505b949350505050565b5f82610514576105115f610a7a565b92505b61051e8383610a95565b5090919050565b816001600160a01b0316836001600160a01b031603156106f35760405163344ff10160e01b81526001600160a01b0384811660048301525f919086169063344ff10190602401602060405180830381865afa158015610586573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105aa9190611093565b60405163344ff10160e01b81526001600160a01b0385811660048301529192505f9187169063344ff10190602401602060405180830381865afa1580156105f3573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106179190611093565b905061062386836108e6565b61062d86826108e6565b5f6106375f610939565b90505f61064485836109c8565b90505f610665896001600160a01b03165f9081526001602052604090205490565b90506001600160a01b03871615610698575f610685836104a8878a61094f565b9050610694826104ad8361097d565b9150505b6001600160a01b038816156106c9575f6106b6836104a8888761094f565b90506106c5826104898361097d565b9150505b6001600160a01b0389165f9081526001602052604090208190556106ec81610b09565b5050505050505b50505050565b610761836001600160a01b031663540952276040518163ffffffff1660e01b8152600401602060405180830381865afa158015610738573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061075c9190611093565b151590565b1561077f576040516374f6661760e11b815260040160405180910390fd5b6001600160a01b0383165f908152600160205260408120555f6107a4828401846110aa565b90506106f384825b8067ffffffffffffffff81166107e25760405163e8487f8f60e01b815267ffffffffffffffff90911660048201526024016101e5565b506001600160a01b0382165f8181526020818152604091829020805467ffffffffffffffff191667ffffffffffffffff861690811790915591519182527ff32c1e99c1dd4b312a3cbb595eeef5ef988ac8eb87de166c5328241329e0c4d7910160405180910390a25050565b5f805f5160206111385f395f51905f5280546040516382027b6d60e01b8152600481018790526001600160a01b0386811660248301529293509116906382027b6d90604401602060405180830381865afa1580156108ae573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104fa9190611074565b5f6108dd6001610a7a565b95945050505050565b806108ef575050565b6108f9818361030f565b8183909161092c5760405163c664688160e01b815260048101929092526001600160a01b031660248201526044016101e5565b505061026f82825f610b29565b5f6101a58267ffffffffffffffff166005610b6a565b5f826109615761095e5f610939565b92505b816109725761096f5f610939565b91505b61020d83835f610bf9565b5f8161098f5761098c5f610a7a565b91505b6101a5826005610ca6565b5f826109ac576109a95f610939565b92505b816109bd576109ba5f610939565b91505b61020d83835f610cf5565b5f826109da576109d75f610939565b92505b816109eb576109e85f610939565b91505b61020d83835f610d58565b5f82610a0857610a055f610a7a565b92505b81610a1957610a165f610a7a565b91505b61020d83835f610dbb565b5f82610a3657610a335f610939565b92505b81610a4757610a445f610939565b91505b61020d83835f610e1e565b5f82610a6457610a615f610939565b92505b61020d8367ffffffffffffffff84166001610e81565b5f6101a582610a89575f610a8c565b60015b60ff165f610b6a565b5f5160206111385f395f51905f528054604051630f8e573b60e21b8152600481018590526001600160a01b03848116602483015290911690633e395cec906044015b5f604051808303815f87803b158015610aee575f5ffd5b505af1158015610b00573d5f5f3e3d5ffd5b50505050505050565b5f81610b1b57610b185f610939565b91505b610b258230610ee4565b5090565b811561025f576040516306d4a79960e01b81526004810183905230602482015281151560448201526001600160a01b038416906306d4a79990606401610ad7565b5f5160206111185f395f51905f5254604051639cd07acb60e01b81525f915f5160206111385f395f51905f52916001600160a01b0390911690639cd07acb90610bb990879087906004016110e3565b6020604051808303815f875af1158015610bd5573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104fa9190611093565b5f5f8215610c0c5750600160f81b610c0f565b505f5b5f5160206111185f395f51905f525460405163f77f3f1d60e01b81525f5160206111385f395f51905f52916001600160a01b03169063f77f3f1d90610c5c908990899087906004016110f7565b6020604051808303815f875af1158015610c78573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c9c9190611093565b9695505050505050565b5f5160206111185f395f51905f52546040516307227b9160e21b81525f915f5160206111385f395f51905f52916001600160a01b0390911690631c89ee4490610bb990879087906004016110e3565b5f5f8215610d085750600160f81b610d0b565b505f5b5f5160206111185f395f51905f52546040516303056db360e31b81525f5160206111385f395f51905f52916001600160a01b03169063182b6d9890610c5c908990899087906004016110f7565b5f5f8215610d6b5750600160f81b610d6e565b505f5b5f5160206111185f395f51905f52546040516336024b2f60e21b81525f5160206111385f395f51905f52916001600160a01b03169063d8092cbc90610c5c908990899087906004016110f7565b5f5f8215610dce5750600160f81b610dd1565b505f5b5f5160206111185f395f51905f525460405163d99882d560e01b81525f5160206111385f395f51905f52916001600160a01b03169063d99882d590610c5c908990899087906004016110f7565b5f5f8215610e315750600160f81b610e34565b505f5b5f5160206111185f395f51905f525460405163022f65e760e31b81525f5160206111385f395f51905f52916001600160a01b03169063117b2f3890610c5c908990899087906004016110f7565b5f5f8215610e945750600160f81b610e97565b505f5b5f5160206111185f395f51905f5254604051631d44e90160e21b81525f5160206111385f395f51905f52916001600160a01b031690637513a40490610c5c908990899087906004016110f7565b5f5160206111385f395f51905f528054604051635ca4b5b160e11b8152600481018590526001600160a01b0384811660248301529091169063b9496b6290604401610ad7565b5f60208284031215610f3a575f5ffd5b81356001600160e01b03198116811461020d575f5ffd5b80356001600160a01b0381168114610f67575f5ffd5b919050565b5f5f5f60608486031215610f7e575f5ffd5b610f8784610f51565b9250610f9560208501610f51565b9150604084013590509250925092565b5f60208284031215610fb5575f5ffd5b61020d82610f51565b5f5f60208385031215610fcf575f5ffd5b823567ffffffffffffffff811115610fe5575f5ffd5b8301601f81018513610ff5575f5ffd5b803567ffffffffffffffff81111561100b575f5ffd5b85602082840101111561101c575f5ffd5b6020919091019590945092505050565b803567ffffffffffffffff81168114610f67575f5ffd5b5f5f60408385031215611054575f5ffd5b61105d83610f51565b915061106b6020840161102c565b90509250929050565b5f60208284031215611084575f5ffd5b8151801515811461020d575f5ffd5b5f602082840312156110a3575f5ffd5b5051919050565b5f602082840312156110ba575f5ffd5b61020d8261102c565b605481106110df57634e487b7160e01b5f52602160045260245ffd5b9052565b8281526040810161020d60208301846110c3565b92835260208301919091526001600160f81b03191660408201526060019056fe9e7b61f58c47dc699ac88507c4f5bb9f121c03808c5676a8078fe583e46497019e7b61f58c47dc699ac88507c4f5bb9f121c03808c5676a8078fe583e4649700a26469706673582212202267baf645ea5f0eeed61c2fc5d9862fd01ce175dea36dbcab8d10c5cce5ea3464736f6c634300081b0033",
253
+ "deployedBytecode": "0x608060405234801561000f575f5ffd5b506004361061007a575f3560e01c806332d26c061161005857806332d26c06146101125780636d61fe70146101275780637813e7f51461013a578063cf02427814610162575f5ffd5b806301ffc9a71461007e578063088fedf1146100a6578063239d2c7d146100c7575b5f5ffd5b61009161008c366004610f2a565b610175565b60405190151581526020015b60405180910390f35b6100b96100b4366004610f6c565b6101ab565b60405190815260200161009d565b6100f96100d5366004610fa5565b6001600160a01b03165f9081526020819052604090205467ffffffffffffffff1690565b60405167ffffffffffffffff909116815260200161009d565b610125610120366004610f6c565b610214565b005b610125610135366004610fbe565b610264565b6100b9610148366004610fa5565b6001600160a01b03165f9081526001602052604090205490565b610125610170366004611043565b610273565b5f6001600160e01b0319821663573c7f8760e01b14806101a557506301ffc9a760e01b6001600160e01b03198316145b92915050565b5f6101b6823361030f565b823390916101ee5760405163c664688160e01b815260048101929092526001600160a01b031660248201526044015b60405180910390fd5b50505f6101fd3386868661031a565b90506102098133610502565b5090505b9392505050565b61021e813361030f565b813390916102515760405163c664688160e01b815260048101929092526001600160a01b031660248201526044016101e5565b505061025f33848484610525565b505050565b61026f3383836106f9565b5050565b6040516307feec1960e21b81523360048201526001600160a01b03831690631ffbb06490602401602060405180830381865afa1580156102b5573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102d99190611074565b3390610304576040516357a8db8960e01b81526001600160a01b0390911660048201526024016101e5565b5061026f82826107ac565b5f61020d838361084e565b5f610327858585856108d2565b90506001600160a01b038316158015906103535750836001600160a01b0316836001600160a01b031614155b156104fa5760405163344ff10160e01b81526001600160a01b0385811660048301525f919087169063344ff10190602401602060405180830381865afa15801561039f573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103c39190611093565b60405163344ff10160e01b81526001600160a01b0386811660048301529192505f9188169063344ff10190602401602060405180830381865afa15801561040c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104309190611093565b905061043c87836108e6565b61044687826108e6565b5f6104505f610939565b90505f6104b261048e6104778b6001600160a01b03165f9081526001602052604090205490565b610489610484888b61094f565b61097d565b61099a565b6104ad61048461049e878761094f565b6104a88b886109c8565b6109f6565b610a24565b90505f6104e6826104e18c6001600160a01b03165f9081526020819052604090205467ffffffffffffffff1690565b610a52565b90506104f286826109f6565b955050505050505b949350505050565b5f82610514576105115f610a7a565b92505b61051e8383610a95565b5090919050565b816001600160a01b0316836001600160a01b031603156106f35760405163344ff10160e01b81526001600160a01b0384811660048301525f919086169063344ff10190602401602060405180830381865afa158015610586573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105aa9190611093565b60405163344ff10160e01b81526001600160a01b0385811660048301529192505f9187169063344ff10190602401602060405180830381865afa1580156105f3573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106179190611093565b905061062386836108e6565b61062d86826108e6565b5f6106375f610939565b90505f61064485836109c8565b90505f610665896001600160a01b03165f9081526001602052604090205490565b90506001600160a01b03871615610698575f610685836104a8878a61094f565b9050610694826104ad8361097d565b9150505b6001600160a01b038816156106c9575f6106b6836104a8888761094f565b90506106c5826104898361097d565b9150505b6001600160a01b0389165f9081526001602052604090208190556106ec81610b09565b5050505050505b50505050565b610761836001600160a01b031663540952276040518163ffffffff1660e01b8152600401602060405180830381865afa158015610738573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061075c9190611093565b151590565b1561077f576040516374f6661760e11b815260040160405180910390fd5b6001600160a01b0383165f908152600160205260408120555f6107a4828401846110aa565b90506106f384825b8067ffffffffffffffff81166107e25760405163e8487f8f60e01b815267ffffffffffffffff90911660048201526024016101e5565b506001600160a01b0382165f8181526020818152604091829020805467ffffffffffffffff191667ffffffffffffffff861690811790915591519182527ff32c1e99c1dd4b312a3cbb595eeef5ef988ac8eb87de166c5328241329e0c4d7910160405180910390a25050565b5f805f5160206111385f395f51905f5280546040516382027b6d60e01b8152600481018790526001600160a01b0386811660248301529293509116906382027b6d90604401602060405180830381865afa1580156108ae573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104fa9190611074565b5f6108dd6001610a7a565b95945050505050565b806108ef575050565b6108f9818361030f565b8183909161092c5760405163c664688160e01b815260048101929092526001600160a01b031660248201526044016101e5565b505061026f82825f610b29565b5f6101a58267ffffffffffffffff166005610b6a565b5f826109615761095e5f610939565b92505b816109725761096f5f610939565b91505b61020d83835f610bf9565b5f8161098f5761098c5f610a7a565b91505b6101a5826005610ca6565b5f826109ac576109a95f610939565b92505b816109bd576109ba5f610939565b91505b61020d83835f610cf5565b5f826109da576109d75f610939565b92505b816109eb576109e85f610939565b91505b61020d83835f610d58565b5f82610a0857610a055f610a7a565b92505b81610a1957610a165f610a7a565b91505b61020d83835f610dbb565b5f82610a3657610a335f610939565b92505b81610a4757610a445f610939565b91505b61020d83835f610e1e565b5f82610a6457610a615f610939565b92505b61020d8367ffffffffffffffff84166001610e81565b5f6101a582610a89575f610a8c565b60015b60ff165f610b6a565b5f5160206111385f395f51905f528054604051630f8e573b60e21b8152600481018590526001600160a01b03848116602483015290911690633e395cec906044015b5f604051808303815f87803b158015610aee575f5ffd5b505af1158015610b00573d5f5f3e3d5ffd5b50505050505050565b5f81610b1b57610b185f610939565b91505b610b258230610ee4565b5090565b811561025f576040516306d4a79960e01b81526004810183905230602482015281151560448201526001600160a01b038416906306d4a79990606401610ad7565b5f5160206111185f395f51905f5254604051639cd07acb60e01b81525f915f5160206111385f395f51905f52916001600160a01b0390911690639cd07acb90610bb990879087906004016110e3565b6020604051808303815f875af1158015610bd5573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104fa9190611093565b5f5f8215610c0c5750600160f81b610c0f565b505f5b5f5160206111185f395f51905f525460405163f77f3f1d60e01b81525f5160206111385f395f51905f52916001600160a01b03169063f77f3f1d90610c5c908990899087906004016110f7565b6020604051808303815f875af1158015610c78573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c9c9190611093565b9695505050505050565b5f5160206111185f395f51905f52546040516307227b9160e21b81525f915f5160206111385f395f51905f52916001600160a01b0390911690631c89ee4490610bb990879087906004016110e3565b5f5f8215610d085750600160f81b610d0b565b505f5b5f5160206111185f395f51905f52546040516303056db360e31b81525f5160206111385f395f51905f52916001600160a01b03169063182b6d9890610c5c908990899087906004016110f7565b5f5f8215610d6b5750600160f81b610d6e565b505f5b5f5160206111185f395f51905f52546040516336024b2f60e21b81525f5160206111385f395f51905f52916001600160a01b03169063d8092cbc90610c5c908990899087906004016110f7565b5f5f8215610dce5750600160f81b610dd1565b505f5b5f5160206111185f395f51905f525460405163d99882d560e01b81525f5160206111385f395f51905f52916001600160a01b03169063d99882d590610c5c908990899087906004016110f7565b5f5f8215610e315750600160f81b610e34565b505f5b5f5160206111185f395f51905f525460405163022f65e760e31b81525f5160206111385f395f51905f52916001600160a01b03169063117b2f3890610c5c908990899087906004016110f7565b5f5f8215610e945750600160f81b610e97565b505f5b5f5160206111185f395f51905f5254604051631d44e90160e21b81525f5160206111385f395f51905f52916001600160a01b031690637513a40490610c5c908990899087906004016110f7565b5f5160206111385f395f51905f528054604051635ca4b5b160e11b8152600481018590526001600160a01b0384811660248301529091169063b9496b6290604401610ad7565b5f60208284031215610f3a575f5ffd5b81356001600160e01b03198116811461020d575f5ffd5b80356001600160a01b0381168114610f67575f5ffd5b919050565b5f5f5f60608486031215610f7e575f5ffd5b610f8784610f51565b9250610f9560208501610f51565b9150604084013590509250925092565b5f60208284031215610fb5575f5ffd5b61020d82610f51565b5f5f60208385031215610fcf575f5ffd5b823567ffffffffffffffff811115610fe5575f5ffd5b8301601f81018513610ff5575f5ffd5b803567ffffffffffffffff81111561100b575f5ffd5b85602082840101111561101c575f5ffd5b6020919091019590945092505050565b803567ffffffffffffffff81168114610f67575f5ffd5b5f5f60408385031215611054575f5ffd5b61105d83610f51565b915061106b6020840161102c565b90509250929050565b5f60208284031215611084575f5ffd5b8151801515811461020d575f5ffd5b5f602082840312156110a3575f5ffd5b5051919050565b5f602082840312156110ba575f5ffd5b61020d8261102c565b605481106110df57634e487b7160e01b5f52602160045260245ffd5b9052565b8281526040810161020d60208301846110c3565b92835260208301919091526001600160f81b03191660408201526060019056fe9e7b61f58c47dc699ac88507c4f5bb9f121c03808c5676a8078fe583e46497019e7b61f58c47dc699ac88507c4f5bb9f121c03808c5676a8078fe583e4649700a26469706673582212202267baf645ea5f0eeed61c2fc5d9862fd01ce175dea36dbcab8d10c5cce5ea3464736f6c634300081b0033",
254
+ "linkReferences": {},
255
+ "deployedLinkReferences": {}
256
+ }
@@ -0,0 +1,165 @@
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": "account",
11
+ "type": "address"
12
+ }
13
+ ],
14
+ "name": "ERC7984HookModuleUnauthorizedAccount",
15
+ "type": "error"
16
+ },
17
+ {
18
+ "inputs": [
19
+ {
20
+ "internalType": "euint64",
21
+ "name": "amount",
22
+ "type": "bytes32"
23
+ },
24
+ {
25
+ "internalType": "address",
26
+ "name": "user",
27
+ "type": "address"
28
+ }
29
+ ],
30
+ "name": "ERC7984HookModuleUnauthorizedUseOfEncryptedAmount",
31
+ "type": "error"
32
+ },
33
+ {
34
+ "anonymous": false,
35
+ "inputs": [
36
+ {
37
+ "indexed": true,
38
+ "internalType": "address",
39
+ "name": "token",
40
+ "type": "address"
41
+ },
42
+ {
43
+ "indexed": true,
44
+ "internalType": "address",
45
+ "name": "from",
46
+ "type": "address"
47
+ },
48
+ {
49
+ "indexed": true,
50
+ "internalType": "address",
51
+ "name": "to",
52
+ "type": "address"
53
+ },
54
+ {
55
+ "indexed": false,
56
+ "internalType": "euint64",
57
+ "name": "encryptedAmount",
58
+ "type": "bytes32"
59
+ },
60
+ {
61
+ "indexed": false,
62
+ "internalType": "ebool",
63
+ "name": "result",
64
+ "type": "bytes32"
65
+ },
66
+ {
67
+ "indexed": false,
68
+ "internalType": "bytes32",
69
+ "name": "context",
70
+ "type": "bytes32"
71
+ }
72
+ ],
73
+ "name": "ERC7984HookModuleResult",
74
+ "type": "event"
75
+ },
76
+ {
77
+ "inputs": [
78
+ {
79
+ "internalType": "bytes",
80
+ "name": "initData",
81
+ "type": "bytes"
82
+ }
83
+ ],
84
+ "name": "onInstall",
85
+ "outputs": [],
86
+ "stateMutability": "nonpayable",
87
+ "type": "function"
88
+ },
89
+ {
90
+ "inputs": [
91
+ {
92
+ "internalType": "address",
93
+ "name": "from",
94
+ "type": "address"
95
+ },
96
+ {
97
+ "internalType": "address",
98
+ "name": "to",
99
+ "type": "address"
100
+ },
101
+ {
102
+ "internalType": "euint64",
103
+ "name": "encryptedAmount",
104
+ "type": "bytes32"
105
+ }
106
+ ],
107
+ "name": "postTransfer",
108
+ "outputs": [],
109
+ "stateMutability": "nonpayable",
110
+ "type": "function"
111
+ },
112
+ {
113
+ "inputs": [
114
+ {
115
+ "internalType": "address",
116
+ "name": "from",
117
+ "type": "address"
118
+ },
119
+ {
120
+ "internalType": "address",
121
+ "name": "to",
122
+ "type": "address"
123
+ },
124
+ {
125
+ "internalType": "euint64",
126
+ "name": "encryptedAmount",
127
+ "type": "bytes32"
128
+ }
129
+ ],
130
+ "name": "preTransfer",
131
+ "outputs": [
132
+ {
133
+ "internalType": "ebool",
134
+ "name": "",
135
+ "type": "bytes32"
136
+ }
137
+ ],
138
+ "stateMutability": "nonpayable",
139
+ "type": "function"
140
+ },
141
+ {
142
+ "inputs": [
143
+ {
144
+ "internalType": "bytes4",
145
+ "name": "interfaceId",
146
+ "type": "bytes4"
147
+ }
148
+ ],
149
+ "name": "supportsInterface",
150
+ "outputs": [
151
+ {
152
+ "internalType": "bool",
153
+ "name": "",
154
+ "type": "bool"
155
+ }
156
+ ],
157
+ "stateMutability": "view",
158
+ "type": "function"
159
+ }
160
+ ],
161
+ "bytecode": "0x",
162
+ "deployedBytecode": "0x",
163
+ "linkReferences": {},
164
+ "deployedLinkReferences": {}
165
+ }