← Code LabSolidity0/50 solved · 0%
Security · medium

30. Role-based access control

Multiple admins, not just owner.

`mapping(bytes32 => mapping(address => bool)) public hasRole` plus `grantRole(bytes32 role, address user)` callable only by a current holder of that role. Bootstrap: constructor grants `ADMIN` to deployer.
Required in your answer: hasRole[ADMIN][msg.sender] = truerequire(hasRole[role][msg.sender]hasRole[role][user] = true