Originally submitted by warden defsec in #198, duplicate of #178 related to the use of safeApprove.
This is upgraded from a QA report to standalone issue because it correctly described the revert when trying to call safeApprove on non-zero allowance. QA report that only describe safeApprove as deprecated and unable to identify the revert problem are intentionally not upgraded. Duplicate of #180.
The Contract Should approve(0) first
Impact
Some tokens (like USDT L199) do not work when changing the allowance from an existing non-zero allowance value.
They must first be approved by zero and then the actual allowance must be approved.
Originally submitted by warden
defsec
in #198, duplicate of #178 related to the use ofsafeApprove
. This is upgraded from a QA report to standalone issue because it correctly described the revert when trying to callsafeApprove
on non-zero allowance. QA report that only describesafeApprove
as deprecated and unable to identify the revert problem are intentionally not upgraded. Duplicate of #180.The Contract Should approve(0) first
Impact
Some tokens (like USDT L199) do not work when changing the allowance from an existing non-zero allowance value. They must first be approved by zero and then the actual allowance must be approved.
Proof of Concept
Tools Used
None
Recommended Mitigation Steps
Approve with a zero amount first before setting the actual amount. Consider use safeIncreaseAllowance and safeDecreaseAllowance.