In the ReFiSwapRebateHook::withdrawTokens function, if for any reason the transaction fails, the code does not catch the issue and revert (while it is supposed to). Instead, it continues and emits the event. It may cause confusion for external services or parties relying on the event.
Even if the returning result is accounted for, in some cases of weird ERC20 (like for USDT which does not return any value), it will be impossible to notice the transaction failure.
Likelihood: Low
It will happen when something goes wrong during execution of the transaction in the blockchain.
Impact: Low
Since the event is emitted indefinitely even after the unsuccessful transaction, the owner may wrongly assume it was done properly and move on.
You can see the emitted event by:
Copying/pasting the code into Remix.
Running the program.
Seeing the event in the terminal window.
The easy solution is to get the return value of the transfer function and check if it is true. If not, revert with the appropriate custom error. However, it is not effective in the case of weird ERC20 tokens like USDT which does not return a value.
The best solution is to utilize the safeTransfer function from Openzeppelin SafeERC20 library.
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.