Hi, currently working on an ERC20 contract, I've been using AccessControl for a bit of time and suddenly today I'm experiencing a interesting issue when compiling.
contract Token is
IERC20,
Ownable,
ReentrancyGuard,
AccessControl
{
...
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
...
constructor() VRFConsumerBaseV2(_vrfCoordinator) {
router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); // Uniswap
pair = IUniswapV2Factory(router.factory()).createPair(
router.WETH(),
address(this)
);
_allowances[address(this)][address(router)] = type(uint256).max;
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
_setupRole(ADMIN_ROLE, msg.sender);
}}
So here in the constructor I get,
DeclarationError: Undeclared identifier.
--> contracts/Token.sol:505:9:
|
505 | _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
Same for ADMIN_ROLE.
It is the first time seeing this error, last week this contract was perfectly compiling and deploying. So I'm wondering if it is because of V5.0 of OZ contracts? They added an AccessManager so maybe there's some conflict idk tbh. If anyone has any idea, that would be great, thank you!