Skip to content

giwaov/arc-dungeons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Arc Dungeons

A pixel-art survival game built on Arc Network where players dodge enemies in on-chain dungeons, spend USDC to unlock harder levels, and compete for seasonal prize pool rewards.

Play now: arcescape.vercel.app

How It Works

  1. Connect your wallet and switch to Arc Testnet
  2. Pick a dungeon (the first one is free, others require keys + entry fees)
  3. Survive as long as you can - dodge enemies, rack up your score
  4. Your run is registered on-chain and scores hit the seasonal leaderboard
  5. Top 3 players at season end split the USDC prize pool (50/30/20)

Tech Stack

  • Smart Contracts - Solidity 0.8.30, Foundry, OpenZeppelin v5
  • Frontend - Phaser.js 3.80 game engine, ethers.js 5.7, vanilla JS
  • Network - Arc Testnet (Chain ID 5042002) - EVM L1 by Circle with native USDC gas
  • Hosting - Vercel

Contracts (Arc Testnet)

Contract Address
GameItems (ERC-1155) 0xdD11dBF186738565037fF90Ae02FbD2fcaC8A52B
GameShop 0x5Ceb5bBa1E5C87929f6291321733bdA02B7c5830
ArcDungeons 0xf9FD51fE97b601f93F4857d1a40884530cbB15E5

Anti-Bot Protections

Runs use a 2-step commit-reveal flow to prevent score manipulation:

  • startRun() registers the run on-chain before gameplay begins
  • completeDungeonRun() validates against the start timestamp
  • Minimum run duration (30s) prevents instant score submissions
  • Score capped at 100 points/second of elapsed time
  • 5-minute cooldown between runs
  • 50 runs max per season per player

Project Structure

arc-dungeons/
  contracts/
    src/
      GameItems.sol      # ERC-1155 items (potions, keys, gear)
      GameShop.sol       # USDC marketplace with bundles & discounts
      ArcDungeons.sol    # Core game: dungeons, runs, leaderboard, rewards
    test/
      ArcDungeons.t.sol  # 32 tests including anti-bot coverage
    script/
      Deploy.s.sol
      RedeployDungeons.s.sol
  frontend/
    index.html
    css/style.css
    js/
      app.js             # UI wiring & navigation
      blockchain.js      # Wallet, contract interactions
      config.js          # Chain config, contract addresses, item metadata
      game.js            # Phaser game engine & GameManager
      shop.js            # In-game shop UI

Development

Contracts

cd contracts
forge build
forge test -vvv

Deploy

export PRIVATE_KEY=<your-deployer-key>
forge script script/Deploy.s.sol:Deploy \
  --rpc-url https://rpc.testnet.arc.network \
  --broadcast --slow

Frontend

Serve frontend/ with any static file server, or deploy to Vercel:

cd frontend
npx vercel --prod

License

MIT

About

Pixel-art survival game on Arc Network - dodge enemies, spend USDC to unlock dungeons, compete for seasonal prize pool rewards

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors