Skip to content

Reward anyone with crypto assets using email or github username

License

Notifications You must be signed in to change notification settings

Romsters/rewardme

Repository files navigation

RewardMe

Reward anyone with crypto assets using receiver's Google email or GitHub username

📌 Overview

This repository is a monorepo consisting of 3 packages:

  • Contracts - solidity contracts and deployment scripts.
  • Auth - authentication service.
  • App - a front-end app.

Send reward flow:

Call one of the RewardMe smart contract functions (sendETHReward, sendTokenReward, sendNFTReward) with receiver and reward details.

Claiming flow:

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

📋 Prerequisites

  • Ensure you have node >= 18.0.0 and npm >= 9.0.0 installed.

🛠 Installation

$ npm install

⛓️ Setting up GitHub App and Google OAuth client

Follow 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.

🚀 Deploying contracts

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.

Deployment to zkSync

npm run deploy -- --network {network_name_here}

The deployed contracts are verified automatically if verifyURL is present for hardhat network config.

Deployment to L1

npm run deployL1 -- --network {network_name_here}

Verification

npm run verify -- --network {network_name_here} {contract_address_here}

⚙️ Setting up env variables

Make sure you have set up all the necessary env variables for Auth and App services.

👨‍💻 Running locally

Before running the app, make sure you have system contract deployed. To start Auth and App services locally in dev mode run:

$ npm run dev

🕵️‍♂️ Testing

Run tests for contracts:

$ npm run test -w contracts

💻 Using App with zkSync local node

In 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");

🔗 Links:

About

Reward anyone with crypto assets using email or github username

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published