@cofhe/mock-contracts 0.6.1 → 0.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofhe/mock-contracts",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
4
4
  "description": "Mock smart contracts for testing CoFHE with FHE primitives locally",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -33,7 +33,7 @@
33
33
  "cofhe"
34
34
  ],
35
35
  "dependencies": {
36
- "@fhenixprotocol/cofhe-contracts": "0.1.4",
36
+ "@fhenixprotocol/cofhe-contracts": "0.2.0",
37
37
  "@openzeppelin/contracts": "5.4.0",
38
38
  "@openzeppelin/contracts-upgradeable": "5.4.0"
39
39
  },
@@ -46,7 +46,7 @@
46
46
  "tsx": "4.21.0",
47
47
  "tsup": "8.5.0",
48
48
  "typechain": "8.3.2",
49
- "@cofhe/sdk": "0.6.1",
49
+ "@cofhe/sdk": "0.7.1",
50
50
  "@cofhe/tsconfig": "0.1.2"
51
51
  },
52
52
  "publishConfig": {
@@ -0,0 +1,359 @@
1
+ // This file is auto-generated by build-artifacts.ts
2
+ import { type MockArtifact } from './types';
3
+
4
+ export const ACPShareRegistryArtifact = {
5
+ contractName: 'ACPShareRegistry',
6
+ isFixed: false,
7
+ abi: [
8
+ {
9
+ type: 'function',
10
+ name: 'getShare',
11
+ inputs: [
12
+ {
13
+ name: 'shareId',
14
+ type: 'bytes32',
15
+ internalType: 'bytes32',
16
+ },
17
+ ],
18
+ outputs: [
19
+ {
20
+ name: '',
21
+ type: 'tuple',
22
+ internalType: 'struct ACP',
23
+ components: [
24
+ {
25
+ name: 'issuer',
26
+ type: 'address',
27
+ internalType: 'address',
28
+ },
29
+ {
30
+ name: 'expiration',
31
+ type: 'uint64',
32
+ internalType: 'uint64',
33
+ },
34
+ {
35
+ name: 'recipient',
36
+ type: 'address',
37
+ internalType: 'address',
38
+ },
39
+ {
40
+ name: 'revokerData',
41
+ type: 'uint256',
42
+ internalType: 'uint256',
43
+ },
44
+ {
45
+ name: 'revokerContract',
46
+ type: 'address',
47
+ internalType: 'address',
48
+ },
49
+ {
50
+ name: 'scope',
51
+ type: 'uint8',
52
+ internalType: 'uint8',
53
+ },
54
+ {
55
+ name: 'contracts',
56
+ type: 'address[]',
57
+ internalType: 'address[]',
58
+ },
59
+ {
60
+ name: 'handles',
61
+ type: 'bytes32[]',
62
+ internalType: 'bytes32[]',
63
+ },
64
+ {
65
+ name: 'sealingKey',
66
+ type: 'bytes32',
67
+ internalType: 'bytes32',
68
+ },
69
+ {
70
+ name: 'issuerSignature',
71
+ type: 'bytes',
72
+ internalType: 'bytes',
73
+ },
74
+ {
75
+ name: 'recipientSignature',
76
+ type: 'bytes',
77
+ internalType: 'bytes',
78
+ },
79
+ ],
80
+ },
81
+ ],
82
+ stateMutability: 'view',
83
+ },
84
+ {
85
+ type: 'function',
86
+ name: 'isShareValid',
87
+ inputs: [
88
+ {
89
+ name: 'shareId',
90
+ type: 'bytes32',
91
+ internalType: 'bytes32',
92
+ },
93
+ ],
94
+ outputs: [
95
+ {
96
+ name: '',
97
+ type: 'bool',
98
+ internalType: 'bool',
99
+ },
100
+ ],
101
+ stateMutability: 'view',
102
+ },
103
+ {
104
+ type: 'function',
105
+ name: 'removeShare',
106
+ inputs: [
107
+ {
108
+ name: 'shareId',
109
+ type: 'bytes32',
110
+ internalType: 'bytes32',
111
+ },
112
+ ],
113
+ outputs: [],
114
+ stateMutability: 'nonpayable',
115
+ },
116
+ {
117
+ type: 'function',
118
+ name: 'share',
119
+ inputs: [
120
+ {
121
+ name: 'acp',
122
+ type: 'tuple',
123
+ internalType: 'struct ACP',
124
+ components: [
125
+ {
126
+ name: 'issuer',
127
+ type: 'address',
128
+ internalType: 'address',
129
+ },
130
+ {
131
+ name: 'expiration',
132
+ type: 'uint64',
133
+ internalType: 'uint64',
134
+ },
135
+ {
136
+ name: 'recipient',
137
+ type: 'address',
138
+ internalType: 'address',
139
+ },
140
+ {
141
+ name: 'revokerData',
142
+ type: 'uint256',
143
+ internalType: 'uint256',
144
+ },
145
+ {
146
+ name: 'revokerContract',
147
+ type: 'address',
148
+ internalType: 'address',
149
+ },
150
+ {
151
+ name: 'scope',
152
+ type: 'uint8',
153
+ internalType: 'uint8',
154
+ },
155
+ {
156
+ name: 'contracts',
157
+ type: 'address[]',
158
+ internalType: 'address[]',
159
+ },
160
+ {
161
+ name: 'handles',
162
+ type: 'bytes32[]',
163
+ internalType: 'bytes32[]',
164
+ },
165
+ {
166
+ name: 'sealingKey',
167
+ type: 'bytes32',
168
+ internalType: 'bytes32',
169
+ },
170
+ {
171
+ name: 'issuerSignature',
172
+ type: 'bytes',
173
+ internalType: 'bytes',
174
+ },
175
+ {
176
+ name: 'recipientSignature',
177
+ type: 'bytes',
178
+ internalType: 'bytes',
179
+ },
180
+ ],
181
+ },
182
+ ],
183
+ outputs: [
184
+ {
185
+ name: 'shareId',
186
+ type: 'bytes32',
187
+ internalType: 'bytes32',
188
+ },
189
+ ],
190
+ stateMutability: 'nonpayable',
191
+ },
192
+ {
193
+ type: 'function',
194
+ name: 'sharesFor',
195
+ inputs: [
196
+ {
197
+ name: 'recipient',
198
+ type: 'address',
199
+ internalType: 'address',
200
+ },
201
+ ],
202
+ outputs: [
203
+ {
204
+ name: 'acps',
205
+ type: 'tuple[]',
206
+ internalType: 'struct ACP[]',
207
+ components: [
208
+ {
209
+ name: 'issuer',
210
+ type: 'address',
211
+ internalType: 'address',
212
+ },
213
+ {
214
+ name: 'expiration',
215
+ type: 'uint64',
216
+ internalType: 'uint64',
217
+ },
218
+ {
219
+ name: 'recipient',
220
+ type: 'address',
221
+ internalType: 'address',
222
+ },
223
+ {
224
+ name: 'revokerData',
225
+ type: 'uint256',
226
+ internalType: 'uint256',
227
+ },
228
+ {
229
+ name: 'revokerContract',
230
+ type: 'address',
231
+ internalType: 'address',
232
+ },
233
+ {
234
+ name: 'scope',
235
+ type: 'uint8',
236
+ internalType: 'uint8',
237
+ },
238
+ {
239
+ name: 'contracts',
240
+ type: 'address[]',
241
+ internalType: 'address[]',
242
+ },
243
+ {
244
+ name: 'handles',
245
+ type: 'bytes32[]',
246
+ internalType: 'bytes32[]',
247
+ },
248
+ {
249
+ name: 'sealingKey',
250
+ type: 'bytes32',
251
+ internalType: 'bytes32',
252
+ },
253
+ {
254
+ name: 'issuerSignature',
255
+ type: 'bytes',
256
+ internalType: 'bytes',
257
+ },
258
+ {
259
+ name: 'recipientSignature',
260
+ type: 'bytes',
261
+ internalType: 'bytes',
262
+ },
263
+ ],
264
+ },
265
+ ],
266
+ stateMutability: 'view',
267
+ },
268
+ {
269
+ type: 'event',
270
+ name: 'ShareRemoved',
271
+ inputs: [
272
+ {
273
+ name: 'recipient',
274
+ type: 'address',
275
+ indexed: true,
276
+ internalType: 'address',
277
+ },
278
+ {
279
+ name: 'issuer',
280
+ type: 'address',
281
+ indexed: true,
282
+ internalType: 'address',
283
+ },
284
+ {
285
+ name: 'shareId',
286
+ type: 'bytes32',
287
+ indexed: false,
288
+ internalType: 'bytes32',
289
+ },
290
+ ],
291
+ anonymous: false,
292
+ },
293
+ {
294
+ type: 'event',
295
+ name: 'Shared',
296
+ inputs: [
297
+ {
298
+ name: 'recipient',
299
+ type: 'address',
300
+ indexed: true,
301
+ internalType: 'address',
302
+ },
303
+ {
304
+ name: 'issuer',
305
+ type: 'address',
306
+ indexed: true,
307
+ internalType: 'address',
308
+ },
309
+ {
310
+ name: 'shareId',
311
+ type: 'bytes32',
312
+ indexed: false,
313
+ internalType: 'bytes32',
314
+ },
315
+ ],
316
+ anonymous: false,
317
+ },
318
+ {
319
+ type: 'error',
320
+ name: 'AlreadyShared',
321
+ inputs: [],
322
+ },
323
+ {
324
+ type: 'error',
325
+ name: 'IssuerSignatureMissing',
326
+ inputs: [],
327
+ },
328
+ {
329
+ type: 'error',
330
+ name: 'NotIssuer',
331
+ inputs: [],
332
+ },
333
+ {
334
+ type: 'error',
335
+ name: 'NotIssuerOrRecipient',
336
+ inputs: [],
337
+ },
338
+ {
339
+ type: 'error',
340
+ name: 'RecipientMissing',
341
+ inputs: [],
342
+ },
343
+ {
344
+ type: 'error',
345
+ name: 'SealingKeyMustBeEmpty',
346
+ inputs: [],
347
+ },
348
+ {
349
+ type: 'error',
350
+ name: 'ShareExpired',
351
+ inputs: [],
352
+ },
353
+ {
354
+ type: 'error',
355
+ name: 'UnknownShare',
356
+ inputs: [],
357
+ },
358
+ ],
359
+ } as const satisfies MockArtifact;
@@ -0,0 +1,134 @@
1
+ // This file is auto-generated by build-artifacts.ts
2
+ import { type MockArtifact } from './types';
3
+
4
+ export const ACPTimestampRevokerArtifact = {
5
+ contractName: 'ACPTimestampRevoker',
6
+ isFixed: false,
7
+ abi: [
8
+ {
9
+ type: 'function',
10
+ name: 'disabled',
11
+ inputs: [
12
+ {
13
+ name: 'issuer',
14
+ type: 'address',
15
+ internalType: 'address',
16
+ },
17
+ {
18
+ name: 'id',
19
+ type: 'uint256',
20
+ internalType: 'uint256',
21
+ },
22
+ ],
23
+ outputs: [
24
+ {
25
+ name: '',
26
+ type: 'bool',
27
+ internalType: 'bool',
28
+ },
29
+ ],
30
+ stateMutability: 'view',
31
+ },
32
+ {
33
+ type: 'function',
34
+ name: 'revokeAllAt',
35
+ inputs: [
36
+ {
37
+ name: '',
38
+ type: 'address',
39
+ internalType: 'address',
40
+ },
41
+ ],
42
+ outputs: [
43
+ {
44
+ name: '',
45
+ type: 'uint256',
46
+ internalType: 'uint256',
47
+ },
48
+ ],
49
+ stateMutability: 'view',
50
+ },
51
+ {
52
+ type: 'function',
53
+ name: 'revokeAllExisting',
54
+ inputs: [],
55
+ outputs: [],
56
+ stateMutability: 'nonpayable',
57
+ },
58
+ {
59
+ type: 'function',
60
+ name: 'revokeSingle',
61
+ inputs: [
62
+ {
63
+ name: 'id',
64
+ type: 'uint256',
65
+ internalType: 'uint256',
66
+ },
67
+ ],
68
+ outputs: [],
69
+ stateMutability: 'nonpayable',
70
+ },
71
+ {
72
+ type: 'function',
73
+ name: 'revokedSingle',
74
+ inputs: [
75
+ {
76
+ name: '',
77
+ type: 'address',
78
+ internalType: 'address',
79
+ },
80
+ {
81
+ name: '',
82
+ type: 'uint256',
83
+ internalType: 'uint256',
84
+ },
85
+ ],
86
+ outputs: [
87
+ {
88
+ name: '',
89
+ type: 'bool',
90
+ internalType: 'bool',
91
+ },
92
+ ],
93
+ stateMutability: 'view',
94
+ },
95
+ {
96
+ type: 'event',
97
+ name: 'RevokedAll',
98
+ inputs: [
99
+ {
100
+ name: 'issuer',
101
+ type: 'address',
102
+ indexed: true,
103
+ internalType: 'address',
104
+ },
105
+ {
106
+ name: 'at',
107
+ type: 'uint256',
108
+ indexed: false,
109
+ internalType: 'uint256',
110
+ },
111
+ ],
112
+ anonymous: false,
113
+ },
114
+ {
115
+ type: 'event',
116
+ name: 'RevokedSingle',
117
+ inputs: [
118
+ {
119
+ name: 'issuer',
120
+ type: 'address',
121
+ indexed: true,
122
+ internalType: 'address',
123
+ },
124
+ {
125
+ name: 'id',
126
+ type: 'uint256',
127
+ indexed: true,
128
+ internalType: 'uint256',
129
+ },
130
+ ],
131
+ anonymous: false,
132
+ },
133
+ ],
134
+ } as const satisfies MockArtifact;