poanetwork / token-wizard

(Discontinued) TokenWizard is an DApp to create and manage crowdsale and token contracts using a simple UI
MIT License
386 stars 214 forks source link

(Wizard2.0-Dutch)Investor receives more tokens than planned to buy #865

Closed dennis00010011b closed 6 years ago

dennis00010011b commented 6 years ago

Test URL: https://5af093921f12b70ce2f90775--architect-coin-64174.netlify.com/

Steps:

  1. Create crowdsale: decimals=18, supply=1000(Step2), mincap=0, 1 tier: duration=10min, minRate=1000, maxRate=2000, supply=1000
  2. Open invest page and buy 100 tokens
  3. Look to the balance

Expected result:

Actual result:

Probably it happens because the price changing quickly and investor receives tokens for lower price than he planned to buy.

Which network did you use? (Mainnet, Kovan, Rinkeby, etc.)

Ropsten

If you were able to create it, what is the URL of your crowdsale?

https://5af093921f12b70ce2f90775--architect-coin-64174.netlify.com/invest?exec-id=0x86851fe8cadbdfc6ffa955bdfa3a7d94f0f484410ec5ddbdfb008ff801510913&networkID=3

Do you have screenshots showing the problem?

screen shot 2018-05-08 at 22 47 08 screen shot 2018-05-08 at 22 47 11

Do you see errors in the dev console? If yes, please include a screenshot

To open the dev console in Google Chrome, press F12, or go to View -> Developer -> Developer Tools, and open the Console tab

If you see errors, please right click on them and "Save as..". Zip saved file and attach it to the Issue.

No


vbaranov commented 6 years ago

Probably it happens because the price changing quickly and investor receives tokens for lower price than he planned to buy.

@dennis00010011b Exactly. Anyways, the next change was made: recalculation of rate has implemented immediately before a transaction generation. The rest is a time gap between tx generation and submitting to blockchain. Increasing of crowdsale time or decreasing difference between min and max rate leads to mitigating this issue.

dennis00010011b commented 6 years ago

Issue still reproducible ExecID 0x7bc9b1fa37f2fa80e76e2333ecd9b0c34495068af66cb4bdc72150306ca2cfcd

screen shot 2018-05-14 at 22 08 46 screen shot 2018-05-14 at 22 10 09
vbaranov commented 6 years ago

@dennis00010011b as I said, I guess, it is related to a gap between transaction generation and submitting to blockchain(time between Metamask alert is displayed and time when you clicked “Confirm” button). Can you reproduce this issue with local connection to ganache-cli (without Metamask installed) ? Then transactions are confirmed immediately, and amount you are trying to buy should be almost the same, that you actuallly have bought.