Omniscia Sova Network Audit
LibRoleManaged Code Style Findings
LibRoleManaged Code Style Findings
LRM-01C: Inefficient Logic Contract Import
| Type | Severity | Location |
|---|---|---|
| Gas Optimization | ![]() | LibRoleManaged.sol:L4, L23, L34, L42 |
Description:
The RoleManager contract imported in the LibRoleManaged implementation is utilized as an interface.
Example:
src/auth/LibRoleManaged.sol
4import {RoleManager} from "./RoleManager.sol";5
6/**7 * @title LibRoleManaged8 * @notice Logical library for role-managed contracts. Can be inherited by9 * both deployable and cloneable versions of RoleManaged.10 */11abstract contract LibRoleManaged {12 /*//////////////////////////////////////////////////////////////13 ERRORS14 //////////////////////////////////////////////////////////////*/15
16 error UnauthorizedRole(address caller, uint256 roleRequired);17
18 /*//////////////////////////////////////////////////////////////19 STATE20 //////////////////////////////////////////////////////////////*/21
22 /// @notice The role manager contract23 RoleManager public roleManager;Recommendation:
We advise a proper interface to be defined for it and utilized by the LibRoleManaged contract, optimizing its bytecode size.
Alleviation (e4d6885477438291b0d3ca477fab7e088522967b):
The Sova Network team evaluated this exhibit and specified that they observed an increase in the generated bytecode size when importing an interface rather than a logic implementation.
We do not believe such a discrepancy should arise if the RoleManager is removed. Nevertheless, compilation discrepancies are difficult to precisely assess confidently due to varying compilation environments rendering this exhibit acknowledged.
