BaseTC Console is a Web3 mining simulation game designed specifically as a Farcaster Mini App and Frame. This project enables users to participate in an on-chain gamified ecosystem on the Base network, featuring activities such as Rig NFT purchasing, staking, mining, PvP battles, and social interactions via the Farcaster protocol.
- About the Project
- Architecture & Tech Stack
- Key Features
- Game Mechanics
- Smart Contracts
- Project Structure
- Installation & Development
BaseTC Console serves as the frontend interface for interacting with the BaseTC suite of Smart Contracts. The application detects the user's environment (User Agent) to ensure access is mediated through supported clients such as Warpcast or the Base App. It integrates Web3 wallet authentication and the Farcaster social graph to provide a seamless user experience.
The project is built using a modern architecture that separates Client-Side, Server-Side, and On-Chain Logic.
- Core Framework: Next.js 14 (App Router).
- Language: TypeScript.
- Styling: Tailwind CSS & PostCSS.
- State Management: React Query (@tanstack/react-query).
- Interaction Libraries: Wagmi & Viem for EVM interactions.
- Wallet Connection: ConnectKit.
- Smart Contract Integration: Custom Hooks & EIP-712 Typed Data Signing for secure off-chain verification (
SpinVault).
- SDK:
@farcaster/miniapp-sdkfor Mini App integration. - Viral Loop: Integrated
sdk.actions.openUrlto trigger "Cast to Claim" flows.
Based on the codebase structure, here are the system's core capabilities:
- Mining Simulation: The core mechanism where users manage "Rigs" to earn tokens.
- ⚔️ Battle Arena (PvP): A wagering system where users battle for $BaseTC using their Rig NFTs.
- ⚡ Overclock Hazard: A "push-your-luck" minigame where users overclock their rigs for massive multipliers.
- 🎰 Social Spin & Cast: Daily reward system powered by EIP-712 signatures and Farcaster social actions.
- NFT Integration: Utilization of
RigNFT(ERC-1155) with tiered attributes (Basic, Pro, Legend). - Staking: Time-locked asset staking with NFT-based yield boosts (
StakingVault). - Environment Gating: Automatic client detection (Warpcast, Base, Ethereum) to restrict access from bots.
- Overclock Hazard: A single-player risk management game. Users can increase their reward multiplier but face a growing risk of rig failure.
- Integrated Game Hub: A new tabbed navigation system within the Arena component allowing seamless switching between PvP Battles and Overclocking.
- Battle Arena PvP: Real-time betting lobbies where the winner takes 95% of the pot. Win probability is calculated based on RNG + Rig Power.
- Cast-to-Claim: Users must "Cast" their spin results to Warpcast to unlock Leaderboard points, creating a strong viral loop.
Users can create or join lobbies with fixed bet amounts (e.g., 10, 50, 100 $BaseTC).
- Winner Take All: The winner receives 190% of the bet amount (Total Pot - 5% Treasury Fee).
- Power Calculation: Your chance of winning increases based on the NFTs you hold:
- Base Power: 10
- Basic Rig: +1 point
- Pro Rig: +5 points
- Legend Rig: +20 points
- Fairness: The battle logic uses on-chain randomness (
block.prevrandao) combined with user power scores.
A high-stakes minigame integrated into the Arena hub.
- Multiplier Levels: Users progress through tiers (1.2x, 1.8x, 3.5x, 8.0x) by "Overclocking" their system.
- Risk Management: Each level increases the chance of failure. If the system fails, the initial bet is lost.
- NFT Safety Boost: Holding RigNFTs provides a safety buffer, reducing the failure risk percentage based on the rig tier.
- Cashout: Users can secure their current profit at any level before the next attempt.
A "Spin & Cast" mechanic designed for retention and virality.
- Ticket System: Users get free spins based on Epochs or Referrals.
- Flow:
- Spin: User signs a message; the backend verifies eligibility and generates an EIP-712 signature.
- On-Chain Claim: User submits the signature to
SpinVaultto receive tokens. - Cast: User is prompted to share the win on Farcaster.
- Points: Once casted, leaderboard points are credited via the MiniApp SDK.
The repository includes Solidity source code (app/api/solidity/) which forms the foundation of the on-chain logic:
| Contract | Function Description |
|---|---|
| BaseTC.sol | The main ERC-20 token of the ecosystem. |
| BattleArena.sol | PvP Logic, Lobby management, and Power calculation. |
| OverclockHazard.sol | (New) Multi-level risk game logic with NFT-based safety modifiers. |
| SpinVault.sol | EIP-712 Secured reward distribution for the Spin feature. |
| RigNFT.sol | ERC-1155 contract with BASIC, PRO, and LEGEND tiers. |
| StakingVault.sol | Logic for staking tokens with time-locks and NFT boosts. |
| GameCore.sol | Primary game logic and interaction orchestration. |
| ReferralClaimer.sol | On-chain referral reward distribution. |
| TreasuryVault.sol | Management of protocol treasury and revenue. |
basetc-console/
├── app/
│ ├── api/ # API Routes (Next.js) & Solidity Contracts
│ │ ├── frame/ # Endpoints for Farcaster Frames
│ │ ├── solidity/ # Smart Contract source code
│ │ ├── sign-event-action/ # Backend signer for EIP-712
│ │ └── ...
│ ├── components/ # React UI Components
│ │ ├── Arena.tsx # Integrated Game Hub (PvP & Overclock)
│ │ ├── OverclockGame.tsx # Overclock Hazard Minigame
│ │ ├── Spin.tsx # Spin & Cast Interface
│ │ └── ...
│ ├── context/ # React Context (Web3Provider, FarcasterProvider)
│ ├── lib/ # Utilities, ABIs (JSON), and client configuration
│ └── page.tsx # Entry point with client detection logic
├── public/ # Static assets
└── supabase/ # Supabase Configuration & Edge Functions
🔵 Base Ecosystem Integration
This project is proudly built on Base L2 and designed for the Farcaster ecosystem.
Tech Stack Highlights
Network: Base Mainnet
Framework: Next.js 14 + Farcaster Frames
Integration: Coinbase Smart Wallet & Wagmi
Track: Base Builders January Sprint
Deployed and verified for the Base Builders community.