@inco/lightning 1.0.0-devnet-9 → 1.0.0-rc-2

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/manifest.yaml CHANGED
@@ -1,3 +1,29 @@
1
+ incoLightning_testnet_v12_687186260:
2
+ executor:
3
+ name: incoLightning_testnet_v12_687186260
4
+ majorVersion: 12
5
+ deployer: "0x9eb3483532302Ab76290BACf9D6DC4efD3fa0d1B"
6
+ owner: "0x9eb3483532302Ab76290BACf9D6DC4efD3fa0d1B"
7
+ pepper: testnet
8
+ executorAddress: "0xe9CB49A5b16C6D4a093E5900AA8b450FD40541B6"
9
+ salt: "0x9eb3483532302ab76290bacf9d6dc4efd3fa0d1b00a56971525153062e0ab754"
10
+ verifierAddress: "0x0DF77d5803c09BB073e94fDCe6534851F2B3b638"
11
+ deployments:
12
+ - name: incoLightning_12_0_2__687186260
13
+ chainId: "84532"
14
+ chainName: Base Sepolia
15
+ version:
16
+ major: 12
17
+ minor: 0
18
+ patch: 2
19
+ shortSalt: "687186260"
20
+ blockNumber: "42021377"
21
+ deployDate: 2026-05-26T15:57:28.732Z
22
+ commit: v0.11.0-demonet-7-27-g60c6c4e7
23
+ active: true
24
+ includesPreviewFeatures: false
25
+ executorImpl: "0x7985Ab8B0231dd202ca9123f19C600edC4de562e"
26
+ verifierImpl: "0xf971532c7f7558416f2CED8a0B44B2D7388d883B"
1
27
  incoLightning_devnet_v12_873394282:
2
28
  executor:
3
29
  name: incoLightning_devnet_v12_873394282
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inco/lightning",
3
- "version": "1.0.0-devnet-9",
3
+ "version": "1.0.0-rc-2",
4
4
  "repository": "https://github.com/Inco-fhevm/inco-monorepo",
