groLabs / GSquared

GNU General Public License v3.0
1 stars 0 forks source link

Informational - Theoretical casting overflow #40

Open kitty-the-kat opened 1 year ago

kitty-the-kat commented 1 year ago

Casting is not protected by SafeMath and could overflow. There is one case where this may happen.

Technical Details

This line of StopLossLogic casts a uint256 dy_diff to an int256 value. It is possible a very large unsigned value would be converted to a negative number.

Impact

Informational.

Recommendation

Consider protecting against this casting overflow.

kitty-the-kat commented 1 year ago

acknowledged - not going to fix as this is v. unlikely to happen