Skip to content

Add denomination migration path when payment_token decimals change post-launch #817

Description

@thlpkee20-wq

Description

Some payment tokens migrate to new decimals. Provide a controlled migration path that re-scales stored amounts and updates metadata under issuer authorization.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: src/lib.rs
  • Migration must be idempotent per (offering_id, from_decimals, to_decimals)

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/denom-migration
  • Implement changes
    • Add migrate_denomination(offering_id, from_dec, to_dec)
    • Re-scale stored amounts with checked arithmetic
    • Emit denom_migrated event
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • cargo test --all
  • Cover edge cases
    • Downscale that would round to zero for smallest balances
  • Include test output and security notes

Example commit message

feat: add denomination migration path

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions