I have written a contract where 50% tokens are in reserve and owner wants to sale those tokens via Exchange. Should I add BUY function in contract to achieve this feature.

function buy() payable public {
    uint amount = msg.value/buyPrice;       /// calculates the amount
    _transfer(owner, msg.sender, amount);   /// makes the transfersowner account

If I add this function in contract, anybody can buy after ICO without involving exchange.

Need a guidance on this.

  • Your qus little confusion. Can you please update with code and wht your trying to do? – Jitendra Kumar. Balla May 8 '18 at 11:18
  • let me try to explain it further, let say I as token owner have 100 tokens and I want to sale only 50 in ICO and I want to sale remaining 50 when my token will be listed on exchange via exchanges, how can I achieve it? – murtza gondal May 8 '18 at 14:48

If your token is an ERC20 token a common solution is to move the tokens to an address controlled by the owner at the end of the token sale.

Then the owner can trade them like any other ERC20 token through any exchange that have support for them, EtherDelta for example.

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.