THE LAW OF EVERY LAUNCH
Launchpads before this launched tokens. TAVERN launches economies. One
launchGame() deploys a full game: fixed-supply coin, Uniswap v4 pool with the
tithe hook, vault-birth NFT population, staking floor and an ETH-backed yield token —
atomically, or not at all. Creators configure a bounded parameter set; the engine code is
fixed for every launch — no arbitrary code, ever. The Sherwood-cast game is launch #1,
the flagship proof. This page is the template every launch runs.
§0THE ONE-SENTENCE GAME
Lock the coin to be born a villager; Peasants forge $GOLD, Sheriffs tax it, and every swap of the coin on its Uniswap v4 pool pays a real-ETH tithe into the game's Treasury that backs $GOLD with hard ETH — so the game token is a claim on real trading volume, not a promise.
§1ASSETS
| ASSET | WHAT IT IS | SOURCES | SINKS |
|---|---|---|---|
| The coin ($SHER in the flagship) |
Fixed supply, trades on its own v4 pool (native ETH / coin) with the hook attached. | market | birth burn, redeem toll burn, treasury buyback-and-burn |
| Villager NFT | Born by locking the birth price (flagship: 100k). 90% Peasant / 10% Sheriff, 5 rarities. Carries an on-chain vault: redeemable for the locked coin minus toll. | birthCommit / birthReveal | redeem (burn NFT, reclaim vault) |
| $GOLD | The yield token. Minted only by the Floor (emission-capped). Backed: burn $GOLD → pro-rata ETH from the Treasury's backing pot. | Peasant forging (staked accrual) | rarity upgrades (burn), ETH redemption (burn) |
| ETH (Treasury) | Real yield. The hook skims every swap on the pool. | v4 hook fee on ALL swaps, both directions | raids (§4) |
§2THE LOOP — WHY EACH ACTOR KEEPS PLAYING
- Peasant: stake → forge GOLD → cash to ETH at backing, or burn it upgrading rarity. Upgrade iff you believe future volume > current backing. A real bet, not a ponzi step.
- Sheriff: earns claim tax + exit-gamble losses + mint-snipes + a direct ETH slice of every raid. Sheriffs are long game activity itself.
- Trader who never mints: swaps pay the tithe. Exiting the coin literally funds the players who stay. Dumps feed the room they dump on.
- Coin holder: births + tolls only burn; treasury buybacks only burn. Supply is monotone-decreasing from game activity.
§3THE V4 HOOK — THE 2% BREAKDOWN
- Pool: native ETH / coin, dynamic-fee, hook attached. Total swap cost to trader: 2.00%.
- The tithe is skimmed via afterSwap-returns-delta, taken only on the ETH-denominated side (input on buys, output on sells) — the treasury accrues pure ETH and never market-sells the coin.
- Applies symmetrically to buys and sells. Symmetry is the no-exit-friction proof: selling is never dearer than buying.
- No owner levers on the fee. Constants, immutable, verified in the constructor against the mined hook-address flag mask.
§4RAIDS — TREASURY DISTRIBUTION
Permissionless raid() when the treasury ≥ threshold (1 ETH):
§5$GOLD BACKING — THE EXCHEQUER
cashOut(amount): burn GOLD, receivepot × amount / totalSupplyETH.- Invariant G1: a cash-out leaves the backing ratio (pot/supply) unchanged. Fee inflow and upgrade-burns strictly raise it. The only dilutant is new emission, which is hard-capped — the claim on the pot is finite and the long-run ratio is volume-driven.
- GOLD's market price has a hard floor at the backing ratio (arb: buy under backing → burn → profit) and trades above it on upgrade demand.
- No first-mover advantage → no bank run. Queue-free by construction.
§7CLASS & RARITY — FLAGSHIP NUMBERS
| RARITY | ODDS | FORGE MULT. | UPGRADE COST (BURN GOLD, FROM TIER) |
|---|---|---|---|
| Common | 60% | 1.0× | 2,000 |
| Uncommon | 25% | 1.25× | 5,000 |
| Rare | 10% | 1.6× | 12,000 |
| Epic | 4% | 2.2× | 30,000 |
| Golden | 1% | 3.0× | — (top) |
§10THE FACTORY — WHAT A CREATOR CAN AND CANNOT TOUCH
| DIAL | CREATOR CONFIGURES? | BOUND |
|---|---|---|
| Name / symbol | YES | — |
| Birth price | YES | sane bounds, validated |
| Predator (Sheriff) odds | YES | 5% – 20% |
| Rarity odds | YES | must sum to 10000 bps |
| Emission cap | YES | sane bounds; canon guidance: ≥ 4 years of full-population forging |
| Swap fee (2% = 1% LP + 1% tithe) | NO | template constant |
| Raid split 60/25/14/1 | NO | template constant |
| Claim tax / gamble / burn / toll | NO | 20% / 50% / 10% / 4% |
| Engine code | NO | fixed for every launch — no arbitrary code |
| Exit freedom | NO | constitutional |
launchGame(cfg)is atomic: coin (CREATE2, fixed supply), v4 pool + hook wiring, Villagers + Floor + Exchequer, initial liquidity from the launch payment with the LP position locked/burned. All-or-nothing (S6).- Per-game isolation is an invariant: treasuries, backings and fee accrual never cross between games.
- S7: no post-launch lever exists on any instance; factory owner powers end at parameter bounds.
§11THE CREATIVE SKIN — YOURS ENTIRELY
The economics are law. The world is yours. Every launch runs the identical
engine — same fees, same splits, same invariants — but each game can look like its own
world: its own earner and predator classes, yield-token name, rarity names, lore and
palette. The skin lives in the coin itself: TavernCoin.tokenMetadata, a
≤512-byte string set once at launch (LaunchConfig.coinMetadata) and
immutable forever, like everything else. A skin changes zero numbers — the
yield token's real name on chain stays GOLD, the backing stays ETH, the odds stay
whatever the creator's bounded dials said.
Inline theme — compact JSON in the metadata string:
| FIELD | TYPE | LIMIT | MEANING |
|---|---|---|---|
v | number | must be 1 | schema version — anything else is ignored (default skin) |
pack | string | one of the 4 packs | built-in sprite pack; unknown → sherwood |
e | string | ≤24 chars | earner class name (the forger) — default from pack |
p | string | ≤24 chars | predator class name (the taxer) — default from pack |
g | string | ≤12 chars | yield-token display name — display only, backing stays ETH |
r | string[5] | ≤16 chars each | rarity tier names, Common→Golden order; blanks fall back per-tier |
tag | string | ≤120 chars | one-line lore, shown on the game page and the board |
pal | string | palette name or #rrggbb | accent: forest · ember · steel · night · gold · blood |
uri | string | https, ≤256 | alternative form {"v":1,"uri":"https://…"} — full external theme |
The four built-in packs — art the tavern owns, an earner/predator pair each:
| PACK | EARNER | PREDATOR | ACCENT |
|---|---|---|---|
| sherwood | Peasant | Sheriff | forest |
| outlaws | Merchant | Outlaw | ember |
| castle | Blacksmith | Knight | steel |
| wilds | King | Wolf | night |
External themes — {"v":1,"uri":"https://…/theme.json"} on chain,
pointing at a JSON file with the same fields plus optional custom sprites:
- Fetched by the game page with a hard 3-second timeout; any failure (timeout, non-200, bad JSON) → tavern-classic skin. The page never blocks on a theme.
uriand sprite URLs must be https; sprite URLs are only ever rendered as<img src>— never fetched as code, never inlined.- External themes may not point at further URIs (no recursion).
Sanitization — enforced on every theme, inline or external:
< > & " ' `) and control characters are stripped at parse, and output is HTML-escaped at render. No HTML injection path exists.§6ATTACKS, AND WHY THEY DIE
- Death spiral (GOLD hyperinflation) — the Wolf Game killer. Hard emission cap + ETH backing + upgrade burns: GOLD is never worth zero while the pot is non-zero.
- Wash trading — fees aren't rewarded to traders; washing only donates to the treasury. Self-defeating.
- Peek-and-abandon mint — burn happens at commit, commits non-refundable, open
birthRevealFor. Dead. - Exit-roll simulation — two-phase commit/reveal on unstake; the seed block doesn't exist at commit; the >256-block fallback is worst-case for the committer. Dead.
- Sheriff cartel steering steals — the steal pool freezes at the victim's commit; staking afterwards can't steer selection. Dead.
- Bank-run on the Exchequer — cash-outs are ratio-neutral (G1); no first-mover advantage, so no run.
- Raid MEV — permissionless with a fixed split; the buyback leg takes a caller-supplied minOut checked against a 30-min TWAP floor from the hook's own observations. Sandwiching a capped, TWAP-floored buy is unprofitable.
- Vault under-collateralization —
totalVaulted == coin held for vaultsis a tested engine invariant; redeems can never exceed vaults. - Emission-cap griefing — cap consumption is proportional to real staking (per-token rate × time); cap sized ≥ 4 years of full-population forging.
§8WHAT IS EXPLICITLY NOT IN THE GAME
§9SOLVENCY INVARIANTS — TESTED, AND SHOWN LIVE IN THE UI
coin.balanceOf(Villagers) ≥ totalVaulted — vault solvencyETH(pot) / GOLD.totalSupply() never decreased by any Exchequer action (G1)Floor.totalEarned ≤ maxEmission — bounded GOLD claimLIVE STATUS
reading chain config…
THE FLAGSHIP CAST

Peasant
Sheriff
Merchant
Outlaw
Blacksmith
Knight
King
Wolf