-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Wizard 2.0) Disable to buy minimal amount(decimals) if decimals>16 #853
Comments
@dennis00010011b |
@dennis00010011b @fernandomg
where It is simple to check, that Please let me know, if I'm wrong. |
As I understand minCap will be the minimum value allowed for the first In the other hand, if we think about For instance, if the user sets I'm thinking about it from this perspective, due to the steps in the wizard. User will set first the amount of decimals for the token, based on that, I thought about inform the user the max rate that he/she will be able to set, depending on the amount of decimals. |
right
but I am not sure, validating of a rate in such manner it is a good idea. Why, for example, if token decimals = 18, the rate should be <= 1? we can see from https://etherscan.io/tokens, that overwhelming number of tokens has 18 decimals with different rates > 1. I rather think that token decimals and rate could be arbitrary, but we need to warn contributors and crowdsale owner what will be the minimal amount to contribute. Maybe, For owner: For contributors: @fernandomg @fvictorio @pablofullana @dennis00010011b what do you think? |
So, this is my understanding: If you create a crowdsale with both a big rate and a lot of decimals, then a contributor won't be able to buy any theoretically allowed amount of tokens. More precisely, not all multiples of In other words, the worst case scenario is that a user "loses" 1 wei. Is this really important? I honestly don't think is even worth a warning. Maybe some small print below the contribute input, even smaller than the "Think twice before...". If this is important for some reason, then we should check that the number of tokens that the user typed can be bought by a whole number of weis. If not, we would show some kind of message saying how many tokens will actually be bought. This message would look like "You want to buy 0.000000000000000001, but the closest allowed value you can buy is 0.000000000000000003". But then again, I doubt users will care. |
Users lose nothing. We convert to an integer before sending transaction. I would say, the issue is not with the non-integer amount of wei but with the fact, that |
Yes, sorry. What I meant was that if we round up to the next wei, the user will be spending (at most) 1 wei more than they intended. But I said that because I thought we were doing that rounding up, which will avoid the issue with the min buy, but I take from your answer that we are not? In that case, doing that rounding is a possible solution, but a message indicating the minimum amount that can be bought sounds fine too. |
Yeah, we are doing that rounding up, but for some specific parameters (of crowdsale and token) 1 wei which user will be trying to pay will not be enough due to min cap ("natural", global or individual) and a transaction will be failed like from Dennis's experience from this issue. Also, I agree that this is a rare boundary case. My suggestion here is just to give a user maximum info on the page in order to avoid misunderstandings. |
Test URL: https://5aec92f21f12b70339c64d4a--architect-coin-64174.netlify.com/
Steps:
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?
*https://5aec92f21f12b70339c64d4a--architect-coin-64174.netlify.com/invest?exec-id=0x45cd5779ef7840269cf3fc9e2490ea72ff119027401f8ac0a61c932cd1b64c5f&networkID=3
*
Do you have screenshots showing the problem?
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 tabIf you see errors, please right click on them and "Save as..". Zip saved file and attach it to the Issue.
Your answer
The text was updated successfully, but these errors were encountered: