The owner is unable to set a new SwapParams
if one of the unchanged tokens is USDT. Because the approval for the unchanged token is not reset to zero, resulting in a direct revert of USDT's approval.
When modifying the SwapParams
, editParams
will reset the approval to zero only if the new tokens are different from the old tokens. If the new tokens are the same as the old tokens, the approval will remain unchanged.
In _editParams
, the approve
method is invoked even if the new token is the same as the old token. If a token, particularly USDT, hasn't changed, its approve
method will still be called, leading to failure since its previous approval number is not set to 0.
This is the code of approve
, the comment says that you first have to reduce the addresses allowance to zero by calling approve(_spender, 0)
, or it will revert.
The owner is unable to set a new SwapParams
if the unchanged token is USDT, as the approval for the unchanged token is not reset to zero, resulting in a direct revert of USDT's approval.
Manual Review
Ensure the approval is set to zero, even if the new tokens are the same as the old tokens.
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.