@inco/lightning 0.5.2 → 0.6.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 (40) hide show
  1. package/manifest.yaml +23 -9
  2. package/package.json +1 -2
  3. package/src/DeployUtils.sol +10 -19
  4. package/src/Lib.alphanet.sol +12 -6
  5. package/src/Lib.demonet.sol +12 -6
  6. package/src/Lib.devnet.sol +13 -7
  7. package/src/Lib.sol +13 -7
  8. package/src/Lib.template.sol +12 -6
  9. package/src/Lib.testnet.sol +12 -6
  10. package/src/Types.sol +4 -1
  11. package/src/libs/incoLightning_alphanet_v0_297966649.sol +12 -6
  12. package/src/libs/incoLightning_demonet_v0_863421733.sol +12 -6
  13. package/src/libs/incoLightning_devnet_v0_340846814.sol +12 -6
  14. package/src/libs/incoLightning_devnet_v1_904635675.sol +457 -0
  15. package/src/libs/incoLightning_testnet_v0_183408998.sol +12 -6
  16. package/src/lightning-parts/AccessControl/BaseAccessControlList.sol +21 -5
  17. package/src/lightning-parts/AccessControl/test/TestAdvancedAccessControl.t.sol +1 -0
  18. package/src/lightning-parts/EncryptedInput.sol +22 -6
  19. package/src/lightning-parts/EncryptedOperations.sol +6 -6
  20. package/src/lightning-parts/Fee.sol +41 -0
  21. package/src/lightning-parts/TEELifecycle.sol +170 -67
  22. package/src/lightning-parts/TEELifecycle.types.sol +9 -12
  23. package/src/lightning-parts/TrivialEncryption.sol +1 -1
  24. package/src/lightning-parts/interfaces/IEncryptedInput.sol +3 -3
  25. package/src/lightning-parts/interfaces/IEncryptedOperations.sol +48 -1
  26. package/src/lightning-parts/interfaces/ITEELifecycle.sol +2 -2
  27. package/src/lightning-parts/test/Fee.t.sol +101 -0
  28. package/src/lightning-parts/test/HandleMetadata.t.sol +4 -3
  29. package/src/lightning-parts/test/InputsFee.t.sol +65 -0
  30. package/src/lightning-parts/test/TestDecryptionAttestationInSynchronousFlow.t.sol +1 -0
  31. package/src/test/AddTwo.sol +18 -6
  32. package/src/test/FakeIncoInfra/FakeIncoInfraBase.sol +12 -0
  33. package/src/test/FakeIncoInfra/MockRemoteAttestation.sol +6 -0
  34. package/src/test/FakeIncoInfra/getOpForSelector.sol +5 -0
  35. package/src/test/IncoTest.sol +1 -0
  36. package/src/test/TEELifecycle/TEELifecycleMockTest.t.sol +21 -26
  37. package/src/test/TestAddTwo.t.sol +9 -1
  38. package/src/test/TestFakeInfra.t.sol +12 -3
  39. package/src/version/IncoLightningConfig.sol +3 -1
  40. package/src/test/TEELifecycle/README.md +0 -53
package/manifest.yaml CHANGED
@@ -1,25 +1,39 @@
1
- incoLightning_devnet_v1_887305889:
1
+ incoLightning_devnet_v1_904635675:
2
2
  executor:
3
- name: incoLightning_devnet_v1_887305889
3
+ name: incoLightning_devnet_v1_904635675
4
4
  majorVersion: 1
5
5
  deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC"
6
6
  pepper: devnet
7
- executorAddress: "0x7b98b0482099611B0ebEA0F98f81FF555406794A"
8
- salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc00e0709ca1c4596e431f34a1"
7
+ executorAddress: "0x3473820DcAa71Af8157b93C7f2bf1c676A2A39A6"
8
+ salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc007d63c0fdca6698ac7cc51b"
9
9
  deployments:
10
- - name: incoLightningPreview_1_0_0__887305889
10
+ - name: incoLightningPreview_1_0_2__904635675
11
+ chainId: "9746"
12
+ chainName: Plasma Testnet
13
+ version:
14
+ major: 1
15
+ minor: 0
16
+ patch: 2
17
+ shortSalt: "904635675"
18
+ decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f"
19
+ eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1"
20
+ blockNumber: "3696905"
21
+ deployDate: 2025-10-03T13:24:44.682Z
22
+ commit: v0.5.3-6-g8db0f27f-dirty
23
+ active: true
24
+ - name: incoLightningPreview_1_0_0__904635675
11
25
  chainId: "9746"
