Sparkn

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

No track of contestId

Summary

In the context of contesting activities within a system, it's crucial to maintain a comprehensive record of individuals who have contested. Neglecting this practice can lead to potential issues such as cheating and self-reward.

This should be applicable to setContest, deployProxyAndDistribute, deployProxyAndDistributeBySignature, deployProxyAndDistributeByOwner, distributeByOwner _distribute, _deployProxy

Vulnerability Details

Attackers can submit multiple contests without the owner being aware of whether the attacker has contested before, making it essential to keep track of those who are contesting.

Impact

Not keeping track of those who have contested can result in cheating and self-reward.

Tools Used

VSCode

Recommendations

mapping(bytes32 => bool) _constestExist; if (_contestExists[contestId]) { revert("Contest already exists"); } else { _contestExists[contestId] = true; }

Before creating a new contest, the function checks whether the contest already exists in the mapping. If it does, the function reverts with an error message indicating that the contest already exists.

Support

FAQs

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