contract SellTokens is Ownable {
    using SafeMath for uint256;

    ERC20Basic public token;

    uint256 decimalDiff;
    uint256 public rate;
    string public description;
    string public telegram;


    /**
     * @dev Constructor
     */
    constructor(ERC20Basic _token, uint256 _tokenDecimals, uint256 _rate, string _description, string _telegram) public {
        uint256 etherDecimals = 18;

        token = _token;
        decimalDiff = etherDecimals.sub(_tokenDecimals);
        rate = _rate;
        description = _description;
        telegram = _telegram;
    }

    /**
     * @dev receive ETH and send tokens
     */
    function () public payable {
        uint256 weiAmount = msg.value;
        uint256 tokenAmount = weiAmount.mul(rate).div(10 ** decimalDiff);
        
        require(tokenAmount > 0);
        
        assert(token.transfer(msg.sender, tokenAmount));
        owner.transfer(address(this).balance);
    }

    /**
     * @dev Set Rate
     * 
     * @param _rate uint256
     */
    function setRate(uint256 _rate) external onlyOwner returns (bool) {
        rate = _rate;
        return true;
    }

    /**
     * @dev Set Description
     * 
     * @param _description string
     */
    function setDescription(string _description) external onlyOwner returns (bool) {
        description = _description;
        return true;
    }

    /**
     * @dev Set Telegram
     * 
     * @param _telegram string
     */
    function setTelegram(string _telegram) external onlyOwner returns (bool) {
        telegram = _telegram;
        return true;
    }
}
/**
 * @title Sell Tokens
 */
function setDescription(string _description) external onlyOwner returns (bool) {
    description = _description;
    return true;
}

/**
 * @dev Set Description
 * 
 * @param _description string
 */