The calculateStreamedPercentage function calculates the percentage of the deposited amount that has been streamed so far. However, it does not explicitly handle the case where depositedAmount is zero, which can lead to a division by zero error.
Consider a function tokenURI that generates metadata for an NFT. If calculateStreamedPercentage is called within this function and the depositedAmount is zero, the function will revert, causing the entire metadata generation process to fail.
If depositedAmount is zero, the division operation will cause the transaction to revert, leading to potential disruptions in the contract's functionality.
Users might experience failed transactions without a clear understanding of the cause, leading to confusion and frustration.
manual review
Ensure that depositedAmount is greater than zero before performing the division.
Here is an updated version of the calculateStreamedPercentage function that includes a check for zero depositedAmount:
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.