The purpose of this project is to show the outline of a system to integrate an open-source game to the blockchain. We've worked on the application used by the gamer and the smart contracs.
The purpose of this system is to bootstrap a play-to-earn economy on the game Osu! Players are rewarded with cryptocurrencies & NFTs for submitting their plays to a server that will act as an oracle (anti-cheat. Should the oracle deem the play legit, they will mint NFTs for this user to claim or aidrop some of the game currency.
We believe the outlines of this project can be reused on existing games with a lot of user-generated content, in order to align incentives of contributors and players alike.
[Uploading Sans-titre-2021-09-22-0913 (1).excalidraw…](Excalidraw file for the above diagram)
Restore the project dependency
npm install
npx hardhat node
This will spin up the local node and list 20 local wallet address with their private key, all preloaded with 1000 ETH
Run the following command to deploy contract on localhost
npx hardhat run scripts/deploy.js --network localhost
Copy the deployed contract address printed on console for reference
TODO- Save this contract address automatically to some file
Create a file by name .env
inside the root directory of this project. Paste the following lines inside this .env file
ALCHEMY_API_KEY = 'YOUR_ALCHEMY_API_KEY'
WALLET_PRIVATE_KEY = 'YOUR_WALLET_PRIVATE_KEY'
Replace YOUR_ALCHEMY_API_KEY
with API key created using Alchemy
Replace YOUR_WALLET_PRIVATE_KEY
with private key obtained by following these steps
Click on metamask plugin icon in the browser
Select Account details
Click Export Private Key
button and confirm your password
Process should be similar with other wallets.
Run the following command to deploy contract on rinkeby network
npx hardhat run scripts/deploy.js --network rinkeby