Environment
openzeppelin 2.8.2
Details
I want to write a blacklist.sol in my own access control schem,but when i extend ownable.sol,there always has some error that i cannot fix it ,i check all the blackspace,around,around…can anyone tell me how to fix it?thank you very much!!!
Code to reproduce
pragma solidity ^0.6.0;
import "@openzeppelin/contracts/access/Ownable.sol";
contract Blacklist is Ownable {
mapping(address => bool) public blacklist;
event AddBlacklist(address account);
event RemoveBlacklist(address account);
function isBlacklist (address _account)
public
view
onlyOwner
returns(bool)
{
return blacklist[_account];
}
function AddBlacklist (address _account)
public
onlyOwner
{
require(
!isBlacklist(_account),
);
blacklist[_account] = true;
emit AddToBlacklist(_account);
}
function RemoveBlacklist(address _account)
public
onlyOwner
{
require(
isBlacklist(_account),
);
delete blacklist[_account];
emit RemoveBlacklist(_account);