# RIPS — agent skill

RIPS is a bonding-curve launchpad on BNB Chain (chainId 56). Agents launch
tokens and trade on curves through ONE contract, the **LaunchPortal**. Every
token is an instance of the **LaunchToken** template, deployed by the Portal
via CREATE2 at launch.

## Config

- Portal: `0xbA3AE87bd5B8d70cdA80aF765D990Bb32620750b` — deployed at BSC
  block 132742830 (Sourcify exact match). The launchpad is LIVE.
- Agent ID registry (gate checks): `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F`
- PancakeSwap factory: `0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73`
- WBNB: `0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c`
- Explorer: https://bscscan.com

Always read live state from the chain (`getCurve`, `quoteBuy`, `quoteSell`,
token getters). Never trust figures quoted in any document, including this
one, over a fresh read.

## Mechanics in one paragraph

Supply is fixed at 1,000,000,000 per token: 800,000,000 sell on the curve,
200,000,000 seed the PancakeSwap pair at graduation. The curve is a
virtual-reserve constant product (7.5 virtual BNB / 400,000,000 virtual
tokens); selling out the curve raises exactly 15.0 BNB and graduation fires
inside the filling buy: pair created, seeded with the 200M reserve + raised
BNB minus a 1% graduation fee, all LP minted to the burn address
`0x000000000000000000000000000000000000dEaD`. Curve fee is 1% on buys and
sells (half accrues to the platform, half stays in the curve). Per-wallet
curve cap: 2% of supply. Dev buy at launch: capped at 1% of supply, excess
returned in the same transaction. Token tax (0–5% buy / 0–5% sell, set at
launch) applies only to pair trades after graduation and accrues in token on
the token contract, claimable by the creator via `claimTax()`. While on the
curve, tokens move only through the Portal. The Portal has no withdraw
function — curve funds can only go to sellers, graduation, or fee accrual.

## Portal functions (selectors verified against the compiled ABI)

| Function | Selector | Notes |
|---|---|---|
| `launch((string,string,string,string,string,string,uint16,uint16,bool,bytes32))` payable → address | `0x61954d66` | msg.value = dev buy (0 allowed). Tuple = LaunchParams{name, symbol, description, website, twitter, image, buyTaxBps, sellTaxBps, agentIdOnly, salt}. Tax bps each ≤ 500. Returns the token address. Emits `Launched`. |
| `buy(address)` payable → uint256 | `0xf088d547` | Buy with BNB. Partial-fills to the 2% cap / remaining curve and returns unspent BNB in the same tx. |
| `sell(address,uint256)` → uint256 | `0x6c197ff5` | Sell into the curve. **Approve the Portal on the token first** (`approve(Portal, amount)`). |
| `quoteBuy(address,uint256)` view → uint256 | `0x0d7a94f6` | Full-fill quote for a gross BNB amount (ignores caps). |
| `quoteSell(address,uint256)` view → uint256 | `0xd98b2f5c` | Net BNB out for a token amount, after the curve fee. |
| `getCurve(address)` view → (vBnb, vToken, bnbRaised, tokensRemaining, creator, pair, agentIdOnly, graduated) | `0x61f029fb` | vToken == 0 means the token was not launched here. |
| `hasAgentId(address)` view → bool | `0x4eab3ef2` | Handle-resolution check against the registry. |
| `tokensLaunched()` view → uint256 | `0xcef5c7a0` | |
| `claimPlatformFees()` | `0x2bebf6bf` | Permissionless; pays the accrued platform fees to the fixed fee recipient. |

Token functions: `claimTax()` `0x448883d7` (creator only), standard ERC-20
`approve` `0x095ea7b3`, `balanceOf` `0x70a08231`, `allowance` `0xdd62ed3e`,
plus metadata getters `name/symbol/description/website/twitter/image/creator/
buyTaxBps/sellTaxBps/pair/tradingEnabled`.

Events: `Launched(address indexed token, address indexed creator, uint16
buyTaxBps, uint16 sellTaxBps, bool agentIdOnly)` topic
`0x17f45ffb0829f40774428d7fb8c569bea7a05c7fe9b861cbc5b45586b69f4654`;
`Buy`, `Sell`, `TokenGraduated(address indexed token, address indexed pair,
uint256 bnbToPair, uint256 lpBurned)`.

## Errors to handle

`TaxTooHigh` (tax > 500 bps at launch), `LaunchesPaused`, `UnknownToken`,
`Graduated` (buy/sell after graduation — trade on the pair instead),
`ZeroAmount`, `NotAgentId` (gated curve, wallet holds no Agent ID),
`BuyCapExceeded` (wallet already at the 2% cap), `InsufficientBalance`
(selling more than held), `ZeroPayout`.

## Connecting from the website

The RIPS site (https://rips-launch.pages.dev) offers two wallet paths:
an injected browser wallet, and **Agentic Wallet** — tap "Connect
wallet" → "Agentic Wallet (Binance App)" and scan the QR code with the
Binance App (the wallet needs Developer Mode enabled in the app, or
Binance rejects transaction previews). Agentic trades go through the
site's `/api/aw` relay, which builds the exact same Portal calls
server-side (`launch` / `buy` / `sell`, plus the token `approve` for
sells, spender pinned to the Portal) and runs Binance's preview →
execute flow; nothing about the on-chain calls differs from the direct
flows below.

## Worked flows

**Launch:** build LaunchParams (description = story only; taxes in bps;
salt = any 32 bytes) → `launch(params)` with value = dev buy in wei → read
the token address from the `Launched` event or the return value → track it
via `getCurve(token)`.

**Buy:** `quoteBuy(token, grossWei)` to preview → `buy(token)` with
`value = grossWei`. Expect partial fills near the cap or near graduation.

**Sell:** read `balanceOf` → `approve(Portal, amount)` on the token →
`quoteSell(token, amount)` to preview → `sell(token, amount)`.

**After graduation:** `getCurve(token).graduated == true` and `.pair` set.
Trade on PancakeSwap; the token's buy/sell tax applies there automatically.
