Skip to content

feat(all): add contract upgradability, batch payouts, and proposal cancellation#82

Merged
Kaylahray merged 1 commit into
learnault:mainfrom
SaintSammi:project-requirements
Jun 2, 2026
Merged

feat(all): add contract upgradability, batch payouts, and proposal cancellation#82
Kaylahray merged 1 commit into
learnault:mainfrom
SaintSammi:project-requirements

Conversation

@SaintSammi
Copy link
Copy Markdown
Contributor

feat(all): add contract upgradability, batch payouts, and proposal cancellation

Summary

This PR resolves three open issues by adding new functionality across the core contracts.


#61 — Smart Contract Upgradability

Added upgrade_contract(env, admin, new_wasm_hash) to all six core contracts:

  • BadgeNFT, CourseRegistry, QuestEngine, RewardPool, StakeVault, Governance

  • Requires admin.require_auth() and verifies the caller is the stored admin

  • Calls env.deployer().update_current_contract_wasm(new_wasm_hash)

  • Emits a ContractUpgraded event

  • All persistent storage state is preserved across upgrades


#62 — Batch Payouts for Quests

Added batch_review_submissions(env, employer, quest_id, learners) to QuestEngine:

  • Requires employer.require_auth() once for the whole batch
  • Iterates over all learner addresses and executes the full review_submission logic per learner (15% platform fee + staking multiplier)
  • Emits individual SubmissionReviewed events and a final BatchReviewed event

#60 — Cancel Proposal (Governance)

Added cancel_proposal(env, caller, proposal_id) to Governance:

  • Requires caller.require_auth()
  • Verifies caller is the original proposer or the protocol admin
  • Asserts the voting period is still active and the proposal has not already been executed
  • Sets executed = true to lock the proposal from further votes or execution
  • Emits a ProposalCancelled event

Testing

  • Tests added for all three features in their respective test.rs files
  • All existing tests continue to pass
image

Closes #60
Closes #61
Closes #62

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@SaintSammi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Kaylahray Kaylahray merged commit 099469e into learnault:main Jun 2, 2026
1 check passed
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.

[QuestEngine] Batch payouts for quests [Global] Smart contract upgradability [Governance] Cancel proposal

2 participants