Does a failed swap leave token approval active?
Does a failed DEX swap leave token approval active? Usually yes: a confirmed allowance stays in place because the swap revert cannot undo an earlier transaction.
A failed swap usually leaves token approval active when the approval was confirmed first. The approval and swap are separate transactions, so the swap’s revert rolls back its own changes, not the earlier allowance.
Does a failed swap cancel the token approval?
No. An ERC-20 approval sets an allowance, or spending limit, for a spender on the token contract. A later swap uses a separate transaction. If that swap reverts, its changes are rolled back, but the confirmed allowance remains until it is used or changed.
This matters when a SyncSwap swap fails after approval: first establish whether the approval succeeded, then look into the swap failure. The SyncSwap swap failure causes can help you investigate why the swap reverted.
A wallet showing “pending” or “failed” for the approval is a different case. A pending transaction has not yet been confirmed, and a failed approval may not have set an allowance. Check the approval’s status before assuming the spender can use the tokens.
Say you approve a token, see that approval confirmed, and then submit a SyncSwap swap that reverts. The allowance set by the first transaction remains. Now compare that with the same sequence when the approval itself failed: there may be no allowance, because the first transaction did not successfully set one. The deciding factor is whether the approval was confirmed, not whether the swap succeeded.
To see what access remains, look up the allowance for the specific token and spender in your wallet or an allowance checker. If you no longer want that spender to have access, revoke the approval or set the allowance to zero. Revoking changes the allowance; it does not retry or repair the failed swap.
Related questions
Can I use the same token approval for another swap?
Yes, if the confirmed allowance still covers the next swap and is for the spender that swap uses. You may need a new approval if the allowance was used up, changed, or was set for a different spender.
Does revoking a token approval cost gas?
Usually, yes. Revoking or setting an on-chain allowance to zero requires a transaction, which typically costs gas on that network.