I am using slither and I get the following medium severity error: performs a multiplication on the result of a division
Now this is the equation in question.
uint256 mult = (_type == 1 ? 5 : 2); uint256 value = (((_amount / 1e18) * (getPrice() / 1e18)) / 10) * mult * 1e18;
I need some help to rewrite this equation to satisfy slither.
That equation is basically doing the following:
- Gets the price of what they sent (
getPriceis the current price of BNB and
_amountis what they sent in wei)
- Get the value of how many times it goes into $10
- Multiply that value by a multiplier
- Convert it back to wei
- Gives answer on how many tokens to give to user
Any help on this would be greatly appreciated. Thanks!