contract Pausable is Ownable {
  event PausePublic(bool newState);
  event PauseOwnerAdmin(bool newState);

  bool public pausedPublic = true;
  bool public pausedOwnerAdmin = false;

  address public admin;

  /**
   * @dev Modifier to make a function callable based on pause states.
   */
  modifier whenNotPaused() {
    if (pausedPublic) {
      if (!pausedOwnerAdmin) {
        require(msg.sender == admin || msg.sender == owner);
      } else {
        revert();
      }
    }
    _;
  }

  /**
   * @dev called by the owner to set new pause flags
   * pausedPublic can't be false while pausedOwnerAdmin is true
   */
  function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public {
    require(!(newPausedPublic == false && newPausedOwnerAdmin == true));

    pausedPublic = newPausedPublic;
    pausedOwnerAdmin = newPausedOwnerAdmin;

    emit PausePublic(newPausedPublic);
    emit PauseOwnerAdmin(newPausedOwnerAdmin);
  }
}
/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public {
  require(!(newPausedPublic == false && newPausedOwnerAdmin == true));

  pausedPublic = newPausedPublic;
  pausedOwnerAdmin = newPausedOwnerAdmin;

  emit PausePublic(newPausedPublic);
  emit PauseOwnerAdmin(newPausedOwnerAdmin);
}

/**
 * @dev called by the owner to set new pause flags
 * pausedPublic can't be false while pausedOwnerAdmin is true
 */