Salt Wars

Map Data

Waiting for live map snapshot...

High Level Blockchain Plan

Salt Wars should build the chain layer as a modular game protocol: stable ownership contracts for creatures and resources, swappable registries for maps and drops, vault-backed prize custody, deterministic action records, and indexed events that the frontend can render cleanly. We will plan each component first, audit the combined design, then build.

1. Game Config

One address registry points to the active MapRegistry, DropRegistry, Worms, Sticks, VaultManager, RNGProvider, GameActions, resources, items, and indexer schema versions.

2. Worm NFTs First

Worms should be their own NFT contract, similar to sticks but not trapped inside stick assumptions. Worms get base metadata, stats, assignment state, future modifier hooks, and token-bound wallets.

3. Sticks Later

Sticks can follow the same unit pattern after worms: ownable NFTs, effective stats, home assignment, action locks, route visualization, cargo, and claim state.

4. Maps And Zones

Maps, terrain hashes, drop zone records, egg slots, bridges, and project positions live in registries. A drop zone is a record, not its own contract.

5. Drop Tables And Vaults

Drop zones point to drop tables and prize vaults. Vaults hold the real NFTs/tokens, while drop tables declare batches like 500 x 10, 5k x 5, NFT #1 x 1.

6. RNG And Claims

Roll when a unit starts walking, lock the claim result against the action, animate suspense on the frontend, then transfer the prize when the unit arrives.

7. Actions And Pathing

GameActions validates ownership, map activity, drop activity, route hash, terrain rules, travel time, unit availability, and immutable action records.

8. Stats And Items

Base stats stay stable, while approved future modules can add bounded item, consumable, event, or project modifiers to worms and sticks.

9. Indexer And Data

The frontend should read a clean indexed state model: maps, zones, vault inventory, rolls, claims, units, eggs, projects, balances, and activity history.

Resource Token Direction

$DIRT is the first ecosystem token. It should be harvested through gameplay, claimed from drop zones, transferable, visible in wallets, and spendable to mint more worms. $SALT should be reserved as a later token, not forced into v0.

PieceDirectionWhy
$DIRTERC-20 style ecosystem token on Robinhood Chain.Feels closer to pons-style token launches than an internal-only game balance.
Worm mintingSpend or burn $DIRT through a WormMinter module.Lets harvested dirt become the loop for creating more worms.
$SALTReserve as a later resource token.Keeps v0 focused while leaving the schema ready.
Token-bound accountsWorms and sticks should support NFT-owned wallets.Lets rewards and inventory travel with the NFT, similar to StonkBrokers ERC-6551 accounts.
Drop packagesTrack package counts like 500 x 10, 5k x 5, 100k x 2.Lets vault validation prove the drop table can actually pay its prizes.

Execution Planning Files

We will keep the high-level plan in one markdown file, then create one focused sub-plan per component. Each sub-plan should include the contract responsibility, state shape, admin controls, events, failure cases, and audit questions.

ComponentMarkdown Plan PathPurpose
High-level plandocs/blockchain/high-level-plan.mdOverall architecture, build order, audit flow, and component map.
Game configdocs/blockchain/game-config.mdSwappable module addresses, admin model, timelock path, pause controls.
Worm NFTsdocs/blockchain/worm-nfts.mdFirst unit NFT contract, metadata, base stats, current assignment, future modifiers.
Stick NFTsdocs/blockchain/stick-nfts.mdSecond unit NFT contract using the same unit/action/stat pattern.
Map registrydocs/blockchain/map-registry.mdMap ids, terrain/object hashes, bridge states, egg slots, zone positions, active flags.
Drop registrydocs/blockchain/drop-registry.mdDrop zone records, drop table ids, vault links, depletion, active flags.
Vault managerdocs/blockchain/vault-manager.mdPrize vault custody, inventory validation, batch accounting, recovery, transfers.
RNG and claimsdocs/blockchain/rng-claims.mdRoll timing, prize selection, reveal flow, claim records, randomness provider swaps.
Game actionsdocs/blockchain/game-actions.mdAssigning units, deterministic paths, travel time, mining, return, claim/deposit flow.
Resourcesdocs/blockchain/resources.md$DIRT, future $SALT, token package accounting, worm mint cost, ERC-20/pool direction.
Stats and itemsdocs/blockchain/stats-items.mdBase stats, effective stats, module allowlist, consumables, temporary modifiers.
Eggs and projectsdocs/blockchain/eggs-projects.mdEgg slots, home state, bridge rebuilds, contribution accounting, leaderboards.
Indexer and APIdocs/blockchain/indexer-api.mdEvent-derived read model, frontend data shape, cache/update strategy.
Audit checklistdocs/blockchain/audit-checklist.mdCentralization risk, stuck assets, RNG fairness, accounting, permissions, path determinism.

Extensibility Layer For Items And Consumables

The stick NFT should not need a contract migration every time we invent a new potion, tool, tattoo, map buff, event rule, or limited-time effect. The safer pattern is stable base stats plus a controlled modifier layer.

