What
Eight learn-token admin/configuration functions do not check require_not_paused:
set_transfer_restriction (lib.rs:211) -- can change transfer rules during pause
add_to_whitelist (lib.rs:227) -- can modify whitelist during pause
remove_from_whitelist (lib.rs:238) -- can modify whitelist during pause
snapshot (lib.rs:255) -- can create snapshots during pause
record_balance_snapshot (lib.rs:275) -- can record snapshots during pause
grant_role (lib.rs:858) -- can grant admin roles during pause
revoke_role (lib.rs:868) -- can revoke admin roles during pause
add_admin (lib.rs:880) -- can add admins during pause
remove_admin (lib.rs:893) -- can remove admins during pause
increase_allowance (lib.rs:1274) -- can modify allowances during pause
Why
During an emergency pause, an admin could:
- Change transfer restrictions to freeze all non-whitelisted holders
- Grant roles to compromised addresses
- Remove legitimate admins
- Modify allowances to prepare for attacks after unpause
The pause should freeze ALL state-changing operations, not just token transfers.
Scope
Add Self::require_not_paused(&env); to each function listed above, after the auth check.
Acceptance Criteria
- All listed functions panic when the contract is paused
- Tests verify they are blocked during pause
Technical Context
contracts/learn-token/src/lib.rs -- all functions listed above
What
Eight learn-token admin/configuration functions do not check
require_not_paused:set_transfer_restriction(lib.rs:211) -- can change transfer rules during pauseadd_to_whitelist(lib.rs:227) -- can modify whitelist during pauseremove_from_whitelist(lib.rs:238) -- can modify whitelist during pausesnapshot(lib.rs:255) -- can create snapshots during pauserecord_balance_snapshot(lib.rs:275) -- can record snapshots during pausegrant_role(lib.rs:858) -- can grant admin roles during pauserevoke_role(lib.rs:868) -- can revoke admin roles during pauseadd_admin(lib.rs:880) -- can add admins during pauseremove_admin(lib.rs:893) -- can remove admins during pauseincrease_allowance(lib.rs:1274) -- can modify allowances during pauseWhy
During an emergency pause, an admin could:
The pause should freeze ALL state-changing operations, not just token transfers.
Scope
Add
Self::require_not_paused(&env);to each function listed above, after the auth check.Acceptance Criteria
Technical Context
contracts/learn-token/src/lib.rs-- all functions listed above