The ContestManager::fundContest
function uses an unchecked transferFrom operation, which may lead to situations where tokens are not properly transferred to the Pot contract without the contract detecting the failure.
TheContestManager::fundContest
attempts to transfer tokens from the caller to a specific Pot contract using the following code:
However, this operation does not check the return value of ContestManager::token.transferFrom
. If the operation fails (e.g., due to insufficient balance or allowance), the contract will proceed as if the transfer was successful, potentially leading to a mismatch between the expected and actual funds available in the Pot
.
Funds Mismatch: The Pot
contract may not receive the intended amount of tokens, leading to insufficient rewards available for distribution. This could cause users to attempt to claim rewards that do not exist, resulting in failed transactions and a poor user experience.
Manual Review
Slither
Use OpenZeppelin’s SafeERC20 library to ensure the transferFrom operation is checked for success, and revert the transaction if it fails.
Or check the return value.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.