Some tokens (like USDT) don't correctly implement the EIP20 standard and their transfer/transferFrom/approve function return void instead of a success boolean. Calling these functions with the correct EIP20 function signatures will always revert.
We recommend using OpenZeppelin’s SafeERC20 versions with the safeTransfer and safeTransferFrom functions that handle the return value check as well as non-standard-compliant tokens.
Lines of code
https://github.com/code-423n4/2022-04-dualityfocus/blob/f21ef7708c9335ee1996142e2581cb8714a525c9/contracts/vault_and_oracles/FlashLoan.sol#L48-L58 https://github.com/code-423n4/2022-04-dualityfocus/blob/f21ef7708c9335ee1996142e2581cb8714a525c9/contracts/vault_and_oracles/UniV3LpVault.sol#L366
Vulnerability details
Impact
Some tokens (like USDT) don't correctly implement the EIP20 standard and their
transfer
/transferFrom
/approve
function returnvoid
instead of a success boolean. Calling these functions with the correct EIP20 function signatures will always revert.Non-safe transfers are used in:
FlashLoan.executeOperation
UniV3LpVault.flashFocusCall/repayDebt/etc.
Recommended Mitigation Steps
We recommend using OpenZeppelin’s
SafeERC20
versions with thesafeTransfer
andsafeTransferFrom
functions that handle the return value check as well as non-standard-compliant tokens.