The _transferToken
function does not properly check the return values of token transfers, which could lead to silent failures and loss of funds.
The function attempts to transfer tokens using ERC20's transfer
method but doesn't properly utilize the SafeERC20 library despite it being imported. The empty try-catch block silently ignores successful transfers, and the fallback transfer to treasury may also fail silently.
Code sippet:
This line uses raw transfer instead of safeTransfer:
The empty try block ignores the transfer result:
The catch block attempts another unchecked transfer:
Token transfers could fail silently without proper reversion
Funds could be lost or stuck in the contract
State changes might occur even when transfers fail
Users might believe transfers succeeded when they actually failed
PoC:
Manual Review
Use SafeERC20's safeTransfer
consistently:
Remove the try-catch block and allow failed transfers to revert
Add explicit success checks for all token operations
Implement proper error handling with specific error messages
Consider adding events for successful 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.