ERC20 Roles Support

So I created an ERC20 Contract with mintable and pausable roles. So basically there are 3 roles ie default admin, minter and pauser. I generated this contract using the Openzeppelin Wizard. After deploying my contract, when I checked the default admin role, it was 0x00... the line

_grantRole(DEFAULT_ADMIN_ROLE, defaultAdmin);

was not working. Then I checked the roles contract of Zeppelin and saw that the default admin role is being initially set to 0x00 and so give a role to someone, one has to be the role admin. Initially since the default admin is 0x00, then I wouldn't get this role granted to myself since im not the role admin, if this makes sense. Could someone help what can I do to set myself as default admin? Sorry for such a long description. Thankyou!

Hello @Nirzar_Bhatt

In a contract that uses AccessControl, there will always be a DEFAULT_ADMIN_ROLE() function that returns 0x00...00. That is the "role number". It is NOT the address of someone that has the role. In fact multiple accounts could share the admin role.

What you should be looking for is the hasRole() function.

You should call hasRole(0x00...00, <address of your account>) to check that you have the admin role.

Oh, understood! I thought that was the address of the person who had the specific role. Thankyou so much for clarifying.