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:
-
remove conversion from
https://github.com/MoonSHRD/MS-Factory/blob/feat/hold/contracts/721/singleton/TicketFactory721.sol#L86
-
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
-
add web3.toWei conversion at client side, in moment, when we setting up price
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:
remove conversion from
https://github.com/MoonSHRD/MS-Factory/blob/feat/hold/contracts/721/singleton/TicketFactory721.sol#L86
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
add
web3.toWeiconversion at client side, in moment, when we setting up price