Skip to main content
In this guide, you’ll launch a token on Robinhood Chain by calling BagsFactory directly. A single transaction deploys the token, its bonding curve, and its fee-share contract, mints the fixed supply to the curve, and registers everything on-chain. You can optionally include an atomic initial buy in the same transaction.

Prerequisites

Before starting, make sure you have:
  • Completed the Environment Setup (chain.ts, addresses.ts, clients.ts, and the ABIs).
  • Read the Overview for the token lifecycle and fee model.
  • ETH in your wallet to cover the creation fee (default 0.02 ETH — read it live), any initial buy, and gas.

1. How Launching Works

BagsFactory exposes two launch entry points: Both take the same arguments:
The partner’s fee rate is not a launch parameter: the factory’s global partnerFeeBps (default 2500) is snapshotted into the launch, and the partner is paid from the protocol half of trading fees — it never reduces the claimers’ share. See section 6. With createAndBuy, the factory spends the entire surplus above creationFee on an atomic buyFor(msg.sender, 1) — there is no front-run window, and if the buy would cross the graduation threshold the excess is auto-refunded.
The returned token and curve addresses, plus the feeShare, partner, and poolId, must be read from the TokenCreated event in the receipt. Per-launch addresses are not predictable before the launch.

2. Fee Claimers Rules

The claimers / bps arrays configure who earns the creator half (1%) of trading fees. The factory enforces:
  1. 1 to 100 claimers, with claimers.length == bps.length.
  2. Each claimer address is valid, non-zero, and unique, and not equal to the partner.
  3. Each bps is a uint16, and all bps sum to exactly 10000 (100%). The factory enforces only the sum — individual shares of 0 are accepted on-chain. The client validator below additionally requires each share to be >= 1 as a sensible default (a 0-bps claimer would never earn).
The simplest setup is a single claimer (the creator) at 10000 bps. Validate client-side before signing — an on-chain revert still costs gas.
When splitting a percentage across claimers, have the last claimer absorb any rounding remainder so the total lands on exactly 10000.

3. Prepare Metadata

metadataURI should point to a JSON document describing the token (name, symbol, description, image, socials), typically hosted on IPFS. Upload it however you like and pass the resulting URI (e.g. https://ipfs.io/ipfs/...). This guide assumes you already have a metadataURI.

4. The Launch Script

Save this as launch-token.ts. It validates claimers, reads the live creation fee, simulates, sends, and parses the receipt.
launch-token.ts

5. Run Your Script

On success you’ll see the token, curve, feeShare, and poolId addresses. Save the token address — it’s the identifier you’ll use everywhere else.

6. Splitting Fees Among Multiple Claimers

To share the creator side with additional wallets, list each with its bps. The example below gives the creator 50%, and two collaborators 30% and 20%:
To include a partner, pass a non-zero partner address. The partner’s cut comes from the protocol half of trading fees, not from the claimers: the factory’s global partnerFeeBps (default 2500 = 25% of the protocol half = 0.25% of volume) is snapshotted at launch, the partner accrues that share in the token’s BagsFeeShare, and the vault receives the remainder. The claimers always split the full creator half regardless of partner. The partner must not also appear in claimers. See the Partner Program guide for the full partner workflow (tracking tokens, reading earnings, claiming).

7. What Happens Next

After launch, the token trades on its bonding curve. Buyers send ETH to the curve to receive tokens; the creator side of every trade fee accrues to the feeShare contract. When enough ETH is raised, the token graduates to a Uniswap v4 pool.

Troubleshooting

  • BagsFactory_InsufficientCreationFee — you sent less than creationFee(). Read the fee live and set value accordingly.
  • BagsFactory_NoClaimers — the claimers array is empty. Pass at least one claimer.
  • BagsFactory_InvalidClaimers — the config failed a rule in section 2: claimers.length != bps.length, a duplicate or zero address, a claimer equal to the partner, more than 100 claimers, or bps that don’t sum to 10000.
  • BagsFactory_BuyFailed(curve, value) — the atomic initial buy in createAndBuy reverted (e.g. slippage or curve state). Lower the buy value, or call create and buy separately.
  • BagsFactory_NoBuyValue — you called createAndBuy with value == creationFee (nothing left to buy with). Either add buy value or call create.
  • Simulation reverts before sending — the decoded custom error tells you exactly which rule failed; fix the inputs and retry. Simulating first means you never waste gas on a doomed launch.
For the full function, event, and error catalog, see the Contracts Reference.