12
26
  chainName: Plasma Testnet
13
27
  version:
14
28
  major: 1
15
29
  minor: 0
16
30
  patch: 0
17
- shortSalt: "887305889"
31
+ shortSalt: "904635675"
18
32
  decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f"
19
33
  eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1"
20
- blockNumber: "2994009"
21
- deployDate: 2025-09-25T09:51:49.838Z
22
- commit: v0.5.0-dirty
34
+ blockNumber: "3344310"
35
+ deployDate: 2025-09-29T11:14:02.599Z
36
+ commit: v0.5.1-5-g4135c790-dirty
23
37
  active: true
24
38
  incoLightning_testnet_v0_183408998:
25
39
  executor:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inco/lightning",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "repository": "https://github.com/Inco-fhevm/inco-monorepo",
5
5
  "files": [
6
6
  "src/",
@@ -21,7 +21,6 @@
21
21
  "@safe-global/safe-smart-account": "https://github.com/safe-global/safe-smart-account.git#v1.5.0",
22
22
  "ds-test": "https://github.com/dapphub/ds-test",
23
23
  "forge-std": "https://github.com/foundry-rs/forge-std",
24
- "solady": "https://github.com/Vectorized/solady.git#v0.1.24",
25
24
  "tsx": "^4.19.3"
26
25
  },
27
26
  "devDependencies": {
@@ -6,15 +6,15 @@ import {Script} from "forge-std/Script.sol";
6
6
  import {IIncoLightning} from "./interfaces/IIncoLightning.sol";
7
7
  import {Vm} from "forge-std/Vm.sol";
8
8
  import {
9
- CreateX,
10
- createXAddress,
11
- createXDeployer
9
+ CreateX,
10
+ createXAddress,
11
+ createXDeployer
12
12
  } from "./pasted-dependencies/CreateX.sol";
13
13
  import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
14
14
  import {
15
- CONTRACT_NAME,
16
- MAJOR_VERSION,
17
- VERIFIER_NAME
15
+ CONTRACT_NAME,
16
+ MAJOR_VERSION,
17
+ VERIFIER_NAME
18
18
  } from "./version/IncoLightningConfig.sol";
19
19
  import {IncoVerifier} from "./IncoVerifier.sol";
20
20
  import {IIncoVerifier} from "./interfaces/IIncoVerifier.sol";
@@ -51,22 +51,13 @@ contract DeployUtils is Script {
51
51
  string memory pepper
52
52
  ) internal pure returns (bytes32) {
53
53
  return
54
- bytes32(
54
+ bytes32(
55
55
  abi.encodePacked(
56
56
  deployer,
57
57
  crossChainDeployAuthorizedFlag,
58
58
  bytes11(
59
59
  keccak256(
60
- abi.encodePacked(
61
- name,
62
- majorVersionNumber,
63
- // "ghost" minor and patch versions are passed in the salt for retro compatibility
64
- // of the deployment address
65
- // todo #1037 remove permanently fake minor and patch versions from the salt
66
- uint8(1),
67
- uint8(29),
68
- pepper
69
- )
60
+ abi.encodePacked(name, majorVersionNumber, pepper)
70
61
  )
71
62
  )
72
63
  )
@@ -91,8 +82,8 @@ contract DeployUtils is Script {
91
82
  string memory pepper,
92
83
  IQuoteVerifier quoteVerifier
93
84
  )
94
- internal
95
- returns (IIncoLightning lightningProxy, IIncoVerifier verifierProxy)
85
+ internal
86
+ returns (IIncoLightning lightningProxy, IIncoVerifier verifierProxy)
96
87
  {
97
88
  (bytes32 lightningSalt, bytes32 verifierSalt) = getIncoSalts(
98
89
  deployer,
@@ -353,16 +353,19 @@ library e {
353
353
  return inco.eNot(s(a));
354
354
  }
355
355
 
356
+ /// @dev costs the inco fee
356
357
  function rand() internal returns (euint256) {
357
- return euint256.wrap(inco.eRand(ETypes.Uint256));
358
+ return euint256.wrap(inco.eRand{value: inco.getFee()}(ETypes.Uint256));
358
359
  }
359
360
 
361
+ /// @dev costs the inco fee
360
362
  function randBounded(uint256 upperBound) internal returns (euint256) {
361
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
363
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
362
364
  }
363
365
 
366
+ /// @dev costs the inco fee
364
367
  function randBounded(euint256 upperBound) internal returns (euint256) {
365
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(s(upperBound)), ETypes.Uint256));
368
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(s(upperBound)), ETypes.Uint256));
366
369
  }
367
370
 
368
371
  function asEuint256(uint256 a) internal returns (euint256) {
@@ -385,16 +388,19 @@ library e {
385
388
  return euint256.wrap(inco.eCast(ebool.unwrap(a), ETypes.Uint256));
386
389
  }
387
390
 
391
+ /// @dev costs the inco fee
388
392
  function newEuint256(bytes memory ciphertext, address user) internal returns (euint256) {
389
- return inco.newEuint256(ciphertext, user);
393
+ return inco.newEuint256{value: inco.getFee()}(ciphertext, user);
390
394
  }
391
395
 
396
+ /// @dev costs the inco fee
392
397
  function newEbool(bytes memory ciphertext, address user) internal returns (ebool) {
393
- return inco.newEbool(ciphertext, user);
398
+ return inco.newEbool{value: inco.getFee()}(ciphertext, user);
394
399
  }
395
400
 
401
+ /// @dev costs the inco fee
396
402
  function newEaddress(bytes memory ciphertext, address user) internal returns (eaddress) {
397
- return inco.newEaddress(ciphertext, user);
403
+ return inco.newEaddress{value: inco.getFee()}(ciphertext, user);
398
404
  }
399
405
 
400
406
  function allow(euint256 a, address to) internal {
@@ -353,16 +353,19 @@ library e {
353
353
  return inco.eNot(s(a));
354
354
  }
355
355
 
356
+ /// @dev costs the inco fee
356
357
  function rand() internal returns (euint256) {
357
- return euint256.wrap(inco.eRand(ETypes.Uint256));
358
+ return euint256.wrap(inco.eRand{value: inco.getFee()}(ETypes.Uint256));
358
359
  }
359
360
 
361
+ /// @dev costs the inco fee
360
362
  function randBounded(uint256 upperBound) internal returns (euint256) {
361
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
363
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
362
364
  }
363
365
 
366
+ /// @dev costs the inco fee
364
367
  function randBounded(euint256 upperBound) internal returns (euint256) {
365
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(s(upperBound)), ETypes.Uint256));
368
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(s(upperBound)), ETypes.Uint256));
366
369
  }
