I’ve just switched to the @openzeppelin/contracts-upgradeable.
My contract inherits from ERC20PresetMinterPauserUpgradeable which in turn inherits AccessControlUpgradeable.
After deploying with upgrades.deployProxy(...) the deploying address (which was the owner before switching to upgradeable) does no longer have the DEFAULT_ADMIN_ROLE and can therefore no longer grant other roles.
getRoleAdmin for all roles returns 0x00....0
How do I set this up correctly to have some account that can grant roles?
Hi, I think the admin role for all roles is DEFAULT_ADMIN_ROLE by default, and it is set as bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; so when you use getRoleAdmin() it will return zero address, if you want to change it, I think you can have a look at the function _setRoleAdmin()
BTW, if you want to set permission for some functions, you should use hasRole() to restrict, and roles can be granted and revoked dynamically via the grantRole() and revokeRole() functions.