Skip to main content

Combat system

Fantums fight. The combat system is D&D-style 6 ability scores + 11 weapons + signed-result PvP, computed deterministically from a seed and re-verified on-chain. No off-chain dice. No trust-the-server.

This is the replacement for the original Fantums duel loop, which lived on api.fantums.com (currently 502) and computed results behind a closed-source API. We re-built it open.

The ability scores

Six scores per Fantum, all D&D-style:

ScoreWhat it does
STR (Strength)Direct damage. Heavy weapons scale on this.
DEX (Dexterity)Hit chance, dodge chance, initiative ties.
CON (Constitution)HP pool. Resistance to chip damage.
INT (Intelligence)Wand / scroll item scaling.
WIS (Wisdom)Saving throws, status resistance.
CHA (Charisma)Crowd-based modifiers, tournament multipliers.

Each score rolls between 3 and 18 at mint, with a soft target around 11 average. The OG +5% boost is applied on top, rounded half-up, capped at STAT_MAX_AT_CREATION + 2 = 20.

All six scores are stored on-chain in the Fantums struct and read by the duel contract on every fight.

The 11 weapons

WeaponPrimary scalingNotes
MicrophoneCHAThe signature operatic weapon. Crowd-shock.
DaggerDEXFast, low base damage, high crit chance.
CandelabraSTRHeavy, slow, fire-damage chip.
ScrollINTCasts. One-use per duel.
Music sheetsCHABuff: lowers opponent CHA temporarily.
MaskWISStatus-resist boost.
TorchSTRLight damage + status.
WandINTMid-power magic.
Vinyl discDEXRanged, scaling on hit chain.
BatonCHAConductor weapon. Multi-hit.
QuillINTNiche but devastating on a Composer Fantum.

The weapon is rolled at mint time and stored on-chain. Players cannot swap weapons. Your Fantum's loadout is its loadout.

The duel resolution

A duel is a deterministic function of three inputs:

result = computeDuel(seed, fantumA, fantumB)

Where:

  • seed is a per-duel random number, generated by the matchmaker
  • fantumA and fantumB are the full on-chain stat blocks of the two combatants

The function is deterministic. Given the same inputs, anyone can re-run it and arrive at the same result. The code lives in contracts/lib/Combat.sol.

Signed-result PvP

Duel computation happens off-chain (in the matchmaker) for UX reasons — you don't want to pay gas for every dice roll. The result is then signed by a keeper EOA and submitted on-chain in a single transaction.

The on-chain contract:

  1. Receives the signed result (tokenA, tokenB, winnerId, rounds, seed, newEloA, newEloB, nonce, expiry, signature).
  2. Verifies the EIP-712 signature is from the trusted keeper.
  3. Re-runs the duel computation on-chain from seed + the two stat blocks.
  4. Reverts if the computed winner doesn't match the signed winnerId.
  5. Otherwise applies the result — ELO updates, pot transfer, optional permadeath, optional trophy DNA.

This means:

  • Provably fair. Anyone can re-derive the duel result from public inputs.
  • No off-chain trust. Even the keeper can't cheat — if the signature doesn't match the math, the contract reverts.
  • Replaceable. The keeper EOA can be swapped for a contract later if the community wants fully on-chain matchmaking.

What gets staked

A duel has a fight cost in sFUM (the utility token). The default base cost is configured at deployment and tunable up to MAX_FIGHT_COST_SFUMS = 10,000 sFUM per duel.

The cost is reduced by:

  • OG discount — 25% off if your Fantum has isOG = true (default ogFightDiscountBps = 2500)
  • Founder 100 discount — 25% off if your Fantum's tokenId is 1..100

These two discounts do not stack. The larger of the two applies.

A 5% slice of every fight pot goes to a persistent sFUM buyback and is burned. The duel mechanic literally reduces the utility token supply over time.

The pot

The pot is the sum of both fantums' stakes minus the buyback slice. The winner takes the remainder.

Optional insurance pool: a small premium (e.g. 5%) of each duel can be routed into an on-contract pool that funds free resurrections. If the dead Fantum is OG, the pool covers their first revive if there's balance. Self-funding from active duelers.

ELO

Every Fantum carries an ELO score on-chain. ELO updates on every duel using a standard ELO delta. The matchmaker uses ELO to find balanced opponents.

  • Base ELO at mint: 1000
  • ELO delta after a duel: computed off-chain by the keeper, signed, submitted on-chain
  • OG winners get a +10% ELO bonus on their delta — losers' loss is unchanged
  • The signed payload includes the new ELOs so the on-chain contract knows the final state

Permadeath

Optional, opt-in at mint. See Permadeath and revival for the full mechanic, including the Graveyard, paid revival, OG free revive, and the insurance pool.

See also


Last updated: 2026-05-21