A Play2Earn + Donate DApp.
This was submitted for ETH Shangai Hackhathon.
MetaChess is a DApp built with TypeScript, React and Solidity.
It enables users to enjoy a chess game whilst promoting a positive social impact project on the blockchain.
- The MetaChess DApp spins up an instance where 2 players must pay a challenge fee (contribute to a pot) to play.
- A smart contract acts as an escrow/proctor and monitors the game.
- When the game ends, the smart contract awards the winner 90% of the total pot amount.
- It also sends a donation fee (10% of the total pot amount) to the charity's address.
>> LIVE INTRO WEB APP
>> LIVE DAPP
>> SMART CONTRACTS - POLYGONSCAN (MUMBAI TESTNET)
· How to Start DEV· Contracts· Feedback· References
Pre-Requisites: Node JS, NPM, NVM
After Forking/Cloning the chess-engine branch, you can get up and running in just a few minutes. From the project's root folder:
-
Install all required packages.
npm install
-
Start the site.
npm start
P.S, If on Windows OS:
npm run start-windows
-
Voila! View app in any browser at http://localhost:3000/
NOTE: To interact/work directly with the DApp, please switch to the main branch for more details main
The smart contracts are included in this branch. To work with:
-
Create a Polygon Mumbai Wallet Address and add some funds to your address.
>> POLYGON MUMBAI FAUCET
Select Mumbai -> Paste wallet address -> Submit -
Create a project/app on Infura
-
Edit the .env file and set your mnemonic and Infura ID.
MNEMONIC= <12 secret words here> PROJECT_ID= <Infura Polygon Project ID>
-
Compile Contracts
truffle compile
-
Deploy Contracts
truffle migrate --network matic
-
Copy your contract address and view on PolygonScan (Mumbai TestNet)
https://mumbai.polygonscan.com/address/ + {contract address}
I always appreciate feedback, so share your thoughts and suggestions with me: mail@bisi.dev
If you find any bugs or have feature suggestions, create a new issue or pull request 🙏
Thanks a lot! 💪
Ayodeji Olabisi – bisi.dev
These are my references in scaffolding this app
- Smart Contracts : Truffle-Suite
- Host : Infura
- Environment : Polygon Mumbai
- INTRO WebApp : UNISWAP Landing Page
- DApp : UNISWAP App Utilitiy
- Chess Engine : JSVeron Chess Engine
- Design - Miracle Otugo