Skip to content
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

Fix price and rate calculation (WARN - it will allow prices be not integer) #84

Open
JackBekket opened this issue Jul 18, 2020 · 0 comments
Labels
bug Something isn't working invalid This doesn't seem right wontfix This will not be worked on

Comments

@JackBekket
Copy link
Member

Problem:
https://github.com/MoonSHRD/MS-Factory/blob/feat/hold/contracts/721/singleton/TicketFactory721.sol#L86
Unneccesarity conversion from wei to ether at contract side

This conversion should be done at client side

Way to solution:

  1. remove conversion from
    https://github.com/MoonSHRD/MS-Factory/blob/feat/hold/contracts/721/singleton/TicketFactory721.sol#L86

  2. refactor
    uint256 ta = (weiAmount / (1 ether)) / (_rate / (1 ether));
    to
    uint256 ta = weiAmount / _rate;
    at
    https://github.com/MoonSHRD/MS-Factory/blob/feat/hold/contracts/721/singleton/TokenSale721.sol#L247

  3. add web3.toWei conversion at client side, in moment, when we setting up price

@JackBekket JackBekket added bug Something isn't working invalid This doesn't seem right wontfix This will not be worked on labels Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant