How Contracts Work

The sequence of events is:
Call
QuestFactory.createQuest(rewardType: [erc20]defined as:function createQuest( address rewardTokenAddress_, uint256 endTime_, uint256 startTime_, uint256 totalParticipants_, uint256 rewardAmountOrTokenId_, string memory contractType_, string memory questId_ )rewardTokenAddress_is the contract address for the ERC20 token rewardendTimeis the end time in unix for the Quest.startTimeis the start time in unix for the Quest.totalParticipantsis the total number of accounts that can participate in the Quest.rewardAmountOrTokenId_is the reward amount if it's an ERC-20 token (ie. 1 UNI token out of the 1,000 total)contractType_will be either an ERC-20 token.questIdis an internal UUID that connects multiple systems and acts as a universal UUID
Transfer rewards to the newly created Quest. You can just transfer in rewards directly.
The Quest Factory will keep track of receipts for a given user and quest. There is a finite amount of participants allowed which is calculated by taking the totalRewards / rewardAmountOrTokenId.
Execute the start function. This will validate that the Quest is ready for public and upon reaching the effective StartDate, will be ready for use.
Last updated
Was this helpful?