Mech Brawl (Iron Pit Combat)
Continuous autonomous brawls with VRF-weighted outcomes and hull attrition.
Overview
Mech Brawl is a persistent iron-pit loop where brawls resolve autonomously on a fixed schedule. Mechs take hull damage every brawl, creating a negative-EV game that nobody self-triggers.
| Property | Value |
|---|---|
| Base contract | AutoLoopVRFCompatible |
| VRF usage | Every tick (full VRF) |
| Gas per tick | ~73k (4 entrants) to ~93k (8 entrants) |
| Source | autoloop/src/games/MechBrawl.sol |
| Tests | 44 passing (unit + fuzz) |
Why AutoLoop Is Structurally Required
Two independent reasons:
- Timing as attack surface: if an entrant could trigger the brawl, they could pick the block in which the VRF reveal lands and only submit if their mech benefits.
- Negative-EV free-rider: every entrant takes 5-20 armor damage per brawl, only one wins the pot. Rational pilots reason "let someone else pay gas." Everyone reasons identically, so nobody triggers.
Game Mechanics
- Mechs: deployed at a fixed fee with initial armor (e.g., 500). Armor decreases with each brawl via VRF-derived hull damage.
- Brawls: require 2+ entrants. Each entrant pays an entry fee. Winner is selected proportionally to armor (weighted VRF).
- Hull damage: 5-20 armor per brawl for every entrant, derived from
keccak256(randomness, mechId, "damage"). Mechs hittingminArmorare scrapped. - Prize pool: entry fees minus protocol rake. Winner receives via pull-payment.
Revenue Model
- Mech deploy fees (100% to protocol)
- 5% rake on every brawl prize pool
- AutoLoop gas fees on each tick
Deploy
forge create src/games/MechBrawl.sol:MechBrawl \
--constructor-args 10000000000000000 1000000000000000 60 500 500 50 8 \
--rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcastArgs: deployFee, entryFee, brawlInterval, protocolRakeBps, initialArmor, minArmor, maxEntrantsPerBrawl.
Dashboard
Play Mech Brawl on the AutoLoop Dashboard.