@inco/lightning 0.5.3 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/manifest.yaml +37 -0
  3. package/package.json +1 -1
  4. package/src/Lib.alphanet.sol +13 -7
  5. package/src/Lib.demonet.sol +12 -6
  6. package/src/Lib.devnet.sol +12 -6
  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 +2 -1
  11. package/src/libs/incoLightning_alphanet_v0_297966649.sol +12 -6
  12. package/src/libs/incoLightning_alphanet_v1_725458969.sol +457 -0
  13. package/src/libs/incoLightning_demonet_v0_863421733.sol +12 -6
  14. package/src/libs/incoLightning_devnet_v0_340846814.sol +12 -6
  15. package/src/libs/incoLightning_devnet_v1_904635675.sol +12 -6
  16. package/src/libs/incoLightning_testnet_v0_183408998.sol +12 -6
  17. package/src/lightning-parts/AccessControl/BaseAccessControlList.sol +11 -3
  18. package/src/lightning-parts/AccessControl/test/TestAdvancedAccessControl.t.sol +1 -0
  19. package/src/lightning-parts/EncryptedInput.sol +22 -6
  20. package/src/lightning-parts/EncryptedOperations.sol +6 -6
  21. package/src/lightning-parts/Fee.sol +41 -0
  22. package/src/lightning-parts/TEELifecycle.sol +138 -52
  23. package/src/lightning-parts/TEELifecycle.types.sol +9 -12
  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/test/Fee.t.sol +101 -0
  27. package/src/lightning-parts/test/HandleMetadata.t.sol +4 -3
  28. package/src/lightning-parts/test/InputsFee.t.sol +65 -0
  29. package/src/lightning-parts/test/TestDecryptionAttestationInSynchronousFlow.t.sol +1 -0
  30. package/src/test/AddTwo.sol +18 -6
  31. package/src/test/FakeIncoInfra/FakeIncoInfraBase.sol +12 -0
  32. package/src/test/FakeIncoInfra/getOpForSelector.sol +3 -1
  33. package/src/test/IncoTest.sol +2 -2
  34. package/src/test/TEELifecycle/TEELifecycleMockTest.t.sol +2 -2
  35. package/src/test/TestAddTwo.t.sol +9 -1
  36. package/src/test/TestFakeInfra.t.sol +13 -3
  37. package/src/version/IncoLightningConfig.sol +4 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.2
4
+
5
+ - Inco Fees on:
6
+ - rand()
7
+ - randBounded()
8
+ - newEuint256()
9
+ - newEbool()
10
+ - newEaddress()
11
+
3
12
  ## 1.0.0
4
13
 
5
14
  - **State breaking change** - Contract Split between Executor and Verifier
package/manifest.yaml CHANGED
@@ -1,3 +1,26 @@
1
+ incoLightning_alphanet_v1_725458969:
2
+ executor:
3
+ name: incoLightning_alphanet_v1_725458969
4
+ majorVersion: 1
5
+ deployer: "0x8202D2D747784Cb7D48868E44C42C4bf162a70BC"
6
+ pepper: alphanet
7
+ executorAddress: "0x28676Cd3b10b03b2FDF105Ba280425b45a674F2A"
8
+ salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc004dfbe338c6966a22bcca19"
9
+ deployments:
10
+ - name: incoLightningPreview_1_0_2__725458969
11
+ chainId: "84532"
12
+ chainName: Base Sepolia
13
+ version:
14
+ major: 1
15
+ minor: 0
16
+ patch: 2
17
+ shortSalt: "725458969"
18
+ decryptSigner: "0x4736F8CE685760017eEc130AC3FFc6187f5A1F95"
19
+ eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1"
20
+ blockNumber: "32124925"
21
+ deployDate: 2025-10-09T13:55:42.997Z
22
+ commit: v0.5.3-10-ga4f2312d
23
+ active: true
1
24
  incoLightning_devnet_v1_904635675:
2
25
  executor:
3
26
  name: incoLightning_devnet_v1_904635675
@@ -7,6 +30,20 @@ incoLightning_devnet_v1_904635675:
7
30
  executorAddress: "0x3473820DcAa71Af8157b93C7f2bf1c676A2A39A6"
8
31
  salt: "0x8202d2d747784cb7d48868e44c42c4bf162a70bc007d63c0fdca6698ac7cc51b"
9
32
  deployments:
33
+ - name: incoLightningPreview_1_0_2__904635675
34
+ chainId: "9746"
35
+ chainName: Plasma Testnet
36
+ version:
37
+ major: 1
38
+ minor: 0
39
+ patch: 2
40
+ shortSalt: "904635675"
41
+ decryptSigner: "0x138AcbDC1FA02b955949d8Da09E546Ea7748710f"
42
+ eciesPublicKey: "0x038a582d29083c2f3fefe024bf4dd9ab913ab8973716977da5f01106e0b84095b1"
43
+ blockNumber: "3696905"
44
+ deployDate: 2025-10-03T13:24:44.682Z
45
+ commit: v0.5.3-6-g8db0f27f-dirty
46
+ active: true
10
47
  - name: incoLightningPreview_1_0_0__904635675
11
48
  chainId: "9746"
12
49
  chainName: Plasma Testnet
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inco/lightning",
3
- "version": "0.5.3",
3
+ "version": "0.6.1",
4
4
  "repository": "https://github.com/Inco-fhevm/inco-monorepo",
5
5
  "files": [
6
6
  "src/",
@@ -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(0x4651DfD7729aE5568092E7351fAaD872266d4CBd);
11
+ IncoLightning constant inco = IncoLightning(0x28676Cd3b10b03b2FDF105Ba280425b45a674F2A);
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 {
@@ -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 {
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(0x3473820DcAa71Af8157b93C7f2bf1c676A2A39A6);
11
+ IncoLightning constant inco = IncoLightning(0x28676Cd3b10b03b2FDF105Ba280425b45a674F2A);
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
@@ -38,7 +38,8 @@ pragma solidity ^0.8;
38
38
  EOP30, EOP31, EOP32, EOP33, EOP34, EOP35, EOP36, EOP37, EOP38, EOP39,
39
39
  // Pseudo-operation for an ACL (persistent) allow
40
40
  Allow, // 40
41
- EOP41, EOP42, EOP43, EOP44, EOP45, EOP46, EOP47, EOP48, EOP49,
41
+ Reveal, // 41
42
+ EOP42, EOP43, EOP44, EOP45, EOP46, EOP47, EOP48, EOP49,
42
43
  EOP50, EOP51, EOP52, EOP53, EOP54, EOP55, EOP56, EOP57, EOP58, EOP59,
43
44
  EOP60, EOP61, EOP62, EOP63, EOP64, EOP65, EOP66, EOP67, EOP68, EOP69,
44
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 {