contract SimpleToken is ERC20, Ownable {
    using SafeMath for uint256;

    string public version = "1.0.0";
    string public name;
    string public symbol;
    uint8 public decimals = 18;

    mapping (address => bool) public frozenAccount;

    event FrozenFunds(address indexed target, bool frozen);

    constructor(
        uint256 initialSupply,
        string memory tokenName,
        string memory tokenSymbol
    ) public {
        name = tokenName;
        symbol = tokenSymbol;

        super._mint(_msgSender(), initialSupply.mul(10 ** uint256(decimals)));
    }

    function transfer(address recipient, uint256 amount) public returns (bool) {
        // Check if sender is frozen
        require(!frozenAccount[_msgSender()], "ERC20: transfer from a frozen address");
        // Check if recipient is frozen
        require(!frozenAccount[recipient], "ERC20: transfer to a frozen address");

        return super.transfer(recipient, amount);
    }

    function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
        // Check if sender is frozen
        require(!frozenAccount[_msgSender()], "ERC20: transfer from a frozen address");
        // Check if sender is frozen
        require(!frozenAccount[sender], "ERC20: transfer from a frozen address");
        // Check if recipient is frozen
        require(!frozenAccount[recipient], "ERC20: transfer to a frozen address");

        return super.transferFrom(sender, recipient, amount);
    }

    /**
     * @dev Function to freeze account
     * @param target Address to be frozen.
     * @param freeze either to freeze it or not.
     * @return A boolean that indicates if the operation was successful.
     */
    function freezeAccount(address target, bool freeze) onlyOwner public returns (bool) {
        frozenAccount[target] = freeze;
        emit FrozenFunds(target, freeze);
        return true;
    }
}
function freezeAccount(address target, bool freeze) onlyOwner public returns (bool) {
        frozenAccount[target] = freeze;
        emit FrozenFunds(target, freeze);
        return true;
    }
/**
 * @dev Function to freeze account
 * @param target Address to be frozen.
 * @param freeze either to freeze it or not.
 * @return A boolean that indicates if the operation was successful.
 */