Skip to content

Latest commit

 

History

History
27 lines (14 loc) · 1.84 KB

README.md

File metadata and controls

27 lines (14 loc) · 1.84 KB

Donut Quests

Donut quests is an incentives platform where users get exposure to various DeFi protocols, complete tasks and earn donuts, the ERC20 token of r/ethtrader.

Generating the snapshot :

Head over to the Quest compute repo. Then run the commands explained below.

node main

Runs the snapshot scripts which fetch eligible users' data from TheGraph subgraphs. This script generates list of eligible users and saves them as taskNum.JSON. So for task with id as 0, the users list will. be generated in the JSON 0.json in the root directory.

node printRoot

This command runs the merkle root generation script. The new merkle roots for each task will be generated based on the JSONs fetched previously using node main . The merkle roots will be saved to the file roots.json. The roots will also be printed to the console.

Updating the MerkleRoots :

The merkle roots can only be updated by the owner of the contract. During testing and initial deployment, the owner is a single entity while after the testing phase, the DAO's multsig will become the owner.

To update the merkleRoot for a task, the QuestRewards contract should be called by the owner with the taskId and newMerkleRoot as parameters.

Updating the frontend :

This repository should also be updated with the new JSONs generated by the snapshots. While it isn't necessary for interacting with the contract and claiming rewards, it makes it easier for users to claim rewards as frontend will generate the merkleProof for the claim.

To update the frontend with latest JSON, just copy paste the new JSONs generated by node printRoot from questCompute repo into the claims folder inside the public folder.