1

I am planning to run a Coin's ICO for several years, not interested in the gains to be made from selling out ICO in 3 days NO, but interested in using the COin to end Global Poverty as i deem fit. So a lenghty ICO is one solution. That said I want to know if its possible for the coin to be liquid during the ICO of like 2-4 years. If it is possible for its liquidity then suggest how that can be done please.

0

You have to set the liquidity in the solidity contract. Most ICO's restrict the transfer of funds during the ICO using a start/stop function. However, to answer your question. You need 3 functions. Buy, Sell and set minimum price.

/**
* @dev Buys Tokens from contract in ether
*/
function () isRunning validAddress external payable {
    uint256 amount = msg.value;
    amount = amount.div(buyPrice);
    amount = amount.mul(10**18);
    _transfer(this, msg.sender, amount);
    Buy(this, msg.sender, amount, buyPrice);
  }

/**
* @dev Sells Ether from contract in Token
* @param amount The amount of tokens to be sold
*/
function sell(uint256 amount) isRunning validAddress public {
    require(this.balance >= amount.mul(sellPrice));
    _transfer(msg.sender, this, amount);
    msg.sender.transfer(amount.mul(sellPrice));
    Sell(msg.sender, this, amount, sellPrice);
}

/**
* @dev Sets Buy and Sell Prices
* @param newSellPrice The Sell Price
* @param newBuyPrice The Buy Price
*/
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner {
    sellPrice = newSellPrice;
    buyPrice = newBuyPrice;
}

You would also need to send the tokens that you create back to the token contract, or create a new contract just for the liquidity.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.