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 | β |
| Starting mcap (the launch price floor) | YES | 1 β 500 ETH (default β $10k) |
| Vanity coin address (mined salt) | YES | salt is namespaced to the creator β unsnipeable |
| 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, the LP position locked by construction. All-or-nothing (S6).- v1.1 curve (LAW): liquidity is one-sided, coin-only β launching takes no ETH seed, it is free minus gas. The pool opens at the creator-chosen
startMcapEth(bounded 1β500 ETH; the UI default β $10k) and the entire supply sits as a range order from that price upward. Buys walk the price up and fill the pool with real ETH; the starting price is a hard floor β a sell-back can never push spot below it. No dust-mcap spawns: $20 buys $20 worth, at every launch. - 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

β back to the TAVERN Β· play the flagship Β· launch a game Β· follow on π
Peasant
Sheriff
Merchant
Outlaw
Blacksmith
Knight
King
Wolf