Skip to content

Incentives#231

Merged
massouji82 merged 18 commits intotestnetfrom
incentives
May 18, 2025
Merged

Incentives#231
massouji82 merged 18 commits intotestnetfrom
incentives

Conversation

@massouji82
Copy link
Contributor

This PR introduces a new incentives system to the Demos platform, enabling users to earn points for linking wallets and social accounts. The main features and changes include:

  • Points logic for awarding incentives when users link wallets or social accounts.
  • Defensive programming to ensure points are only awarded once per account/platform.
  • Initial support for tracking points on Twitter with future possibility of other platforms (GitHub, Discord, etc.).

Massoud Valipoor added 15 commits March 27, 2025 21:55
…management

- Replaced UserPointsEntity with direct GCR integration for user points.
- Updated methods to retrieve user identities and points from GCR.
- Removed unused UserPointsEntity and related database fields.
- Enhanced wallet and Twitter linking methods to award points through GCR.
- Improved error handling and response messages for identity and points queries.
- Added @cosmjs/encoding dependency to package.json.
- Refactored identity retrieval methods in PointSystem to use getIdentities and include GitHub as a source for web2 identities.
- Updated the typeof of the field variable in verifyWeb2Proof function to TwitterProofParser | GithubProofParser instead of Web2ProofParser, to get the correct instance
- Added logic to create a new account in GCR if one does not exist for the given user ID.
- Initialized total points and breakdown for new accounts.
- Added TURNSTILE_SECRET_KEY to the environment configuration.
- Updated handleIdentityRequest to use the correct type for Turnstile verification payload.
… and PointSystem

- Simplified the onTwitterLinked method to only require userId.
- Updated PointSystem to handle Twitter identities more efficiently and added platform-specific breakdown for social accounts.
- Enhanced awardTwitterPoints method to check for existing points and award them accordingly.
- Adjusted data structures to support multiple social platforms in points breakdown.
@massouji82 massouji82 requested a review from cwilvx May 12, 2025 17:25
@massouji82 massouji82 self-assigned this May 12, 2025
Massoud Valipoor added 3 commits May 13, 2025 20:39
- Moved the incentive point awarding logic for wallet and social media linking to be more readable and maintainable.
- Updated the simulate flag in endpointHandlers to true
- Deleted the IncentiveController class to streamline the incentive point awarding process.
- Updated GCRIdentityRoutines to utilize IncentiveManager for wallet and social media linking.
- Removed references to IncentiveController in endpointHandlers and handleIdentityRequest for cleaner code structure.
@massouji82 massouji82 merged commit 3006366 into testnet May 18, 2025
@massouji82 massouji82 deleted the incentives branch May 18, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants