Description
When multiple freeze reasons apply, clearing one should not automatically unfreeze the account. Add reason-scoped unfreeze semantics that only thaws when all reasons are cleared.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
src/test_freeze_matrix.rs
- Reason set persisted as bitmask under
FreezeReasonSet
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/freeze-scoped-unfreeze
- Implement changes
- Persist reason bitmask
clear_freeze_reason(reason) clears bit and re-evaluates
- Emit
freeze_reason_cleared event
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Clear the only-set reason (full unfreeze)
- Include test output and security notes
Example commit message
feat: scoped-unfreeze by reason bitmask
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
When multiple freeze reasons apply, clearing one should not automatically unfreeze the account. Add reason-scoped unfreeze semantics that only thaws when all reasons are cleared.
Requirements and context
src/test_freeze_matrix.rsFreezeReasonSetSuggested execution
git checkout -b feat/freeze-scoped-unfreezeclear_freeze_reason(reason)clears bit and re-evaluatesfreeze_reason_clearedeventTest and commit
cargo test --allExample commit message
feat: scoped-unfreeze by reason bitmaskGuidelines