This decentralized app allows to user create/join and play Tic Tac Toe game. This project is built for Patika - Akbank Web3 Practicum's Final Project.
- Game is built to run with smart contract which runs on Avalanche Fuji Testnet.
- Frontend is built to ease interact with smart contracts.
- To try app, click here.
- If Fuji Testnet is not added in your wallet (i.e. Metamask), pop-up will be automatically shown to add.
- If needed some test AVAX on Fuji Testnet, click here for Official Avalanche Faucet.
- See Usage and Screenshots for details.
Rules
- Player who create a game is defined as Player 1.
- Game starts by Player 1.
- Reward pool is determined by player who create a game.
$(Reward Pool = 2 * entry fee)$ - Winner gets all reward pool excluding commission.
- If there is no winner (in case of draw) each player get their entry fee back. No commission for draw.
- If anyone doesn't join an existing game for 1 day at least, creator of that game (Player 1) will be able to cancel that game and get their entry fee back.
To get started with this project, clone this repo and follow these commands:
Clone the project
git clone https://github.com/0xsergen/tic-tac-toe-dapp.git
Go to the frontend directory of project
cd tic-tac-toe-dapp/frontend
Install dependencies
npm install
Build the application
npm run build
Start the server
npm run start
Go to your http://localhost:3000/ to check page.
You can start editing the page by modifying pages/index.js
. If you have own smart contract, just modify constants.js
.
If you want to deploy a contract etc, create a .env
file in hardhat
folder.
PRIVATE_KEY:"YOUR_KEY"
RPC_URL:"RPC_URL" //
API_KEY:"API_KEY_SNOWTRACE" // snowtrace.io is like etherscan of Avalanche.
Connect your wallet and select Avalanche Fuji Testnet as network