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
Submission Guidelines
- Branch:
feat/explore-verification-replay-guard
- Depends on:
[QuestEngine] Verify explore quest
- PR:
fix(quest-engine): prevent duplicate explore quest payouts
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
contracts/quest-engine/src/lib.rs,contracts/quest-engine/src/types.rs,contracts/quest-engine/src/test.rs(learner, quest_id)verify_explore_questmust revert if the learner was already verified for that questQuestType::ExplorechecksSuggested Implementation
Acceptance Criteria
Submission Guidelines
feat/explore-verification-replay-guard[QuestEngine] Verify explore questfix(quest-engine): prevent duplicate explore quest payouts