The __update
function in the Fertilizer
contract has a potential underflow vulnerability when calculating the difference between stopBpf
and _balances[ids[i]][account].lastBpf
. This issue could result in incorrect calculations and potentially disrupt the contract's expected behavior.
See the following code:
The subtraction stopBpf - _balances[ids[i]][account].lastBpf
can cause an underflow if stopBpf
is less than _balances[ids[i]][account].lastBpf
.
Even if one of the ids
has this issue,the whole process will revert. So it will lead to DOS on regular basis.
To mitigate this issue, add a safety check to ensure that the subtraction only occurs when stopBpf
is greater than _balances[ids[i]][account].lastBpf
.
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.