# Hoodie launch kit

Current Hoodie launch on Robinhood Chain (chain id 4663). One transaction to `HoodieCreate` v5 launches the token on PONS and creates the Hoodie contracts for that token.

| Contract | Address | Role |
|---|---|---|
| HoodieCreate | `0x3CDB4956CD35F8b865cc3E682a10906773DBe1Df` | Send `launchAndSetup` here |
| PONS launch factory | `0x7eD598BcEf8bd9Edd8C97A195C6d13f40801EC7e` | Launch fee, configs, economics |
| PONS launch router | `0xe33E9E479dF8802cb0866d5d05258bEc4cF62948` | Called by HoodieCreate when the launch includes a buy |
| Hoodie distribution factory | `0xd67D2EBA0D3172D43DBe41F76a7bD85357F9d1C5` | Whale Hit reward escrows |

Each launch creates its own copies of these contracts. `buildLaunchTransaction` returns their addresses before the transaction is sent:

- HoodieCreatorFeeVaultV11 — trading fees and the creator split
- HoodieAutomationCostEscrowV5 — gas budget for claims and payouts
- HoodieWhaleFeeBudgetV5 — Whale Hit quote budget, when Whale Hit is on
- HoodieWhaleRewardInventoryV5 — Whale Hit reward reserve, when the launch pays a reward token

ABIs and the creation bytecode those addresses are computed from are in `contracts/`. Addresses are in `addresses.json`.

There is no registration API. A launch sent to this HoodieCreate is the registration. Hoodie reads `Launched(address creator, address token, address vault)` and shows the token, the vault, and the split. A later `setAllocationWithRecipients` on the vault is read from `AllocationConfigured`. You do not send the new hash.

## Install

```bash
npm install
node example.mjs
```

`example.mjs` reads the live launch fee and prints a transaction. It does not send one. A filled-in launch, with the split, the ETH amounts, and the contracts it creates, is in `EXAMPLE.md`.

## Launch

1. Read `launchFee()` and `previewLaunchEconomics(configId, pairToken)` from the PONS factory. `getLaunchConfig(configId)` shows the curve for that id. Config `0` is the live ETH curve. `approvedPairTokens(pairToken)` must be true for any other pair.
2. Pick a fresh `bytes32` salt. The same salt always produces the same vault.
3. Call `buildLaunchTransaction` in `encodeLaunch.mjs`.
4. Send the returned `to`, `data`, and `value` from the creator wallet on chain 4663.

For an ETH pair, `valueWei` is `launchFee + quoteIn`. `quoteIn` is the creator's ETH buy in wei. Use `quoteIn = 0` to launch without a buy.

For an ERC-20 pair, launch with `quoteIn = 0` and `valueWei = launchFee`. Buy the token in a later transaction. The pair token must already be approved to the launch router for a buy done through the router.

`creatorTaxBps` is the protocol tax in basis points, from 15 to 945. That is a creator fee of 0.70% to 10.00% after the fixed 0.55% base. The vault only accepts curve fee 100, pool fee 100, and protocol share 3000, which is what `previewLaunchEconomics` returns for the current schedule. `expectedEconomics` must be the bytes32 from that call.

`split` is the fee distribution stored in the vault at launch:

- `communityBps` and `buybackBps` are shares of the creator side, in basis points
- `directRecipients` is a list of `{ address, bps }`, at most 50
- the three shares together must be at most 10000
- `settingsHash` is any non-zero bytes32 your platform keeps with that split. The vault stores it. Hoodie stores the same bytes and does not recompute them. Later changes on the vault must present the hash your platform expects.

`keepers` grants the first automation permissions:

- `autoClaim` collects fees into the vault
- `community` pays holders, buyback, and Whale Hit
- `attestor` co-signs the gas budget in the cost escrow

These are optional. Use your own addresses when your platform sends the keeper transactions. Hoodie still indexes the launch and shows the vault's claims, payouts, and buybacks, whichever keeper sent them. Those chain rows show the amount and the transaction. They do not list each wallet paid, because the vault logs carry a recipients hash.

When Hoodie should run those jobs as well, set both `autoClaim` and `community` to `keepers.pool` in `addresses.json`, and set `attestor` to `keepers.attestor`. The pool is one address. Five signers call it, and the vault still sees that one keeper. A launch that names other keepers stays on those keepers.

The cost grant set in the launch allows a gas lot of 0.1 ETH and 0.005 ETH per operation. A claim sets 0.01 ETH of the creator's share aside for that lot before the split is paid out.

The ABIs for the vault, cost escrow, whale budget, inventory, and distribution escrow are in `contracts/`.

`whaleHit` is optional:

- `{ reward: "own-token" }` creates the whale budget and a reward reserve that pays the launched token. The reserve is tied to the distribution factory above.
- `{ rewardToken: "0x..." }` pays that ERC-20 instead
- `{ reward: "budget-only" }` creates the whale budget and no reward reserve
- omit `whaleHit` to launch without Whale Hit

The receipt event is `Launched(address creator, address token, address vault)` on HoodieCreate.
