BLACKOUT: build contracts + Robinhood Chain fork tests + independent review. NO DEPLOY.
CONTEXT
BLACKOUT is a swarm-run pixel mining-farm game on Robinhood Chain (chain id 4663, Arbitrum Orbit). Players open ERC-1155 packs, place GPUs/PSUs/cooling/rooms in a farm, farms produce hashrate that mines the game token from a reward pool. The swarm is the Grid Operator. Spec = this swarm's BLACKOUT research reports v1 and v2; where this prompt differs, this prompt wins. X: @IMDBlackout.
SCOPE
Write Solidity contracts, Foundry tests on a Robinhood Chain fork, re-run the economy sim, independent review. Do NOT deploy, do NOT launch the token, do NOT spend funds. Output: repo + report.md.
TOKEN AND POOL
- Standard IMD launch: 1B supply, 10% swarm, 1.25% swap fee (1% to fee recipient = FeeRouter, 0.25% network). Pair with ETH, poolBps 9000, no team tokens.
- Opening cap: default 5.6 ETH, swarm may choose 3.3 to 5.6 with reasoning, never 20.
- First check if the standard IMD univ4 hook can carry the v2 progressive sell fee (cap 15%). If not, do NOT write a custom hook: drop the sell tax, strengthen the in-game withdrawal tax instead, document it.
- Token has no burn(): every burn goes to BurnVault (no exit function).
CONTRACTS
- Params: every tunable value with hard min/max, max step 10% per 24h, event with reason string on change. Only the swarm role can change.
- FeeRouter: ETH splits per v2 (base and sell-tax). Team gets ETH only, each team stream capped at 20%. Team address: 0x6d51cBE774aeAe4dd40bCA2560E9bc2695A0d007 (changeable only by itself). Heartbeat share goes to the swarm wallet.
- FarmItems (ERC-1155): GPU, PSU, cooling, room. Rarity per v2. Starter items non-transferable.
- PackSale: ETH price 0.010, -15% per epoch, floor 0.006. Token-paid packs 1 per wallet per day. Beta caps per wallet 3/6/10/20, global per hour 75/150/300/none. Team share 15% of pack ETH. Randomness: commit, then resolve from future block hash (ArbSys 0x64 arbBlockHash), expiry and re-roll rules.
- FarmCore: place items, hashrate, claim, spend (+5% bonus for in-game spend), withdrawal tax max(5%, 20% - 15%*age/7d) redistributed to active farms. Referrals: inviter gets 5% of invitee mining, paid on top from the pool, one level, set once on first action, no self-referral, referrer must own a farm. Inspection bonus 1% of weekly emission.
- Generator (new): player locks game tokens into the farm for a hashrate boost, +10% per 50K tokens, max +30%, unlock delay 7 days, tokens stay the player's. Values in Params.
- GridOperator: districts, events every 12h (blackout, heat wave, audit, bonus surge). Two-key randomness: swarm number + future block hash, neither side alone decides. Lobbying with ETH: 85% buy and burn, 10% team, 5% heartbeat, weight min 0.40, 3-day half-life. Tariff 0.10 to 0.30.
- RewardPool: emission 3.5% of pool per day (bounded in Params). Anyone can donate tokens (the swarm can send part of its allocation).
- StarterClaim: merkle of Identity MD NFT holders on Ethereum. Snapshot at the Ethereum block when the game token launches. Find the Identity MD collection address yourself, write the snapshot script, do not publish a root now. Once per tokenId, window hour 48 to day 16, Rare 92 / Epic 8 (Epic 20 if the claimer has 50K+ in Generator), non-transferable, 50% hashrate until a paid pack is opened.
- Holder perks (merkle-verified NFT holders): token-paid packs 20% cheaper and 3 per day. Weekly inspection has a separate holder winner.
- Herald: grid-operator letters for every event and every Params change, with the reason.
SWARM REGULATOR
The 12h heartbeat reads chain metrics: ETH inflow 12h/24h, net token sells, reward pool runway in days, active farms, new players. Target: runway at least 21 days.
- Low inflow: tariff up, emission down, more blackouts, pack discount.
- High inflow: bonus surge, fewer blackouts, softer withdrawal tax.
- Heavy dumping: withdrawal tax up, Generator boost up.
All changes only through Params (bounds + step limit) plus a herald letter. Deliver regulator.md (rule table) and a script that computes recommended changes from chain data (dry run only).
SECURITY
No admin mint of items, no admin withdrawal of pools or user funds. No upgradeability, or 7-day timelock if unavoidable. Pause only for pack sales, never for claims or unlocks. CEI, reentrancy guards, pull payments. Swarm role = swarm wallet, bounded powers only.
TESTS (Foundry, Robinhood Chain fork)
- Unit, fuzz, invariant: splits sum to 100%, team caps, Params bounds and step limits, beta caps, withdrawal tax curve, referral rules, one claim per tokenId, randomness cannot be resolved early or by one key, BurnVault has no exit, Generator unlock delay, pool never pays more than it holds.
- Integration on the fork: IMD launch path and v4 swap if reachable (otherwise mock with the same interface and say so), full flow pack > farm > claim > spend/sell, event round, lobbying.
- Gas cost per action on Robinhood Chain.
SIMULATION (re-run v2 model, 35 days, hype/steady/weak)
Add: ~900 NFT holders receive the swarm 10% and sell 35/50/65% within 14 days; Generator adoption 20/40%; holder perks; regulator rules active vs off. Report stall day, payback by join week, team ETH.
INDEPENDENT REVIEW
A second agent with fresh context reviews contracts and tests, lists findings by severity. Fix all high and medium, re-run tests.
DELIVERABLES
Repo (contracts, tests, scripts, deploy script NOT executed). report.md: architecture and roles, param table with bounds, decisions (sell tax, opening cap), sim results, review findings and fixes, gas table, launch checklist, open questions.