The contract currently uses the transfer function for ERC-20 token transfers. While transfer is the standard function for transferring tokens, it lacks additional checks to ensure compatibility with recipient contracts. This approach can result in potential issues when interacting with smart contracts that do not properly handle ERC-20 tokens, potentially leading to a loss of funds.
The transfer function does not verify if the recipient is a contract capable of handling ERC-20 tokens. When tokens are sent to a smart contract that does not support token reception, such as one that lacks a fallback function or the necessary logic to manage incoming ERC-20 tokens, the tokens can be lost. The safeTransfer function, provided by the OpenZeppelin SafeERC20 library, wraps the transfer function with additional checks. It ensures the transaction reverts if the transfer fails, and it checks for recipient compatibility, preventing accidental token loss.
Lost Funds: Tokens transferred to an incompatible contract will be unrecoverable.
Unexpected Failures: If the recipient is a smart contract that requires specific handling for tokens, transfer will fail without helpful error handling.
Manual Review
Use safeTransfer Instead of transfer for Secure Token Transfers
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.