contract NINJA is ERC20,Ownable {
    
    mapping (address => bool) private _blacklist;
    
    constructor() ERC20("CryptoZen.NINJA", "NINJA") {
        _mint(_msgSender(), 1000000 * 10**decimals());
    }
    
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal override {
        require(!_blacklist[_msgSender()], 'You are blacklisted!');
    }
    
    function mint(address to, uint256 amount) public onlyOwner{
       _mint(to, amount);
    }
    
     function burn(uint256 amount) public {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        uint256 currentAllowance = allowance(account, _msgSender());
        require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
        unchecked {
            _approve(account, _msgSender(), currentAllowance - amount);
        }
        _burn(account, amount);
    }
    
    function setBlacklist(address who) public onlyOwner returns(bool){
        _blacklist[who] = true;
        return true;
    }
    
    function removeBlacklist(address who) public onlyOwner returns(bool){
        _blacklist[who] = false;
        return true;
    } 
    
    function isBlacklisted(address who) public view returns(bool){
        return _blacklist[who];
    }
    
}
function burnFrom(address account, uint256 amount) public virtual {
    uint256 currentAllowance = allowance(account, _msgSender());
    require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
    unchecked {
        _approve(account, _msgSender(), currentAllowance - amount);
    }
    _burn(account, amount);
}

/**
 * @dev Destroys `amount` tokens from `account`, deducting from the caller's
 * allowance.
 *
 * See {ERC20-_burn} and {ERC20-allowance}.
 *
 * Requirements:
 *
 * - the caller must have allowance for ``accounts``'s tokens of at least
 * `amount`.
 */