Skip to content

[QuestEngine] Prevent duplicate Explore quest verification payouts #91

Description

@Kaylahray

Description

The Explore Quest verification flow should track whether a learner has already been paid for a specific Explore Quest, preventing accidental or malicious repeated admin-triggered payouts.

User Story

As the Learnault Protocol,
I want to ensure each Explore Quest payout is one-time per learner,
so that admin retries or replayed calls cannot duplicate reward distribution.

Requirements and Context

  • Files: contracts/quest-engine/src/lib.rs, contracts/quest-engine/src/types.rs, contracts/quest-engine/src/test.rs
  • Add storage that records Explore Quest verification per (learner, quest_id)
  • verify_explore_quest must revert if the learner was already verified for that quest
  • Preserve the current admin-only and QuestType::Explore checks

Suggested Implementation

// 1. Add a verification DataKey for (learner, quest_id).
// 2. Assert the key does not already exist before payout.
// 3. Call RewardPoolClient::distribute_reward.
// 4. Persist the verification marker after successful payout.

Acceptance Criteria

  • A learner can only be paid once per Explore Quest.
  • Repeated verification attempts revert cleanly.
  • Different learners on the same Explore Quest remain independently payable.

Submission Guidelines

  • Branch: feat/explore-verification-replay-guard
  • Depends on: [QuestEngine] Verify explore quest
  • PR: fix(quest-engine): prevent duplicate explore quest payouts

Activity

  1. Silver36-ship-it commented on Jul 21, 2026

    @Silver36-ship-it

    I would love to work on this professionally, please assign it to me

  2. Martins-594 commented on Jul 21, 2026

    @Martins-594

    Hi, I'd like to work on this issue. I've gone through the description and acceptance criteria and I'm confident I can deliver it. I'll make sure every acceptance criterion is met and submit a clean, tested PR. Please assign it to me.

  3. syed-ghufran-hassan commented on Jul 21, 2026

    @syed-ghufran-hassan
    Contributor

    Please assign this issue to me as below is the issue and resolution:

    Issue: No storage check allowed repeated verify_explore_quest calls to pay the same learner multiple times;

    Fix: I will Add an ExploreVerification(Address, u32) marker that is checked before payout and persisted after, ensuring one‑time payment per (learner, quest_id).

  4. grantfox-oss commented on Jul 28, 2026

    @grantfox-oss

    🦊 GrantFox — @syed-ghufran-hassan has been assigned to this issue as part of the Official Campaign | FWC26 campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #91)
    2. Your PR will be reviewed by the learnault maintainers

    Good luck! Track your progress on GrantFox.

  5. syed-ghufran-hassan commented on Jul 29, 2026

    @syed-ghufran-hassan
    Contributor

    @Kaylahray I have raised following PRs please check

    #97
    #102

  6. Kaylahray commented on Jul 29, 2026

    @Kaylahray
    ContributorAuthor
  7. syed-ghufran-hassan commented on Jul 30, 2026

    @syed-ghufran-hassan
    Contributor

    Hi @Kaylahray I am working on resolving conflicts on test.rs and will share the updated PR

  8. syed-ghufran-hassan commented on Jul 30, 2026

    @syed-ghufran-hassan
    Contributor

    #106 - I have raised the PR which is free from conflicts please check @Kaylahray

  9. grantfox-oss commented on Aug 17, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Third Campaign campaign!

    @syed-ghufran-hassan's PR #106 was approved and merged by @3m1n3nc3.

    🏆 @syed-ghufran-hassan: You earned 40 FoxPoints for this contribution! Your current tier: Builder (1,567 total points). Track your full progress on GrantFox.

    👏 Great work, @syed-ghufran-hassan! Keep contributing to learnault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions