contract BaseContract is MintableToken, FreezableToken, RoundsContract {

    uint256 internal purchasedTokens;

    uint256 internal sellPrice;
    
    uint256 internal sellPriceDecimals;

    uint256 internal buyPrice;
    
    uint256 internal buyPriceDecimals;

    uint256 internal membersCount;

    event Buy(address target, uint256 eth, uint256 tokens);

    event Sell(address target, uint256 eth, uint256 tokens);


    
    /**
     * @return return sell price decimals
     */
    function getSellPriceDecimals() public view returns (uint256) {
        return sellPriceDecimals;
    }

    /**
     * @return return buy price decimals
     */
    function getBuyPriceDecimals() public view returns (uint256) {
        return buyPriceDecimals;
    }

    /**
     * @return return sell price
     */
    function getSellPrice() public view returns (uint256) {
        return sellPrice;
    }

    /**
     * @return return buy price
     */
    function getBuyPrice() public view returns (uint256) {
        return buyPrice;
    }

    /**
     * @return return count mebers
     */
    function getMembersCount() public view returns (uint256) {
        return membersCount;
    }

    /**
     * @dev return count bought tokens 
     * @return uint256
     */
    function getPurchasedTokens() public view returns(uint256) {
        return purchasedTokens;
    }


    /**
     * @dev set prices for sell tokens and buy tokens
     */
    function setPrices(uint256 newSellPrice, uint256 newBuyPrice) public onlyOwner{
        sellPrice = newSellPrice;
        buyPrice = newBuyPrice;
    }


     /**
     * @dev set prices for sell tokens and buy tokens
     */
    function setPricesDecimals(uint256 newSellDecimal, uint256 newBuyDecimal) public onlyOwner{
        sellPriceDecimals = newSellDecimal;
        buyPriceDecimals = newBuyDecimal;
    }

    /**
     * @dev buy tokens 
     */
    function buy(address _sender, uint256 _value) internal isRoundActive{
        require (_value > 0 );
        require (buyPrice > 0);
        uint256 dec = 10 ** buyPriceDecimals; 
        uint256 amount = (_value / buyPrice) * dec; 
        require((purchasedTokens + amount) < rounds[currentRoundKey].tokens);
        require( (purchasedTokens + amount) <= _totalSupply);
        purchasedTokens = purchasedTokens.add(amount);
        membersCount  = membersCount.add(1);
        _transfer( owner,  _sender, amount);
        emit Buy(_sender, _value, amount);
    }

    /**
     * @dev Sell tokens 
     */
    function sell(uint256 amount) public {
        uint256 dec = 10 ** sellPriceDecimals; 
        uint256 sellAmount = (amount * sellPrice) /  dec;
        require(owner.balance >= sellAmount);
        _transfer(msg.sender, owner, amount);
        msg.sender.transfer(sellAmount);
        emit Sell(msg.sender, sellAmount, amount);
    }
}
/**
 * @title Base contract 
 * @dev Contract for adding ability byu and sell tokens
 */
function getSellPrice() public view returns (uint256) {
    return sellPrice;
}

/**
 * @return return sell price
 */