contract OpetToken is StandardToken, Ownable {

  string public constant name = "Opet Token";
  string public constant symbol = "OPET";
  uint32 public constant decimals = 18;

  bool public transferPaused = true;

  mapping(address => bool) public whitelistedTransfer;
  mapping(address => bool) public tokenLockedAddresses;

  constructor() public {
    balances[msg.sender] = 100000000 * (10 ** uint(decimals));
    totalSupply_ = balances[msg.sender];
    emit Transfer(address(0), msg.sender, balances[msg.sender]);
  }

  // The modifier checks, if address can send tokens or not at current contract state.
  modifier transferable() {
    require(!transferPaused || whitelistedTransfer[msg.sender] || msg.sender == owner);
    require(!tokenLockedAddresses[msg.sender]);
    _;
  }

  /**
   * @dev Function to unpause transfer restriction
   */
  function unpauseTransfer() onlyOwner public {
    transferPaused = false;
  }


  function transferFrom(address _from, address _to, uint256 _value) transferable public returns (bool) {
      return super.transferFrom(_from, _to, _value);
  }

  function transfer(address _to, uint256 _value) transferable public returns (bool) {
    return super.transfer(_to, _value);
  }

  function sendAirdrops(address[] _addresses, uint256[] _amounts) public {
    require(_addresses.length == _amounts.length);
    for(uint i = 0; i < _addresses.length; i++){
      transfer(_addresses[i], _amounts[i]);
    }
  }

  function addWhitelistedTransfer(address[] _addresses) public onlyOwner {
    for(uint i = 0; i < _addresses.length; i++){
      whitelistedTransfer[_addresses[i]] = true;
    }
  }

  function removeWhitelistedTransfer(address[] _addresses) public onlyOwner {
    for(uint i = 0; i < _addresses.length; i++){
      whitelistedTransfer[_addresses[i]] = false;
    }
  }

  function addToTokenLocked(address[] _addresses) public onlyOwner {
    for(uint i = 0; i < _addresses.length; i++){
      tokenLockedAddresses[_addresses[i]] = true;
    }
  }

  function removeFromTokenLocked(address[] _addresses) public onlyOwner {
    for(uint i = 0; i < _addresses.length; i++){
      tokenLockedAddresses[_addresses[i]] = false;
    }
  }
}
/**
 * @title OpetToken token
 * @dev Simple ERC20 Token example, with paused transfer and whitelisting
 */
function unpauseTransfer() onlyOwner public {
    transferPaused = false;
  }
/**
 * @dev Function to unpause transfer restriction
 */