A blockchain-based competitive gaming platform on Base where players stake cryptocurrency and compete to earn rewards.
ChainSkills Arena is a Web3 gaming hub where players connect their wallets, compete in blockchain-powered games, and earn cryptocurrency rewards. Built on the Base blockchain, it features smart contract-managed escrow, transparent prize distribution, and a strategic powerup system.
- Stake-Based Gaming: Players stake ETH to compete, winner takes 95% of the pot
- Smart Contract Escrow: Secure fund management with automatic distribution
- Powerup System: Strategic items that enhance gameplay (Shield, Multiball, Pad Stretch)
- Decentralized & Transparent: All game results and fund distribution on-chain
- Multi-Wallet Support: MetaMask, Coinbase Wallet, WalletConnect, Gemini Wallet
- Currently Featured: Pong (more games coming soon via GameHub)
This is a monorepo containing both smart contracts and frontend application:
Base-arc/
├── contract/ # Hardhat smart contract development
│ ├── contracts/ # Solidity contracts (PingPong.sol)
│ ├── test/ # Comprehensive Foundry + Mocha tests
│ ├── scripts/ # Deployment & verification utilities
│ └── ignition/ # Hardhat Ignition deployment modules
│
├── frontend/ # Next.js web application
│ ├── app/ # Next.js 16 app router
│ ├── components/ # React components (UI, game, wallet)
│ ├── lib/ # Wagmi + Reown AppKit wallet integration
│ └── pages/ # Game pages (Pong)
│
└── README.md # This file
- Solidity 0.8.28 - Smart contract language
- Hardhat 3.1.0 - Development framework
- Foundry - Testing framework (Forge-std)
- OpenZeppelin 5.4.0 - Security libraries (ReentrancyGuard, Ownable)
- ethers.js 6.14.0 - Blockchain interaction library
- Next.js 16.0.7 (React 19.2.0) - Web framework
- TypeScript 5.9.3 - Type safety
- Tailwind CSS 4.1.17 - Styling
- Wagmi 3.1.0 - Ethereum wallet hooks
- Reown AppKit 1.8.15 - Multi-chain wallet connection UI
- Framer Motion 12.23.26 - Animations
- TanStack Query 5.90.12 - Data fetching & caching
- Base Mainnet (Chain ID: 8453) - Production network
- Base Sepolia - Testnet for development
- Node.js 18+ and npm/pnpm
- Hardhat for smart contract development
- MetaMask or compatible Web3 wallet
git clone https://github.com/Rafikace/Base-arc.git
cd Base-arccd contract
# Install dependencies
npm install
# Run tests
npx hardhat test
# Run Solidity tests only
npx hardhat test solidity
# Run TypeScript tests only
npx hardhat test mochaCreate contract/.env:
BASE_RPC_URL=https://mainnet.base.org
BASE_NAME_WALLET_PRIVATE_KEY=your_private_key_here
ETHERSCAN_API_KEY=your_etherscan_api_key# Deploy to local network
npx hardhat ignition deploy ignition/modules/PingPong.ts
# Deploy to Base Sepolia (testnet)
npx hardhat ignition deploy --network baseSepolia ignition/modules/PingPong.ts
# Estimate deployment cost
npx hardhat run scripts/estimateDeploy.tscd frontend
# Install dependencies
npm install
# Run development server
npm run devCreate frontend/.env.local:
# Required for WalletConnect v2 (get from https://cloud.reown.com)
NEXT_PUBLIC_PROJECT_ID=your_reown_project_id
# Contract addresses (after deployment)
NEXT_PUBLIC_PINGPONG_CONTRACT_ADDRESS=0x...The application will be available at http://localhost:3000
The core game contract implementing stake-based Pong with escrow management.
Key Features:
- Create/join games with custom stakes
- Secure escrow holding player funds
- Winner gets 95%, dev fee 5%
- 7-day timeout protection with refunds
- Three powerup types (Multiball, Pad Stretch, Shield)
- Pausable for emergencies
Main Functions:
createGame() payable // Create game with stake
joinGame(gameId) payable // Join existing game
endGame(gameId, winner) // Owner declares winner (off-chain result)
requestRefund(gameId) // Cancel waiting game
claimTimeoutRefund(gameId) // Claim refund after 7 days
grantPowerup(recipient, type) // Owner grants powerups
usePowerup(gameId, type) // Use powerup during gameGame States:
WAITING (1)- Created, waiting for second playerACTIVE (2)- Both players joined, game in progressENDED (3)- Game completed, funds distributedCANCELLED (4)- Game cancelled, refunds issued
Comprehensive test suite with 2,468+ lines of tests:
cd contract
# Run all tests
npx hardhat test
# Run with gas reporting
REPORT_GAS=true npx hardhat test
# Run specific test file
npx hardhat test test/Pingpong.t.sol✅ Implemented:
- Wallet connection (Wagmi + Reown AppKit)
- Multi-wallet support (MetaMask, Coinbase, WalletConnect)
- UI components (Navbar, Game modes, Inventory, Leaderboard UI)
- Dark mode support
- Responsive design with animations
🚧 In Progress:
- Smart contract integration (wagmi hooks)
- Actual Pong game logic (Canvas, physics, multiplayer)
- Real-time leaderboard data fetching
- Live games display
- Daily powerup reward system
- Quick Match - Fast-paced free play
- Create/Join - Custom game lobbies
- Friendly Stake - Low-stakes competitive play
- Compete - High-stakes tournaments
Current Phase: Development
- ✅ Smart contracts fully implemented and tested
- ✅ Frontend UI components built
- ⏳ Contract-frontend integration (in progress)
- ⏳ Pong game logic implementation (in progress)
- ⏳ Deployment to Base mainnet (pending)
We welcome contributions! Here's how to get started:
- Fork the repository to your GitHub account
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/Base-arc.git - Add upstream remote:
git remote add upstream https://github.com/Rafikace/Base-arc.git - Create a feature branch:
git checkout -b feature/your-feature-name
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringtest/- Adding testschore/- Build/tooling updates
Beginner-Friendly:
- Documentation improvements
- UI/UX enhancements
- Adding environment variable templates
- Writing tests
Intermediate:
- Smart contract integration with wagmi
- Leaderboard data fetching
- State management implementation
- Component refactoring
Advanced:
- Pong game Canvas implementation with physics
- Multiplayer synchronization (WebSockets)
- GameHub contract development
- Automated game result verification backend
- Make your changes and commit with clear messages
- Push to your fork:
git push origin feature/your-feature-name - Open a PR from your fork to
Rafikace/Base-arc:main - Describe your changes clearly in the PR description
- Wait for review and address any feedback
- Follow existing code style (ESLint + Prettier configured)
- Write tests for new features
- Update documentation as needed
- Keep commits atomic and well-described
cd contract
# Estimate gas costs
npx hardhat run scripts/estimateDeploy.ts
# Deploy to Base mainnet
npx hardhat ignition deploy --network base ignition/modules/PingPong.ts
# Verify on Etherscan
npx hardhat verify --network base DEPLOYED_CONTRACT_ADDRESScd frontend
# Build for production
npm run build
# Start production server
npm startRecommended Hosting:
- Vercel (recommended for Next.js)
- Netlify
- AWS Amplify
- Smart contracts use OpenZeppelin's audited libraries
- ReentrancyGuard prevents reentrancy attacks
- Ownable pattern for access control
- Comprehensive test coverage (100+ test cases)
Note: Contracts are not yet audited. Use at your own risk.
- PingPong smart contract implementation
- Frontend UI components
- Smart contract integration (wagmi hooks)
- Pong game Canvas implementation
- Daily reward system
- Real-time leaderboard
- GameHub multi-game support
- Tournament system
- Professional security audit
- Mainnet deployment
This project is licensed under the MIT License - see the LICENSE file for details.
- Base Network: https://base.org/
- Hardhat Docs: https://hardhat.org/
- Next.js Docs: https://nextjs.org/docs
- Wagmi Docs: https://wagmi.sh/
- Reown AppKit: https://docs.reown.com/appkit/overview
For questions or issues:
- Open an issue in this repository
- Join our community discussions
Built with ❤️ on Base