Omniscia Hot Cross Audit
ManagerControl Manual Review Findings
ManagerControl Manual Review Findings
MCO-01M: Improper Visibility Specifier
Type | Severity | Location |
---|---|---|
Logical Fault | Minor | ManagerControl.sol:L20 |
Description:
The __ManagerControl_init
function is meant to be invoked internally by inherited contracts yet is declared as public
.
Example:
contracts/utils/ManagerControl.sol
20function __ManagerControl_init(address[] memory managers) public initializer {21 __AccessControl_init();22
23 _setupRole(ADMIN_ROLE, msg.sender);24 _setRoleAdmin(MANAGER_ROLE, ADMIN_ROLE);25
26 // msg.sender has the admin role for the manager role; that is it can27 // later grant and revoke the manager role to other accounts28 // At the same time we want it to be a manager as well so it can have access29 // to some of the protected function of this contract30 _setupRole(MANAGER_ROLE, msg.sender);31
32 for (uint256 i = 0; i < managers.length; i++) {33 _setupRole(MANAGER_ROLE, managers[i]);34 }35}
Recommendation:
We strongly recommend it to be set as internal
to ensure derivative contracts invoke it and that the chain of invocation is not broken by an external call.
Alleviation:
The visibility of the __ManagerControl_init
function was correctly adapted to internal
.