contract EmergencySafe is Ownable{ 

  event PauseToggled(bool isPaused);

  bool public paused;


  /**
   * @dev Throws if contract is paused
   */
  modifier isNotPaused() {
    require(!paused);
    _;
  }

  /**
   * @dev Throws if contract is not paused
   */
  modifier isPaused() {
    require(paused);
    _; 
  }

  /**
   * @dev Initialises contract to non-paused
   */
  function EmergencySafe() public {
    paused = false;
  }

  /**
   * @dev Allows draining of tokens (to owner) that might accidentally be sent to this address
   * @param token Address of ERC20 token
   * @param amount Amount to drain
   */
  function emergencyERC20Drain(ERC20Interface token, uint amount) public ownerOnly{
    token.transfer(owner, amount);
  }

  /**
   * @dev Allows draining of Ether
   * @param amount Amount to drain
   */
  function emergencyEthDrain(uint amount) public ownerOnly returns (bool){
    return owner.send(amount);
  }

  /**
   * @dev Switches the contract from paused to non-paused or vice-versa
   */
  function togglePause() public ownerOnly {
    paused = !paused;
    emit PauseToggled(paused);
  }
}
/**
 * @title Emergency Safety contract
 * @dev Allows token and ether drain and pausing of contract
 */
function EmergencySafe() public {
  paused = false;
}

/**
 * @dev Initialises contract to non-paused
 */