token-wizard icon indicating copy to clipboard operation
token-wizard copied to clipboard

(Bug) Deployment failed if number of reserved addresses more than 45

Open dennis00010011b opened this issue 7 years ago • 3 comments

Reproducibility 5/5

Steps:

  1. Start wizard https://wizard.oracles.org/
  2. Start creating, add 50 reserved addresses
  3. Continue and finish deployment.

Expected result:

  • token should be deployed without issue
  • user should able to distribute tokens to reserved addresses

Actual result:

  • transaction 'Register addresses for reserved tokens' skipped
  • manage page does not contain button 'Distribute'

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

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

Sokol, Rinkeby

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

https://wizard.oracles.org/invest?addr=0x3cab0D682C7F95Dcad39030895775e7b0799E4c4&networkID=4

Do you have screenshots showing the problem?

screen shot 2018-04-07 at 15 45 40 screen shot 2018-04-07 at 15 45 35 screen shot 2018-04-07 at 15 46 50 screen shot 2018-04-07 at 15 51 21 screen shot 2018-04-07 at 15 53 31 screen shot 2018-04-07 at 15 53 49 screen shot 2018-04-07 at 16 00 03 screen shot 2018-04-07 at 16 02 18

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

Yes screen shot 2018-04-07 at 15 53 49

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

bundleReservedTokens.log icowizard_Rinkeby_0xE375BB8C92112B841eFD313E7b02ea5b8F3c2aa6.zip


dennis00010011b avatar Apr 07 '18 23:04 dennis00010011b

I'll work on this after #777, so that manual testing it is easier.

fvictorio avatar Apr 10 '18 19:04 fvictorio

@vbaranov I just realized that this is going to need a change in the contract:

  function setReservedTokensListMultiple(
    address[] addrs, 
    uint[] inTokens, 
    uint[] inPercentageUnit, 
    uint[] inPercentageDecimals
  ) public canMint onlyOwner {
    assert(!reservedTokensDestinationsAreSet);
    assert(addrs.length == inTokens.length);
    assert(inTokens.length == inPercentageUnit.length);
    assert(inPercentageUnit.length == inPercentageDecimals.length);
    for (uint iterator = 0; iterator < addrs.length; iterator++) {
      if (addrs[iterator] != address(0)) {
        setReservedTokensList(addrs[iterator], inTokens[iterator], inPercentageUnit[iterator], inPercentageDecimals[iterator]);
      }
    }
    reservedTokensDestinationsAreSet = true;
  }

The method does not allow calling it more than once, but if we want to reserve a lot of addresses (say, hundreds) then we'll need to do it in chunks.

I have already made the changes in the frontend to do this, but of course the method fails the second time is called.

But my question is, does it make sense to modify this if we are going to migrate everything to auth_os? How should we approach this?

cc @pablofullana

fvictorio avatar Apr 13 '18 13:04 fvictorio

Yes, it is contract limitation for now. Let's put this issue on hold until migration to auth_os.

vbaranov avatar Apr 13 '18 13:04 vbaranov