367
370
 
368
371
  function asEuint256(uint256 a) internal returns (euint256) {
@@ -385,16 +388,19 @@ library e {
385
388
  return euint256.wrap(inco.eCast(ebool.unwrap(a), ETypes.Uint256));
386
389
  }
387
390
 
391
+ /// @dev costs the inco fee
388
392
  function newEuint256(bytes memory ciphertext, address user) internal returns (euint256) {
389
- return inco.newEuint256(ciphertext, user);
393
+ return inco.newEuint256{value: inco.getFee()}(ciphertext, user);
390
394
  }
391
395
 
396
+ /// @dev costs the inco fee
392
397
  function newEbool(bytes memory ciphertext, address user) internal returns (ebool) {
393
- return inco.newEbool(ciphertext, user);
398
+ return inco.newEbool{value: inco.getFee()}(ciphertext, user);
394
399
  }
395
400
 
401
+ /// @dev costs the inco fee
396
402
  function newEaddress(bytes memory ciphertext, address user) internal returns (eaddress) {
397
- return inco.newEaddress(ciphertext, user);
403
+ return inco.newEaddress{value: inco.getFee()}(ciphertext, user);
398
404
  }
399
405
 
400
406
  function allow(euint256 a, address to) internal {
@@ -8,7 +8,7 @@ pragma solidity ^0.8;
8
8
  import { IncoLightning } from "./IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "./Types.sol";
10
10
 
11
- IncoLightning constant inco = IncoLightning(0x7b98b0482099611B0ebEA0F98f81FF555406794A);
11
+ IncoLightning constant inco = IncoLightning(0x3473820DcAa71Af8157b93C7f2bf1c676A2A39A6);
12
12
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
13
13
 
14
14
  function typeOf(bytes32 handle) pure returns (ETypes) {
@@ -353,16 +353,19 @@ library e {
353
353
  return inco.eNot(s(a));
354
354
  }
355
355
 
356
+ /// @dev costs the inco fee
356
357
  function rand() internal returns (euint256) {
357
- return euint256.wrap(inco.eRand(ETypes.Uint256));
358
+ return euint256.wrap(inco.eRand{value: inco.getFee()}(ETypes.Uint256));
358
359
  }
359
360
 
361
+ /// @dev costs the inco fee
360
362
  function randBounded(uint256 upperBound) internal returns (euint256) {
361
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
363
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
362
364
  }
363
365
 
366
+ /// @dev costs the inco fee
364
367
  function randBounded(euint256 upperBound) internal returns (euint256) {
365
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(s(upperBound)), ETypes.Uint256));
368
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(s(upperBound)), ETypes.Uint256));
366
369
  }
367
370
 
368
371
  function asEuint256(uint256 a) internal returns (euint256) {
@@ -385,16 +388,19 @@ library e {
385
388
  return euint256.wrap(inco.eCast(ebool.unwrap(a), ETypes.Uint256));
386
389
  }
387
390
 
391
+ /// @dev costs the inco fee
388
392
  function newEuint256(bytes memory ciphertext, address user) internal returns (euint256) {
389
- return inco.newEuint256(ciphertext, user);
393
+ return inco.newEuint256{value: inco.getFee()}(ciphertext, user);
390
394
  }
391
395
 
396
+ /// @dev costs the inco fee
392
397
  function newEbool(bytes memory ciphertext, address user) internal returns (ebool) {
393
- return inco.newEbool(ciphertext, user);
398
+ return inco.newEbool{value: inco.getFee()}(ciphertext, user);
394
399
  }
395
400
 
401
+ /// @dev costs the inco fee
396
402
  function newEaddress(bytes memory ciphertext, address user) internal returns (eaddress) {
397
- return inco.newEaddress(ciphertext, user);
403
+ return inco.newEaddress{value: inco.getFee()}(ciphertext, user);
398
404
  }
399
405
 
400
406
  function allow(euint256 a, address to) internal {
package/src/Lib.sol CHANGED
@@ -8,7 +8,7 @@ pragma solidity ^0.8;
8
8
  import { IncoLightning } from "./IncoLightning.sol";
9
9
  import { ebool, euint256, eaddress, ETypes } from "./Types.sol";
10
10
 
11
- IncoLightning constant inco = IncoLightning(0x7b98b0482099611B0ebEA0F98f81FF555406794A);
11
+ IncoLightning constant inco = IncoLightning(0x3473820DcAa71Af8157b93C7f2bf1c676A2A39A6);
12
12
  address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
13
13
 
14
14
  function typeOf(bytes32 handle) pure returns (ETypes) {
@@ -353,16 +353,19 @@ library e {
353
353
  return inco.eNot(s(a));
354
354
  }
355
355
 
356
+ /// @dev costs the inco fee
356
357
  function rand() internal returns (euint256) {
357
- return euint256.wrap(inco.eRand(ETypes.Uint256));
358
+ return euint256.wrap(inco.eRand{value: inco.getFee()}(ETypes.Uint256));
358
359
  }
359
360
 
361
+ /// @dev costs the inco fee
360
362
  function randBounded(uint256 upperBound) internal returns (euint256) {
361
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
363
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
362
364
  }
363
365
 
366
+ /// @dev costs the inco fee
364
367
  function randBounded(euint256 upperBound) internal returns (euint256) {
365
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(s(upperBound)), ETypes.Uint256));
368
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(s(upperBound)), ETypes.Uint256));
366
369
  }
367
370
 
368
371
  function asEuint256(uint256 a) internal returns (euint256) {
@@ -385,16 +388,19 @@ library e {
385
388
  return euint256.wrap(inco.eCast(ebool.unwrap(a), ETypes.Uint256));
386
389
  }
387
390
 
391
+ /// @dev costs the inco fee
388
392
  function newEuint256(bytes memory ciphertext, address user) internal returns (euint256) {
389
- return inco.newEuint256(ciphertext, user);
393
+ return inco.newEuint256{value: inco.getFee()}(ciphertext, user);
390
394
  }
391
395
 
396
+ /// @dev costs the inco fee
392
397
  function newEbool(bytes memory ciphertext, address user) internal returns (ebool) {
393
- return inco.newEbool(ciphertext, user);
398
+ return inco.newEbool{value: inco.getFee()}(ciphertext, user);
394
399
  }
395
400
 
401
+ /// @dev costs the inco fee
396
402
  function newEaddress(bytes memory ciphertext, address user) internal returns (eaddress) {
397
- return inco.newEaddress(ciphertext, user);
403
+ return inco.newEaddress{value: inco.getFee()}(ciphertext, user);
398
404
  }
399
405
 
400
406
  function allow(euint256 a, address to) internal {
@@ -365,24 +365,27 @@ library e {
365
365
  return inco.eNot(s(a));
366
366
  }
367
367
 
368
+ /// @dev costs the inco fee
368
369
  function rand() internal returns (euint256) {
369
- return euint256.wrap(inco.eRand(ETypes.Uint256));
370
+ return euint256.wrap(inco.eRand{value: inco.getFee()}(ETypes.Uint256));
370
371
  }
371
372
 
373
+ /// @dev costs the inco fee
372
374
  function randBounded(uint256 upperBound) internal returns (euint256) {
373
375
  return
374
376
  euint256.wrap(
375
- inco.eRandBounded(
377
+ inco.eRandBounded{value: inco.getFee()}(
376
378
  euint256.unwrap(asEuint256(upperBound)),
377
379
  ETypes.Uint256
378
380
  )
379
381
  );
380
382
  }
381
383
 
384
+ /// @dev costs the inco fee
382
385
  function randBounded(euint256 upperBound) internal returns (euint256) {
383
386
  return
384
387
  euint256.wrap(
385
- inco.eRandBounded(
388
+ inco.eRandBounded{value: inco.getFee()}(
386
389
  euint256.unwrap(s(upperBound)),
387
390
  ETypes.Uint256
388
391
  )
@@ -409,25 +412,28 @@ library e {
409
412
  return euint256.wrap(inco.eCast(ebool.unwrap(a), ETypes.Uint256));
410
413
  }
411
414
 
415
+ /// @dev costs the inco fee
412
416
  function newEuint256(
413
417
  bytes memory ciphertext,
414
418
  address user
415
419
  ) internal returns (euint256) {
416
- return inco.newEuint256(ciphertext, user);
420
+ return inco.newEuint256{value: inco.getFee()}(ciphertext, user);
417
421
  }
418
422
 
423
+ /// @dev costs the inco fee
419
424
  function newEbool(
420
425
  bytes memory ciphertext,
421
426
  address user
422
427
  ) internal returns (ebool) {
423
- return inco.newEbool(ciphertext, user);
428
+ return inco.newEbool{value: inco.getFee()}(ciphertext, user);
424
429
  }
425
430
 
431
+ /// @dev costs the inco fee
426
432
  function newEaddress(
427
433
  bytes memory ciphertext,
428
434
  address user
429
435
  ) internal returns (eaddress) {
430
- return inco.newEaddress(ciphertext, user);
436
+ return inco.newEaddress{value: inco.getFee()}(ciphertext, user);
431
437
  }
432
438
 
433
439
  function allow(euint256 a, address to) internal {
@@ -353,16 +353,19 @@ library e {
353
353
  return inco.eNot(s(a));
354
354
  }
355
355
 
356
+ /// @dev costs the inco fee
356
357
  function rand() internal returns (euint256) {
357
- return euint256.wrap(inco.eRand(ETypes.Uint256));
358
+ return euint256.wrap(inco.eRand{value: inco.getFee()}(ETypes.Uint256));
358
359
  }
359
360
 
361
+ /// @dev costs the inco fee
360
362
  function randBounded(uint256 upperBound) internal returns (euint256) {
361
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
363
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
362
364
  }
363
365
 
366
+ /// @dev costs the inco fee
364
367
  function randBounded(euint256 upperBound) internal returns (euint256) {
365
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(s(upperBound)), ETypes.Uint256));
368
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(s(upperBound)), ETypes.Uint256));
366
369
  }
367
370
 
368
371
  function asEuint256(uint256 a) internal returns (euint256) {
@@ -385,16 +388,19 @@ library e {
385
388
  return euint256.wrap(inco.eCast(ebool.unwrap(a), ETypes.Uint256));
386
389
  }
387
390
 
391
+ /// @dev costs the inco fee
388
392
  function newEuint256(bytes memory ciphertext, address user) internal returns (euint256) {
389
- return inco.newEuint256(ciphertext, user);
393
+ return inco.newEuint256{value: inco.getFee()}(ciphertext, user);
390
394
  }
391
395
 
396
+ /// @dev costs the inco fee
392
397
  function newEbool(bytes memory ciphertext, address user) internal returns (ebool) {
393
- return inco.newEbool(ciphertext, user);
398
+ return inco.newEbool{value: inco.getFee()}(ciphertext, user);
394
399
  }
395
400
 
401
+ /// @dev costs the inco fee
396
402
  function newEaddress(bytes memory ciphertext, address user) internal returns (eaddress) {
397
- return inco.newEaddress(ciphertext, user);
403
+ return inco.newEaddress{value: inco.getFee()}(ciphertext, user);
398
404
  }
399
405
 
400
406
  function allow(euint256 a, address to) internal {
package/src/Types.sol CHANGED
@@ -36,7 +36,10 @@ pragma solidity ^0.8;
36
36
  DecryptionRequested, // 28
37
37
  RequestFulfilled, // 29
38
38
  EOP30, EOP31, EOP32, EOP33, EOP34, EOP35, EOP36, EOP37, EOP38, EOP39,
39
- EOP40, EOP41, EOP42, EOP43, EOP44, EOP45, EOP46, EOP47, EOP48, EOP49,
39
+ // Pseudo-operation for an ACL (persistent) allow
40
+ Allow, // 40
41
+ Reveal, // 41
42
+ EOP42, EOP43, EOP44, EOP45, EOP46, EOP47, EOP48, EOP49,
40
43
  EOP50, EOP51, EOP52, EOP53, EOP54, EOP55, EOP56, EOP57, EOP58, EOP59,
41
44
  EOP60, EOP61, EOP62, EOP63, EOP64, EOP65, EOP66, EOP67, EOP68, EOP69,
42
45
  EOP70, EOP71, EOP72, EOP73, EOP74, EOP75, EOP76, EOP77, EOP78, EOP79,
@@ -353,16 +353,19 @@ library e {
353
353
  return inco.eNot(s(a));
354
354
  }
355
355
 
356
+ /// @dev costs the inco fee
356
357
  function rand() internal returns (euint256) {
357
- return euint256.wrap(inco.eRand(ETypes.Uint256));
358
+ return euint256.wrap(inco.eRand{value: inco.getFee()}(ETypes.Uint256));
358
359
  }
359
360
 
361
+ /// @dev costs the inco fee
360
362
  function randBounded(uint256 upperBound) internal returns (euint256) {
361
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
363
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
362
364
  }
363
365
 
366
+ /// @dev costs the inco fee
364
367
  function randBounded(euint256 upperBound) internal returns (euint256) {
365
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(s(upperBound)), ETypes.Uint256));
368
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(s(upperBound)), ETypes.Uint256));
366
369
  }
367
370
 
368
371
  function asEuint256(uint256 a) internal returns (euint256) {
@@ -385,16 +388,19 @@ library e {
385
388
  return euint256.wrap(inco.eCast(ebool.unwrap(a), ETypes.Uint256));
386
389
  }
387
390
 
391
+ /// @dev costs the inco fee
388
392
  function newEuint256(bytes memory ciphertext, address user) internal returns (euint256) {
389
- return inco.newEuint256(ciphertext, user);
393
+ return inco.newEuint256{value: inco.getFee()}(ciphertext, user);
390
394
  }
391
395
 
396
+ /// @dev costs the inco fee
392
397
  function newEbool(bytes memory ciphertext, address user) internal returns (ebool) {
393
- return inco.newEbool(ciphertext, user);
398
+ return inco.newEbool{value: inco.getFee()}(ciphertext, user);
394
399
  }
395
400
 
401
+ /// @dev costs the inco fee
396
402
  function newEaddress(bytes memory ciphertext, address user) internal returns (eaddress) {
397
- return inco.newEaddress(ciphertext, user);
403
+ return inco.newEaddress{value: inco.getFee()}(ciphertext, user);
398
404
  }
399
405
 
400
406
  function allow(euint256 a, address to) internal {
@@ -353,16 +353,19 @@ library e {
353
353
  return inco.eNot(s(a));
354
354
  }
355
355
 
356
+ /// @dev costs the inco fee
356
357
  function rand() internal returns (euint256) {
357
- return euint256.wrap(inco.eRand(ETypes.Uint256));
358
+ return euint256.wrap(inco.eRand{value: inco.getFee()}(ETypes.Uint256));
358
359
  }
359
360
 
361
+ /// @dev costs the inco fee
360
362
  function randBounded(uint256 upperBound) internal returns (euint256) {
361
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
363
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
362
364
  }
363
365
 
366
+ /// @dev costs the inco fee
364
367
  function randBounded(euint256 upperBound) internal returns (euint256) {
365
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(s(upperBound)), ETypes.Uint256));
368
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(s(upperBound)), ETypes.Uint256));
366
369
  }
367
370
 
368
371
  function asEuint256(uint256 a) internal returns (euint256) {
@@ -385,16 +388,19 @@ library e {
385
388
  return euint256.wrap(inco.eCast(ebool.unwrap(a), ETypes.Uint256));
386
389
  }
387
390
 
391
+ /// @dev costs the inco fee
388
392
  function newEuint256(bytes memory ciphertext, address user) internal returns (euint256) {
389
- return inco.newEuint256(ciphertext, user);
393
+ return inco.newEuint256{value: inco.getFee()}(ciphertext, user);
390
394
  }
391
395
 
396
+ /// @dev costs the inco fee
392
397
  function newEbool(bytes memory ciphertext, address user) internal returns (ebool) {
393
- return inco.newEbool(ciphertext, user);
398
+ return inco.newEbool{value: inco.getFee()}(ciphertext, user);
394
399
  }
395
400
 
401
+ /// @dev costs the inco fee
396
402
  function newEaddress(bytes memory ciphertext, address user) internal returns (eaddress) {
397
- return inco.newEaddress(ciphertext, user);
403
+ return inco.newEaddress{value: inco.getFee()}(ciphertext, user);
398
404
  }
399
405
 
400
406
  function allow(euint256 a, address to) internal {
@@ -353,16 +353,19 @@ library e {
353
353
  return inco.eNot(s(a));
354
354
  }
355
355
 
356
+ /// @dev costs the inco fee
356
357
  function rand() internal returns (euint256) {
357
- return euint256.wrap(inco.eRand(ETypes.Uint256));
358
+ return euint256.wrap(inco.eRand{value: inco.getFee()}(ETypes.Uint256));
358
359
  }
359
360
 
361
+ /// @dev costs the inco fee
360
362
  function randBounded(uint256 upperBound) internal returns (euint256) {
361
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
363
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(asEuint256(upperBound)), ETypes.Uint256));
362
364
  }
363
365
 
366
+ /// @dev costs the inco fee
364
367
  function randBounded(euint256 upperBound) internal returns (euint256) {
365
- return euint256.wrap(inco.eRandBounded(euint256.unwrap(s(upperBound)), ETypes.Uint256));
368
+ return euint256.wrap(inco.eRandBounded{value: inco.getFee()}(euint256.unwrap(s(upperBound)), ETypes.Uint256));
366
369
  }
367
370
 
368
371
  function asEuint256(uint256 a) internal returns (euint256) {
@@ -385,16 +388,19 @@ library e {
385
388
  return euint256.wrap(inco.eCast(ebool.unwrap(a), ETypes.Uint256));
386
389
  }
387
390
 
391
+ /// @dev costs the inco fee
388
392
  function newEuint256(bytes memory ciphertext, address user) internal returns (euint256) {
389
- return inco.newEuint256(ciphertext, user);
393
+ return inco.newEuint256{value: inco.getFee()}(ciphertext, user);
390
394
  }
391
395
 
396
+ /// @dev costs the inco fee
392
397
  function newEbool(bytes memory ciphertext, address user) internal returns (ebool) {
393
- return inco.newEbool(ciphertext, user);
398
+ return inco.newEbool{value: inco.getFee()}(ciphertext, user);
394
399
  }
395
400
 
401
+ /// @dev costs the inco fee
396
402
  function newEaddress(bytes memory ciphertext, address user) internal returns (eaddress) {
397
- return inco.newEaddress(ciphertext, user);
403
+ return inco.newEaddress{value: inco.getFee()}(ciphertext, user);
398
404
  }
399
405
 
400
406
  function allow(euint256 a, address to) internal {