#49250 [SC-Insight] `AccessControl`: unnecessary box usage in `_grant_role`
Description
Description
@subroutine
def _grant_role(self, role: Bytes16, account: Address) -> Bool:
# if new role then add the default admin role
if role not in self.roles:
self.roles[role] = self.default_admin_role() @abimethod(readonly=True)
def get_role_admin(self, role: Bytes16) -> Bytes16:
"""Returns the admin role that controls a role
Args:
role: The role to get its admin of
Returns:
The role admin
"""
if role not in self.roles:
return self.default_admin_role()
return self.roles[role]Remediation
Proof of Concept
Proof of Concept
Previous#49075 [SC-Low] `SetLib.remove_item()` is not safe on empty Dynamic arraysNext#49390 [SC-Low] `UInt64SetLib#remove_item` would revert if the item is empty
Was this helpful?