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

(Fix) Investors incorrect max cap #1072

Closed fernandomg closed 6 years ago

fernandomg commented 6 years ago

Closes #1067

This PR fixes all the related issues with whitelisted addresses and tier's supply. Scenarios that I took into account for both strategies (MintedCapped and DutchAuction):

Note The scenario that I didn't fix, due to the complexity of the fix itself (it would require several modifications and would be better to address it in a separate PR), has to be with manage screen and an address values modification.

As you can see in the screenshot image Despite having 1011 tokens available, and requiring only 28 extra tokens to change 1972 to 2000, it's giving the error as it considers that the address is new and not a modification of an existing one.


Also:

dennis00010011b commented 6 years ago

@fernandomg Manage page: allowed to add whitelisted investors with maxCap greater than remained token's supply. Steps:

  1. Create Minted crowdsale, 1 tier:
    • supply =1000
    • whitelisted address with maxCap=300
  2. As whitelisted investor buy maxCap
  3. As an owner open manage page
  4. Add another whitelisted investor with maxCap=supply

Expected result:

Actual result:

fernandomg commented 6 years ago

@dennis00010011b that was quick! thanks for the catch, will review it

BlackDuckCoPilot commented 6 years ago

Black Duck Security Report

Merging #1072 into 2.0 will not change security risk.

Removed Components

Clean: 2

Click here to see full report

fernandomg commented 6 years ago

Ok, so after reviewing the different scenarios that will arise with this PR and have a chat with @vbaranov. It was decided to close this PR and create a new solution for #1067, which is https://github.com/poanetwork/token-wizard/issues/1067#issuecomment-411397561