contract Stoppable is Ownable {
  event Stop();  

  bool public stopped = false;

  /**
   * @dev Modifier to make a function callable only when the contract is not stopped.
   */
  modifier whenNotStopped() {
    require(!stopped);
    _;
  }

  /**
   * @dev Modifier to make a function callable only when the contract is stopped.
   */
  modifier whenStopped() {
    require(stopped);
    _;
  }

  /**
   * @dev called by the owner to pause, triggers stopped state
   */
  function stop() onlyOwner whenNotStopped public {
    stopped = true;
    Stop();
  }
}
/**
 * @title Stoppable
 * @dev Base contract which allows children to implement a permanent stop mechanism.
 */
function stop() onlyOwner whenNotStopped public {
  stopped = true;
  Stop();
}

/**
 * @dev called by the owner to pause, triggers stopped state
 */