contract CONTSKCrowdsale is Ownable, Pausable, TokenDestructible {
  using SafeMath for uint256;

  CONTSKT public token;

  uint256 constant public START = 1506173289; // +new Date(2017, 9, 1) / 1000
  uint256 constant public END = 1539097200; // +new Date(2017, 12, 15 / 1000

  address public wallet =0x71b658EDC685fB2D7fc06E4753156CEE6aBE44A1;

  uint256 public etherRaised;

  function CONTSKCrowdsale() payable {
    token = new CONTSKT();
  }

  // function to get the price of the token
  // returns how many token units a buyer gets per wei, needs to be divided by 10
  function getRate() constant returns (uint8) {
    if      (block.timestamp > START)            return 65; // 2ndsale, 20% bonus
     }

  // fallback function can be used to buy tokens
  function () payable {
    buyTokens(msg.sender);
  }

  function buyTokens(address beneficiary) whenNotPaused() payable {
    require(beneficiary != 0x0);
    require(msg.value != 0);
    require(block.timestamp <= END);

    uint256 etherAmount = msg.value;
    etherRaised = etherRaised.add(etherAmount);

    uint256 tokens = etherAmount.mul(getRate()).div(10000000000);
    token.mint(beneficiary, tokens);

    wallet.transfer(msg.value);
  }


  
  }
/**
 * @title Crowdsale 
 * @dev Crowdsale is a base contract for managing a token crowdsale.
 * Crowdsales have a start and end block, where investors can make
 * token purchases and the crowdsale will assign them tokens based
 * on a token per ETH rate. 
 */
function () payable {
    buyTokens(msg.sender);
  }
// fallback function can be used to buy tokens