Skip to content

feat(badge-nft): add admin badge revocation for fraud prevention#71

Open
amankoli09 wants to merge 1 commit into
learnault:mainfrom
amankoli09:feat/revoke-badge
Open

feat(badge-nft): add admin badge revocation for fraud prevention#71
amankoli09 wants to merge 1 commit into
learnault:mainfrom
amankoli09:feat/revoke-badge

Conversation

@amankoli09
Copy link
Copy Markdown

Description

Allows the Protocol Admin to revoke a specific Soulbound Badge from a user's UserBadges vector. This is implemented to penalize users who were caught cheating or plagiarizing.

Changes Made

  • Added a BadgeRevoked event which is emitted upon successful revocation.
  • Implemented the revoke_badge(env: Env, admin: Address, learner: Address, course_id: u32) function in contracts/badge-nft/src/lib.rs.
  • Added authentication and admin checks (admin.require_auth()) to verify the caller is the authorized registry.
  • Added full test coverage for the revocation flow in contracts/badge-nft/src/test.rs verifying:
    • Successful badge removal.
    • Correct event emission (badge_revoked).
    • Function correctly panics if an unauthorized user attempts to call it.

Acceptance Criteria Met

  • The badge is successfully removed from the user's profile.
  • Non-admins cannot call this function.

Related Issue

Closes #59

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@amankoli09 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

Copy link
Copy Markdown
Contributor

@Kaylahray Kaylahray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @amankoli09 Please resolve workflow

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.

[BadgeNFT] Revoke badge (fraud prevention)

2 participants