- 
                Notifications
    
You must be signed in to change notification settings  - Fork 12.3k
 
docs(IAccessManager): document locked roles for label/admin/guardian/grantDelay #6041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(IAccessManager): document locked roles for label/admin/guardian/grantDelay #6041
Conversation
          
 | 
    
          
WalkthroughDocumentation constraints are added to several IAccessManager functions in  Suggested labels
 Pre-merge checks and finishing touches❌ Failed checks (1 warning)
 ✅ Passed checks (2 passed)
 ✨ Finishing touches🧪 Generate unit tests (beta)
 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment   | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
contracts/access/manager/IAccessManager.sol (2)
258-261: Consider simplifying the NOTE for better clarity.The NOTE is somewhat verbose since line 258 already states that
roleIdmust not beADMIN_ROLEorPUBLIC_ROLE. Consider rewording the NOTE to focus solely on clarifying that theadminparameter can be set toPUBLIC_ROLE:- * NOTE: Setting `admin` to the `PUBLIC_ROLE` is allowed, but the target `roleId` itself - * must not be a locked role (`ADMIN_ROLE` or `PUBLIC_ROLE`). + * NOTE: The `admin` parameter may be set to `PUBLIC_ROLE`, but the `roleId` parameter + * is still subject to the locked-role restriction above.This reduces redundancy while maintaining clarity about which parameter has which restriction.
273-276: Apply the same NOTE simplification as suggested for setRoleAdmin.For consistency with
setRoleAdmin, consider simplifying this NOTE to avoid redundancy:- * NOTE: Setting `guardian` to the `PUBLIC_ROLE` is allowed, but the target `roleId` itself - * must not be a locked role (`ADMIN_ROLE` or `PUBLIC_ROLE`). + * NOTE: The `guardian` parameter may be set to `PUBLIC_ROLE`, but the `roleId` parameter + * is still subject to the locked-role restriction above.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
contracts/access/manager/IAccessManager.sol(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Redirect rules - solidity-contracts
 - GitHub Check: Header rules - solidity-contracts
 - GitHub Check: Pages changed - solidity-contracts
 - GitHub Check: slither
 - GitHub Check: coverage
 - GitHub Check: tests-foundry
 - GitHub Check: tests-upgradeable
 - GitHub Check: tests
 - GitHub Check: halmos
 
🔇 Additional comments (2)
contracts/access/manager/IAccessManager.sol (2)
194-203: LGTM! Clear documentation of locked-role constraint.The added requirement clearly documents that
labelRolecannot targetADMIN_ROLEorPUBLIC_ROLE, aligning with the implementation constraints.
282-292: ****The documentation is correct. The implementation of
_setGrantDelayat line 363 deliberately checks only forPUBLIC_ROLE, notADMIN_ROLE, allowing the grant delay ofADMIN_ROLEto be modified. This is intentional design—unlikesetRoleAdminandsetRoleGuardianwhich exclude both roles,setGrantDelayhas different validation logic that only excludesPUBLIC_ROLE. The documentation accurately reflects the implementation behavior.Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Align IAccessManager NatSpec with AccessManager implementation and tests by documenting locked-role constraints.
ADMIN_ROLE and PUBLIC_ROLE cannot be targeted by labelRole, setRoleAdmin, or setRoleGuardian, and PUBLIC_ROLE cannot be targeted by setGrantDelay.
Notes clarify that admin/guardian can be set to PUBLIC_ROLE, but the target roleId itself must not be a locked role.
This prevents integrator confusion and ensures interface documentation accurately reflects enforced behavior (see
AccessManager.sol and AccessManager.test.js).