Smart-contracts to build a whole casual games platform, including a factory allowing anyone to create new games. Many features can still be added, this is just meant to be a good starting point.
The whole idea is to handle as many things as possible onchain, while generating as little transations as possible. All datas are updated in batches (every hours, twice a day, ...). Withdrawals from players are sent once per day, players are require to submit a request, then all requests are processed at once every day.
- Factory contract for any publishers to add games (handle all games)
- Game contract handling players score and stats (per game)
- Payment manager
- Weekly tournament reward + distribution
- NFT collection whitelist for additionnal perks
You can check the deployed contract at:
RewardStructure:
0xbc02b46612aC64bdf3ABD0682e8E109B4bf30803
LevelLib:
0xdcE9B772A42e1b0190Ab5c147AA2329c05f3b146
GameFactory:
0xd1c20e5d8e8cc48eCC0a6CB47CB7346061c77b48
PaymentManager:
0xA928Cb89535E19EB435E2369Be319f1f59De7Cd6
- node.js installed (developped on LTS v16.16.0)
- typescript installed (developped on v4.7.4)
- yarn installed
- hardhat installed
2. Once your config is ready, create a new repo, open your favorite code editor, and clone the repo with the following cmd:
git clone https://github.com/Pedrojok01/Web3-Gaming-Platform.git .
yarn install
yarn test
Edit the deployment scrits scripts/depoy.ts
then edit the network on which you want to deploy the platform line 21 in package.json
"deploy": "hardhat run --network mumbai scripts/deploy.ts",
Then simply run the following command:
yarn deploy