A transferFrom call is made to an ERC20 token contract without verifying its return value. This can lead to unexpected behavior if the transfer fails silently (i.e., returns false but does not revert).
ERC20’s transferFrom() function is defined to return a bool indicating success. Some non-standard or outdated tokens may return false rather than reverting on failure.
In both of these functions i.e
RockPaperScissors::createGameWithToken
and RockPaperScissors::joinGameWithToken
have the same issue
Medium.
Failing to check the result may cause logic to proceed as if a token was transferred, when in fact it was not.
This is particularly risky when interacting with non-compliant ERC20 tokens, or tokens like USDT that do not revert on failure.
Manual Review
Slither
OpenZeppelin ERC20 standard documentation
Use OpenZeppelin’s SafeERC20 wrapper which handles non-reverting tokens safely:
• Alternatively, explicitly check the return value:
ERC20 implementation typically reverts on transfer failures
ERC20 implementation typically reverts on transfer failures
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.