Contracts
Glitch Bomb is fully onchain: the game engine, the token, staking, and governance are Cairo contracts built with Dojo Engine on Starknet. The source lives in the cartridge-gg/glitchbomb repository under contracts/.
Systems
| Contract | Role |
|---|---|
| Play | The game engine: create a game, pull orbs, buy/burn/refresh in the shop, enter levels, cash out, claim rewards |
| Setup | Admin configuration: entry price, vault revenue share, starter pack registration |
| Token | The GLITCH ERC-20 reward token, minted on reward claims |
| Vault | The staking vault: an ERC-4626 vault issuing vGLITCH shares, distributing a share of game revenue to stakers, with vote tracking |
| Governor | OpenZeppelin governor using vGLITCH voting units, with delay, period, and quorum settings |
| Treasury | Timelock controller executing approved governance proposals and holding protocol funds |
| Collection | ERC-721 collection — each ranked game is a token |
| Faucet | Test USDC faucet used on test networks |
Game state
The full game state fits in a single compact model, updated on every action:
- the bag is a packed list of orb ids (up to 50 orbs)
- pulled orbs are tracked as a bitmap — one bit per orb slot; the Bomberang's bit is never set, which is what makes it "sticky"
- curses are bit flags on the game
- the shop packs its 6 offers, the burn/refresh flags, and per-orb purchase counters into one field
Every pull, purchase, and level transition is emitted as an event and indexed by Torii, which is what the game client renders in real time.
Randomness
Ranked pulls are seeded by Cartridge VRF, a verifiable random function whose output is proven onchain — see Randomness.
Determinism and the practice engine
The game rules are deterministic given a seed, which allows the client to embed a TypeScript mirror of the Cairo engine for free practice games — same milestones, prices, and bag mechanics, no transactions required.
Last updated: