Project

One World
NFTDeFi
15,000 USDC
View results
Submission Details
Severity: low
Invalid

Role Overlap (ADMIN_ROLE and DEFAULT_ADMIN_ROLE) in CurrencyManager contract

Summary

The contract assigns both DEFAULT_ADMIN_ROLE and ADMIN_ROLE to msg.sender in the constructor, leading to a potential redundancy in role assignments. This could cause confusion regarding the intended access control logic and potentially introduce unnecessary complexity in managing roles.

Vulnerability Details

The constructor c

_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(ADMIN_ROLE, msg.sender);

Both roles (DEFAULT_ADMIN_ROLE and ADMIN_ROLE) are assigned to the deploying address (msg.sender), despite DEFAULT_ADMIN_ROLE inherently having the permissions to manage other roles, including ADMIN_ROLE.

  • The contract should only assign one role, either DEFAULT_ADMIN_ROLE or ADMIN_ROLE, to msg.sender.

  • There should be no unnecessary role duplication, as DEFAULT_ADMIN_ROLE already provides all necessary administrative permissions.

Impact

Redundant roles create unnecessary complexity in managing roles and permissions. It may lead to confusion about which role is responsible for specific administrative actions.

Unnecessary role grants could slightly increase the gas cost for administrative tasks, although this impact is minimal.

Tools Used

manual review

Recommendations

if ADMIN_ROLE is preferred for the logic, remove the grant for DEFAULT_ADMIN_ROLE and adjust the role-checking accordingly.

_grantRole(ADMIN_ROLE, msg.sender); // Remove this line
Updates

Lead Judging Commences

0xbrivan2 Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Design choice
0xbrivan2 Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.