In Silo:rewardToFertilizer
there is a condition newTotalBpf >= firstEndBpf
in the while loop. This condition implies that the loop continues as long as the total new beans per fertilizer is greater than or equal to the end beans per fertilizer of the first fertilizer to run out. At the end of the loop firstEndBpf
has assigned s.fFirst
value, which is never updated or changed within the loop. Same value is assigned again and again.
See the following code:
If s.fFirst
is not properly updated within the loop and remains constant or increases indefinitely, the loop condition newTotalBpf >= firstEndBpf may always evaluate to true, causing the loop to become an infinite loop. This could result in excessive gas consumption and potentially render the contract unusable.
Manual Review
To address this potential issue, you should ensure that s.fFirst
is updated correctly within the loop so that the loop condition terminates as expected. Alternatively, you may need to adjust the loop condition to properly reflect the termination criteria based on the logic of your contract.
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.