OracleRun (Autonomous Dungeon)
A permadeath dungeon crawl with escalating VRF-derived difficulty.
Overview
OracleRun is a permadeath dungeon that runs on an unchangeable schedule. Characters roll against VRF-derived difficulty each floor; survivors split the prize pool while dead characters are permanently flagged.
| Property | Value |
|---|---|
| Base contract | AutoLoopVRFCompatible |
| VRF usage | Every tick (expedition resolution) |
| Gas per tick | ~114k (wipe) to ~137k (survivors) |
| Source | autoloop/src/games/OracleRun.sol |
| Tests | 36 passing (unit + fuzz) |
Why AutoLoop Is Structurally Required
- Mempool-snoop attack: a player-controlled trigger lets the caller compute the resulting VRF difficulty for their own character and only submit if favored. A neutral schedule fires for all characters simultaneously.
- Death-stalling: borderline characters want delay, strong characters want resolution now. No single trigger time serves both.
- Forfeit floor: the dungeon floor advances on survivor success. Player-controlled triggers could camp forever at low-difficulty floors.
Game Mechanics
- Characters: minted at a fixed fee with initial power. Power determines survival odds.
- Expeditions: characters register by paying an entry fee. When the expedition resolves, each character rolls
keccak256(randomness, charId, "roll") % 1000. Survival requiresroll + power > difficulty. - Difficulty:
baseDifficulty + (currentFloor - 1) * difficultyPerFloor, capped at 999. The floor only advances when at least one character survives. - Permadeath: dead characters are permanently flagged. No resurrection in v1.
- Prize pool: entry fees minus protocol rake, split equally among survivors. Full wipe sends the entire pot to the protocol.
Survival Math
survives = (roll + power) > difficulty
roll = keccak256(randomness, charId, "roll") % 1000
difficulty = baseDifficulty + (floor - 1) * difficultyPerFloorWith baseDifficulty=300, difficultyPerFloor=50, initialPower=400:
- Floor 1: difficulty 300, survival if roll > -100 (always survives)
- Floor 3: difficulty 400, survival if roll > 0 (99.9% chance)
- Floor 7: difficulty 600, survival if roll > 200 (80% chance)
- Floor 13: difficulty 900, survival if roll > 500 (50% chance)
Revenue Model
- Character mint fees (100% to protocol)
- 5% rake on every expedition entry pool
- Full wipe rounds send entire pot to protocol (house edge)
- AutoLoop gas fees on each resolution tick
Deploy
forge create src/games/OracleRun.sol:OracleRun \
--constructor-args 10000000000000000 2000000000000000 60 500 300 50 400 \
--rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcastArgs: characterMintFee, entryFee, expeditionInterval, protocolRakeBps, baseDifficulty, difficultyPerFloor, initialPower.
Dashboard
Play OracleRun on the AutoLoop Dashboard.