The contracts veRAACToken.sol, RToken.sol, and DEToken.sol use transferFrom instead of safeTransferFrom for token transfers. This practice can lead to unexpected failures when interacting with ERC-721 and ERC-1155 tokens, or with ERC-20 tokens that do not strictly conform to the ERC-20 standard.
The transferFrom function is used for token transfers in several places across different contracts:
veRAACToken.sol
The function does not ensure token safety and may result in failures for non-standard ERC-20 tokens.
RToken.sol
Uses transferFrom without verifying if the token follows the standard behavior.
DEToken.sol
Restricts transfers to a specific pool but still relies on transferFrom without safety checks.
The primary issue is that transferFrom does not handle cases where tokens may revert or return false. Some tokens do not return a boolean, causing calls to break unexpectedly.
Failure to detect failed transfers: Some ERC-20 tokens (e.g., USDT, BNB, OMG) do not return a boolean, which may cause silent failures or unintended behavior.
Potential loss of funds: If transferFrom fails and the failure is not properly handled, funds could be stuck or lost.
Compatibility issues: Certain non-standard tokens may revert, leading to disruptions in contract execution.
Manual Review
Replace transferFrom with safeTransferFrom from OpenZeppelin’s SafeERC20 library:
Ensure that transfer failures are handled properly by checking return values or wrapping transfers in try/catch.
Test with various ERC-20 tokens, including non-compliant ones, to validate expected behavior.
LightChaser Low-60
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.