TokenTycoon
Explore Ethereum, DeFi and other crypto primitives in a on-chain multi-player trading card game
Problem Statement
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.
Solution
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 languageFoundry Framework: Development, testing, and deploymentforge: Compilation and testinganvil: Local blockchain for developmentcast: Contract interaction CLIOptimizer enabled: With via_ir = true for complex contract compilationFrontend ApplicationReact 19 with TypeScript: Modern UI frameworkVite: Fast development and build toolTailwind CSS: Styling with custom Ethereum themePrivy: Web3 authentication and wallet managementWagmi: Ethereum interaction layerZustand: State managementFramer Motion: Animations and transitionsDnD Kit: Drag-and-drop card interactionsDevelopment WorkflowMake-based commands: make dev, make test, make buildNode.js scripts: Deployment automation with Viem libraryJSON data files: Cards and decks stored as structured dataGit workflow: Version control with commit automationArchitecture ComponentsSmart Contracts (src/): - GameEngine.sol: Core game logic and turn management - CardRegistry.sol: Onchain card storage with abilities - DeckRegistry.sol: Pre-configured deck definitionsData Layer (data/): - cards.json: 42 card definitions with DeFi themes - decks.json: 5 pre-built competitive decksFrontend (frontend/): - React components for game UI - Web3 hooks for contract interaction - Mock contract system for development - SVG card artwork and animationsDeployment (scripts/): - Automated contract deployment - Card/deck initialization from JSON - Local development environment setup
Hackathon
ETHGlobal New York 2025
2025
Contributors
- chad
130 contributions
- timjrobinson
47 contributions
- philippbanhardt
2 contributions