Description
Beyond a single admin, the contract needs distinct roles — Creator, Auditor, and Operator — each with a scoped set of permitted operations. This prevents over-privileged accounts from performing actions outside their remit.
Technical Context
Add a Role enum to types.rs with variants Admin, Operator, Auditor. Store role assignments under RoleAssignment(address, role) in storage::persistent inside contracts/split/src/lib.rs. Add grant_role and revoke_role (admin-only) and a require_role helper. Gate each entry point with the appropriate role check.
Acceptance Criteria
Description
Beyond a single admin, the contract needs distinct roles —
Creator,Auditor, andOperator— each with a scoped set of permitted operations. This prevents over-privileged accounts from performing actions outside their remit.Technical Context
Add a
Roleenum totypes.rswith variantsAdmin,Operator,Auditor. Store role assignments underRoleAssignment(address, role)instorage::persistentinsidecontracts/split/src/lib.rs. Addgrant_roleandrevoke_role(admin-only) and arequire_rolehelper. Gate each entry point with the appropriate role check.Acceptance Criteria
grant_roleandrevoke_roleare admin-only and emitRoleGranted/RoleRevokedeventscreate_invoicerequiresCreatororAdminrolerelease_paymentrequiresOperatororAdminroleget_invoiceis callable by any role includingAuditor