Skip to content

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

@JackBekket

Description

@JackBekket

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginvalidThis doesn't seem rightwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions