contract AccessControl {
  /// @dev Emited when contract is upgraded
  event ContractUpgrade(address newContract);

  address public owner;

  // @dev Keeps track whether the contract is paused. When that is true, most actions are blocked
  bool public paused = false;

  /**
   * @dev The AccessControl constructor sets the original `owner` of the contract to the sender
   * account.
   */
  function AccessControl() public {
    owner = msg.sender;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) public onlyOwner {
    require(newOwner != address(0));
    owner = newOwner;
  }

  /// @dev Modifier to allow actions only when the contract IS NOT paused
  modifier whenNotPaused() {
    require(!paused);
    _;
  }

  /// @dev Modifier to allow actions only when the contract IS paused
  modifier whenPaused() {
    require(paused);
    _;
  }

  /// @dev Called by owner role to pause the contract. Used only when
  ///  a bug or exploit is detected and we need to limit damage.
  function pause() external onlyOwner whenNotPaused {
    paused = true;
  }

  /// @dev Unpauses the smart contract. Can only be called owner.
  /// @notice This is public rather than external so it can be called by
  ///  derived contracts.
  function unpause() public onlyOwner whenPaused {
    // can't unpause if contract was upgraded
    paused = false;
  }
}
function AccessControl() public {
  owner = msg.sender;
}

/**
 * @dev The AccessControl constructor sets the original `owner` of the contract to the sender
 * account.
 */