@iexec-nox/nox-protocol-contracts 0.1.0-beta.2 → 0.1.0-beta.4

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