Skip to content

Add governance mechanism to set_max_supply to prevent unlimited admin inflation #184

Description

@DeFiVC

What

The admin can call set_max_supply to increase the token supply cap to any value without governance, timelock, or any form of checks and balances.

Why

Combined with mint(), this means the admin can mint unlimited tokens at any time. A compromised admin key could inflate the token supply arbitrarily, destroying token value. This is a significant centralization risk for any production deployment.

Scope

  • Add a governance mechanism (e.g., multi-sig requirement, timelock, or hard cap)
  • Consider a maximum increase per call (e.g., cannot increase by more than 2x)
  • Consider a timelock delay before changes take effect
  • Document the chosen approach

Technical Context

  • File: contracts/learn-token/src/lib.rs (lines ~453-464)
  • set_max_supply currently only requires admin auth
  • The supply cap directly affects tokenomics and user trust

Acceptance Criteria

  • set_max_supply cannot be increased without additional safeguards
  • The chosen governance mechanism is documented
  • Tests verify the new constraints
  • The approach is reasonable for the project's current stage (don't over-engineer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    mediumFunctionality impaired but workaround exists, edge case, partial feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions