Open hats-bug-reporter[bot] opened 2 weeks ago
renounceRole
is not such a big risk if we already put a lot of trust in the wallets corresponding to the roles. It's a nice practice to prevent renouncing but not really a rule and while for token contracts it's been added because we have more roles, in the other contracts which are more specialized I'm fine with either having or not having it. Thus, not an issue.
Github username: -- Twitter username: -- Submission hash (on-chain): 0x0e9694d933c5fc7d9a215d29d46229f566dc5cd461e04729a8d3bf4679c7f5b8 Severity: high
Description: Description\ In the Validator contract, which inherits from OpenZeppelin's AccessControl, users assigned specific roles such as WHITELISTER_ROLE and BLACKLISTER_ROLE have the ability to renounce their roles by calling the renounceRole function. This function is provided by the AccessControl contract and allows any role bearer to relinquish their role
Issue:
WHITELISTER_ROLE
orBLACKLISTER_ROLE
) renounce their roles, there may be no one left with the authority to perform essential functions such as whitelisting or blacklisting addresses. This could impede the contract's ability to enforce access control or compliance measures.Impact:
Recommendation:
To prevent unintended loss of critical roles and maintain the contract's functionality, consider overriding the
renounceRole
function to disable role renouncement. This approach has been utilized in other contracts within the same project (e.g.,InvestToken
andUSDE
contracts), where therenounceRole
function is overridden to always revert:Implementation Example: