Calling approve() without first calling approve(0) if the current approval is non-zero will revert with some tokens, such as Tether (USDT). While Tether is known to do this, it applies to other tokens as well, which are trying to protect against this attack vector..
Lines of code
https://github.com/code-423n4/2024-05-predy/tree/main/src/settlements/UniswapSettlement.sol#L31 https://github.com/code-423n4/2024-05-predy/tree/main/src/settlements/UniswapSettlement.sol#L47
Vulnerability details
Impact
Calling
approve()
without first callingapprove(0)
if the current approval is non-zero will revert with some tokens, such as Tether (USDT). While Tether is known to do this, it applies to other tokens as well, which are trying to protect against this attack vector..Proof of Concept
31, 47
Tools Used
Recommended Mitigation Steps
Always reset the approval to zero before changing it to a new value.
Assessed type
ERC20