contract LittlePhilCrowdsale is MintedCrowdsale, TieredCrowdsale, InitialSupplyCrowdsale, TokenVestingCrowdsale, WhitelistedCrowdsale {

    /**
     * @notice Event for rate-change logging
     * @param rate the new ETH-to_LPC exchange rate
     */
    event NewRate(uint256 rate);

    /**
     * @notice Constructor
     */
    constructor(
        uint256 _rate,
        address _fundsWallet,
        address[6] _wallets,
        LittlePhilCoin _token,
        address _whitelister
    ) public
    Crowdsale(_rate, _fundsWallet, _token)
    InitialSupplyCrowdsale(_wallets) 
    WhitelistedCrowdsale(_whitelister){}

    /**
     * @notice Sets up the initial balances
     * @dev This must be called after ownership of the token is transferred to the crowdsale
     */
    function setupInitialState() external onlyOwner {
        setupInitialSupply();
    }

    /**
     * @notice Ownership management
     */
    function transferTokenOwnership(address _newOwner) external onlyOwner {
        require(_newOwner != address(0));
        // I assume the crowdsale contract holds a reference to the token contract.
        LittlePhilCoin(token).transferOwnership(_newOwner);
    }

    /**
     * @notice Crowdsale Closed
     * @dev Called at the end of the crowdsale when it is ended
     */
    function crowdsaleClosed() internal {
        uint256 remainingTokens = tokenCap.sub(tokensRaised);
        _deliverTokens(airdropWallet, remainingTokens);
        LittlePhilCoin(token).finishMinting();
    }

    /**
     * @notice Checks the state when validating a purchase
     */
    function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal {
        super._preValidatePurchase(_beneficiary, _weiAmount);
        require(_weiAmount >= 500000000000000000);
    }

    /**
     * @notice Update the ETH-to-LPC exchange rate
     * @param _rate The Rate that will applied to ETH to derive how many LPC to mint
     * does not affect, nor influenced by the bonus rates based on the current tier.
     */
    function setRate(uint256 _rate) public onlyOwner {
        require(_rate > 0);
        rate = _rate;
        emit NewRate(rate);
    }

     /**
      * @notice Mint for Private Fiat Transactions
      * @dev Allows for minting from owner account
      */
    function mintForPrivateFiat(address _beneficiary, uint256 _weiAmount) public onlyOwner {
        _preValidatePurchase(_beneficiary, _weiAmount);

        // calculate token amount to be created
        uint256 tokens = _getTokenAmount(_weiAmount);

        // update state
        weiRaised = weiRaised.add(_weiAmount);

        _processPurchase(_beneficiary, tokens);
        emit TokenPurchase(
            msg.sender,
            _beneficiary,
            _weiAmount,
            tokens
        );

        _updatePurchasingState(_beneficiary, _weiAmount);

        _forwardFunds();
        _postValidatePurchase(_beneficiary, _weiAmount);
    }

}
/**
 * @title Little Phil Crowdsale
 */
function mintForPrivateFiat(address _beneficiary, uint256 _weiAmount) public onlyOwner {
    _preValidatePurchase(_beneficiary, _weiAmount);

    // calculate token amount to be created
    uint256 tokens = _getTokenAmount(_weiAmount);

    // update state
    weiRaised = weiRaised.add(_weiAmount);

    _processPurchase(_beneficiary, tokens);
    emit TokenPurchase(
        msg.sender,
        _beneficiary,
        _weiAmount,
        tokens
    );

    _updatePurchasingState(_beneficiary, _weiAmount);

    _forwardFunds();
    _postValidatePurchase(_beneficiary, _weiAmount);
}

/**
 * @notice Mint for Private Fiat Transactions
 * @dev Allows for minting from owner account
 */