5
5
  "files": [
6
6
  "src/",
@@ -6,17 +6,19 @@ import {Script} from "forge-std/Script.sol";
6
6
  import {IIncoLightning} from "./interfaces/IIncoLightning.sol";
7
7
  import {CreateX, CREATE_X_ADDRESS, CREATE_X_DEPLOYER} from "./pasted-dependencies/CreateX.sol";
8
8
  import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
9
- import {CONTRACT_NAME, MAJOR_VERSION, VERIFIER_NAME} from "./version/IncoLightningConfig.sol";
9
+ import {
10
+ CONTRACT_NAME,
11
+ MAJOR_VERSION,
12
+ MINOR_VERSION,
13
+ PATCH_VERSION,
14
+ VERIFIER_NAME
15
+ } from "./version/IncoLightningConfig.sol";
10
16
  import {IncoVerifier} from "./IncoVerifier.sol";
11
17
  import {IIncoVerifier} from "./interfaces/IIncoVerifier.sol";
12
18
  import {console} from "forge-std/console.sol";
13
19
  import {CreateXHelper} from "./CreateXHelper.sol";
14
20
  import {IQuoteVerifier} from "./interfaces/automata-interfaces/IQuoteVerifier.sol";
15
-
16
- /// @dev Flag controlling cross-chain deployment authorization.
17
- /// Set to 0x00 to allow same contract at same address on all chains.
18
- /// Set to 0x01 to restrict to single chain deployment.
19
- bytes1 constant CROSS_CHAIN_DEPLOY_AUTHORIZED_FLAG = 0x00;
21
+ import {Salt} from "./periphery/SaltLib.sol";
20
22
 
21
23
  // GLOSSARY
22
24
  // Pepper: a deployment-time string mixed into the salt hash function, used to avoid address collision on deploying
@@ -54,30 +56,6 @@ contract DeployUtils is Script {
54
56
  return createX;
55
57
  }
56
58
 
57
- /// @notice Computes a deployment salt from contract metadata
58
- /// @dev The salt incorporates:
59
- /// - Deployer address (first 20 bytes)
60
- /// - Cross-chain flag (1 byte)
61
- /// - Hash of name, version, and pepper (last 11 bytes)
62
- /// @param name The contract name (e.g., "IncoLightning")
63
- /// @param majorVersionNumber The major version number
64
- /// @param deployer The address that will deploy the contract
65
- /// @param pepper Additional entropy to avoid address collisions
66
- /// @return The 32-byte salt for CreateX deployment
67
- function getSalt(string memory name, uint8 majorVersionNumber, address deployer, string memory pepper)
68
- internal
69
- pure
70
- returns (bytes32)
71
- {
72
- return bytes32(
73
- abi.encodePacked(
74
- deployer,
75
- CROSS_CHAIN_DEPLOY_AUTHORIZED_FLAG,
76
- bytes11(keccak256(abi.encodePacked(name, majorVersionNumber, pepper)))
77
- )
78
- );
79
- }
80
-
81
59
  /// @notice Computes the address a contract will be deployed to using CreateX
82
60
  /// @dev Uses CREATE3 address derivation. The address is deterministic based only on salt.
83
61
  /// @param salt The salt value that will be passed to CreateX
@@ -87,9 +65,10 @@ contract DeployUtils is Script {
87
65
  return createX.computeCreate3DeployAddress({salt: salt});
88
66
  }
89
67
 
90
- /// @notice Full deployment of IncoLightning and IncoVerifier using configuration
91
- /// @dev Computes salts from deployer and pepper, then deploys both contracts.
92
- /// Should be wrapped in prank (testing) or broadcast (production).
68
+ /// @notice Full EOA-broadcast deployment of IncoLightning and IncoVerifier.
69
+ /// @dev Computes salts from deployer and pepper, then deploys both contracts via CreateX.
70
+ /// Should be wrapped in prank (testing) or broadcast (production). For the Gnosis Safe
71
+ /// path, callers should invoke `SafeDeployUtils.proposeAll(...)` directly instead.
93
72
  /// @param deployer The deployer address used in salt for CreateX permissioned deploy protection
94
73
  /// @param owner The address that will own both deployed proxies (can be a multisig)
95
74
  /// @param pepper Entropy string to avoid address collision with previous deployments
@@ -105,6 +84,7 @@ contract DeployUtils is Script {
105
84
  (bytes32 lightningSalt, bytes32 verifierSalt) = getIncoSalts(deployer, pepper);
106
85
  lightningProxy = deployLightning(lightningSalt, verifierSalt, owner);
107
86
  verifierProxy = deployVerifier(verifierSalt, lightningProxy, owner, quoteVerifier);
87
+
108
88
  console.log(
109
89
  "Deploying Inco with executor: %s, owner: %s, lightning salt: %s",
110
90
  vm.toString(address(lightningProxy)),
@@ -124,8 +104,8 @@ contract DeployUtils is Script {
124
104
  pure
125
105
  returns (bytes32 lightningSalt, bytes32 verifierSalt)
126
106
  {
127
- lightningSalt = getSalt(CONTRACT_NAME, MAJOR_VERSION, deployer, pepper);
128
- verifierSalt = getSalt(VERIFIER_NAME, MAJOR_VERSION, deployer, pepper);
107
+ lightningSalt = Salt.getSalt(CONTRACT_NAME, MAJOR_VERSION, deployer, pepper);
108
+ verifierSalt = Salt.getSalt(VERIFIER_NAME, MAJOR_VERSION, deployer, pepper);
129
109
  }
130
110
 
131
111
  /// @notice Deploys the IncoLightning contract with proxy
@@ -140,11 +120,18 @@ contract DeployUtils is Script {
140
120
  returns (IIncoLightning lightningProxy)
141
121
  {
142
122
  address verifierAddress = computeAddressFromSalt(verifierSalt);
143
- IncoLightning lightningImplem = new IncoLightning(lightningSalt, IIncoVerifier(verifierAddress));
123
+ bytes32 implSalt = Salt.getImplSalt(lightningSalt, MINOR_VERSION, PATCH_VERSION);
124
+ address lightningImplem = CreateX(CREATE_X_ADDRESS)
125
+ .deployCreate3(
126
+ implSalt,
127
+ abi.encodePacked(
128
+ type(IncoLightning).creationCode, abi.encode(lightningSalt, IIncoVerifier(verifierAddress))
129
+ )
130
+ );
144
131
  lightningProxy = IIncoLightning(
145
132
  deployProxy({
146
133
  salt: lightningSalt,
147
- implem: address(lightningImplem),
134
+ implem: lightningImplem,
148
135
  initCall: abi.encodeWithSelector(IIncoLightning.initialize.selector, owner)
149
136
  })
150
137
  );
@@ -162,11 +149,13 @@ contract DeployUtils is Script {
162
149
  internal
163
150
  returns (IIncoVerifier verifierProxy)
164
151
  {
165
- IncoVerifier verifierImplem = new IncoVerifier(address(lightning));
152
+ bytes32 implSalt = Salt.getImplSalt(verifierSalt, MINOR_VERSION, PATCH_VERSION);
153
+ address verifierImplem = CreateX(CREATE_X_ADDRESS)
154
+ .deployCreate3(implSalt, abi.encodePacked(type(IncoVerifier).creationCode, abi.encode(address(lightning))));
166
155
  verifierProxy = IIncoVerifier(
167
156
  deployProxy({
168
157
  salt: verifierSalt,
169
- implem: address(verifierImplem),
158
+ implem: verifierImplem,
170
159
  initCall: abi.encodeWithSelector(
171
160
  IIncoVerifier.initialize.selector, owner, VERIFIER_NAME, lightning.getMajorVersion(), quoteVerifier
172
161
  )
package/src/Lib.sol CHANGED
@@ -10,8 +10,8 @@ import { ebool, euint256, eaddress, ETypes, elist, IndexOutOfRange, InvalidRange
10
10
  import { asBool } from "./shared/TypeUtils.sol";
11
11
  import { DecryptionAttestation, ElementAttestationWithProof } from "./lightning-parts/DecryptionAttester.types.sol";
12
12
 
13
- IncoLightning constant inco = IncoLightning(payable(0xB3C06f0Ed967a7E366ba31C67927DDf93d7c1154));
14
- address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
13
+ IncoLightning constant inco = IncoLightning(payable(0xe9CB49A5b16C6D4a093E5900AA8b450FD40541B6));
14
+ address constant deployedBy = 0x9eb3483532302Ab76290BACf9D6DC4efD3fa0d1B;
15
15
 
16
16
  /// @notice Returns the ETypes enum value encoded in a handle
17
17
  /// @param handle The handle to decode
@@ -10,8 +10,8 @@ import { ebool, euint256, eaddress, ETypes, elist, IndexOutOfRange, InvalidRange
10
10
  import { asBool } from "./shared/TypeUtils.sol";
11
11
  import { DecryptionAttestation, ElementAttestationWithProof } from "./lightning-parts/DecryptionAttester.types.sol";
12
12
 
13
- IncoLightning constant inco = IncoLightning(payable(0x3cC345Eaa5bEe457AF9C0C3183335a67b62b0066));
14
- address constant deployedBy = 0x8202D2D747784Cb7D48868E44C42C4bf162a70BC;
13
+ IncoLightning constant inco = IncoLightning(payable(0xe9CB49A5b16C6D4a093E5900AA8b450FD40541B6));
14
+ address constant deployedBy = 0x9eb3483532302Ab76290BACf9D6DC4efD3fa0d1B;
15
15
 
16
16
  /// @notice Returns the ETypes enum value encoded in a handle
17
17
  /// @param handle The handle to decode