> ## Documentation Index
> Fetch the complete documentation index at: https://docs.o1.exchange/llms.txt
> Use this file to discover all available pages before exploring further.

# Smart contract architecture

> How the factory, launch hook, fee escrow, vesting vault, announcement registry, and launch tokens work together.

The production system uses separate contracts for token creation, permanent liquidity, fee balances, vesting, and announcements. Each contract has a narrow responsibility, which makes its authority and custody easier to verify.

<CardGroup cols={1}>
  <Card title="Launch path" icon="rocket">
    The creator signs one factory transaction. It creates and distributes the token, opens the Uniswap v4 pool, and places the remaining supply into the permanent liquidity position.
  </Card>

  <Card title="Trading path" icon="arrow-right-arrow-left">
    The trader signs a swap through Uniswap. The launch hook applies the fee, the user receives the trade output, and the fee escrow records claimable balances.
  </Card>
</CardGroup>

## Contract responsibilities

| Contract                 | Responsibility                                                                                 | Custody or authority                                                             |
| ------------------------ | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| Base crypto factory      | `B20LaunchpadFactory` creates B20 tokens paired with registered crypto assets                  | Controls settings for future crypto-paired launches only                         |
| Base stock factory       | `RWAB20LaunchpadFactory` is deployed for a future B20 stock-paired route                       | Becomes available when its shared quote catalog and live factory state are ready |
| Robinhood crypto factory | `ERC20LaunchpadFactory` creates ERC-20 tokens paired with ETH or USDG                          | Controls settings for future crypto-paired launches only                         |
| Robinhood stock factory  | `RWAERC20LaunchpadFactory` creates ERC-20 tokens paired with one of 96 registered Stock Tokens | Maintains stock quote revisions and future opening settings                      |
| Token deployer           | `LaunchTokenDeployer` creates the fixed-supply Robinhood token for the launch factory          | Callable only by the factory; holds no user funds                                |
| Launch hook              | `LaunchHook` opens approved pools, owns permanent positions, and applies swap fees             | Owns and permanently locks launch liquidity positions                            |
| Fee escrow               | `FeeEscrow` records and pays each recipient's swap-fee balance                                 | Can pay only balances credited by the hook                                       |
| Vesting vault            | `VestingVault` stores and releases vested allocations                                          | Has no administrator; schedules are set once                                     |
| Announcement registry    | `AnnouncementRegistry` publishes creator-authenticated announcements                           | Has no token authority and holds no funds                                        |
| Robinhood token          | `LaunchToken` is the fixed-supply ERC-20 implementation                                        | Has no owner or administrative control                                           |

## Factory: launch coordination

`createLaunch` coordinates the complete launch. The selected chain and paired asset determine the available factory. Base currently uses its crypto factory to create native B20 tokens. Robinhood uses its crypto or stock factory to create fixed-supply ERC-20 tokens. Every available route follows the same distribution and market-opening process.

| Stage            | Factory behavior                                                                                                                                             |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Validate         | Confirms the selected paired asset, route, current creation fee, deadline, supply distribution, vesting schedules, profile-editing choice, and launch limits |
| Create token     | Creates the fixed supply and verifies the expected immutable token properties                                                                                |
| Distribute       | Sends immediate allocations to recipients and vested allocations to `VestingVault`                                                                           |
| Configure market | Records the creator, platform fee receiver, fee split, anti-snipe schedule, currencies, and exact pool identity with `LaunchHook`                            |
| Open pool        | Initializes the Uniswap v4 pool at the configured opening price                                                                                              |
| Seed liquidity   | Sends the remaining token supply to the permanent position owned by the hook                                                                                 |
| Publish result   | Emits the token address, creator, pool ID, quote, supply, and spacing in `Launched`                                                                          |

The factory owner may update paired assets, supply, opening prices, liquidity ranges, fees, the platform fee receiver, and announcement support for future launches. The stock factories also support bounded quote batches, per-quote revisions, a restricted opening-price updater, and a switch for new stock-paired creation. Those changes cannot rewrite a completed token or pool.

## Stock quote controls

Stock-paired factories keep their quote registry separate from crypto-paired factories.

| Control            | Purpose                                                                                                 |
| ------------------ | ------------------------------------------------------------------------------------------------------- |
| Quote registration | Adds a supported Stock Token and its opening-price frame                                                |
| Quote revision     | Prevents a stale price update from overwriting a newer one                                              |
| Price updater      | May update the opening frame of an existing stock quote, but cannot add or remove assets or change fees |
| Creation switch    | Pauses only new stock-paired launches; existing pools continue trading and claiming                     |
| Batch limit        | Bounds one quote-management transaction to 64 entries                                                   |

Robinhood currently has 96 published stock quotes. No Base stock catalog is published yet. Deployment alone does not expose a route: the platform also requires catalogued quotes to be registered on the live factory with creation enabled.

## LaunchHook: market enforcement

Each pool receives a frozen configuration when it is created. The hook then enforces the launch market throughout its lifetime.

| Responsibility | Behavior                                                                                                                                                                        |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Pool gate      | Accepts initialization only for a factory-registered launch                                                                                                                     |
| Liquidity seed | Creates the token-only position and verifies that no paired asset is required                                                                                                   |
| Permanent lock | Rejects every removal and every external liquidity addition                                                                                                                     |
| Anti-snipe     | Calculates the timestamp-based opening surcharge in the paired asset                                                                                                            |
| Fee accounting | Splits the base fee between creator, platform, and valid referrer                                                                                                               |
| Trade record   | Publishes the callback executor, referrer, fee currency, fee amount, and optional comment in the `Trade` event; direction and trader attribution come from the complete receipt |

During the opening anti-snipe period, `LaunchHook` keeps o1's input-amount buy and sell flow open while applying the temporary surcharge. It rejects exact-output requests until the total fee reaches the normal 1% rate.

The detailed callback and function surface is available in [Functions and events](/launchpad/reference/events-functions).

## Escrow, vesting, and announcements

`FeeEscrow` tracks claimable balances in each pool's paired asset. Anyone can trigger payment to the recorded recipient, while a recipient can also redirect their own claim. Only the launch hook can add new fee credits.

`VestingVault` shows each schedule and the amount available now. Anyone can trigger a claim, but payment always goes to the recorded beneficiary. Only the factory can create a schedule, and no administrator can change or recover it later.

`AnnouncementRegistry` records the creator at launch. That creator can later post announcements with a unique ID, description, and URI without receiving any token administration role.

## Trust boundaries

* The factory owner can change defaults for launches that have not happened yet.
* The factory owner cannot change an existing pool or token.
* The hook can credit fees only according to frozen pool configuration.
* The escrow can pay only swap fees already credited to it.
* The vesting vault can send tokens only to the recorded beneficiary.
* Transaction signing stays in the user's wallet; o1 services never hold signing keys.
