# BurnHook mechanics

How the protocol works, in the order things happen. Numbers here mirror the contract constants;
if they ever disagree with `Lens.constants()`, the chain is right.

## Contracts

| Contract | Role |
|---|---|
| BurnToken (BURN) | The token. Fair mint, referral accounting, dev share, refunds, pre-trading transfer lock. |
| BurnHook | Uniswap V4 hook. Creates the pool at finalize, locks the liquidity, gates trading, takes the 1% fee. |
| XBurn (xBURN) | Received 1:1 for burning BURN. Earns the swap fees. |
| WrappedXBurn (wxBURN) | ERC4626 vault over xBURN that auto-compounds. Safe to trade on DEXes. |
| BurnSwapRouter | Minimal router for buying/selling BURN against the V4 pool. |
| BurnHookLens | Read-only aggregator. Holds no funds; the core contracts do not depend on it. |

None of them has an owner, an upgrade mechanism or a pause switch. The deployer can only wire the
hook and open the mint; `startMint()` clears the deployer role permanently.

## 1. Mint (phase 1, MINTING)

- 0.005 BNB per mint → 1,000 BURN. Same price for everyone.
- 14,000 mints in total; at most 100 per wallet.
- Window: 3 days from `startMint()`. Reaching 14,000 ends it immediately (phase 2).
- Gate: the wallet must hold a Binance Agent ID — a soulbound (non-transferable) ERC721 issued by
  SPACE ID. One identity cannot be lent to other wallets.
- Referrer: every wallet except the very first minter must name a referrer on its first mint. The
  referrer must already have minted 10 times. The binding is permanent.
- Minted BURN cannot be transferred until trading opens.

## 2. Where each mint's 0.005 BNB goes

| Share | Amount | To | When payable |
|---|---|---|---|
| ≥ 65% | ≥ 0.00325 BNB | Liquidity pool | At finalize, automatically. |
| 20% | 0.001 BNB | DEV address (fixed at deploy, cannot change) | After the mint succeeds. |
| 10% | 0.0005 BNB | The minter's referrer | After the mint succeeds. |
| 5% | 0.00025 BNB | The referrer's referrer | After the mint succeeds. |

Referral shares with no recipient (the first minter has no referrer; the first minter's direct
invitees have no second tier) stay in the pool share, which is why it is "at least" 65%.

At a full 70 BNB raise: DEV 14 BNB, referrers up to 10.5 BNB, pool roughly 45.5–56 BNB.

Token supply is 21,000,000 BURN: 14,000,000 to minters and 7,000,000 minted at finalize into the
pool. The developer receives no tokens.

## 3. If the mint fails (phase 5, MINT_FAILED)

If 14,000 is not reached in 3 days, holders call `refund(amount)` and get back exactly 0.005 BNB per
1,000 BURN — 100% of what they paid. The dev share and all referral rewards are void; nothing is
deducted from refunds. Refunds never expire.

## 4. Finalize (phase 2 → 3)

Anyone can call `BurnHook.finalize()` once the mint has filled. No caller reward. In one transaction:

1. BurnToken mints 7,000,000 BURN and sends it with all BNB not reserved for DEV/referrers to the hook.
2. The hook deploys XBurn and wraps the BNB into WBNB.
3. A BURN/WBNB pool is created on Uniswap V4 at price = pool WBNB ÷ 7,000,000 BURN. With 45.5–56 BNB
   that is about 0.0000065–0.000008 BNB per BURN, 1.3–1.6× the mint cost of 0.000005.
4. Full-range liquidity is added and the LP position NFT is minted straight to the dead address.
   Nobody can ever remove it.

The hook rejects any other pool initialization or liquidity addition, so this locked position is the
pool's only liquidity, forever.

## 5. Cooldown (phase 3, BONDED)

For `BLOCK_DELAY` blocks after finalize (1,333 on BNB Chain, about 10 minutes) swaps revert and BURN
cannot be transferred. This prevents sniping in the pool-creation block. Phase 4 begins automatically
at `tradingStartBlock`.

One thing is open during the cooldown: **burning BURN into xBURN** (and wrapping xBURN into wxBURN).
Only minters hold BURN at this point, so they can take their xBURN position before any outside buyer
can trade. Fees are split across the xBURN that exists when a swap happens, so xBURN created during
the cooldown shares the fee of the very first swap; without this window that fee would go entirely
to whoever deposited first after trading opened.

## 6. Trading and the 1% fee (phase 4, TRADING)

- BURN transfers and trades freely.
- The pool's LP fee is 0. The hook takes 1% of the WBNB side of every swap — buys and sells, exact-in
  and exact-out. A buyer effectively pays 1% more WBNB; a seller receives 1% less.
- The fee goes to the XBurn contract in the same transaction. 100% of it belongs to xBURN holders;
  the developer takes nothing from trading.
- Liquidity is a single full-range position, so price impact follows a constant-product curve:
  a trade that is x% of the pool's WBNB moves the price by roughly 2x%.

## 7. xBURN

- Depositing BURN sends it to the dead address (burned forever) and mints xBURN 1:1. One-way: xBURN
  can never be turned back into BURN. Deposits are open from the cooldown (phase 3) onwards.
- Each swap's fee is divided across the xBURN supply at that moment. Later depositors do not dilute
  dividends already accrued; they only share fees that arrive after they join.
- `claim(n)` pays all pending WBNB and burns `n` wei of xBURN. `n = 1` collects everything.
- Transferring xBURN first settles both parties' pending dividends to their wallets.
- Fees that arrive while nobody holds xBURN go to the first depositor.
- Do not put xBURN in a DEX pool or send it to arbitrary contracts: each transfer pushes dividends to
  the receiving address, where they are skimmed by others or stuck for good.

## 8. wxBURN

- Standard ERC4626 over xBURN: deposit xBURN for shares, redeem shares for xBURN at any time.
- The vault's own dividends are compounded by `compoundFromDividend()`, callable by anyone: harvest
  WBNB → 0.5% bounty to the caller → buy BURN in the protocol pool (max 2% slippage, enforced
  on-chain) → burn into xBURN for the vault. Each wxBURN is therefore backed by a growing amount of
  xBURN.
- Transferring wxBURN does not move the underlying xBURN, so it is safe on DEXes.
- 21 decimals. The deployer seeds a small first deposit to prevent the ERC4626 inflation attack.
- Choosing between them: hold xBURN to receive WBNB; hold wxBURN to accumulate more xBURN instead.

## 9. Risks to disclose

- Smart-contract risk. Do not claim the contracts are audited unless the site publishes a report.
- BURN's price can move sharply; large trades have significant price impact.
- Burning into xBURN is permanent.
- Dividends depend entirely on trading volume and can be zero.
- Agent IDs are issued centrally by SPACE ID; a wallet without one cannot mint.
