Factory_v2

The entry point for deploying new token + bonding curve pairs. Uses CREATE2 with vanity salt enforcement to produce token addresses starting with 0x24.

Contract Type

Singleton — one instance per chain. Not upgradeable, no admin functions.

Write Functions

deploy_pair payable external

Deploy a new token + bonding curve pair with vanity address enforcement.

Parameters
NameTypeDescription
nameString[64]Token name (must be non-empty)
symbolString[32]Token symbol (must be non-empty)
saltbytes32Vanity salt (see Vanity Addresses)
packed_socialsbytes32Packed social links (optional, default empty)
Returns

(address, address) — the deployed token address and bonding curve address.

Value Required

msg.value must equal deployment_fee exactly: 0.0006 ETH (Base) or 0.0012 BNB (BSC).

Reverts
  • "Incorrect fee" — msg.value ≠ deployment_fee
  • "Invalid name/symbol" — empty name or symbol
  • "Invalid salt" — anchor_block is 0
  • "Anchor not mined" — block.number ≤ anchor_block
  • "Too late" — block.number > anchor_block + INCLUSION_WINDOW
  • "Blockhash unavailable" — anchor_block too old (>256 blocks)
  • "Blockhash mismatch" — salt's blockhash prefix doesn't match
  • "Vanity miss" — resulting address doesn't start with 0x24
Emits

PairDeployed(token, curve, deployer, name, symbol, packed_socials)

View Functions

get_config view

Returns the master template addresses.

Returns

(address, address, address) — (token_master, bonding_curve_master, token_socials)

get_deployment_fee view

Returns the deployment fee in wei.

Returns

uint256 — 600000000000000 (Base) or 1200000000000000 (BSC)

get_token_socials view

Returns the TokenSocials registry address.

Returns

address

Events

event PairDeployed:
    token: indexed(address)
    curve: indexed(address)
    deployer: indexed(address)
    name: String[64]
    symbol: String[32]
    packed_socials: bytes32