Skip to content

CuriQusEth/Warp-Racer

Repository files navigation

๐ŸŒ€ Warp Racer

A high-speed endless racing game set inside a digital warp tunnel โ€” powered by Farcaster and Base Builder Codes.


๐ŸŽฎ Game Overview

Warp Racer turns the Farcaster feed into a blazing digital tunnel. Race through neon warp zones, dodge obstacles, collect power-ups, and compete for the top spot on weekly leaderboards.

Core Features

  • ๐Ÿš€ Endless Runner - High-speed tunnel racing with increasing difficulty
  • ๐Ÿ’œ Vaporwave Aesthetics - Neon purple/pink Farcaster-themed visuals
  • ๐ŸŽฏ Collectibles - Likes (โค๏ธ) and Recasts (๐Ÿ”) for points and speed boosts
  • โšก Power-ups - Shields, boosts, time slow, and magnets
  • ๐Ÿ† Leaderboards - Weekly competitions with score sharing
  • ๐Ÿ“ฑ Mobile Optimized - Touch controls for on-the-go racing
  • ๐ŸŽจ Desktop Controls - Keyboard controls with visual hints

๐Ÿ—๏ธ Base Builder Integration

Warp Racer is fully integrated with Base Builder Codes (ERC-8021) for onchain attribution and reward qualification.

Attribution

{
  builderCode: "warpracer",
  codes: ["warpracer", "farcaster", "basebuilder"],
  payoutAddress: "0x29536D0bc1004ab274c4F0F59734Ad74D4559b7B"
}

Documentation


๐Ÿš€ Tech Stack

Frontend

  • Next.js 15.3.6 - React framework (with security patches)
  • React 19.1.0 - UI library
  • TypeScript 5.8.3 - Type safety
  • Tailwind CSS - Styling
  • Shadcn/ui - UI components

Blockchain & Attribution

  • Ox 0.2.2 - Base Builder Codes utilities
  • Wagmi 2.19.5 - Wallet integration
  • Viem 2.41.2 - Ethereum utilities
  • ERC-8021 - Transaction attribution standard

Farcaster

  • @farcaster/miniapp-sdk 0.2.1 - Mini app integration
  • @farcaster/quick-auth 0.0.8 - Authentication

๐ŸŽฏ Game Mechanics

Controls

Desktop:

  • Arrow Keys / A,D - Move left/right
  • Space - Pause game
  • ESC - Toggle controls hint

Mobile:

  • Touch buttons - Left/Right movement
  • Auto-pause on tab switch

Collectibles

Item Points Effect
โค๏ธ Like +100 Score boost
๐Ÿ” Recast +200 Speed burst + score

Power-ups

Power-up Duration Effect
๐Ÿ›ก๏ธ Shield 5s One-hit protection
๐ŸŒ€ Warp Boost 5s Double speed + invincibility
โšก Time Slow 5s Slow-motion mode
๐Ÿ’ซ Magnet 5s Auto-collect nearby items

Obstacles

  • ๐Ÿ”ด Data Blocks - Static red barriers
  • ๐ŸŸ  Spam Bots - Moving orange threats
  • ๐ŸŸฃ Firewall Barriers - Purple walls

Scoring

Final Score = (Distance ร— Combo Multiplier) + Collectibles + Power-ups

๐Ÿ› ๏ธ Development

Prerequisites

  • Node.js 18+
  • pnpm (recommended) or npm

Installation

# Clone the repository
git clone <your-repo-url>
cd warp-racer

# Install dependencies
pnpm install

# Create environment file
cp .env.local.example .env.local

# Edit .env.local with your values:
# NEXT_PUBLIC_BASE_BUILDER_CODE=warpracer
# NEXT_PUBLIC_PAYOUT_ADDRESS=0x29536D0bc1004ab274c4F0F59734Ad74D4559b7B

Running Locally

# Development mode
pnpm dev

# Production build
pnpm build
pnpm start

# Linting
pnpm lint

Environment Variables

# Required
NEXT_PUBLIC_BASE_BUILDER_CODE=warpracer
NEXT_PUBLIC_PAYOUT_ADDRESS=0x29536D0bc1004ab274c4F0F59734Ad74D4559b7B

# Optional (auto-injected by Farcaster)
NEXT_PUBLIC_FARCASTER_FRAME_ID=...

๐Ÿ“ Project Structure

warp-racer/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/                  # Next.js app router
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx         # Main game page
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx       # Root layout with Farcaster SDK
โ”‚   โ”‚   โ””โ”€โ”€ api/             # API routes
โ”‚   โ”‚       โ””โ”€โ”€ submit-score/  # Score submission endpoint
โ”‚   โ”œโ”€โ”€ components/          # React components
โ”‚   โ”‚   โ”œโ”€โ”€ WarpRacer.tsx   # Main game component
โ”‚   โ”‚   โ”œโ”€โ”€ GameCanvas.tsx  # Canvas rendering
โ”‚   โ”‚   โ”œโ”€โ”€ GameOver.tsx    # Game over screen
โ”‚   โ”‚   โ”œโ”€โ”€ Leaderboard.tsx # Score display
โ”‚   โ”‚   โ””โ”€โ”€ ui/             # Shadcn UI components
โ”‚   โ”œโ”€โ”€ hooks/              # React hooks
โ”‚   โ”‚   โ”œโ”€โ”€ useBaseBuilderAttribution.ts  # Base Builder integration
โ”‚   โ”‚   โ”œโ”€โ”€ useTransactionAttribution.ts  # ERC-8021 utilities
โ”‚   โ”‚   โ””โ”€โ”€ ...             # Farcaster hooks
โ”‚   โ”œโ”€โ”€ lib/                # Utilities
โ”‚   โ”‚   โ”œโ”€โ”€ erc8021.ts     # ERC-8021 core implementation
โ”‚   โ”‚   โ”œโ”€โ”€ erc8021-tests.ts  # Test suite
โ”‚   โ”‚   โ”œโ”€โ”€ gameEngine.ts  # Game logic
โ”‚   โ”‚   โ”œโ”€โ”€ gameTypes.ts   # Type definitions
โ”‚   โ”‚   โ””โ”€โ”€ codeRegistry.ts   # Attribution registry
โ”‚   โ””โ”€โ”€ utils/             # Helper functions
โ”œโ”€โ”€ public/
โ”‚   โ””โ”€โ”€ .well-known/
โ”‚       โ””โ”€โ”€ farcaster.json # Farcaster manifest
โ”œโ”€โ”€ BASE-BUILDER-INTEGRATION.md  # Builder codes guide
โ”œโ”€โ”€ ERC8021-README.md      # ERC-8021 documentation
โ””โ”€โ”€ package.json           # Dependencies

๐Ÿ” Security

CVE-2025-66478 (PATCHED)

  • Status: โœ… FIXED
  • Version: Next.js 15.3.6
  • CVSS: 10.0 (Critical RCE)
  • Action: All dependencies updated

ERC-8021 Security

  • โœ… Input validation
  • โœ… Length checks (prevent buffer overflow)
  • โœ… Format verification
  • โœ… Graceful error handling
  • โœ… No PII in attribution codes

๐ŸŽจ Design Philosophy

Visual Style

  • Neon Cyberpunk - Glowing tunnels and particle effects
  • Vaporwave Palette - Purple (#7c3aed) and pink (#ec4899)
  • Farcaster Branding - Purple identity throughout
  • Synthwave Aesthetic - Light trails and holographic UI

UX Principles

  • 30-90 second sessions - Quick, replayable runs
  • One-tap sharing - Instant Farcaster casts
  • Progressive difficulty - Smooth learning curve
  • Mobile-first - Touch-optimized controls

๐Ÿš€ Deployment

Vercel (Recommended)

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel

# Environment variables will be prompted
# Or set via Vercel dashboard

Manual Deployment

# Build production bundle
pnpm build

# Start production server
pnpm start

Post-Deployment

  1. โœ… Register on https://base.dev/
  2. โœ… Get your official builder code
  3. โœ… Update NEXT_PUBLIC_BASE_BUILDER_CODE
  4. โœ… Redeploy with new code
  5. โœ… Monitor analytics on Base.dev dashboard

๐Ÿ“Š Testing

Browser Console Tests

// Run all ERC-8021 tests
window.erc8021Tests()

// Run attribution examples
window.erc8021Examples.all()

// Check current attribution
const { codes } = useWarpRacerAttribution()
console.log('Attribution codes:', codes)

Manual Testing Checklist

  • Game starts without errors
  • Mobile controls work
  • Desktop keyboard controls work
  • Collectibles spawn and can be collected
  • Power-ups activate correctly
  • Collision detection works
  • Score calculates properly
  • Game over screen displays
  • Share to Farcaster works
  • Attribution suffix formats correctly

๐Ÿค Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Code Style

  • TypeScript strict mode
  • ESLint + Prettier
  • Conventional commits
  • Test coverage for new features

๐Ÿ“š Resources

Official Documentation

Community


๐Ÿ“„ License

MIT License - see LICENSE file for details


๐ŸŽฏ Roadmap

v1.0 (Current)

  • โœ… Core endless runner mechanics
  • โœ… Base Builder Codes integration
  • โœ… Farcaster mini-app support
  • โœ… Leaderboard system
  • โœ… Mobile controls

v1.1 (Next)

  • ๐Ÿ”„ Real-time multiplayer races
  • ๐Ÿ”„ NFT reward badges for top players
  • ๐Ÿ”„ Custom ship skins
  • ๐Ÿ”„ Seasonal events and themes
  • ๐Ÿ”„ Music sync gameplay

v2.0 (Future)

  • ๐Ÿ”ฎ Tournament mode
  • ๐Ÿ”ฎ Clan competitions
  • ๐Ÿ”ฎ Ship upgrades and progression
  • ๐Ÿ”ฎ Dynamic tunnels based on Farcaster trends
  • ๐Ÿ”ฎ Replay GIF exports

๐Ÿ’ฌ Support

Questions or issues?

  • Open a [GitHub Issue]
  • Join [Base Discord]
  • Cast on [Farcaster]

Built with ๐Ÿ’œ for the Farcaster and Base communities

Warp Racer - Race through the digital feed! ๐Ÿš€

About

BASEAPP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages