DEX Token Approval After a Swap: How Revocation Works
How to revoke a DEX token approval after a swap: set the matching token and spender allowance to zero, confirm the on-chain transaction, then verify it.
Crypto Blog Newsroom4 min read
A token approval used for a Matcha trade can be revoked by setting the ERC-20 allowance for the trade’s token and spender address to zero in a wallet or allowance checker, then confirming the transaction on the same network.
- An allowance belongs to a specific token and spender address.
- Revocation is an on-chain transaction and usually costs gas.
- Changing one allowance leaves approvals for other spenders unchanged.
An ERC-20 approval gives a spender permission to use a token up to the approved amount. The allowance is recorded for that token and spender address. Completing a swap does not automatically erase it; the permission remains until the allowance changes.
That spender-specific setup makes a Matcha swap asking for approval again a useful case for understanding why approval can recur: each permission applies to a particular token and spender. If a later trade needs an allowance, it may prompt for a new approval even after an earlier one was confirmed.
How do you revoke a token approval after a swap?
To revoke an approval after a swap, find the token and spender used for the trade, set that pair’s allowance to zero, and confirm the transaction on the same network.
Start with the trade’s network and token. Look in your wallet activity or use a block explorer to locate the swap transaction. The transaction details can help identify the token and spender address associated with the approval. Make sure you have access to the wallet and enough of the network’s gas token to submit a transaction.
- Open a reputable allowance checker such as Revoke.cash and connect your wallet.
- Select the network used for the trade. Find the entry matching both the token and the spender address.
- Choose the revoke action for that entry. Review the network, token, spender, and transaction details in your wallet before signing.
- Wait for the transaction to confirm, then check the allowance again. Confirm that the matching token-spender allowance is zero.
The spender address matters. If the approval lists spender A, revoking spender B’s allowance changes a different permission. It leaves the allowance for spender A as it was. Match the address, not just the token name or the fact that the trade used the same interface.
Consider an illustrative case: you swapped Token A and later find that the approval for Token A lists spender A. Setting the allowance for Token A and spender A to zero removes that permission. Setting Token A’s allowance for spender B to zero changes only the separate Token A–spender B permission. The token itself and other allowances stay the same.
After confirmation, the allowance for the selected pair should read zero. A later trade that needs that token and spender may ask you to approve again. That new approval is a separate transaction; revoking the old allowance does not prevent you from trading later.
Does revoking a token approval cost gas?
Revoking an ERC-20 allowance usually costs gas because changing the on-chain allowance requires a transaction.
The wallet shows the transaction fee before you sign. Its gas cost depends on network conditions, so the amount can vary. The revocation also needs to be submitted on the network where the allowance exists; selecting another network will not change that token-spender pair.
Once the transaction confirms, verify the allowance in the checker or another suitable view of the token’s allowance. A submitted transaction may still be pending, so signing alone does not confirm that the allowance has changed.
Related
How to check token approvals
To check token approvals, connect your wallet to an allowance checker or inspect the token’s allowance data with a block explorer. Select the relevant network and look for the token and spender address together. That pair identifies the permission you may want to review.
Does revoking token approval cost gas?
Yes. Revoking a token approval usually requires an on-chain transaction, so you need the network’s gas token and the fee varies with network conditions.