Unsafe casting of int256 to uint256 could lead to overflow and Incorrect calculation.
Summary
In the LiquidatePartyB function, its logic tree does a check that involves an unsafe casting an init to a uint256 which can lead to and overflow and a wrong values checked.
shealtielanz
medium
Unsafe casting of int256 to uint256 could lead to overflow and Incorrect calculation.
Summary
In the LiquidatePartyB function, its logic tree does a check that involves an unsafe casting an init to a uint256 which can lead to and overflow and a wrong values checked.
Vulnerability Detail
In the LiquidatePartyB function
Casting an Init to uint this way will cause a silent flow where the value is change.
Impact
This could lead to incorrect value checks and could be exploited to manipulate the liquation of Party B.
Code Snippet
Tool used
Manual Review
Recommendation
Make use of a sol's safeCast Library when casting.