Inside MarketUtils.sol, there is a function sumReturnUint256:
When b < 0 and the absolute value of b is greater than a, an underflow condition may occur.
This function does not properly handle cases where b is negative and exceeds a, leading to an underflow error. This can result in unintended behavior and incorrect calculations.
Incorrect Computations: Arithmetic underflow may lead to improper calculations, causing inaccurate results in functions relying on this logic.
Potential Security Risks: If this function is used in sensitive financial calculations, an underflow could lead to unexpected contract behavior.
Manual Code Review
Solidity Static Analysis Tools
Refactor sumReturnUint256 to include checks preventing underflow conditions.
This ensures that a is large enough to handle the subtraction, preventing underflow errors.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.