Help with Security of a Token

I have written this token but am concerned about its security.

The main feature needed is that it has to be a whitelist token in order to restrict transfers, which it does.

Please someone with security expereince can take a look and leave comments.


// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.7.0 <0.9.0;

import “@openzeppelin/contracts/token/ERC20/ERC20.sol”;

contract MyToken is ERC20{

address owner;

mapping(address => bool) whitelistedAddresses;

constructor() ERC20("My Token", "MTK"){
  owner = msg.sender;
  _mint(msg.sender, 200000000000000000000);

modifier onlyOwner() {
  require(msg.sender == owner, "Ownable: caller is not the owner");

modifier isWhitelisted(address _address) {
  require(whitelistedAddresses[_address], "Whitelist: You need to be whitelisted");

function addUser(address _addressToWhitelist) public onlyOwner {
  whitelistedAddresses[_addressToWhitelist] = true;

function verifyUser(address _whitelistedAddress) public view returns(bool) {
  bool userIsWhitelisted = whitelistedAddresses[_whitelistedAddress];
  return userIsWhitelisted;

function exampleFunction() public view isWhitelisted(msg.sender) returns(bool){
  return (true);

function transfer(address _to, uint256 _value) override public returns (bool) {
    require(verifyUser(_to), "Transfer is not valid");    
    require(_to != address(0));
    require(_value <=   balanceOf(msg.sender)); 
    _transfer(msg.sender, _to, _value);
    return true;