Reward anyone with crypto assets using receiver's Google email or GitHub username
This repository is a monorepo consisting of 3 packages:
- Contracts - solidity contracts and deployment scripts.
- Auth - authentication service.
- App - a front-end app.
Call one of the RewardMe smart contract functions (sendETHReward, sendTokenReward, sendNFTReward) with receiver and reward details.
Get token from Google / GitHub -> Exchange it for a signed app token -> Smart contract verifies the app token -> The smart contract sends you your rewards to the address you choose
- Ensure you have
node >= 18.0.0andnpm >= 9.0.0installed.
$ npm installFollow Registering a GitHub App to set up a GitHub App.
Follow Integrating Google Sign-In into your web app to set up a Google OAuth client.
Set up all the necessary env variables for Contracts package. Check .env.example for reference. Run the deployment script for each network you want to support.
npm run deploy -- --network {network_name_here}
The deployed contracts are verified automatically if verifyURL is present for hardhat network config.
npm run deployL1 -- --network {network_name_here}
npm run verify -- --network {network_name_here} {contract_address_here}
Make sure you have set up all the necessary env variables for Auth and App services.
Before running the app, make sure you have system contract deployed.
To start Auth and App services locally in dev mode run:
$ npm run devRun tests for contracts:
$ npm run test -w contractsIn order to let the App know what is your system contract address deployed to your local node just add a record to the local storage in your browser:
localStorage.setItem("rewardMeLocalNodeSystemContract", "your_system_contract_address_here");