This vulnerability arises when the ContestManager::fundContest
function fails to verify the success of token transfers using transferFrom
. If the transfer fails silently, the contract mistakenly considers the contest pot as funded, leading to potential underfunding and state inconsistencies.
The fundContest
function calls the transferFrom
function to move tokens from the contract owner to the contest's Pot
. However, it does not check the return value of transferFrom
, which indicates whether the transfer was successful (true
) or failed (false
).
Add this function to your ERC20Mock
contract before running the test case.
Add this test case to you TestMyCut
file.
The failure to check the return value of transferFrom
in the fundContest
function creates a vulnerability where token transfers can fail silently. This leads to a mismatch between the contract's internal state and actual token balances, causing underfunded contests and potentially significant financial discrepancies. Properly handling the return value would prevent this issue, ensuring that contests are only marked as funded when the transfer has been successfully completed.
Participants may attempt to claim rewards from contests that are incorrectly marked as funded, leading to disputes and dissatisfaction when they discover that no tokens are available.
Repeated occurrences of such issues can undermine trust in the platform or smart contract, causing users to lose confidence in its reliability and fairness.
The contract's internal records may show contests as fully funded, while the actual token balances are insufficient, leading to significant financial mismatches that could affect the project's overall integrity.
Manual Review
Do this modification in your ContestManager
contract
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.