A launch is one init transaction. Everything a collection is — supply, price, fee, payout addresses and the generator — is fixed there and can’t be changed afterwards.
1. Fix the generator
Finish the generator first. Its hash goes into the header, and a single changed byte breaks verification for every front end. Hash the exact file you will serve:
import { createHash } from "node:crypto";
import { readFileSync } from "node:fs";
const generatorHash = createHash("sha256").update(readFileSync("generator.js")).digest();
2. Choose parameters
| Parameter | Type | Notes |
|---|---|---|
nonce |
u32 | Any value not used before by this creator. Part of the address. |
maxSupply |
u16 | 1 to 65,535. Can only go down, when the creator closes the mint early. |
mintPrice |
u64 | Lamports per token, paid to the creator. 0n for a free mint. |
feeBps |
u16 | 0 to 1,000. Market fee on every sale, paid to the treasury. |
treasury |
Address | Receives the market fee. Can be the creator. |
3. Initialize
import { findCollection, initIx } from "@gl-36/sdk";
const nonce = 1;
const [collection] = await findCollection(PROGRAM, creator.address, nonce);
await send(creator, [
initIx(PROGRAM, creator, collection, treasury, {
nonce,
maxSupply: 5_000,
feeBps: 200, // 2%
mintPrice: 10_000_000n, // 0.01 SOL
generatorHash,
}),
]);
init creates the account at 224 bytes. The creator pays its rent — about 0.0018 SOL at today’s rate — and the network fee.
4. Mint
The mint is open as soon as init lands. Anyone can call mint with 1 to 10 tokens per instruction; several mint instructions can share a transaction. Front ends show a placeholder until the collection is settled.
5. Close and settle
The mint closes itself when the last token is minted. To end it early, the creator calls close: supply stops at the tokens minted so far.
import { closeIx, settleIx } from "@gl-36/sdk";
await send(creator, [closeIx(PROGRAM, creator, collection)]);
About 13 seconds later — 32 slots after the close — anyone can call settle. It takes the hash of that later slot as the entropy, and from then on every token’s seed, and so its content, can be computed by anyone.
await send(anyone, [settleIx(PROGRAM, collection)]);
6. Withdraw surplus rent
Whenever Solana lowers rent, call withdraw_excess. It is safe to call at any time.
await send(creator, [withdrawExcessIx(PROGRAM, creator, collection)]);
Generator final and hashed · nonce unused · treasury address correct and funded with the rent-exempt minimum · fee and price as intended. None of these but the treasury’s balance can be edited after init.