Sparkn

CodeFox Inc.
DeFiFoundryProxy
15,000 USDC
View results
Submission Details
Severity: low

setContest closetime can be current block.timestamp

Summary

When the owner set a new contest, the closetime can be accidentally set to current block timestamp.

Vulnerability Details

Despite having no direct impact on the contests, this can lead to a creation of not usable contests, therefore spend gas unnecessary. Assuming that the closetime is used for tracking when to stop accepting valid submissions for the contest, it means that if the admin creates a contest and set the closetime = block.timestamp, the contest will be automatically invalid. In worst case, users will try to propose submissions and lose gas paying for transactions which will not be considered. This is not benefiting neither the owner, nor the contester.

Impact

Lost of gas fees due to sending invalid contests/transactions.

Tools Used

Foundry

Recommendations

if (closeTime > block.timestamp + MAX_CONTEST_PERIOD || closeTime < block.timestamp || closeTime == block.timestamp) {
revert ProxyFactory__CloseTimeNotInRange();
}

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.