ICreateX
Title: ICreateX
Author: Vendored minimal subset of CreateX by pcaversaccio + Matt Solomon
(https://github.com/pcaversaccio/createx/blob/main/src/ICreateX.sol). Upstream license: AGPL-3.0-only. Only the deterministic-deploy ABI Lattice calls is re-declared here.
Interface for the canonical CreateX universal deterministic deployer, deployed as a
singleton at 0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed on every supported chain.
Lattice uses the CREATE3 path (address independent of initcode → cross-chain-stable) for the
Diamond + facets, plus the CREATE2 helpers for completeness. The *AndInit / clone overloads
are intentionally omitted. Salt-guarding: first 20 bytes == caller ⇒ permissioned deploy; the
21st byte == 0x01 ⇒ cross-chain redeploy protection.
Functions
deployCreate2
Deploys initCode via CREATE2 using salt (subject to salt-guarding).
function deployCreate2(bytes32 salt, bytes memory initCode) external payable returns (address newContract);Parameters
| Name | Type | Description |
|---|---|---|
| salt | bytes32 | |
| initCode | bytes |
Returns
| Name | Type | Description |
|---|---|---|
| newContract | address | The address the contract was deployed to. |
deployCreate2
Deploys initCode via CREATE2 with a pseudo-random salt.
function deployCreate2(bytes memory initCode) external payable returns (address newContract);Parameters
| Name | Type | Description |
|---|---|---|
| initCode | bytes |
Returns
| Name | Type | Description |
|---|---|---|
| newContract | address | The address the contract was deployed to. |
computeCreate2Address
Computes the CREATE2 address for salt/initCodeHash deployed by deployer.
function computeCreate2Address(bytes32 salt, bytes32 initCodeHash, address deployer)
external
pure
returns (address computedAddress);Parameters
| Name | Type | Description |
|---|---|---|
| salt | bytes32 | |
| initCodeHash | bytes32 | |
| deployer | address |
Returns
| Name | Type | Description |
|---|---|---|
| computedAddress | address |
computeCreate2Address
Computes the CREATE2 address for salt/initCodeHash deployed by this CreateX instance.
function computeCreate2Address(bytes32 salt, bytes32 initCodeHash) external view returns (address computedAddress);Parameters
| Name | Type | Description |
|---|---|---|
| salt | bytes32 | |
| initCodeHash | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| computedAddress | address |
deployCreate3
Deploys initCode via the CREATE3 pattern using salt (subject to salt-guarding).
The resulting address depends only on (CreateX, guardedSalt), NOT on initCode.
function deployCreate3(bytes32 salt, bytes memory initCode) external payable returns (address newContract);Parameters
| Name | Type | Description |
|---|---|---|
| salt | bytes32 | |
| initCode | bytes |
Returns
| Name | Type | Description |
|---|---|---|
| newContract | address | The address the contract was deployed to. |
deployCreate3
Deploys initCode via the CREATE3 pattern with a pseudo-random salt.
function deployCreate3(bytes memory initCode) external payable returns (address newContract);Parameters
| Name | Type | Description |
|---|---|---|
| initCode | bytes |
Returns
| Name | Type | Description |
|---|---|---|
| newContract | address | The address the contract was deployed to. |
computeCreate3Address
Computes the CREATE3 address for the GUARDED salt as deployed by deployer.
Does NOT apply salt-guarding — pass the already-guarded salt to predict a guarded deploy.
function computeCreate3Address(bytes32 salt, address deployer) external pure returns (address computedAddress);Parameters
| Name | Type | Description |
|---|---|---|
| salt | bytes32 | |
| deployer | address |
Returns
| Name | Type | Description |
|---|---|---|
| computedAddress | address |
computeCreate3Address
Computes the CREATE3 address for the GUARDED salt as deployed by this CreateX instance.
Does NOT apply salt-guarding — pass the already-guarded salt to predict a guarded deploy.
function computeCreate3Address(bytes32 salt) external view returns (address computedAddress);Parameters
| Name | Type | Description |
|---|---|---|
| salt | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| computedAddress | address |
Structs
Values
payable amounts for a combined deploy-and-initialise call (unused by the CREATE3/CREATE2
deploy paths Lattice calls, but part of the canonical ABI; retained for signature parity).
struct Values {
uint256 constructorAmount;
uint256 initCallAmount;
}Properties
| Name | Type | Description |
|---|---|---|
| constructorAmount | uint256 | |
| initCallAmount | uint256 |