Submitted by hack3r-0m, also found by broccoli
the difference is computed incorrectly when a > b. MathUtils.sol L22
As it only used in within1 function, scope narrows down to where difference(a, b) <= 1; is exploitable.
cases where difference(a, b) <= 1 should be true but is reported false:
cases where difference(a, b) <= 1 should be false but is reported true:
within1 is used at the following locations:
It is possible to decrease the denominator and increase the value of the numerator (when calculating y) using constants and input to make within1 fail
Mitigation:
Add else condition to mitigate it.
maxsam4 (Sushi) confirmed
