The unwrap
function in TokenAdapterMock
contract doesn't check the return value of transferFrom
, which could lead to silent failures.
In the unwrap
function, the return value from transferFrom
is not checked:
Function proving the test:
While most modern ERC20 tokens revert on failed transfers, some older tokens (like USDT) return false
instead of reverting. Not checking this return value could lead to the function continuing execution even when the transfer failed.
Low severity. While this is a best practice violation:
Most modern tokens revert on failed transfers
This is a mock contract used for testing
The actual funds are unlikely to be lost due to subsequent operations that would fail
Slither static analyzer
Manual review
Use SafeERC20's safeTransferFrom
instead of direct transferFrom
:
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.