Skip to content

feat(token-burning): implemented token burn mechanism with authorization and history tracking#526

Open
Kanasjnr wants to merge 2 commits intoDistinctCodes:mainfrom
Kanasjnr:contract/Token-Burning-mechanism
Open

feat(token-burning): implemented token burn mechanism with authorization and history tracking#526
Kanasjnr wants to merge 2 commits intoDistinctCodes:mainfrom
Kanasjnr:contract/Token-Burning-mechanism

Conversation

@Kanasjnr
Copy link

Added complete token burning functionality to the ManageHub smart contract with
authorization checks, batch operations, event emission, and supply management.

CHANGES

Core Functions Added:

  • burn_token(token_id, reason) - Single token burn with admin/owner authorization
  • batch_burn(token_ids, reason) - Batch burn multiple tokens in one transaction
  • get_burn_history(token_id) - Query burn records with timestamp and reason metadata
  • get_burned_token_count() - Track total burned tokens for supply management
  • is_token_burned(token_id) - Check if specific token is burned

Implementation Details:

  • Added BurnRecord struct with token_id, burner, timestamp, and reason fields
  • Updated DataKey enum with BurnedTokens and BurnHistory keys
  • Added 4 new burn-specific error codes to Error enum
  • Emit BurnToken event on single burns and BatchBurned event on batch operations
  • Prevent burning of already-burned, fractionalized, and expired tokens
  • Maintain immutable audit trail for compliance

ACCEPTANCE CRITERIA

  • Implement burn_token function with proper authorization
  • Add BurnToken event with token ID and burner address
  • Update total supply after burning
  • Prevent burning of non-existent tokens
  • Add batch_burn function for multiple tokens
  • Include burn reason/metadata in events
  • Add query function to retrieve burn history
  • Implement burn restrictions based on token state

Closes #500

@vercel
Copy link

vercel bot commented Feb 23, 2026

@Kanasjnr is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Kanasjnr
Copy link
Author

@truthixify kindly review

@truthixify
Copy link
Collaborator

@Kanasjnr please resolve conflict and
Make the ci pass

@Kanasjnr Kanasjnr force-pushed the contract/Token-Burning-mechanism branch from e897b5b to 63fea4f Compare February 23, 2026 12:47
@truthixify
Copy link
Collaborator

@Kanasjnr please fix failing ci

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.

CONTRACTS: Implement Token Burning Mechanism

2 participants