poanetwork / token-wizard

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

(Bug) Minted-Contribution page: Incorrect maxCap for whitelisted investors which added from CSV file #1067

Closed dennis00010011b closed 6 years ago

dennis00010011b commented 6 years ago

Steps:

  1. Create Minted crowdsale, 1 tier, duration by default, decimals=18, rate=1000, supply=100
  2. In Step 3 add whitelisted addresses from file : https://drive.google.com/open?id=1jGWohlqK3PttrPHT_Sma1ousATHSm0gz Private keys: https://drive.google.com/open?id=1QB8Y6qm11ZBRbPd9kiRF7ccd1_ALBJPN

3 .Finish deployment

  1. Set up any whitelisted account in wallet
  2. Open contribution page, observe max contibution field, try to buy

Expected result:

Actual result:

If you are reporting a problem with Token Wizard, please include the following information:

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

Ropsten

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

proxyID 0xce4c704c3af8f359929ed09d3fe3739913d5e263

Do you have screenshots showing the problem?

uuu

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

No


fernandomg commented 6 years ago

This is weird, I've beeing trying to reproduce the bug (with the code in branch 2.0 and with the code from PR #1065), and no luck, everything seems to work fine today :confused:

@dennis00010011b Can you confirm this?

I'm using Ropsten.

The crowdsales addresses:

dennis00010011b commented 6 years ago

@fernandomg Hm.. I can't reproduce with 2.0: 0xb04a586a5d36b2811f32a116d345ac9b5a81d922 But it still reproducible with 2.0: 0xce4c704c3af8f359929ed09d3fe3739913d5e263

dennis00010011b commented 6 years ago

@fernandomg Cause of this issue is that I used supply=100 but some whitelisted addresses have maxCap > 100 . That's why maxContribution field less than maxCap for some addresses . For avoid such cases we need the validation of whitelisted addresses : minCap should be less than supply

fernandomg commented 6 years ago

@dennis00010011b really good catch! thanks!

fernandomg commented 6 years ago

To fix this issue, allow a whitelisted account's maxCap to be not greater than the tier's supply