A decentralized, competitive gaming platform combining on-chain logic, staking mechanics, and AI-powered post-match analysis.
Our smart contract is deployed on Flow testnet
Chain Play Arcade is an On-chain gaming ecosystem where players can compete in skill-based tournaments for real rewards. The platform leverages smart contracts for transparent and trustless event management, prize distribution, and game logic.
We’re building a complete ecosystem for competitive gaming on the blockchain. Our platform is designed to be transparent, secure, and engaging for both event organizers and players.
Here’s the core gameplay loop:
-
Admin Portal: Event organizers use a dedicated admin interface to create and define new games and tournaments directly on the blockchain. They can configure crucial parameters like prize pools, minimum stake amounts, and event durations through our
GameHubandGameFactorysmart contracts. -
Player Dashboard: Players can browse a list of tournaments, and we have to stake crypto to join a tournament after that, play button enables to play the game.
-
Unique Gameplay: Our first featured game is a unique 4x4 Tic-Tac-Toe variant. To win, a player must align 4 of their marks in a row, column, or diagonal. The twist? Every 4th turn, your move from 4 turns prior is erased. This dynamic rule prevents draws and encourages strategic, forward-thinking play.
-
Blockchain usecase: The state of gameplay is stored on walrus storage, and then its unique blobId is stored in the smartcontract to view the state of everygame of the event.
-
AI Post-Match Analysis: After each match, a comprehensive result sheet is generated (total moves, time played, move history). This data is fed to an autonomous AI agent hosted on AgentVerse, which provides a strategic analysis of the game, offering insights on how players could have improved their performance.
-
Claim Rewards&NFTs: When a tournament's duration ends, the smart contract automatically calculates the final leaderboard and distributes the prize pool to the top-performing players. When claiming prizes unique NFT's will also be minted on the way .
- Flow: We have deployed our whole Game logic and Gameplay smartcontracts on the flow testnet
- Walrus: Used Walrus as storage paltform for our gamestate, which is crutial for our project idea. later published blobId on the blockchain for transparency and data retrieval
- Provably Fair Gameplay: Game logic is executed on-chain for maximum transparency.
- AI-Powered Strategic Analysis: Get personalized feedback on your gameplay from an AI coach.
- Automated, Trustless Payouts: Winners are rewarded automatically from the prize pool.
- Modern Web Interface: A sleek and responsive frontend built with Next.js and shadcn/ui.
This project is a full-stack dApp with three main components:
-
Blockchain (Smart Contracts)
- Solidity: For writing the smart contracts.
- Foundry: For compiling, testing, and deploying contracts.
- OpenZeppelin: For secure, community-vetted contract standards (implied).
- Walrus: Walrus for storing the game states in json.
- Flow: Deployed on flow blockchain.
-
Frontend
- Next.js: React framework for the user interface.
- TypeScript: For type-safe code.
- Wagmi & Ethers.js: For interacting with the blockchain (wallet connection, contract calls).
- Tailwind CSS & shadcn/ui: For styling and UI components.
-
Backend
- Node.js & Express.js: For handling off-chain logic, such as managing game sessions and communicating with the AI agent.
To get a local copy up and running, follow these simple steps.
Make sure you have the following installed on your machine:
-
Clone the repository:
git clone [https://github.com/blockvished/chain-play-arcade.git](https://github.com/blockvished/chain-play-arcade.git) cd chain-play-arcade -
Set up the Smart Contracts:
cd smart_contracts forge install forge build -
Set up the Backend:
cd ../backend npm install -
Set up the Frontend:
cd ../frontend npm install -
Create Environment Variables: Create a
.env.localfile in thefrontenddirectory and add the necessary environment variables.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID="YOUR_WALLETCONNECT_PROJECT_ID" NEXT_PUBLIC_ALCHEMY_API_KEY="YOUR_ALCHEMY_API_KEY" # Add other contract addresses and backend API URLs as needed
-
Start a local node (optional, for testing): Open a terminal and run:
anvil
-
Deploy the Smart Contracts: In the
smart_contractsdirectory, deploy your contracts using a Foundry script. Update the script with your desired parameters first.cd smart_contracts forge script script/GameHub.s.sol --rpc-url <YOUR_RPC_URL> --private-key <YOUR_PRIVATE_KEY> --broadcast
-
Run the Backend Server: In a new terminal, navigate to the
backenddirectory and start the server.cd backend npm run start # Or your dev script
-
Run the Frontend Application: In another terminal, navigate to the
frontenddirectory and start the development server.cd frontend npm run devOpen http://localhost:3000 in your browser to see the application.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.