Division by Zero: None of the division functions (div, divFloor, divCeil, reciprocalFloor, reciprocalCeil) check for division by zero, which will cause a revert. It is important to ensure that the divisor is never zero when calling these functions.
Vulnerability Detail
div, divFloor, divCeil, reciprocalFloor, reciprocalCeil will revert as we can be be dividing by 0.
Impact
Function will be revert as division functions (div, divFloor, divCeil, reciprocalFloor, reciprocalCeil) doesnot check for division by zero,
bareli
medium
Division by Zero
Summary
Division by Zero: None of the division functions (div, divFloor, divCeil, reciprocalFloor, reciprocalCeil) check for division by zero, which will cause a revert. It is important to ensure that the divisor is never zero when calling these functions.
Vulnerability Detail
div, divFloor, divCeil, reciprocalFloor, reciprocalCeil will revert as we can be be dividing by 0.
Impact
Function will be revert as division functions (div, divFloor, divCeil, reciprocalFloor, reciprocalCeil) doesnot check for division by zero,
Code Snippet
https://github.com/sherlock-audit/2023-12-dodo-gsp/blob/main/dodo-gassaving-pool/contracts/lib/DecimalMath.sol#L30
Tool used
Manual Review
Recommendation
use require statement to check for the division by zero.