contract AIRToken is StandardToken, Ownable {

	event Mint(address indexed to, uint256 amount);

	string public constant name = "AIR";
	string public constant symbol = "AIR";
	uint8 public constant decimals = 18;
	uint256 public constant INITIAL_SUPPLY = 1000 * 1000000 * (10 ** uint256(decimals));
	bool public mintingFinished = false;
	bool public lock = true;

	modifier canMint() {
		require(!mintingFinished);
		_;
	}

	modifier cantMint() {
		require(mintingFinished);
		_;
	}

	modifier canTransfer() {
		require(!lock);
		_;
	}

	modifier cantTransfer() {
		require(lock);
		_;
	}

	constructor() public {
		totalSupply_ = INITIAL_SUPPLY;
		balances[msg.sender] = INITIAL_SUPPLY;
		emit Transfer(0x00, msg.sender, INITIAL_SUPPLY);
	}

	function transfer(address _to, uint _value) public canTransfer returns(bool) {
		balances[msg.sender] = balances[msg.sender].sub(_value);
		balances[_to] = balances[_to].add(_value);
		emit Transfer(msg.sender, _to, _value);
		return true;
	}

	/* A contract attempts to get the coins */
	function transferFrom(address _from, address _to, uint256 _value) public canTransfer returns(bool success) {
		if (balances[_from] < _value)
			revert(); // Check if the sender has enough
		if (_value > allowed[_from][msg.sender])
			revert(); // Check allowance
		balances[_from] = balances[_from].sub(_value); // Subtract from the sender
		balances[_to] = balances[_to].add(_value); // Add the same to the recipient
		allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
		emit Transfer(_from, _to, _value);
		return true;
	}

	function balanceOf(address _owner) public constant returns(uint balance) {
		return balances[_owner];
	}

	function approve(address _spender, uint _value) public returns(bool) {
		allowed[msg.sender][_spender] = _value;
		emit Approval(msg.sender, _spender, _value);
		return true;
	}

	function allowance(address _owner, address _spender) public constant returns(uint remaining) {
		return allowed[_owner][_spender];
	}

	/**
   * @dev Function to mint tokens
   * @param _to The address that will receive the minted tokens.
   * @param _amount The amount of tokens to mint.
   * @return A boolean that indicates if the operation was successful.
   */
	function mint(address _to, uint256 _amount) public onlyOwner canMint returns (bool) {
		balances[msg.sender] = balances[msg.sender].sub(_amount);
		balances[_to] = balances[_to].add(_amount);
		emit Transfer(msg.sender, _to, _amount);
		emit Mint(_to, _amount);
		return true;
	}

	/**
     * @dev Function to stop minting new tokens.
     * @return True if the operation was successful.
     */
	function finishMinting() public onlyOwner canMint returns (bool) {
		mintingFinished = true;
		return true;
	}

	/**
     * @dev Function to resume minting new tokens.
     * @return True if the operation was successful.
     */
	function resumeMinting() public onlyOwner cantMint returns (bool) {
		mintingFinished = false;
		return true;
	}

	/**
     * @dev Function to unlock token transfer.
     * @return True if the operation was successful.
     */
	function unlockTokenTransfer() public onlyOwner cantTransfer returns (bool) {
		lock = false;
		return true;
	}

	/**
     * @dev Function to unlock token transfer.
     * @return True if the operation was successful.
     */
	function lockTokenTransfer() public onlyOwner canTransfer returns (bool) {
		lock = true;
		return true;
	}
}
function resumeMinting() public onlyOwner cantMint returns (bool) {
	mintingFinished = false;
	return true;
}

/**
 * @dev Function to resume minting new tokens.
 * @return True if the operation was successful.
 */