Request form
Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.
close icon
relevant tag icon
HQ20 Access Control Basic
copy icon
HQ20
• version 1.0.0
Utility
AccessControl

HQ20 Access Control Basic

Basic version of AccessControl.sol, with no built-in hierarchy and allowing to call _grantRole and _revokeRole

*Visit desktop site to download or deploy

Version

1.0.0

Creator

HQ20

Recent Use

🍞 0x77eA downloaded

Last Publish

10/17/2022
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
hasRole(bytes32,address) :
This function checks if a given account has a given role. It takes two parameters, a bytes32 role and an address account, and returns a boolean value. It works by checking if the given account is present in the mapping of roles, which is stored in the _roles variable. If the account is present, the function returns true, otherwise it returns false. (autogenerated documentation)
getRoleMemberCount(bytes32) :
This function returns the number of members in a given role. It works by accessing the _roles mapping, which stores the members of each role, and then using the length() function to count the number of members in the given role. (autogenerated documentation)
getRoleMember(bytes32,uint256) :
This function retrieves the address of a member in a given role. The role is identified by a bytes32 value, and the index of the member is identified by a uint256 value. The function returns the address of the member at the given index in the given role. (autogenerated documentation)
_grantRole(bytes32,address) :
This function grants a role to an account. It takes two parameters, a bytes32 role and an address account. It checks if the role has been added to the account, and if so, emits an event called RoleGranted with the role, account, and message sender as parameters. (autogenerated documentation)
_revokeRole(bytes32,address) :
This function revokes a role from an account. It takes two parameters, a bytes32 role and an address account. It checks if the role is present in the _roles mapping and if it is, it removes the account from the mapping and emits a RoleRevoked event. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i HQ20-Access-Control-Basic
copy icon

Recent Use

🍞 0x77eA downloaded

Last Publish

10/17/2022

Version

1.0.0

Creator

HQ20

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.