The protocol Allows users to contribute to the fund before the creator has set a deadline. This premature contribution capability creates uncertainty for the contributors.
In the contribute
function, there is a check that verifies wheather the deadline has passed, but it incorrectly allows the contributions when no deadline is set (whenfund.deadline
is 0 ).
Due to the use of AND (&&) operator in the condition, the function only blocks contributions when both:
A deadline has been set (fund.deadline != 0
)
The deadline has passed (fund.deadline < current_time
)
This means that when fund.deadline
is 0 (its initial value when a fund is created ), the first condition is false, making the entire condition false regardless of the second condition, and allowing contricutions to proceed.
Medium
Manual Review
Add the above code snippet.
There is no problem users to contribute to a given campaign before the deadline is initialized. The issue is when the users refund before the deadline is set.
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.