Sparkn

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

The logic that has been commented out has not been implemented.

Summary

The code to set the closing time to the current time and immediately end the contest if the organizer wishes has not been implemented in the ProxyFactory.sol contract.

Vulnerability Details

The code includes a comment suggesting that the organizer has the ability to halt the contest immediately by adjusting the closing time to the present moment. However, the actual implementation of this functionality is absent in the provided code.

https://github.com/Cyfrin/2023-08-sparkn/blob/0f139b2dc53905700dd29a01451b330f829653e9/src/ProxyFactory.sol#L133

133: // can set close time to current time and end it immediately if organizer wish
134: if (saltToCloseTime[salt] > block.timestamp) revert ProxyFactory__ContestIsNotClosed();
135: address proxy = _deployProxy(msg.sender, contestId, implementation);

Impact

Since the logic that would allow organizers to promptly terminate contests and distribute tokens by setting up the close time to the current time has not been put in place, they are currently unable to take immediate action in stopping contests and distributing tokens as per their preferences. This implies that the organizer must wait until the designated closing time to distribute the prize to the winners.

Tools Used

Manual Review

Recommendations

Implement the necessary logic to enable setting the closing time to the current time, thereby allowing organizers to immediately close the contests if they wish to do so.

Support

FAQs

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