Complete the code to import the AccessControl contract from OpenZeppelin.
import "@openzeppelin/contracts/access/[1].sol";
The AccessControl contract is imported from OpenZeppelin to manage roles and permissions.
Complete the code to declare a role identifier for ADMIN_ROLE.
bytes32 public constant ADMIN_ROLE = [1]("ADMIN_ROLE");
keccak256 is used to create a unique bytes32 identifier for roles.
Fix the error in the constructor to grant ADMIN_ROLE to the deployer.
constructor() {
_setupRole([1], msg.sender);
}The ADMIN_ROLE constant should be granted to the deployer in the constructor.
Fill both blanks to restrict the function to only ADMIN_ROLE holders.
function restrictedAction() public [1](ADMIN_ROLE) [2] { // action code }
The onlyRole modifier restricts access, and the function visibility is public.
Fill all three blanks to create a new role and grant it to an address.
bytes32 public constant [1] = keccak256("[1]_ROLE"); function grantNewRole(address user) public [2](ADMIN_ROLE) { _grantRole([1], user); }
The MINTER role is declared and granted using onlyRole modifier to restrict access.
