The ContestManager contract does not track whether a contest has already been funded within its state. Consequently, the owner can accidentally call fundContest multiple times for the same contest index, which results in extra tokens being pulled from the owner's address and permanently locked or misallocated inside the target Pot contract.
The contract allows the owner to deploy individual Pot contracts for contests using createContest and subsequently fund them using fundContest.
However, fundContest lacks any state validation or tracking (such as a boolean flag or status mapping) to check if a specific contest index has already received its token allocation. Because the execution flow remains completely stateless regarding the funding history, the transfer logic will execute every time the function is called for that index, as long as the owner has a sufficient token balance and allowance.
Solidity
The owner executes the fundContest function multiple times due to a script error, network congestion resulting in retries, or simple manual operational oversight.
User/Protocol Funds Drain: The owner's token balance is unintentionally depleted by sending redundant rewards to the same Pot.
Locked Capital: Excess funds transferred to the Pot contract become stuck or improperly distributed, as the Pot is only configured to allocate the original totalRewards amount to its players.
The owner calls createContest to initialize a new contest requiring 1,000 tokens.
The owner calls fundContest(0) for the first time, successfully transferring 1,000 tokens to the Pot.
The owner accidentally calls fundContest(0) a second time due to a UI lag or duplicate transaction submission.
The transaction successfully executes again, pulling an additional 1,000 tokens from the owner and leaving the Pot contract with 2,000 tokens instead of the required 1,000.
Introduce a state mapping to record when a contest has completed its funding phase, and add a custom error check to prevent subsequent execution.
Solidity
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.