contract VestingFactory is Ownable {
    
    event VestingCreated(address vestingContractAddress, address beneficiary);
    
    uint256 public constant START  = 1618461892; // start time
    
    uint256 public constant CLIFF  = 86400 * 30; //30 days
    
    uint256 public constant DURATION  = 86400 * 180; //180 days
    
    uint256 public constant PRICE = 610000000000000; // 0.00061 ETH or roughly 1.5 USD 
    
    address public constant LIX = address(0xd0345D30FD918D7682398ACbCdf139C808998709); // LIX TOKEN 0xd0345D30FD918D7682398ACbCdf139C808998709

    function purchase(uint256 amount) public payable {
        uint256 cost = SafeMath.mul(amount, PRICE);
        require(cost == msg.value);
        
        TokenVesting newVestingContract = new TokenVesting(msg.sender, START, CLIFF, DURATION, false); // IRREVOCCABLE. Meaning, once vested, the tokens stay vested. There's no admin function to cancel it midway.
        IERC20(LIX).transfer(address(newVestingContract), amount);
        VestingCreated(address(newVestingContract), msg.sender);
    }
    
    /**
     * @dev Withdraw ether from this contract (Callable by owner)
    */
    function withdraw() onlyOwner public {
        uint balance = address(this).balance;
        msg.sender.transfer(balance);
    }
    
    function withdrawLIX() onlyOwner public {
        uint balance = IERC20(LIX).balanceOf(address(this));
        IERC20(LIX).transfer(msg.sender, balance);
    }
    
}
function purchase(uint256 amount) public payable {
    uint256 cost = SafeMath.mul(amount, PRICE);
    require(cost == msg.value);
        
    TokenVesting newVestingContract = new TokenVesting(msg.sender, START, CLIFF, DURATION, false); // IRREVOCCABLE. Meaning, once vested, the tokens stay vested. There's no admin function to cancel it midway.
    IERC20(LIX).transfer(address(newVestingContract), amount);
    VestingCreated(address(newVestingContract), msg.sender);
}

// LIX TOKEN 0xd0345D30FD918D7682398ACbCdf139C808998709