The LibMath::roundUpDiv and MultiFlowPump::calcCapExponent functions can revert due to division by zero.
In Solidity, a division by zero error will cause a transaction to fail and revert. This means that all changes made during the transaction will be rolled back and no state changes will be made to the blockchain. The entire transaction will be considered invalid and the gas used by the transaction will not be refunded.
There are two functions where there can be a division by zero. The first one is LibMath::roundUpDiv:
In LibMath:
And the second one is: MultiFlowPump::calcCapExponent:
In MultiFlowPump:
In LibMath::roundUpDiv function there is no check if b is not 0. And in the MultiFlowPump::calcCapExponent there is no check to ensure that capInterval is not 0.
If the b in LibMath::roundUpDiv is 0 or the capInterval in MultiFlowPump::calcCapExponent is 0, the functions roundUpDiv and calcCapExponen will revert.
And the functions that rely on these functions will also fail and revert.
Manual Review
Add a require statement to check if b in LibMath::roundUpDiv and capInterval in MultiFlowPump::calcCapExponent are not 0:
In LibMath:
In MultiFlowPump:
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.