I am trying to develop ICO presale site and researched various ICO contracts on github. I am now stuck because I can't know when I should transfer tokens to investors. Someone wrote buyTokens functions as below.
And other person wrote buyTokens function as below.
As you can see, the former made logic that investors can get tokens instantly while the latter made logic that investors can claim their token after ICO finish. I am not sure if investors would like without seeing tokens instantly on their wallet after clicking purchase button in the second case. Can you please teach me how we can persuade investors wait until ICO finish to get their tokens? I mean I want to know how ICO presale site can make guarantee for investors.