# Launch a token on NovaPier

Launching is one transaction from the creator's own wallet on one available home chain: Robinhood Chain (4663), BNB Chain (56), Arc (5042) or Base (8453).

- The wallet that sends it is recorded as the token's creator.
- At graduation that wallet receives the token's **Creator NFT** (`NovaCreatorPass`). Creator-fee claims and metadata editing follow whoever holds that NFT.
- No destination chain is named at launch. Optional bridge setup is separate and permissionless after graduation; it opens no destination market (see `after-auction.md`).

## No wallet? Use a link

If you cannot sign, hand your owner a pre-filled launch form. They review it and sign in their own wallet.

```
https://novapier.xyz/launch?home=<robinhood|bnb|arc>&name=<Token Name>&symbol=<TICKER>&ref=<referral code>
```

URL-encode every value. All four parameters are optional:
- **`home`:** picks the home chain, when that home is open on the site.
- **`name`:** up to 32 bytes.
- **`symbol`:** letters and digits only, up to 11 bytes.
- **`ref`:** fills in a referral code. The launch goes through only if that code is verified.

The form still mines the address, checks the name and asks for a picture.

## With a wallet: step by step

### 1. Read the live settings

`GET https://novapier.xyz/api/agent/config`. Pick the entry in `homes` for the chosen chain. It must have `deployed: true` and `paused: false`.

Or read `NovaFactory.getConfig()` on that chain. It returns:

| Field | Meaning |
|---|---|
| `launchFee` | The exact `msg.value` the launch must carry, in the home's native unit (wei; on Arc the 18-decimal native USDC) |
| `raiseTargets` | The three raise targets a launch may pick, ascending (on the site: Light, Standard, Deep), in the auction currency's raw units (wei on Robinhood Chain, BNB Chain and Base; 6-decimal USDC on Arc). Same fees for every one. |
| `minWindowHours`, `maxWindowHours` | Allowed auction lengths, in whole hours (normally 1 to 72; the contract's hard cap is 144) |
| `maxStartDelayHours` | Maximum whole-hour delay before bids open; 0 means only immediate starts |
| `auctionTickBps` | Price tick configured for new auctions |
| `paused` | `true` = launches refuse with `LaunchesPaused` |
| `pendingTerms` | Five frozen fields: bidFeeBps, successFeeBps, referralBps, auctionShareBps, claimDelayBlocks |

### 2. Pick the inputs

```
NovaFactory.launch(
  (string name, string symbol, uint8 windowHours, address referrer, bytes32 nonce, bytes32 metadataHash, uint16 startDelayHours, uint128 raiseTarget) params,
  bytes32 clientTag
) payable returns (address token, address auction)
```

| Field | Rule |
|---|---|
| `name` | 1 to 32 bytes. |
| `symbol` | 1 to 11 bytes. The site allows letters and digits only. |
| `windowHours` | Between the min and max above. The site offers 1, 4, 8, 24 or 48 hours. |
| `referrer` | `0x0000000000000000000000000000000000000000`, or a verified referrer's address. Look one up with `GET https://novapier.xyz/api/referrals?code=<code>` and use `data.address` only when `data.verified` is `true`. |
| `nonce` | A `bytes32` that gives the token an address starting with `0xD0CC` (step 4). |
| `metadataHash` | `0x000…000` is fine. It is only emitted. See `metadata.md` if you want to match the site. |
| `startDelayHours` | Whole hours, 0..maxStartDelayHours. Zero opens now. A later start is fixed at creation: no cancellation or rescheduling. |
| `raiseTarget` | Exactly one of `raiseTargets` (raw units). Anything else reverts `InvalidRaiseTarget`. The auction must raise it to graduate; it is fixed at creation. |
| `clientTag` | Any `bytes32`, or zero. It is only emitted, for stats. |

### 3. Check the name (once)

`GET https://novapier.xyz/api/name-check?name=<name>&symbol=<symbol>` returns `{ available, nameTaken, symbolTaken, nameReason, symbolReason }`.

- The site refuses names and tickers that are already taken on any home.
- It refuses the project's own reserved names as whole words, in either field. Case and look-alike letters are folded first.
- It refuses hidden Unicode characters (zero-width, direction overrides).
- It refuses text its content filter flags.

The contract does not check names. NovaPier can hide launches that break these rules, so launch only when `available` is `true`.

### 4. Mine the nonce

The token address depends on the home's token factory, the name, the symbol, the **creator's address** and the nonce. So only the creator's wallet can mine it, and a new name, symbol or home needs a new nonce.

It is a 16-bit match, about 65,000 tries, which takes seconds on a laptop.

```
npm i viem
curl -O https://novapier.xyz/skill/scripts/mine-nonce.mjs
node mine-nonce.mjs "<name>" <SYMBOL> <creatorAddress> <tokenFactory>
# prints: <nonce> <tokenAddress>
```

- `<tokenFactory>` is `addresses.tokenFactory` of the home in the config endpoint, or `NovaFactory.tokenFactory()` on that chain.
- Check the result with `NovaTokenFactory.computeTokenAddress(name, symbol, 18, creator, nonce)` on that chain. It must return the same `0xD0CC…` address.

The formula, if you mine it yourself:

```
inner   = keccak256(abi.encode(string name, string symbol, uint8 18, address creator, bytes32 nonce))
rawSalt = bytes20(tokenFactory) ++ 0x00 ++ bytes11(inner)
guarded = keccak256(abi.encode(address tokenFactory, bytes32 rawSalt))
proxy   = CREATE2(createX, guarded, 0x21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f)
token   = last 20 bytes of keccak256(0xd6 ++ 0x94 ++ proxy ++ 0x01)
```

Here `createX = 0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed`.

### 5. Build, simulate, get approval, send

- **`msg.value`** must equal `launchFee` exactly.
- **Chain:** the home you picked.
- **`to`:** that home's `addresses.factory`.
- **ABI:** `https://novapier.xyz/skill/abis/NovaFactory.json`

Simulate with `eth_call` first. Then show your owner the chain, the `to` address, the value and every field, and send only after they approve.

### 6. After it lands

- **Read the result.** The receipt's `TokenLaunched` event gives `token`, `auction`, `startBlock`, `endBlock` and the frozen `terms`. Bidding is open at once.
- **Share the page:** `https://novapier.xyz/token/<token>`.
- **Add details (optional):** a picture, description and links. See `metadata.md`.
- **Plan ahead:** when the window ends, someone must graduate it. See `after-auction.md`.

## Errors

| Error | Meaning |
|---|---|
| `LaunchesPaused()` | Launches on this home are paused. Try later or another home. |
| `InvalidLaunchFee(sent, required)` | Re-read `launchFee`: the value must match exactly. |
| `InvalidWindowHours(given, min, max)` | Pick hours inside the bounds. |
| `InvalidNameOrSymbol()` | The name or symbol is empty or too long. |
| `AddressPrefixMismatch(address)` | The nonce was not mined for this token factory, name, symbol and creator. |
| `TokenAlreadyDeployed(address)` | That identity was already used. Mine a new nonce. |
