📌 Description
set_operator accepts any Address with no check against the current admin. If the admin appoints itself as operator (set_operator(admin_address)), require_admin_or_operator's is_admin || is_operator check becomes trivially true either way, but it is worth confirming this dual-role configuration behaves correctly and doesn't, for example, produce confusing event data or double-count in any future operator-scoped view.
🧩 Requirements and context
- Add a regression test appointing the current admin as its own operator via
set_operator(admin_address).
- Assert
is_operator(admin_address) returns true and pause/unpause/extend_instance_ttl still succeed when authorized as that address.
- Assert
require_admin-only entrypoints are unaffected (the admin retains full authority independent of also holding the operator role).
🛠️ Suggested execution
- Add the test to
src/test.rs alongside existing operator-role coverage.
- No production code changes expected unless the test surfaces an actual bug in
is_operator/require_admin_or_operator.
- Document that a dual admin/operator role is a supported (if redundant) configuration in the README's operator section.
✅ Acceptance criteria
🔒 Security notes
Assuming admin and operator are always distinct addresses in future code (e.g. an event or audit-log design that dedupes by role) could silently drop information about a legitimate dual-role configuration; this test guards the current, permissive behavior explicitly.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
set_operatoraccepts anyAddresswith no check against the current admin. If the admin appoints itself as operator (set_operator(admin_address)),require_admin_or_operator'sis_admin || is_operatorcheck becomes trivially true either way, but it is worth confirming this dual-role configuration behaves correctly and doesn't, for example, produce confusing event data or double-count in any future operator-scoped view.🧩 Requirements and context
set_operator(admin_address).is_operator(admin_address)returnstrueandpause/unpause/extend_instance_ttlstill succeed when authorized as that address.require_admin-only entrypoints are unaffected (the admin retains full authority independent of also holding the operator role).🛠️ Suggested execution
src/test.rsalongside existing operator-role coverage.is_operator/require_admin_or_operator.✅ Acceptance criteria
set_operator(admin_address)succeeds and leaves both admin and operator authority intact for that address.🔒 Security notes
Assuming admin and operator are always distinct addresses in future code (e.g. an event or audit-log design that dedupes by role) could silently drop information about a legitimate dual-role configuration; this test guards the current, permissive behavior explicitly.
📋 Guidelines