Closed sherlock-admin closed 2 years ago
This is invalid, ADMIN_ROLE
inherits all other roles via the overridden hasRole
function in GranularRoles.sol
. This is also covered by our test suite.
// Admin role has all access granted by default
function hasRole(bytes32 role, address account)
public
view
virtual
override
returns (bool)
{
return
super.hasRole(ADMIN_ROLE, account) || super.hasRole(role, account);
}
0x0
medium
Admin Cannot Batch Mint (1155)
Summary
mintByOwnerBatch
allows 1155 to be minted from selected accounts, protected by a modifier. The docstring states that accounts with rolesMINT_ROLE
orADMIN_ROLE
may call this function. In the implementation this is not working for accounts withADMIN_ROLE
.Vulnerability Detail
ERC1155NFTProduct.mintByOwnerBatch
The modifier on this function allows accounts holding specific roles to perform the mint. Accounts holding
ADMIN_ROLE
may not call this without additionally being granted theMINT_ROLE
.Impact
ADMIN_ROLE
will have to pay additional gas to modify the RBAC role to include the admin accountCode Snippet
Tool used
Manual Review
Recommendation
msg.sender
holds roles(MINT_ROLE || ADMIN_ROLE)