Some ERC20 tokens like USDT require resetting the approval to 0 first before being able to reset it to another value. The ierc20.approve function does not do this - unlike OpenZeppelin's safeIncreaseAllowance()
implementation.
##impact
This code does not first reset the allowance to zero before setting it to a new value, which can be problematic with tokens that require this pattern. The issue is that if the contract ever tries to change an already non-zero allowance, the token contract might revert the transaction or behave unexpectedly. to adhere to the best practices for broader compatibility and safety, it's recommended to implement the allowance reset pattern
manual review
It is recommended to set the allowance to zero before increasing the allowance and use safeIncreaseAllowance()
.
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.