Skip to content

Add max_supply_updated event to set_max_supply in learn-token #181

Description

@DeFiVC

What

The set_max_supply function in learn-token does not emit an event when the supply cap is changed.

Why

Supply cap changes significantly affect tokenomics. Indexers, monitoring systems, and block explorers need events to detect when the cap changes. The related set_progress_tracker function already emits a progress_tracker_updated event — set_max_supply should follow the same pattern for consistency.

Scope

  • Define a max_supply_updated event (or reuse existing patterns)
  • Emit the event in set_max_supply with the old and new values
  • Add a test verifying the event is emitted

Technical Context

  • File: contracts/learn-token/src/lib.rs (lines ~453-464)
  • set_progress_tracker already emits progress_tracker_updated — follow this pattern
  • Events in Soroban are emitted via env.events().publish()

Acceptance Criteria

  • set_max_supply emits an event with old and new values
  • Event is testable and verified in unit tests
  • Follows existing event patterns in the codebase

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programlowCosmetic, minor improvement, code quality, documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions