USE OF DEPRECATED _SETUPROLE FUNCTION #14
Labels
0 (Non-critical)
Code style, clarity, syntax, versioning, off-chain monitoring (events etc), exclude gas optimisation
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Handle
Reigada
Vulnerability details
Impact
The contract MixinRoles.sol make use of the deprecated function
_setupRole
from theAccessControl
contract. As per theAccessControl.sol
contract documentation, this function is deprecated:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/AccessControl.sol#L183
Using deprecated functions may eventually produce an unwanted behaviour, for example, if OpenZeppelin decides to remove or update the function.
Proof of Concept
https://github.com/code-423n4/2021-11-unlock/blob/main/smart-contracts/contracts/mixins/MixinRoles.sol#L31
https://github.com/code-423n4/2021-11-unlock/blob/main/smart-contracts/contracts/mixins/MixinRoles.sol#L34
Tools Used
Manual testing
Recommended Mitigation Steps
It is recommended to use the
_grantRole
function instead.The text was updated successfully, but these errors were encountered: