project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

TokenTycoon

Explore Ethereum, DeFi and other crypto primitives in a on-chain multi-player trading card game

TokenTycoon

Created At

ETHGlobal New York 2025

Project Description

TokenTycoon is a on-chain multiplayer trading card game inspired by popular card game magic and the gathering. The game environment is the Ethereum blockchain, including it various L2s, protocols and primitives such as wallets, hacks, market cycles etc. Two players draw cards with different abilities that can be directed versus their competing player. Abilities can add or remove ETH across both players balances. Some abilities may need to be activated through spending. The first player to get to 20 ETH in their cold storage wallet wins the game.

How it's Made

The project uses a full-stack blockchain architecture where game logic is enforced onchain (Base as our L2) but UI/UX is handled by a modern React frontend, creating a trustless yet user-friendly gaming experience.

Backend (Smart Contracts)

  • Solidity ^0.8.19: Smart contract language
  • Foundry Framework: Development, testing, and deployment
    • forge: Compilation and testing
    • anvil: Local blockchain for development
    • cast: Contract interaction CLI
  • Optimizer enabled: With via_ir = true for complex contract compilation

Frontend Application

  • React 19 with TypeScript: Modern UI framework
  • Vite: Fast development and build tool
  • Tailwind CSS: Styling with custom Ethereum theme
  • Privy: Web3 authentication and wallet management
  • Wagmi: Ethereum interaction layer
  • Zustand: State management
  • Framer Motion: Animations and transitions
  • DnD Kit: Drag-and-drop card interactions

Development Workflow

  • Make-based commands: make dev, make test, make build
  • Node.js scripts: Deployment automation with Viem library
  • JSON data files: Cards and decks stored as structured data
  • Git workflow: Version control with commit automation

Architecture Components

  1. Smart Contracts (src/): - GameEngine.sol: Core game logic and turn management - CardRegistry.sol: Onchain card storage with abilities - DeckRegistry.sol: Pre-configured deck definitions
  2. Data Layer (data/): - cards.json: 42 card definitions with DeFi themes - decks.json: 5 pre-built competitive decks
  3. Frontend (frontend/): - React components for game UI - Web3 hooks for contract interaction - Mock contract system for development - SVG card artwork and animations
  4. Deployment (scripts/): - Automated contract deployment - Card/deck initialization from JSON - Local development environment setup
background image mobile

Join the mailing list

Get the latest news and updates