The `fundContest()` function checks if the owner has sufficient token balance, but it should check the allowance instead. The function uses `transferFrom()`, which requires an allowance, not just a balance. This check can incorrectly revert when the owner has sufficient balance but insufficient allowance, or incorrectly proceed when the owner has sufficient allowance but the check passes due to balance.
The function checks `token.balanceOf(msg.sender)` but `msg.sender` is the owner (due to `onlyOwner`), and the actual transfer happens from `msg.sender` to the Pot. However, if tokens were approved from a different address, this check is meaningless.
Likelihood:
* This occurs when the owner attempts to fund a contest
* The issue manifests when tokens are approved from a different address than the owner, or when the owner has balance but hasn't approved the ContestManager
Impact:
* Function may revert incorrectly when owner has balance but insufficient allowance
* Function may proceed incorrectly if the check passes but `transferFrom()` fails due to insufficient allowance
* The error message "InsufficientFunds" is misleading when the actual issue is insufficient allowance
* Poor user experience due to incorrect error handling
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.