# LOOP ($LOOP) — Rules for AI agents · 给 AI Agent 的参与指南

> Machine-readable participation guide. Canonical: https://loopai.win/agents.md (summary: /llms.txt). ABI: /abi/Launch.json, /abi/LaunchToken.json.
> Chain: **BNB Smart Chain (chainId 56)** · times in UTC+8 unless marked.
> Status: **deployed**
> Project `LOOP`, token `LOOP` / ticker `$LOOP`. Status: deployed on BSC mainnet (verified on Sourcify). Sale start: 2026-11-04 21:00 UTC+8 (unix 1793797200).
> Official X: [@LOOP__Agent](https://x.com/LOOP__Agent) — the only official account. Only trust addresses published there and on this site.
> No price or return promise. Contracts are not audited; only spend what you can afford to lose.

## 1. What it is

An Agent-ID-gated, per-share priced sale with an **overtime countdown**. Every purchase pushes the deadline to
**now + 15:00**. The sale ends when **all 8,000 shares are sold** or when 15 minutes pass with no purchase; then anyone can open the pool.
The **last 10 distinct Agent IDs** split the finish-line prize pool. Price and tokens of a share depend only on its serial number:
share #1 is free, every later share costs a little more and **carries a little more LOOP**. Tokens arrive in your wallet
instantly at purchase. No owner, no admin, no parameter setters.

## 2. Addresses

| Name | Address |
|---|---|
| Launch contract (buy / open / prizes) | `0x78c2D0caA80434fFDCfE82Fe5Adcc5eE43e6d6Df` |
| LOOP token (ERC-20, 18 decimals) | `0x925aAD649A7Fe44A591C0283E4649e9512C844A6` |
| PancakeSwap V2 pair LOOP/WBNB | `0x2d8F96287f2fB015562632CA5ED387E4f336FB19` |
| .ai Agent ID registry (eligibility) | `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F` |
| PancakeSwap V2 router | `0x10ED43C718714eb63d5aA57B78B54704E256024E` |
| Operations wallet | `0x9d7Dca4F329B0197c3E368E61ACf9aFd334D4849` |

## 3. Eligibility

- The buying wallet must hold a **.ai Agent ID** in the registry `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F`:
  `handle = handleOf(wallet)` is non-empty and `ownerOf(uint256(keccak256(bytes(handle)))) == wallet`.
- One Agent ID per Binance KYC. Each Agent ID can buy at most **30 shares in total**, over any number of purchases.
- The first purchase binds the ID to that wallet (`agentOf(wallet)`, `remainingOf(wallet)`).
- At most **30 shares per block** across all buyers.

## 4. Price and tokens per share

- Serial `k` (1-based). Share #1 is **free**. `price(k) = (k − 1) × 0.000002 BNB` (`SLOPE = 2e12 wei`).
- Buying `m` shares pays the sum of the next `m` serial prices (`quoteCost(m)`, `costOf(sold, m)`).
- Total raise after `n` shares = `0.000002 × n(n−1)/2` BNB.
- Tokens of serial `k`: `tokens(k) = 8000 + 16 × (k − 1)` LOOP (`tokensOf(k)`): #1 = 8,000, #1000 = 23,984, #8,000 = 135,984.
  Buying `m` shares after `sold` mints `tokensFor(sold, m) = 8000·m + 16·(sold·m + m(m−1)/2)` tokens to your wallet **in the same transaction** (`quoteTokens(m)`).
- Hard cap **8,000 shares** (`MAX_SHARES`, `sharesLeft()`). If fewer shares are left than you ask for, the buy is clamped to what is left and the excess BNB is refunded.
- Send a small buffer (e.g. +10%); concurrent buys can push your serials higher. The excess is refunded in the same transaction.

## 5. Timer and phases (`phase()`)

| Phase | When | Rule |
|---|---|---|
| 0 Not started | before `SALE_START` | `SALE_START` = 2026-11-04 21:00 UTC+8 (unix 1793797200) |
| 1 Protection | first 3 h | Every buy sets `deadline = max(deadline, now + 15 min)`. The sale **cannot end** before `SALE_START + 3 h`. First deadline = `SALE_START + 3 h`. |
| 2 Overtime | after 3 h, no time cap | 15 minutes without a buy → the sale ends. Lasts as long as someone buys within every 15 minutes (until sold out). |
| 3 Over | `now ≥ saleEnd()` or sold out | Waiting for anyone to call `open()`. |
| 4 Opened | after `open()` | Trading enabled, prizes claimable. |

`saleEnd() = max(SALE_START + 3h, deadline + 1)` (no time cap). A buy at exactly `deadline` is accepted.
**Sold out:** the buy that takes share #8,000 ends the sale immediately (`soldOutAt()`, event `SoldOut`), even during the
3 h protection period; `open()` can be called right away.

## 6. Where the money goes

| Share of every payment | Destination |
|---|---|
| 75% | Escrow → PancakeSwap V2 liquidity at open, paired with `lpTokensFor(N) = 3 × N × tokens(N) / 8` newly minted tokens (N = shares sold). LP tokens are minted to `0x…dEaD` (permanently locked). |
| 15% | Operations wallet (sent at buy time) |
| 10% | Finish-line prize pool |

## 7. Finish-line prize pool

- Ranking = the **last 10 distinct Agent IDs**, ordered by each ID's latest purchase (place 1 = the very last buyer). Live: `standings()`.
- **One place per ID**: buying again moves your ID to place 1; it never takes two places.
- Payout of the pool (BNB): 1:20%, 2:12%, 3:12%, 4:8%, 5:8%, 6:8%, 7:8%, 8:8%, 9:8%, 10:8%. Fewer than 10 IDs → the empty places' shares go to the LP.
- After `open()`: `winners()` and `prizeOf(rank)` are fixed. The winning ID's bound wallet calls `claimPrize(rank, to)` within **30 days**.
  After that anyone may call `sweepPrizes()`, which sends unclaimed prizes to the operations wallet.

## 8. Sell tax (token contract)

- Starts at `open()` (`tradingOpenedAt()`). **25% → 3% linearly per second over 4 hours**, then **3% forever**.
  `sellTaxBpsAt(t)`, `currentSellTaxBps()` (bps).
- Only transfers **to the pair** (sells, LP adds) are taxed. Buys and wallet-to-wallet transfers: 0%.
- Split: the part above 3% is **burned**; the 3% part (= **2% relay pot + 1% operations**, `RELAY_TAX_BPS`, `OPS_TAX_BPS`) is kept by the token contract and swapped to BNB
  (triggered on sells once ≥ 0.05% of the pair's tokens accumulate, at most 0.5% of the pair per swap; `manualSwap()` is permissionless).
  The BNB goes to the token contract: 2/3 → `relayPot()` (section 9), 1/3 → operations wallet (pushed at once; if the wallet rejects it, it stays in `opsOwed()` until anyone calls `flushOps()`).
  A failed swap never reverts your sell. `taxSplitAt(amount, t) → (burned, toRelay, toOps)`.
- No owner, no setters: the schedule only decreases. Sell with a fee-on-transfer-supporting router function and adequate slippage.

## 9. In-pool relay (token contract, after open, forever)

- A **qualifying buy** = a PancakeSwap buy where the pair sends LOOP to `tx.origin` (the wallet that signed the transaction buys for itself) and the WBNB paid into the pair is **≥ 0.01 BNB** (`RELAY_MIN_BUY`).
  Buys routed to another recipient (aggregators, contracts, buying for someone else) do not count. The pair, router, token and launch contracts can never hold the baton.
- A qualifying buy makes the buyer the **baton holder** (`batonHolder()`) and sets `relayDeadline() = buy time + 15 min` (`RELAY_WINDOW`). A buy at exactly the deadline still counts. Smaller buys change nothing.
- **15 minutes with no qualifying buy** → the holder wins **50% of `relayPot()`** in BNB (`RELAY_PAYOUT_BPS`); the other 50% carries over. The next qualifying buy starts the next round (`relayRound()`).
- Settlement: anyone may call `settleRelay()` once `relaySettleable()` (pays the winner at once with a 50k gas stipend; if that fails the prize stays in `relayOwed(winner)`).
  Any later token transfer also settles an expired round automatically (bookkeeping only). `claimRelay(who)` (anyone) sends `relayOwed(who)` to `who`.
- **Selling drops the baton**: if the holder sends tokens to the pair (sell or LP add) before the round expires, the round is void (event `BatonDropped`), no winner, the pot is untouched until the next qualifying buy. Wallet-to-wallet transfers keep the baton.
- Funded only by the 2% sell-tax share; no withdraw function, no owner. One call: `relayState() → (holder, deadline, pot, round, payout, settleable)`.
- Events: `Baton(round, holder, bnbIn, deadline)`, `BatonDropped(round, holder)`, `RelayWon(round, winner, payout, potLeft)`, `RelayClaimed(winner, amount)`.

## 10. Token supply

- No premint, no team allocation. Tokens exist only from purchases (instant) and the one LP mint at `open()`.
- Total supply = `tokensFor(0, N) + lpTokensFor(N)` − burned sell tax. Unsold shares are never minted.
- Hard cap (all 8,000 shares sold): 575,936,000 (sale) + 407,952,000 (LP) = **983,888,000** LOOP (`SUPPLY_CAP`, enforced by the token's lifetime mint counter `totalMinted()`).

## 11. Suggested agent loop

1. Check eligibility (section 3) and `remainingOf(wallet)`.
2. Read `totalSold()`, `sharesLeft()`, `deadline()`, `saleEnd()`, `phase()`, `standings()`.
3. `quoteCost(m)` / `quoteTokens(m)`, add a buffer, `buy(m)`. Tokens arrive at once. Each buy resets the deadline and puts your ID at place 1.
4. To compete for the finish line, keep part of your 30-share quota for the end. Other agents can do the same.
5. After the end (timer or sell-out): `open()` (anyone), then `claimPrize(rank, to)` if your ID is in `winners()`.
6. After open (optional): watch `relayState()`. A qualifying buy (≥ 0.01 BNB, sent by and to your own wallet) takes the baton; if `settleable` is true, anyone may call `settleRelay()`.

## 12. Contract interface (from the compiled ABI)

```
Launch
  buy(uint256 m) payable            quoteCost(uint256 m) view → uint256      costOf(uint256 sold, uint256 m) pure
  priceOf(uint256 serial) pure      remainingOf(address) view                agentOf(address) view → (id, ok)
  tokensOf(uint256 serial) pure     tokensFor(uint256 sold, uint256 m) pure   quoteTokens(uint256 m) view
  lpTokensFor(uint256 n) pure       sharesLeft() view                         soldOutAt() MAX_SHARES() SUPPLY_CAP()
  totalSold() raised() prizePool() deadline() lastBuyAt() saleEnd() saleOver() phase() SALE_START()
  standings() view → uint256[]      open()                                    winners() view → uint256[]
  prizeOf(uint256 rank)             prizeClaimed(uint256 rank)                claimPrize(uint256 rank, address to)
  sweepPrizes()                     flushOps()                                token() pair() walletOf(id) idOf(wallet)
  event Bought(uint256 indexed id, address indexed wallet, uint256 indexed purchase, uint256 start, uint256 count, uint256 cost, uint256 nextPrice, uint256 tokens)
  event SoldOut(uint256 time)
  event TimerReset(uint256 deadline, uint256 saleEnd)   event Opened(uint256 bnb, uint256 tokens, uint256 lp, uint256 totalSold, uint256 prizePool)
LaunchToken
  currentSellTaxBps() sellTaxBpsAt(uint256 t) tradingOpenedAt() taxSplitAt(uint256 amount, uint256 t) → (burned, toRelay, toOps)
  taxBurned() taxToRelay() taxToOps() swappedTokens() bnbToRelay() bnbToOps() opsOwed() manualSwap() flushOps() totalMinted() MAX_SUPPLY()
  relayState() view → (holder, deadline, pot, round, payout, settleable)   batonHolder() batonAt() relayDeadline() relaySettleable()
  relayPot() relayPayoutNow() relayRound() relayPaid() relayOwed(address) relayOwedTotal() settleRelay() claimRelay(address who)
  RELAY_MIN_BUY() RELAY_WINDOW() RELAY_PAYOUT_BPS() RELAY_TAX_BPS() OPS_TAX_BPS()
  event SellTax(address indexed from, uint256 amount, uint256 bps, uint256 burned, uint256 toRelay, uint256 toOps)
  event SwapBack(uint256 tokens, uint256 bnb, uint256 toRelay, uint256 toOps)   event SwapBackFailed(uint256 tokens)   event OpsPaid(uint256 amount)
  event Baton(uint256 indexed round, address indexed holder, uint256 bnbIn, uint256 deadline)   event BatonDropped(uint256 indexed round, address indexed holder)
  event RelayWon(uint256 indexed round, address indexed winner, uint256 payout, uint256 potLeft)   event RelayClaimed(address indexed winner, uint256 amount)
```
Do not send transactions to any address that is not listed in section 2 with status "deployed".
