@iexec-nox/nox-protocol-contracts 0.1.0-beta.2 → 0.1.0-beta.3
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/contracts/sdk/Nox.sol +291 -98
- package/package.json +3 -1
package/contracts/sdk/Nox.sol
CHANGED
|
@@ -11,18 +11,53 @@ import "encrypted-types/EncryptedTypes.sol";
|
|
|
11
11
|
* @notice Library providing convenient functions for TEE confidential computations.
|
|
12
12
|
* @dev If an invalid or non-existent handle is passed to any function in the Nox protocol,
|
|
13
13
|
* the transaction will revert as it will not be recognized by the ACL.
|
|
14
|
-
*
|
|
15
|
-
* NOX_COMPUTE and ACL are deterministic across all EVM chains using the CreateX factory.
|
|
16
|
-
* These addresses are derived from the CREATE2 salt configured in hardhat.config.ts.
|
|
17
|
-
*
|
|
18
|
-
* IMPORTANT: If a fresh deployment is performed (not an upgrade), the proxy addresses will change.
|
|
19
|
-
* In that case, update these constants with the new deployed addresses.
|
|
20
14
|
*/
|
|
21
15
|
library Nox {
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
// ============ Internal address resolution ============
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @dev Returns the NoxCompute contract address for the current chain.
|
|
20
|
+
* Supports Arbitrum Mainnet (42161), Arbitrum Sepolia (421614), and local dev chains (31337),
|
|
21
|
+
* including local forks of each network.
|
|
22
|
+
*/
|
|
23
|
+
function _compute() internal view returns (INoxCompute) {
|
|
24
|
+
// Arbitrum mainnet or its fork
|
|
25
|
+
if (block.chainid == 42161) {
|
|
26
|
+
// TODO: Update after mainnet deployment.
|
|
27
|
+
return INoxCompute(address(0));
|
|
28
|
+
}
|
|
29
|
+
// Arbitrum Sepolia or its fork
|
|
30
|
+
if (block.chainid == 421614) {
|
|
31
|
+
return INoxCompute(0xd2856C55447FBb45c85a4C484796fe690981B069);
|
|
32
|
+
}
|
|
33
|
+
// Local development chain
|
|
34
|
+
if (block.chainid == 31337) {
|
|
35
|
+
return INoxCompute(0x463Bdd46031353138713a47D7056F7c85024a4A6);
|
|
36
|
+
}
|
|
37
|
+
revert("Nox: Unsupported chain");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @dev Returns the ACL contract address for the current chain.
|
|
42
|
+
* Supports Arbitrum Mainnet (42161), Arbitrum Sepolia (421614), and local dev chains (31337),
|
|
43
|
+
* including local forks of each network.
|
|
44
|
+
*/
|
|
45
|
+
function _acl() internal view returns (IACL) {
|
|
46
|
+
// Arbitrum mainnet or its fork
|
|
47
|
+
if (block.chainid == 42161) {
|
|
48
|
+
// TODO: Update after mainnet deployment.
|
|
49
|
+
return IACL(address(0));
|
|
50
|
+
}
|
|
51
|
+
// Arbitrum Sepolia or its fork
|
|
52
|
+
if (block.chainid == 421614) {
|
|
53
|
+
return IACL(0xDC91Ec3F965F2F5F143DbBfcC92cC1340857D3d1);
|
|
54
|
+
}
|
|
55
|
+
// Local development chain
|
|
56
|
+
if (block.chainid == 31337) {
|
|
57
|
+
return IACL(0x3219A802B61028Fc29848863268FE17d750E5701);
|
|
58
|
+
}
|
|
59
|
+
revert("Nox: Unsupported chain");
|
|
60
|
+
}
|
|
26
61
|
|
|
27
62
|
// =========== Handle initialization checks ============
|
|
28
63
|
|
|
@@ -94,7 +129,7 @@ library Nox {
|
|
|
94
129
|
function toEbool(bool value) internal returns (ebool) {
|
|
95
130
|
return
|
|
96
131
|
ebool.wrap(
|
|
97
|
-
|
|
132
|
+
_compute().plaintextToEncrypted(bytes32(uint256(value ? 1 : 0)), TEEType.Bool)
|
|
98
133
|
);
|
|
99
134
|
}
|
|
100
135
|
|
|
@@ -104,7 +139,7 @@ library Nox {
|
|
|
104
139
|
function toEaddress(address value) internal returns (eaddress) {
|
|
105
140
|
return
|
|
106
141
|
eaddress.wrap(
|
|
107
|
-
|
|
142
|
+
_compute().plaintextToEncrypted(bytes32(uint256(uint160(value))), TEEType.Address)
|
|
108
143
|
);
|
|
109
144
|
}
|
|
110
145
|
|
|
@@ -113,14 +148,14 @@ library Nox {
|
|
|
113
148
|
*/
|
|
114
149
|
function toEuint16(uint16 value) internal returns (euint16) {
|
|
115
150
|
return
|
|
116
|
-
euint16.wrap(
|
|
151
|
+
euint16.wrap(_compute().plaintextToEncrypted(bytes32(uint256(value)), TEEType.Uint16));
|
|
117
152
|
}
|
|
118
153
|
|
|
119
154
|
/**
|
|
120
155
|
* @dev Convert a plaintext value to an encrypted euint256 integer.
|
|
121
156
|
*/
|
|
122
157
|
function toEuint256(uint256 value) internal returns (euint256) {
|
|
123
|
-
return euint256.wrap(
|
|
158
|
+
return euint256.wrap(_compute().plaintextToEncrypted(bytes32(value), TEEType.Uint256));
|
|
124
159
|
}
|
|
125
160
|
|
|
126
161
|
/**
|
|
@@ -129,7 +164,7 @@ library Nox {
|
|
|
129
164
|
function toEint16(int16 value) internal returns (eint16) {
|
|
130
165
|
return
|
|
131
166
|
eint16.wrap(
|
|
132
|
-
|
|
167
|
+
_compute().plaintextToEncrypted(bytes32(uint256(uint16(value))), TEEType.Int16)
|
|
133
168
|
);
|
|
134
169
|
}
|
|
135
170
|
|
|
@@ -138,7 +173,7 @@ library Nox {
|
|
|
138
173
|
*/
|
|
139
174
|
function toEint256(int256 value) internal returns (eint256) {
|
|
140
175
|
return
|
|
141
|
-
eint256.wrap(
|
|
176
|
+
eint256.wrap(_compute().plaintextToEncrypted(bytes32(uint256(value)), TEEType.Int256));
|
|
142
177
|
}
|
|
143
178
|
|
|
144
179
|
// ============ Handle validation ============
|
|
@@ -148,7 +183,7 @@ library Nox {
|
|
|
148
183
|
bytes calldata handleProof
|
|
149
184
|
) internal returns (ebool) {
|
|
150
185
|
bytes32 handle = externalEbool.unwrap(externalHandle);
|
|
151
|
-
|
|
186
|
+
_compute().validateProof(handle, msg.sender, handleProof, TEEType.Bool);
|
|
152
187
|
return ebool.wrap(handle);
|
|
153
188
|
}
|
|
154
189
|
|
|
@@ -157,7 +192,7 @@ library Nox {
|
|
|
157
192
|
bytes calldata handleProof
|
|
158
193
|
) internal returns (eaddress) {
|
|
159
194
|
bytes32 handle = externalEaddress.unwrap(externalHandle);
|
|
160
|
-
|
|
195
|
+
_compute().validateProof(handle, msg.sender, handleProof, TEEType.Address);
|
|
161
196
|
return eaddress.wrap(handle);
|
|
162
197
|
}
|
|
163
198
|
|
|
@@ -166,7 +201,7 @@ library Nox {
|
|
|
166
201
|
bytes calldata handleProof
|
|
167
202
|
) internal returns (euint16) {
|
|
168
203
|
bytes32 handle = externalEuint16.unwrap(externalHandle);
|
|
169
|
-
|
|
204
|
+
_compute().validateProof(handle, msg.sender, handleProof, TEEType.Uint16);
|
|
170
205
|
return euint16.wrap(handle);
|
|
171
206
|
}
|
|
172
207
|
|
|
@@ -175,7 +210,7 @@ library Nox {
|
|
|
175
210
|
bytes calldata handleProof
|
|
176
211
|
) internal returns (euint256) {
|
|
177
212
|
bytes32 handle = externalEuint256.unwrap(externalHandle);
|
|
178
|
-
|
|
213
|
+
_compute().validateProof(handle, msg.sender, handleProof, TEEType.Uint256);
|
|
179
214
|
return euint256.wrap(handle);
|
|
180
215
|
}
|
|
181
216
|
|
|
@@ -184,7 +219,7 @@ library Nox {
|
|
|
184
219
|
bytes calldata handleProof
|
|
185
220
|
) internal returns (eint16) {
|
|
186
221
|
bytes32 handle = externalEint16.unwrap(externalHandle);
|
|
187
|
-
|
|
222
|
+
_compute().validateProof(handle, msg.sender, handleProof, TEEType.Int16);
|
|
188
223
|
return eint16.wrap(handle);
|
|
189
224
|
}
|
|
190
225
|
|
|
@@ -193,78 +228,78 @@ library Nox {
|
|
|
193
228
|
bytes calldata handleProof
|
|
194
229
|
) internal returns (eint256) {
|
|
195
230
|
bytes32 handle = externalEint256.unwrap(externalHandle);
|
|
196
|
-
|
|
231
|
+
_compute().validateProof(handle, msg.sender, handleProof, TEEType.Int256);
|
|
197
232
|
return eint256.wrap(handle);
|
|
198
233
|
}
|
|
199
234
|
|
|
200
235
|
// ============ Arithmetic primitives ============
|
|
201
236
|
|
|
202
237
|
function add(euint16 a, euint16 b) internal returns (euint16) {
|
|
203
|
-
return euint16.wrap(
|
|
238
|
+
return euint16.wrap(_compute().add(euint16.unwrap(a), euint16.unwrap(b)));
|
|
204
239
|
}
|
|
205
240
|
|
|
206
241
|
function add(euint256 a, euint256 b) internal returns (euint256) {
|
|
207
|
-
return euint256.wrap(
|
|
242
|
+
return euint256.wrap(_compute().add(euint256.unwrap(a), euint256.unwrap(b)));
|
|
208
243
|
}
|
|
209
244
|
|
|
210
245
|
function add(eint16 a, eint16 b) internal returns (eint16) {
|
|
211
|
-
return eint16.wrap(
|
|
246
|
+
return eint16.wrap(_compute().add(eint16.unwrap(a), eint16.unwrap(b)));
|
|
212
247
|
}
|
|
213
248
|
|
|
214
249
|
function add(eint256 a, eint256 b) internal returns (eint256) {
|
|
215
|
-
return eint256.wrap(
|
|
250
|
+
return eint256.wrap(_compute().add(eint256.unwrap(a), eint256.unwrap(b)));
|
|
216
251
|
}
|
|
217
252
|
|
|
218
253
|
function sub(euint16 a, euint16 b) internal returns (euint16) {
|
|
219
|
-
return euint16.wrap(
|
|
254
|
+
return euint16.wrap(_compute().sub(euint16.unwrap(a), euint16.unwrap(b)));
|
|
220
255
|
}
|
|
221
256
|
|
|
222
257
|
function sub(euint256 a, euint256 b) internal returns (euint256) {
|
|
223
|
-
return euint256.wrap(
|
|
258
|
+
return euint256.wrap(_compute().sub(euint256.unwrap(a), euint256.unwrap(b)));
|
|
224
259
|
}
|
|
225
260
|
|
|
226
261
|
function sub(eint16 a, eint16 b) internal returns (eint16) {
|
|
227
|
-
return eint16.wrap(
|
|
262
|
+
return eint16.wrap(_compute().sub(eint16.unwrap(a), eint16.unwrap(b)));
|
|
228
263
|
}
|
|
229
264
|
|
|
230
265
|
function sub(eint256 a, eint256 b) internal returns (eint256) {
|
|
231
|
-
return eint256.wrap(
|
|
266
|
+
return eint256.wrap(_compute().sub(eint256.unwrap(a), eint256.unwrap(b)));
|
|
232
267
|
}
|
|
233
268
|
|
|
234
269
|
function mul(euint16 a, euint16 b) internal returns (euint16) {
|
|
235
|
-
return euint16.wrap(
|
|
270
|
+
return euint16.wrap(_compute().mul(euint16.unwrap(a), euint16.unwrap(b)));
|
|
236
271
|
}
|
|
237
272
|
|
|
238
273
|
function mul(euint256 a, euint256 b) internal returns (euint256) {
|
|
239
|
-
return euint256.wrap(
|
|
274
|
+
return euint256.wrap(_compute().mul(euint256.unwrap(a), euint256.unwrap(b)));
|
|
240
275
|
}
|
|
241
276
|
|
|
242
277
|
function mul(eint16 a, eint16 b) internal returns (eint16) {
|
|
243
|
-
return eint16.wrap(
|
|
278
|
+
return eint16.wrap(_compute().mul(eint16.unwrap(a), eint16.unwrap(b)));
|
|
244
279
|
}
|
|
245
280
|
|
|
246
281
|
function mul(eint256 a, eint256 b) internal returns (eint256) {
|
|
247
|
-
return eint256.wrap(
|
|
282
|
+
return eint256.wrap(_compute().mul(eint256.unwrap(a), eint256.unwrap(b)));
|
|
248
283
|
}
|
|
249
284
|
|
|
250
285
|
function div(euint16 a, euint16 b) internal returns (euint16) {
|
|
251
|
-
return euint16.wrap(
|
|
286
|
+
return euint16.wrap(_compute().div(euint16.unwrap(a), euint16.unwrap(b)));
|
|
252
287
|
}
|
|
253
288
|
|
|
254
289
|
function div(euint256 a, euint256 b) internal returns (euint256) {
|
|
255
|
-
return euint256.wrap(
|
|
290
|
+
return euint256.wrap(_compute().div(euint256.unwrap(a), euint256.unwrap(b)));
|
|
256
291
|
}
|
|
257
292
|
|
|
258
293
|
function div(eint16 a, eint16 b) internal returns (eint16) {
|
|
259
|
-
return eint16.wrap(
|
|
294
|
+
return eint16.wrap(_compute().div(eint16.unwrap(a), eint16.unwrap(b)));
|
|
260
295
|
}
|
|
261
296
|
|
|
262
297
|
function div(eint256 a, eint256 b) internal returns (eint256) {
|
|
263
|
-
return eint256.wrap(
|
|
298
|
+
return eint256.wrap(_compute().div(eint256.unwrap(a), eint256.unwrap(b)));
|
|
264
299
|
}
|
|
265
300
|
|
|
266
301
|
function safeAdd(euint16 a, euint16 b) internal returns (ebool, euint16) {
|
|
267
|
-
(bytes32 success, bytes32 result) =
|
|
302
|
+
(bytes32 success, bytes32 result) = _compute().safeAdd(
|
|
268
303
|
euint16.unwrap(a),
|
|
269
304
|
euint16.unwrap(b)
|
|
270
305
|
);
|
|
@@ -272,7 +307,7 @@ library Nox {
|
|
|
272
307
|
}
|
|
273
308
|
|
|
274
309
|
function safeAdd(euint256 a, euint256 b) internal returns (ebool, euint256) {
|
|
275
|
-
(bytes32 success, bytes32 result) =
|
|
310
|
+
(bytes32 success, bytes32 result) = _compute().safeAdd(
|
|
276
311
|
euint256.unwrap(a),
|
|
277
312
|
euint256.unwrap(b)
|
|
278
313
|
);
|
|
@@ -280,12 +315,12 @@ library Nox {
|
|
|
280
315
|
}
|
|
281
316
|
|
|
282
317
|
function safeAdd(eint16 a, eint16 b) internal returns (ebool, eint16) {
|
|
283
|
-
(bytes32 success, bytes32 result) =
|
|
318
|
+
(bytes32 success, bytes32 result) = _compute().safeAdd(eint16.unwrap(a), eint16.unwrap(b));
|
|
284
319
|
return (ebool.wrap(success), eint16.wrap(result));
|
|
285
320
|
}
|
|
286
321
|
|
|
287
322
|
function safeAdd(eint256 a, eint256 b) internal returns (ebool, eint256) {
|
|
288
|
-
(bytes32 success, bytes32 result) =
|
|
323
|
+
(bytes32 success, bytes32 result) = _compute().safeAdd(
|
|
289
324
|
eint256.unwrap(a),
|
|
290
325
|
eint256.unwrap(b)
|
|
291
326
|
);
|
|
@@ -293,7 +328,7 @@ library Nox {
|
|
|
293
328
|
}
|
|
294
329
|
|
|
295
330
|
function safeSub(euint16 a, euint16 b) internal returns (ebool, euint16) {
|
|
296
|
-
(bytes32 success, bytes32 result) =
|
|
331
|
+
(bytes32 success, bytes32 result) = _compute().safeSub(
|
|
297
332
|
euint16.unwrap(a),
|
|
298
333
|
euint16.unwrap(b)
|
|
299
334
|
);
|
|
@@ -301,7 +336,7 @@ library Nox {
|
|
|
301
336
|
}
|
|
302
337
|
|
|
303
338
|
function safeSub(euint256 a, euint256 b) internal returns (ebool, euint256) {
|
|
304
|
-
(bytes32 success, bytes32 result) =
|
|
339
|
+
(bytes32 success, bytes32 result) = _compute().safeSub(
|
|
305
340
|
euint256.unwrap(a),
|
|
306
341
|
euint256.unwrap(b)
|
|
307
342
|
);
|
|
@@ -309,12 +344,12 @@ library Nox {
|
|
|
309
344
|
}
|
|
310
345
|
|
|
311
346
|
function safeSub(eint16 a, eint16 b) internal returns (ebool, eint16) {
|
|
312
|
-
(bytes32 success, bytes32 result) =
|
|
347
|
+
(bytes32 success, bytes32 result) = _compute().safeSub(eint16.unwrap(a), eint16.unwrap(b));
|
|
313
348
|
return (ebool.wrap(success), eint16.wrap(result));
|
|
314
349
|
}
|
|
315
350
|
|
|
316
351
|
function safeSub(eint256 a, eint256 b) internal returns (ebool, eint256) {
|
|
317
|
-
(bytes32 success, bytes32 result) =
|
|
352
|
+
(bytes32 success, bytes32 result) = _compute().safeSub(
|
|
318
353
|
eint256.unwrap(a),
|
|
319
354
|
eint256.unwrap(b)
|
|
320
355
|
);
|
|
@@ -326,7 +361,7 @@ library Nox {
|
|
|
326
361
|
function select(ebool condition, euint16 ifTrue, euint16 ifFalse) internal returns (euint16) {
|
|
327
362
|
return
|
|
328
363
|
euint16.wrap(
|
|
329
|
-
|
|
364
|
+
_compute().select(
|
|
330
365
|
ebool.unwrap(condition),
|
|
331
366
|
euint16.unwrap(ifTrue),
|
|
332
367
|
euint16.unwrap(ifFalse)
|
|
@@ -341,7 +376,7 @@ library Nox {
|
|
|
341
376
|
) internal returns (euint256) {
|
|
342
377
|
return
|
|
343
378
|
euint256.wrap(
|
|
344
|
-
|
|
379
|
+
_compute().select(
|
|
345
380
|
ebool.unwrap(condition),
|
|
346
381
|
euint256.unwrap(ifTrue),
|
|
347
382
|
euint256.unwrap(ifFalse)
|
|
@@ -352,7 +387,7 @@ library Nox {
|
|
|
352
387
|
function select(ebool condition, eint16 ifTrue, eint16 ifFalse) internal returns (eint16) {
|
|
353
388
|
return
|
|
354
389
|
eint16.wrap(
|
|
355
|
-
|
|
390
|
+
_compute().select(
|
|
356
391
|
ebool.unwrap(condition),
|
|
357
392
|
eint16.unwrap(ifTrue),
|
|
358
393
|
eint16.unwrap(ifFalse)
|
|
@@ -363,7 +398,7 @@ library Nox {
|
|
|
363
398
|
function select(ebool condition, eint256 ifTrue, eint256 ifFalse) internal returns (eint256) {
|
|
364
399
|
return
|
|
365
400
|
eint256.wrap(
|
|
366
|
-
|
|
401
|
+
_compute().select(
|
|
367
402
|
ebool.unwrap(condition),
|
|
368
403
|
eint256.unwrap(ifTrue),
|
|
369
404
|
eint256.unwrap(ifFalse)
|
|
@@ -371,174 +406,332 @@ library Nox {
|
|
|
371
406
|
);
|
|
372
407
|
}
|
|
373
408
|
|
|
409
|
+
function eq(euint16 a, euint16 b) internal returns (ebool) {
|
|
410
|
+
return ebool.wrap(_compute().eq(euint16.unwrap(a), euint16.unwrap(b)));
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
function eq(euint256 a, euint256 b) internal returns (ebool) {
|
|
414
|
+
return ebool.wrap(_compute().eq(euint256.unwrap(a), euint256.unwrap(b)));
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
function eq(eint16 a, eint16 b) internal returns (ebool) {
|
|
418
|
+
return ebool.wrap(_compute().eq(eint16.unwrap(a), eint16.unwrap(b)));
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
function eq(eint256 a, eint256 b) internal returns (ebool) {
|
|
422
|
+
return ebool.wrap(_compute().eq(eint256.unwrap(a), eint256.unwrap(b)));
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
function ne(euint16 a, euint16 b) internal returns (ebool) {
|
|
426
|
+
return ebool.wrap(_compute().ne(euint16.unwrap(a), euint16.unwrap(b)));
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
function ne(euint256 a, euint256 b) internal returns (ebool) {
|
|
430
|
+
return ebool.wrap(_compute().ne(euint256.unwrap(a), euint256.unwrap(b)));
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
function ne(eint16 a, eint16 b) internal returns (ebool) {
|
|
434
|
+
return ebool.wrap(_compute().ne(eint16.unwrap(a), eint16.unwrap(b)));
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
function ne(eint256 a, eint256 b) internal returns (ebool) {
|
|
438
|
+
return ebool.wrap(_compute().ne(eint256.unwrap(a), eint256.unwrap(b)));
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
function lt(euint16 a, euint16 b) internal returns (ebool) {
|
|
442
|
+
return ebool.wrap(_compute().lt(euint16.unwrap(a), euint16.unwrap(b)));
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function lt(euint256 a, euint256 b) internal returns (ebool) {
|
|
446
|
+
return ebool.wrap(_compute().lt(euint256.unwrap(a), euint256.unwrap(b)));
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
function lt(eint16 a, eint16 b) internal returns (ebool) {
|
|
450
|
+
return ebool.wrap(_compute().lt(eint16.unwrap(a), eint16.unwrap(b)));
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
function lt(eint256 a, eint256 b) internal returns (ebool) {
|
|
454
|
+
return ebool.wrap(_compute().lt(eint256.unwrap(a), eint256.unwrap(b)));
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
function le(euint16 a, euint16 b) internal returns (ebool) {
|
|
458
|
+
return ebool.wrap(_compute().le(euint16.unwrap(a), euint16.unwrap(b)));
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function le(euint256 a, euint256 b) internal returns (ebool) {
|
|
462
|
+
return ebool.wrap(_compute().le(euint256.unwrap(a), euint256.unwrap(b)));
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
function le(eint16 a, eint16 b) internal returns (ebool) {
|
|
466
|
+
return ebool.wrap(_compute().le(eint16.unwrap(a), eint16.unwrap(b)));
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
function le(eint256 a, eint256 b) internal returns (ebool) {
|
|
470
|
+
return ebool.wrap(_compute().le(eint256.unwrap(a), eint256.unwrap(b)));
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
function gt(euint16 a, euint16 b) internal returns (ebool) {
|
|
474
|
+
return ebool.wrap(_compute().gt(euint16.unwrap(a), euint16.unwrap(b)));
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function gt(euint256 a, euint256 b) internal returns (ebool) {
|
|
478
|
+
return ebool.wrap(_compute().gt(euint256.unwrap(a), euint256.unwrap(b)));
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
function gt(eint16 a, eint16 b) internal returns (ebool) {
|
|
482
|
+
return ebool.wrap(_compute().gt(eint16.unwrap(a), eint16.unwrap(b)));
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
function gt(eint256 a, eint256 b) internal returns (ebool) {
|
|
486
|
+
return ebool.wrap(_compute().gt(eint256.unwrap(a), eint256.unwrap(b)));
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
function ge(euint16 a, euint16 b) internal returns (ebool) {
|
|
490
|
+
return ebool.wrap(_compute().ge(euint16.unwrap(a), euint16.unwrap(b)));
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
function ge(euint256 a, euint256 b) internal returns (ebool) {
|
|
494
|
+
return ebool.wrap(_compute().ge(euint256.unwrap(a), euint256.unwrap(b)));
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
function ge(eint16 a, eint16 b) internal returns (ebool) {
|
|
498
|
+
return ebool.wrap(_compute().ge(eint16.unwrap(a), eint16.unwrap(b)));
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
function ge(eint256 a, eint256 b) internal returns (ebool) {
|
|
502
|
+
return ebool.wrap(_compute().ge(eint256.unwrap(a), eint256.unwrap(b)));
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// ============ ADVANCED FUNCTIONS ============
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* @dev Atomically transfers `amount` from `balanceFrom` to `balanceTo`.
|
|
509
|
+
* Returns the new balances and whether the transfer was successful.
|
|
510
|
+
* The transfer will fail if `balanceFrom < amount`.
|
|
511
|
+
*/
|
|
512
|
+
function transfer(
|
|
513
|
+
euint256 balanceFrom,
|
|
514
|
+
euint256 balanceTo,
|
|
515
|
+
euint256 amount
|
|
516
|
+
) internal returns (ebool success, euint256 newBalanceFrom, euint256 newBalanceTo) {
|
|
517
|
+
(bytes32 _success, bytes32 _newBalanceFrom, bytes32 _newBalanceTo) = _compute().transfer(
|
|
518
|
+
euint256.unwrap(balanceFrom),
|
|
519
|
+
euint256.unwrap(balanceTo),
|
|
520
|
+
euint256.unwrap(amount)
|
|
521
|
+
);
|
|
522
|
+
success = ebool.wrap(_success);
|
|
523
|
+
newBalanceFrom = euint256.wrap(_newBalanceFrom);
|
|
524
|
+
newBalanceTo = euint256.wrap(_newBalanceTo);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* @dev Atomically mints `amount` to `balanceTo` and increases `totalSupply` by `amount`.
|
|
529
|
+
* Returns the new balance, new total supply, and whether the mint was successful.
|
|
530
|
+
* The mint will fail if `totalSupply + amount` overflows.
|
|
531
|
+
*/
|
|
532
|
+
function mint(
|
|
533
|
+
euint256 balanceTo,
|
|
534
|
+
euint256 amount,
|
|
535
|
+
euint256 totalSupply
|
|
536
|
+
) internal returns (ebool success, euint256 newBalanceTo, euint256 newTotalSupply) {
|
|
537
|
+
(bytes32 _success, bytes32 _newBalanceTo, bytes32 _newTotalSupply) = _compute().mint(
|
|
538
|
+
euint256.unwrap(balanceTo),
|
|
539
|
+
euint256.unwrap(amount),
|
|
540
|
+
euint256.unwrap(totalSupply)
|
|
541
|
+
);
|
|
542
|
+
success = ebool.wrap(_success);
|
|
543
|
+
newBalanceTo = euint256.wrap(_newBalanceTo);
|
|
544
|
+
newTotalSupply = euint256.wrap(_newTotalSupply);
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* @dev Atomically burns `amount` from `balanceFrom` and decreases `totalSupply` by `amount`.
|
|
549
|
+
* Returns the new balance, new total supply, and whether the burn was successful.
|
|
550
|
+
* The burn will fail if `balanceFrom < amount`.
|
|
551
|
+
*/
|
|
552
|
+
function burn(
|
|
553
|
+
euint256 balanceFrom,
|
|
554
|
+
euint256 amount,
|
|
555
|
+
euint256 totalSupply
|
|
556
|
+
) internal returns (ebool success, euint256 newBalanceFrom, euint256 newTotalSupply) {
|
|
557
|
+
(bytes32 _success, bytes32 _newBalanceFrom, bytes32 _newTotalSupply) = _compute().burn(
|
|
558
|
+
euint256.unwrap(balanceFrom),
|
|
559
|
+
euint256.unwrap(amount),
|
|
560
|
+
euint256.unwrap(totalSupply)
|
|
561
|
+
);
|
|
562
|
+
success = ebool.wrap(_success);
|
|
563
|
+
newBalanceFrom = euint256.wrap(_newBalanceFrom);
|
|
564
|
+
newTotalSupply = euint256.wrap(_newTotalSupply);
|
|
565
|
+
}
|
|
566
|
+
|
|
374
567
|
// ============ PERMISSION MANAGEMENT ============
|
|
375
568
|
|
|
376
569
|
/**
|
|
377
570
|
* @dev Allows the use of value for the address account.
|
|
378
571
|
*/
|
|
379
572
|
function allow(ebool value, address account) internal {
|
|
380
|
-
|
|
573
|
+
_acl().allow(ebool.unwrap(value), account);
|
|
381
574
|
}
|
|
382
575
|
|
|
383
576
|
/**
|
|
384
577
|
* @dev Allows the use of value for the address account.
|
|
385
578
|
*/
|
|
386
579
|
function allow(eaddress value, address account) internal {
|
|
387
|
-
|
|
580
|
+
_acl().allow(eaddress.unwrap(value), account);
|
|
388
581
|
}
|
|
389
582
|
|
|
390
583
|
/**
|
|
391
584
|
* @dev Allows the use of value for the address account.
|
|
392
585
|
*/
|
|
393
586
|
function allow(euint16 value, address account) internal {
|
|
394
|
-
|
|
587
|
+
_acl().allow(euint16.unwrap(value), account);
|
|
395
588
|
}
|
|
396
589
|
|
|
397
590
|
/**
|
|
398
591
|
* @dev Allows the use of value for the address account.
|
|
399
592
|
*/
|
|
400
593
|
function allow(euint256 value, address account) internal {
|
|
401
|
-
|
|
594
|
+
_acl().allow(euint256.unwrap(value), account);
|
|
402
595
|
}
|
|
403
596
|
|
|
404
597
|
/**
|
|
405
598
|
* @dev Allows the use of value for the address account.
|
|
406
599
|
*/
|
|
407
600
|
function allow(eint16 value, address account) internal {
|
|
408
|
-
|
|
601
|
+
_acl().allow(eint16.unwrap(value), account);
|
|
409
602
|
}
|
|
410
603
|
|
|
411
604
|
/**
|
|
412
605
|
* @dev Allows the use of value for the address account.
|
|
413
606
|
*/
|
|
414
607
|
function allow(eint256 value, address account) internal {
|
|
415
|
-
|
|
608
|
+
_acl().allow(eint256.unwrap(value), account);
|
|
416
609
|
}
|
|
417
610
|
|
|
418
611
|
/**
|
|
419
612
|
* @dev Allows the use of value for this address (address(this)).
|
|
420
613
|
*/
|
|
421
614
|
function allowThis(ebool value) internal {
|
|
422
|
-
|
|
615
|
+
_acl().allow(ebool.unwrap(value), address(this));
|
|
423
616
|
}
|
|
424
617
|
|
|
425
618
|
/**
|
|
426
619
|
* @dev Allows the use of value for this address (address(this)).
|
|
427
620
|
*/
|
|
428
621
|
function allowThis(eaddress value) internal {
|
|
429
|
-
|
|
622
|
+
_acl().allow(eaddress.unwrap(value), address(this));
|
|
430
623
|
}
|
|
431
624
|
|
|
432
625
|
/**
|
|
433
626
|
* @dev Allows the use of value for this address (address(this)).
|
|
434
627
|
*/
|
|
435
628
|
function allowThis(euint16 value) internal {
|
|
436
|
-
|
|
629
|
+
_acl().allow(euint16.unwrap(value), address(this));
|
|
437
630
|
}
|
|
438
631
|
|
|
439
632
|
/**
|
|
440
633
|
* @dev Allows the use of value for this address (address(this)).
|
|
441
634
|
*/
|
|
442
635
|
function allowThis(euint256 value) internal {
|
|
443
|
-
|
|
636
|
+
_acl().allow(euint256.unwrap(value), address(this));
|
|
444
637
|
}
|
|
445
638
|
|
|
446
639
|
/**
|
|
447
640
|
* @dev Allows the use of value for this address (address(this)).
|
|
448
641
|
*/
|
|
449
642
|
function allowThis(eint16 value) internal {
|
|
450
|
-
|
|
643
|
+
_acl().allow(eint16.unwrap(value), address(this));
|
|
451
644
|
}
|
|
452
645
|
|
|
453
646
|
/**
|
|
454
647
|
* @dev Allows the use of value for this address (address(this)).
|
|
455
648
|
*/
|
|
456
649
|
function allowThis(eint256 value) internal {
|
|
457
|
-
|
|
650
|
+
_acl().allow(eint256.unwrap(value), address(this));
|
|
458
651
|
}
|
|
459
652
|
|
|
460
653
|
/**
|
|
461
654
|
* @dev Allows the use of value by address account for this transaction.
|
|
462
655
|
*/
|
|
463
656
|
function allowTransient(ebool value, address account) internal {
|
|
464
|
-
|
|
657
|
+
_acl().allowTransient(ebool.unwrap(value), account);
|
|
465
658
|
}
|
|
466
659
|
|
|
467
660
|
/**
|
|
468
661
|
* @dev Allows the use of value by address account for this transaction.
|
|
469
662
|
*/
|
|
470
663
|
function allowTransient(eaddress value, address account) internal {
|
|
471
|
-
|
|
664
|
+
_acl().allowTransient(eaddress.unwrap(value), account);
|
|
472
665
|
}
|
|
473
666
|
|
|
474
667
|
/**
|
|
475
668
|
* @dev Allows the use of value by address account for this transaction.
|
|
476
669
|
*/
|
|
477
670
|
function allowTransient(euint16 value, address account) internal {
|
|
478
|
-
|
|
671
|
+
_acl().allowTransient(euint16.unwrap(value), account);
|
|
479
672
|
}
|
|
480
673
|
|
|
481
674
|
/**
|
|
482
675
|
* @dev Allows the use of value by address account for this transaction.
|
|
483
676
|
*/
|
|
484
677
|
function allowTransient(euint256 value, address account) internal {
|
|
485
|
-
|
|
678
|
+
_acl().allowTransient(euint256.unwrap(value), account);
|
|
486
679
|
}
|
|
487
680
|
|
|
488
681
|
/**
|
|
489
682
|
* @dev Allows the use of value by address account for this transaction.
|
|
490
683
|
*/
|
|
491
684
|
function allowTransient(eint16 value, address account) internal {
|
|
492
|
-
|
|
685
|
+
_acl().allowTransient(eint16.unwrap(value), account);
|
|
493
686
|
}
|
|
494
687
|
|
|
495
688
|
/**
|
|
496
689
|
* @dev Allows the use of value by address account for this transaction.
|
|
497
690
|
*/
|
|
498
691
|
function allowTransient(eint256 value, address account) internal {
|
|
499
|
-
|
|
692
|
+
_acl().allowTransient(eint256.unwrap(value), account);
|
|
500
693
|
}
|
|
501
694
|
|
|
502
695
|
/**
|
|
503
696
|
* @dev Checks if the handle is allowed for the account.
|
|
504
697
|
*/
|
|
505
698
|
function isAllowed(ebool handle, address account) internal view returns (bool) {
|
|
506
|
-
return
|
|
699
|
+
return _acl().isAllowed(ebool.unwrap(handle), account);
|
|
507
700
|
}
|
|
508
701
|
|
|
509
702
|
/**
|
|
510
703
|
* @dev Checks if the handle is allowed for the account.
|
|
511
704
|
*/
|
|
512
705
|
function isAllowed(eaddress handle, address account) internal view returns (bool) {
|
|
513
|
-
return
|
|
706
|
+
return _acl().isAllowed(eaddress.unwrap(handle), account);
|
|
514
707
|
}
|
|
515
708
|
|
|
516
709
|
/**
|
|
517
710
|
* @dev Checks if the handle is allowed for the account.
|
|
518
711
|
*/
|
|
519
712
|
function isAllowed(euint16 handle, address account) internal view returns (bool) {
|
|
520
|
-
return
|
|
713
|
+
return _acl().isAllowed(euint16.unwrap(handle), account);
|
|
521
714
|
}
|
|
522
715
|
|
|
523
716
|
/**
|
|
524
717
|
* @dev Checks if the handle is allowed for the account.
|
|
525
718
|
*/
|
|
526
719
|
function isAllowed(euint256 handle, address account) internal view returns (bool) {
|
|
527
|
-
return
|
|
720
|
+
return _acl().isAllowed(euint256.unwrap(handle), account);
|
|
528
721
|
}
|
|
529
722
|
|
|
530
723
|
/**
|
|
531
724
|
* @dev Checks if the handle is allowed for the account.
|
|
532
725
|
*/
|
|
533
726
|
function isAllowed(eint16 handle, address account) internal view returns (bool) {
|
|
534
|
-
return
|
|
727
|
+
return _acl().isAllowed(eint16.unwrap(handle), account);
|
|
535
728
|
}
|
|
536
729
|
|
|
537
730
|
/**
|
|
538
731
|
* @dev Checks if the handle is allowed for the account.
|
|
539
732
|
*/
|
|
540
733
|
function isAllowed(eint256 handle, address account) internal view returns (bool) {
|
|
541
|
-
return
|
|
734
|
+
return _acl().isAllowed(eint256.unwrap(handle), account);
|
|
542
735
|
}
|
|
543
736
|
|
|
544
737
|
// ============ VIEWER MANAGEMENT ============
|
|
@@ -547,84 +740,84 @@ library Nox {
|
|
|
547
740
|
* @dev Adds a viewer for an ebool handle.
|
|
548
741
|
*/
|
|
549
742
|
function addViewer(ebool value, address viewer) internal {
|
|
550
|
-
|
|
743
|
+
_acl().addViewer(ebool.unwrap(value), viewer);
|
|
551
744
|
}
|
|
552
745
|
|
|
553
746
|
/**
|
|
554
747
|
* @dev Adds a viewer for an eaddress handle.
|
|
555
748
|
*/
|
|
556
749
|
function addViewer(eaddress value, address viewer) internal {
|
|
557
|
-
|
|
750
|
+
_acl().addViewer(eaddress.unwrap(value), viewer);
|
|
558
751
|
}
|
|
559
752
|
|
|
560
753
|
/**
|
|
561
754
|
* @dev Adds a viewer for an euint16 handle.
|
|
562
755
|
*/
|
|
563
756
|
function addViewer(euint16 value, address viewer) internal {
|
|
564
|
-
|
|
757
|
+
_acl().addViewer(euint16.unwrap(value), viewer);
|
|
565
758
|
}
|
|
566
759
|
|
|
567
760
|
/**
|
|
568
761
|
* @dev Adds a viewer for an euint256 handle.
|
|
569
762
|
*/
|
|
570
763
|
function addViewer(euint256 value, address viewer) internal {
|
|
571
|
-
|
|
764
|
+
_acl().addViewer(euint256.unwrap(value), viewer);
|
|
572
765
|
}
|
|
573
766
|
|
|
574
767
|
/**
|
|
575
768
|
* @dev Adds a viewer for an eint16 handle.
|
|
576
769
|
*/
|
|
577
770
|
function addViewer(eint16 value, address viewer) internal {
|
|
578
|
-
|
|
771
|
+
_acl().addViewer(eint16.unwrap(value), viewer);
|
|
579
772
|
}
|
|
580
773
|
|
|
581
774
|
/**
|
|
582
775
|
* @dev Adds a viewer for an eint256 handle.
|
|
583
776
|
*/
|
|
584
777
|
function addViewer(eint256 value, address viewer) internal {
|
|
585
|
-
|
|
778
|
+
_acl().addViewer(eint256.unwrap(value), viewer);
|
|
586
779
|
}
|
|
587
780
|
|
|
588
781
|
/**
|
|
589
782
|
* @dev Checks if the viewer can view the handle.
|
|
590
783
|
*/
|
|
591
784
|
function isViewer(ebool handle, address viewer) internal view returns (bool) {
|
|
592
|
-
return
|
|
785
|
+
return _acl().isViewer(ebool.unwrap(handle), viewer);
|
|
593
786
|
}
|
|
594
787
|
|
|
595
788
|
/**
|
|
596
789
|
* @dev Checks if the viewer can view the handle.
|
|
597
790
|
*/
|
|
598
791
|
function isViewer(eaddress handle, address viewer) internal view returns (bool) {
|
|
599
|
-
return
|
|
792
|
+
return _acl().isViewer(eaddress.unwrap(handle), viewer);
|
|
600
793
|
}
|
|
601
794
|
|
|
602
795
|
/**
|
|
603
796
|
* @dev Checks if the viewer can view the handle.
|
|
604
797
|
*/
|
|
605
798
|
function isViewer(euint16 handle, address viewer) internal view returns (bool) {
|
|
606
|
-
return
|
|
799
|
+
return _acl().isViewer(euint16.unwrap(handle), viewer);
|
|
607
800
|
}
|
|
608
801
|
|
|
609
802
|
/**
|
|
610
803
|
* @dev Checks if the viewer can view the handle.
|
|
611
804
|
*/
|
|
612
805
|
function isViewer(euint256 handle, address viewer) internal view returns (bool) {
|
|
613
|
-
return
|
|
806
|
+
return _acl().isViewer(euint256.unwrap(handle), viewer);
|
|
614
807
|
}
|
|
615
808
|
|
|
616
809
|
/**
|
|
617
810
|
* @dev Checks if the viewer can view the handle.
|
|
618
811
|
*/
|
|
619
812
|
function isViewer(eint16 handle, address viewer) internal view returns (bool) {
|
|
620
|
-
return
|
|
813
|
+
return _acl().isViewer(eint16.unwrap(handle), viewer);
|
|
621
814
|
}
|
|
622
815
|
|
|
623
816
|
/**
|
|
624
817
|
* @dev Checks if the viewer can view the handle.
|
|
625
818
|
*/
|
|
626
819
|
function isViewer(eint256 handle, address viewer) internal view returns (bool) {
|
|
627
|
-
return
|
|
820
|
+
return _acl().isViewer(eint256.unwrap(handle), viewer);
|
|
628
821
|
}
|
|
629
822
|
|
|
630
823
|
// ============ PUBLIC DECRYPTION ============
|
|
@@ -633,83 +826,83 @@ library Nox {
|
|
|
633
826
|
* @dev Marks an ebool handle as publicly decryptable.
|
|
634
827
|
*/
|
|
635
828
|
function allowPublicDecryption(ebool value) internal {
|
|
636
|
-
|
|
829
|
+
_acl().allowPublicDecryption(ebool.unwrap(value));
|
|
637
830
|
}
|
|
638
831
|
|
|
639
832
|
/**
|
|
640
833
|
* @dev Marks an eaddress handle as publicly decryptable.
|
|
641
834
|
*/
|
|
642
835
|
function allowPublicDecryption(eaddress value) internal {
|
|
643
|
-
|
|
836
|
+
_acl().allowPublicDecryption(eaddress.unwrap(value));
|
|
644
837
|
}
|
|
645
838
|
|
|
646
839
|
/**
|
|
647
840
|
* @dev Marks an euint16 handle as publicly decryptable.
|
|
648
841
|
*/
|
|
649
842
|
function allowPublicDecryption(euint16 value) internal {
|
|
650
|
-
|
|
843
|
+
_acl().allowPublicDecryption(euint16.unwrap(value));
|
|
651
844
|
}
|
|
652
845
|
|
|
653
846
|
/**
|
|
654
847
|
* @dev Marks an euint256 handle as publicly decryptable.
|
|
655
848
|
*/
|
|
656
849
|
function allowPublicDecryption(euint256 value) internal {
|
|
657
|
-
|
|
850
|
+
_acl().allowPublicDecryption(euint256.unwrap(value));
|
|
658
851
|
}
|
|
659
852
|
|
|
660
853
|
/**
|
|
661
854
|
* @dev Marks an eint16 handle as publicly decryptable.
|
|
662
855
|
*/
|
|
663
856
|
function allowPublicDecryption(eint16 value) internal {
|
|
664
|
-
|
|
857
|
+
_acl().allowPublicDecryption(eint16.unwrap(value));
|
|
665
858
|
}
|
|
666
859
|
|
|
667
860
|
/**
|
|
668
861
|
* @dev Marks an eint256 handle as publicly decryptable.
|
|
669
862
|
*/
|
|
670
863
|
function allowPublicDecryption(eint256 value) internal {
|
|
671
|
-
|
|
864
|
+
_acl().allowPublicDecryption(eint256.unwrap(value));
|
|
672
865
|
}
|
|
673
866
|
|
|
674
867
|
/**
|
|
675
868
|
* @dev Checks if the handle is publicly decryptable.
|
|
676
869
|
*/
|
|
677
870
|
function isPubliclyDecryptable(ebool handle) internal view returns (bool) {
|
|
678
|
-
return
|
|
871
|
+
return _acl().isPubliclyDecryptable(ebool.unwrap(handle));
|
|
679
872
|
}
|
|
680
873
|
|
|
681
874
|
/**
|
|
682
875
|
* @dev Checks if the handle is publicly decryptable.
|
|
683
876
|
*/
|
|
684
877
|
function isPubliclyDecryptable(eaddress handle) internal view returns (bool) {
|
|
685
|
-
return
|
|
878
|
+
return _acl().isPubliclyDecryptable(eaddress.unwrap(handle));
|
|
686
879
|
}
|
|
687
880
|
|
|
688
881
|
/**
|
|
689
882
|
* @dev Checks if the handle is publicly decryptable.
|
|
690
883
|
*/
|
|
691
884
|
function isPubliclyDecryptable(euint16 handle) internal view returns (bool) {
|
|
692
|
-
return
|
|
885
|
+
return _acl().isPubliclyDecryptable(euint16.unwrap(handle));
|
|
693
886
|
}
|
|
694
887
|
|
|
695
888
|
/**
|
|
696
889
|
* @dev Checks if the handle is publicly decryptable.
|
|
697
890
|
*/
|
|
698
891
|
function isPubliclyDecryptable(euint256 handle) internal view returns (bool) {
|
|
699
|
-
return
|
|
892
|
+
return _acl().isPubliclyDecryptable(euint256.unwrap(handle));
|
|
700
893
|
}
|
|
701
894
|
|
|
702
895
|
/**
|
|
703
896
|
* @dev Checks if the handle is publicly decryptable.
|
|
704
897
|
*/
|
|
705
898
|
function isPubliclyDecryptable(eint16 handle) internal view returns (bool) {
|
|
706
|
-
return
|
|
899
|
+
return _acl().isPubliclyDecryptable(eint16.unwrap(handle));
|
|
707
900
|
}
|
|
708
901
|
|
|
709
902
|
/**
|
|
710
903
|
* @dev Checks if the handle is publicly decryptable.
|
|
711
904
|
*/
|
|
712
905
|
function isPubliclyDecryptable(eint256 handle) internal view returns (bool) {
|
|
713
|
-
return
|
|
906
|
+
return _acl().isPubliclyDecryptable(eint256.unwrap(handle));
|
|
714
907
|
}
|
|
715
908
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iexec-nox/nox-protocol-contracts",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.3",
|
|
4
4
|
"description": "Nox protocol smart contracts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Nox",
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
"deploy": "pnpm hardhat run scripts/deploy.ts",
|
|
25
25
|
"set-gateway": "pnpm hardhat run scripts/set-gateway.ts",
|
|
26
26
|
"set-kms-public-key": "pnpm hardhat run scripts/set-kms-public-key.ts",
|
|
27
|
+
"upgrade-acl": "pnpm hardhat run scripts/upgrade-acl.ts",
|
|
28
|
+
"upgrade-nox-compute": "pnpm hardhat run scripts/upgrade-nox-compute.ts",
|
|
27
29
|
"format": "pnpm prettier --write .",
|
|
28
30
|
"format:check": "pnpm prettier --check ."
|
|
29
31
|
},
|