Description
In MyCut::Pot.sol
, the _transferReward()
function does not check the boolean return value of the transfer
function. ERC20 tokens return a boolean indicating whether the transfer was successful. Failure to check this return value means that if the transfer fails, the code will continue execution without reverting, potentially leading to unintended outcomes.
Impact
If the transfer fails and the return value is not checked, the remaining rewards will not be transferred to the msg.sender
, leading to a potential loss of funds. The protocol will proceed as if the transfer was successful. The lack of safe transfer functions may result in incorrect accounting and a loss of trust from users.
Proof of Concepts
In the Pot::_transferReward()
function, the transfer function is not checked for success
Also in the Pot::closePot()
, while transferring the managerCut
we are not checking for success
Also in the ContestManager::fundContest()
, while funding the contest
Recommended Mitigation: Check the boolean return value of the transfer function and revert if the transfer fails. The recommended pattern is as follows:
Also, in the Pot::closePot()
function, it can be handled in a better way like this:
This ensures that the protocol reverts if the transfer fails
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.