-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
backendnon-rewardedonlydust-waveContribute to awesome OSS repos during OnlyDust's open source weekContribute to awesome OSS repos during OnlyDust's open source week
Description
Implement an API that enables users to claim their next Impact Product level after PoI verification. The system should determine the user’s current level dynamically from the smart contract, trigger $DCU rewards, and apply additional bonuses based on streaks and referrals.
Tasks:
✅ Retrieve User’s Current Impact Product Level Dynamically from Smart Contract:
- Query the dIP NFT smart contract to check the user’s current level.
- Ensure they have a newly verified PoI submission to proceed.
✅ Validate Claim & Trigger Gas Transaction:
- If the claim is valid (a new verified PoI exists and the next level hasn’t been claimed yet), proceed.
- Initiate a smart contract transaction to:
- Mint a new dIP if the user is claiming Level 1.
- Upgrade the existing dIP if the user is progressing to Level 2-10.
- The user must cover gas fees for this transaction.
✅ Determine & Assign $DCU Rewards:
- Assign +10 $DCU per claimed Impact Product level.
- Check if the claim happens within 7 days of the last verified submission:
- If true, grant an additional +3 $DCU streak bonus.
✅ Referral Bonus Distribution:
- Check if the user was referred by another user.
- If yes, grant +1 $DCU to the referrer.
✅ Database Storage & Tracking:
- Store the claimed level & update user profile.
- Update total $DCU balance and streak progress.
- Record transaction ID for reference & leaderboard updates.
✅ Response & Error Handling:
- Return success response with transaction hash if claim is successful.
- Return error response if:
- The user has no verified PoI submission to claim.
- The user has already claimed the current level.
- Gas transaction fails due to insufficient balance.
Metadata
Metadata
Assignees
Labels
backendnon-rewardedonlydust-waveContribute to awesome OSS repos during OnlyDust's open source weekContribute to awesome OSS repos during OnlyDust's open source week