create2_mine

Scans a bounded local CPU salt range for EIP-1014 CREATE2 addresses. It performs no network I/O, deployment, chain-state lookup, collision check, or vanity-address safety proof.

Example

Local

1
SELECT salt, address::VARCHAR AS address
2
FROM create2_mine(
3
'0x0000000000000000000000000000000000000000'::ADDRESS,
4
keccak256('0x00'::BYTES),
5
0::BIGINT,
6
256::BIGINT,
7
'0x00000000000000000000000000000000000000ff'::ADDRESS,
8
'0x0000000000000000000000000000000000000038'::ADDRESS,
9
1::BIGINT
10
);
11
-- => [{"salt":"0","address":"0x4d1a2e2bb4f88f0250f26ffff098b0b30b26bf38"}]
Notebook ready in readonly mode.

API reference

Exact signatures with descriptions, requirements, inputs, returns, and examples.

create2_mine(ADDRESS, BYTES32, BIGINT, BIGINT, ADDRESS, ADDRESS, BIGINT) # Capped Masked Create2 Scan

Applies bytewise `(address & mask) = (target & mask)` filtering and a positive result cap. The cap does not promise the lowest matching salts in a parallel scan.

Inputs

NameTypeUse
deployerADDRESS

Address that will execute CREATE2. For factory deployments, this is the factory address, not the future contract owner, transaction caller, or deployer key.

requiredpositional
init_hashBYTES32

`keccak256(init_code)`, where complete init code is linked creation bytecode plus ABI-encoded constructor arguments. Runtime bytecode hashes are invalid substitutes.

requiredpositional
salt_startBIGINT

Inclusive non-negative uint64-compatible BIGINT start; NULL defaults to 0.

requiredpositional
salt_countBIGINT

Non-negative uint64-compatible BIGINT count defining `[start, start + count)`; NULL defaults to 100.

requiredpositional
maskADDRESS

20-byte address mask selecting which output address bits must match.

requiredpositional
Showing fewer

Result columns

Name Type
deployer ADDRESS

Deployer address used in the CREATE2 formula

salt UBIGINT

Integer salt in the scanned range, interpreted as a left-padded 32-byte salt

address ADDRESS

Predicted CREATE2 address for deployer, salt, and init_hash

CREATE2 address candidates. Returns deployer, UBIGINT salt, and predicted address sorted by salt. `salt_start` is inclusive and `salt_count` defines `[start, start + count)`. A zero count returns no rows.

Guidance

Range and parallelism

BIGINT start/count must convert to non-negative uint64 values; negatives error. Scans below 10,000 salts use one worker, while larger scans may use host parallelism.

  • The basic overload emits every candidate.
  • The extended predicate is bytewise `(address & mask) = (target & mask)`.
  • `max_results` is a positive result cap, not a guarantee of the lowest matching salts.
  • When parallel scans have more matches than the cap, scheduling can affect which matches survive before final sorting.

NULL compatibility and boundary

Current compatibility behavior is intentionally retained: NULL deployer/init_hash errors; NULL `salt_start` defaults to 0; NULL `salt_count` defaults to 100. In the extended overload, a NULL mask or target disables filtering and also bypasses the supplied cap, leaving the default cap 100; NULL `max_results` also leaves cap 100.

  • Mining is local CPU work only.
  • It does not deploy, query chain state, test address collisions, or prove vanity-address safety.

Additional overloads

create2_mine(ADDRESS, BYTES32, BIGINT, BIGINT) # Complete Create2 Range Scan

Scans a contiguous salt range and emits one row per salt in that window for post-processing in SQL.

Inputs

Name Type Use
deployer ADDRESS

Address that will execute CREATE2. For factory deployments, this is the factory address, not the future contract owner, transaction caller, or deployer key.

required positional
init_hash BYTES32

`keccak256(init_code)`, where complete init code is linked creation bytecode plus ABI-encoded constructor arguments. Runtime bytecode hashes are invalid substitutes.

required positional
salt_start BIGINT

Inclusive non-negative uint64-compatible BIGINT start; NULL defaults to 0.

required positional
salt_count BIGINT

Non-negative uint64-compatible BIGINT count defining `[start, start + count)`; NULL defaults to 100.

required positional

Result columns

Name Type
deployer ADDRESS

Deployer address used in the CREATE2 formula

salt UBIGINT

Integer salt in the scanned range, interpreted as a left-padded 32-byte salt

address ADDRESS

Predicted CREATE2 address for deployer, salt, and init_hash

CREATE2 address candidates. Returns deployer, UBIGINT salt, and predicted address sorted by salt. `salt_start` is inclusive and `salt_count` defines `[start, start + count)`. A zero count returns no rows.

Overload examples

Local SQL

1
SELECT salt, address::VARCHAR AS address
2
FROM create2_mine(
3
'0x0000000000000000000000000000000000000000'::ADDRESS,
4
keccak256('0x00'::BYTES),
5
0::BIGINT,
6
1::BIGINT
7
);
8
-- => [{"salt":"0","address":"0x4d1a2e2bb4f88f0250f26ffff098b0b30b26bf38"}]

Related functions

Category and tags

Tag
CREATE2