Skip to content

Feature/add total revoked counter - #336

Merged
Calebux merged 2 commits into
zintarh:mainfrom
Gentleslyl2006:feature/add-total-revoked-counter
Jul 30, 2026
Merged

Feature/add total revoked counter#336
Calebux merged 2 commits into
zintarh:mainfrom
Gentleslyl2006:feature/add-total-revoked-counter

Conversation

@Gentleslyl2006

Copy link
Copy Markdown
Contributor

Add total revoked counter and revoke_wrap query

Context:
Operators need a simple on-chain metric for how many records were revoked.

What changed:

  • Added DataKey::TotalRevoked to storage_types.rs
  • Added ContractError::WrapNotFound to errors.rs
  • Implemented admin::revoke_wrap in admin.rs
    • requires admin auth
    • removes the wrap record
    • decrements the user’s WrapCount
    • increments global TotalRevoked
    • emits a revoke event
  • Added revoke_wrap and total_revoked contract methods in lib.rs
  • Added queries::total_revoked in queries.rs
  • Added tests in test.rs for:
    • successful revoke increments global revoked counter
    • revoked wrap is removed and user balance updates
    • revoke of nonexistent wrap fails with WrapNotFound

Notes:

- Implement upgrade() function with admin authorization
- Emit event containing requested WASM hash before upgrade
- Add tests for upgrade event emission and authorization
- Document event schema for operators
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

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

@Calebux
Calebux merged commit 7ba67e3 into zintarh:main Jul 30, 2026
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.

feature: Add total revoked counter

2 participants