LayerWhat It StoresWho Can Change ItWhy
Base identityspecies, team/home egg, permanent tats, permanent base stat seedStick NFT contract at mint or explicit admin/game migrationThis is the durable identity of the NFT.
Equipped itemsitem ids, equipment slots, fixed trait items, inventory itemsowner actions routed through approved game/item contractsLets gear affect stats without rewriting the NFT itself.
Temporary modifiersstat deltas, multiplier bps, start/end time, source contract, reasonapproved modules only: consumables, events, quests, projectsLets us add limited-time buffs/debuffs later.
Computed statsattack, speed, carry, luck, tax bonus, regen, resource bonusread-only function or indexer derived from base + modifiersFrontend and contracts can agree on the effective result.
Module permissionsallowlist of contracts and which stat keys each can modifyowner/governance/multisig/world controllerPrevents random contracts from mutating NFT power.

Recommended Extensible Contract Shape

  1. StickNFT: owns token identity, base traits, ownership, metadata pointer, and exposes current/effective stats.
  2. StatsRegistry: defines stat keys and formulas so future stats can be added without breaking old sticks.
  3. ModifierManager: stores active modifiers per stick: source, stat key, operation, value, expiry, stack rule.
  4. Module allowlist: only approved contracts can add/remove modifiers, and each module can be scoped to specific stat keys.
  5. Item/Consumable contracts: call the modifier manager instead of directly editing the StickNFT.
  6. Events: every modifier add/remove/expire emits an event so the indexer can explain why a stick’s stats changed.

Stat Modifier Rules To Decide Later

QuestionRecommended DefaultWhy We Can Defer Details
Flat vs percentage modifiers?Support both: flat add and basis-point multiplier.The storage shape can support both before we design every item.
Can buffs stack?Each modifier has a stack group and max stacks.We can launch with max 1, then loosen by module later.
How do time limits work?Store expiry timestamp or expiry block.Consumables can be built later without changing stick ownership.
Who can mutate stats?Only approved module contracts, never arbitrary callers.This gives expansion room while keeping the NFT safe.
Where does final math live?Contract view for canonical math, indexer mirrors for fast UI.Game can read fast while chain remains source of truth.

Chain State Buckets

  1. Ownership: wallets own stick NFTs, egg NFTs/accounts, resource tokens, and possibly map/project permissions.
  2. Map state: map id, terrain hash/version, object hash, bridge state, project states, and current active ruleset.
  3. Stick state: NFT metadata plus current trip, route hash, cargo, target, home egg, ETA, and claim readiness.
  4. Modifier state: active item/consumable/event modifiers by stick id, source contract, stat key, value, and expiry.
  5. Economy state: resource balances per wallet/egg/project/drop and tax splits.
  6. Activity state: event log for who did what, when, with which NFT, from which drop, and into which egg/project.

What Needs To Be True Before Mainnet

AreaDecisionWhy It Matters
ChainPick target chain and token standards.Determines NFT/token interfaces, gas costs, wallet UX, and indexer stack.
Stick NFTsDecide which metadata is mutable on-chain vs rendered by indexer.Trip/cargo state changes often; permanent traits should not churn metadata unnecessarily.
StatsSeparate base stats from active modifiers and effective stats.Lets future item/consumable contracts change behavior without replacing the stick NFT contract.
ResourcesChoose ERC-20 style tokens, ERC-1155 style resources, or internal balances.This determines how expensive mining, depositing, taxing, and trading will be.
$DIRTDecide fixed-supply/pool launch vs controlled gameplay emission.This determines whether $DIRT behaves like a pons-style ecosystem token, a mined reward token, or a hybrid.
Token-bound walletsDecide ERC-6551-style accounts for worms and sticks.Unit-owned wallets make NFT inventory and reward delivery much cleaner, but add integration complexity.
PathingCommit to grid path hash, route cells, and duration formula.Movement must be deterministic and cannot secretly change after assignment.
DropsDefine depletion, randomness, enemy behavior, and drop-table proofs.Players need to trust that rewards and remaining supply are not arbitrary.
ProjectsDefine contribution accounting and unlock conditions.Bridge repair and egg goals need contributor leaderboards and clear state transitions.
IndexerBuild a canonical read model from events.The game page should read fast indexed state, not scrape contract storage for everything.

Recommended Build Order

  1. Update high-level plan: define the component list, boundaries, trust model, and markdown files for each sub-plan.
  2. Write sub-plans: fill each component doc with responsibilities, state, events, permissions, and unresolved decisions.
  3. Cross-component audit: check that ownership, drops, vaults, RNG, resources, paths, eggs, and modifiers agree with each other.
  4. Local simulator schema: make the current game emit the same state shape the contracts and indexer will later expose.
  5. Contracts v0: build GameConfig, $DIRT, WormNFT, MapRegistry, DropRegistry, VaultManager, RNG/Claims, GameActions, and Resources.
  6. Indexer v0: consume contract events and serve the same readable state this page expects.
  7. Frontend wiring: move the game from local state to indexed chain state while keeping smooth animation and suspense reveals.
  8. Testnet and audit: run accounting, stuck-asset, permission, pathing, RNG, and claim-flow tests before mainnet.