function deploy() public onlyOwner {
    token = new QBEToken();

    presale = new Presale();

    presale.setToken(token);
    presale.addStage(6000,3000);
    presale.setMultisigWallet(0x17FB4A3ff095F445287AA6F3Ab699a3DCaE3DC56);
    presale.setStart(1510128000);
    presale.setPeriod(31);
    presale.setMinPrice(100000000000000000);
    token.setSaleAgent(presale);	

    mainsale = new Mainsale();

    mainsale.setToken(token);
    mainsale.addStage(45000,1500);
    mainsale.setMultisigWallet(0xdfF07F415E00a338205A8E21C39eC007eb37F746);
    mainsale.setFoundersTokensWallet(0x7bfC9AdaF3D07adC4a1d3D03cde6581100845540);
    mainsale.setBountyTokensWallet(0xce8d83BA3cDD4E7447339936643861478F8037AD);
    mainsale.setUnsoldTokensWallet(0xd88a0920Dc4A044A95874f4Bd4858Fb013511290);
    mainsale.setStart(1514764800);
    mainsale.setPeriod(60);
    mainsale.setLockPeriod(90);
    mainsale.setMinPrice(100000000000000000);
    mainsale.setFoundersTokensReserve(20 * (10**6) * 10**18);
    mainsale.setBountyTokensReserve(10 * (10**6) * 10**18);
    mainsale.setMaxTokenSupply(100 * (10**6) * 10**18);

    presale.setMainsale(mainsale);

    token.transferOwnership(owner);
    presale.transferOwnership(owner);
    mainsale.transferOwnership(owner);
  }