Skip to content

[FEATURE]: add TokenBurned event for consistent token lifecycle tracking #32

@rohans02

Description

@rohans02

Feature and its Use Cases

Summary

burnToken() does not emit a custom event, unlike issueToken() and revokeToken().
This creates inconsistency in the token lifecycle event pattern.

Current Behavior

  • issueToken() → emits TokenIssued
  • revokeToken() → emits TokenRevoked
  • burnToken() → no custom event ❌ (only ERC721's Transfer)

Proposed Change

Add a TokenBurned event for consistency:

event TokenBurned(address indexed burner, uint256 indexed tokenId);

Why Not Rely on ERC721 Transfer?

The TokenIssued event includes the issuer field, which is not available in ERC721's Transfer event.
This data is fundamental to TNT's trust model and enables efficient off-chain queries like:

"Show all tokens issued by X"

Removing custom events would break this capability.

Impact

  • Consistent event pattern across all lifecycle operations
  • Efficient off-chain filtering by burner address
  • Better subgraph and analytics support
  • Gas cost: ~375 gas per burn (acceptable trade-off)

Additional Context

Relevant code:

Code of Conduct

  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions