Submitted by IllIllI, also found by cccz and hyh
Some tokens do not implement the ERC20 standard properly but are still accepted by most code that accepts ERC20 tokens.  For example Tether (USDT)s approve() function will revert if the current approval is not zero, to protect against front-running changes of approvals.
The code as currently implemented does not handle these sorts of tokens properly when theyre a Uniswap pool asset, which would prevent USDT, the sixth largest pool, from being used by this project. This project relies heavily on Uniswap, so this would hamper future growth and availability of the protocol.
There are other calls to approve(), but they correctly set the approval to zero after the transfer is done, so that the next approval can go through.
Use OpenZeppelins SafeERC20s safeTransfer() instead.
0xdramaone (Duality Focus) confirmed and commented:
0xdramaone (Duality Focus) resolved
