Hi @abcoathup - I’m using ERC20PresetMinterPauserUpgradeable
and having a hard time testing roles. This works:
const [deployer] = await ethers.getSigners();
const isAdmin = await godToken.hasRole(DEFAULT_ADMIN_ROLE, deployer.address);
expect(isAdmin).to.equal(true);
but this doesn’t:
const [deployer] = await ethers.getSigners();
const isMinter = await godToken.hasRole(
ethers.utils.keccak256(ethers.utils.formatBytes32String('MINTER_ROLE')),
deployer.address
);
expect(isMinter).to.equal(true);
From the look of AccessControl.sol, MINTER_ROLE is assigned when ERC20PresetMinterPauserUpgradeable
is initialized, so I’m at a loss. Any ideas?