The deadline validation mechanism is incomplete, allowing potentially invalid deadlines.
The function set_deadline
does not have a mechanism to prevent setting deadlines in the past.
The owner of the Fund caling set_deadline
will have the ability to set a deadline in the past. This will block the contribute
function, because the deadline check will show, that the fund is not active returning error DeadlineReached
Foundry Tests: By writing a test where I set a deadline in the past.
Manual Code Review: Identified missing checks in the function set_deadline
.
Additional deadline check which verifies that the deadline is not in the past.
New error code ErrorCode::InvalidDeadlineInput
which will be returned when the check is triggered.
The creator has an incentive to pay attention to the deadline and provide correct data. If the `deadline` is set in the past, the campaign will be completed. If there are any funds the creator or the contributors (depending on the success of the campaign) can receive them. It is the creator's responsibility to set correct deadline, otherwise the creator can create a new campaign. There is no impact on the protocol from this missing check, so I consider this to be an informational issue.
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.