Skip to content

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

Merged
Kaylahray merged 3 commits into
learnault:mainfrom
amankoli09:feat/revoke-badge
Jun 4, 2026
Merged

feat(badge-nft): add admin badge revocation for fraud prevention#71
Kaylahray merged 3 commits into
learnault:mainfrom
amankoli09:feat/revoke-badge

Conversation

@amankoli09

Copy link
Copy Markdown
Contributor

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

drips-wave Bot commented May 31, 2026

Copy link
Copy Markdown

@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

@Kaylahray Kaylahray left a comment

Copy link
Copy Markdown
Contributor

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

# Conflicts:
#	contracts/badge-nft/src/lib.rs
@amankoli09

Copy link
Copy Markdown
Contributor Author

@Kaylahray i have resolved the conflict please do check it out

@Kaylahray

Copy link
Copy Markdown
Contributor

@Kaylahray i have resolved the conflict please do check it out

Your Ci failed @amankoli09

@Kaylahray

Kaylahray commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@amankoli09 Please resolve this so I can merge. You'll still be awarded points

@amankoli09

amankoli09 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

@Kaylahray I have fixed please check once Ci is passing now sry for late reply

@Kaylahray Kaylahray merged commit 3972623 into learnault:main Jun 4, 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.

[BadgeNFT] Revoke badge (fraud prevention)

2 participants