The roundUpDiv
and mulDivOrMax
functions in the LibMath
library perform division operations that could result in a division by zero if the denominator input is zero.
In Solidity, division by zero is a critical issue that can cause transactions to revert. The roundUpDiv
function performs a division operation (a - 1) / b + 1
without checking if b
is zero. Similarly, mulDivOrMax
performs multiple division operations without explicit checks for a zero denominator
.
For roundUpDiv:
For mulDivOrMax
:
If either function is called with a denominator
of zero, the transaction will revert, potentially leading to denial of service or other unintended effects in dependent contracts.
Manual
Implement a check to ensure the denominator is not zero before performing the division.
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.