Skip to content

Add pause mechanism to token contract #68

@aji70

Description

@aji70

Description

The goal is to add admin-controlled pause for emergencies. Add paused storage. Add pause(env) and unpause(env) (admin only). Guard transfer, mint, burn, transfer_from with require(!paused). Add unit tests for pause, unpause, transfer fails when paused, mint fails when paused, and unauthorized pause revert.

Tasks

  1. Add paused storage:

    • Bool, default false
  2. Implement pause/unpause:

    • Admin only
  3. Guard state-changing functions:

    • transfer, mint, burn, transfer_from check !paused
  4. Add tests:

    • Pause and unpause work
    • Transfer fails when paused
    • Mint fails when paused
    • Non-admin cannot pause

Acceptance Criteria

  • Admin can pause and unpause
  • All state-changing functions fail when paused
  • Unauthorized pause reverts
  • All tests pass

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions