Token Allowances You’ve Granted to Smart Contracts: Why They Persist and How to Revoke Them
Token Allowances You’ve Granted to Smart Contracts: Why They Persist and How to Revoke Them
Key takeaways:
- Allowances to smart contracts remain active until you revoke them, even if you no longer use the application.
- Unlimited allowances give the contract the right to spend all your tokens from your wallet.
- Revoking allowances is a simple process done directly on the block explorer, without third parties.
- Regularly checking and revoking allowances reduces the risk of losing funds if a contract is compromised.
When you connect your wallet to a decentralized application, you often sign a transaction that grants the smart contract access to your tokens. That approval remains in effect until you revoke it, and users often have more active allowances than they realize. This article explains how to identify approvals, why they persist, and how to safely revoke allowances.
What Are Smart Contract Allowances and Why Are They Permanent?
An allowance is a mechanism in the ERC-20 token standard that allows a smart contract to transfer a specific amount of tokens from your account. When you first use a decentralized exchange or protocol, the application asks you to sign a transaction granting approval. That approval is stored on-chain and does not expire on its own.
Many users think it is enough to stop using the application, but the approval remains active. Even if the application is abandoned or compromised, the smart contract can still spend your tokens up to the granted limit. Therefore, it is important to periodically review and revoke allowances that are no longer needed.
How to Review Allowances on a Block Explorer
The most transparent way to see all your allowances is to use a public block explorer, such as Etherscan for the Ethereum network. On Etherscan, after entering your wallet address, open the Token Approvals tab. There you will see a list of all tokens and smart contracts you have approved.
For other networks (BSC, Polygon, Arbitrum), similar block explorers exist, and you can also use specialized allowance management tools that aggregate data from multiple networks. These tools are useful because they let you see everything in one place, but always verify that the tool is reliable and has a good reputation.
How to Identify an Unlimited Allowance
An unlimited allowance is when you grant a smart contract the right to spend an unlimited amount of tokens. On a block explorer, this is usually shown as Unlimited or as the maximum value (e.g., 115792089237316195423570985008687907853269984665640564039457584007913129639935).
Such allowances are common on exchanges and aggregators because they enable faster transactions without re-signing. However, they carry higher risk: if the smart contract is compromised, an attacker can drain your entire balance of that token. Therefore, it is advisable to use limited allowances for less trusted applications, even though that means an extra transaction each time you use them.
When Does It Make Sense to Revoke Allowances?
- When you stop using an application: If you no longer trade on a particular exchange, revoking the allowance removes the risk of misuse through that approval.
- When you suspect a project’s security: If the application is abandoned, has had vulnerabilities, or the team has disappeared, revoking is necessary.
- When you hold large amounts of tokens: If you hold significant assets, reducing the number of active allowances reduces the attack surface.
- When you notice unknown approvals: If you see a contract you do not recognize, revoke it immediately.
You do not have to revoke all allowances at once, but regular checks (e.g., every few months) are good practice.
How to Revoke Allowances Step by Step
Revoking allowances is a transaction that sets the approval to zero. You can do this directly on a block explorer or through a specialized tool. Here is the general process:
- Connect your wallet (e.g., MetaMask) to the block explorer or allowance management tool.
- Find the token and contract for which you want to revoke the allowance.
- Click the Revoke or Remove Approval option.
- Confirm the transaction in your wallet. Be prepared to pay a gas fee.
- Wait for the transaction to be confirmed. After that, the approval is set to zero.
Some tools make it easier to revoke multiple allowances in a row from one interface, but each revocation is a separate transaction with its own gas fee. Always verify the contract address before confirming.
Additional Precautions and Best Practices
In addition to revoking allowances, consider using a hardware wallet for larger amounts of funds. Hardware wallets keep private keys offline, so even if an attacker gains access to your computer, they cannot sign a transaction without physical access to the device. However, a hardware wallet protects your keys but does not cancel existing allowances; the only protection against allowance misuse is revocation.
Also, for new applications, use a separate wallet with limited funds, or set limited allowances (e.g., the exact amount you plan to invest). Regularly check your allowance list and revoke those that are no longer needed.
Related Articles
Frequently Asked Questions
Does revoking allowances cost gas?
Yes, each revocation transaction requires a gas fee, which varies depending on the network and congestion. Some tools make it easier to revoke multiple allowances in a row from one interface, but each revocation is a separate transaction with its own gas fee.
How do I know if an approval is unlimited?
On a block explorer, look for the label ‘Unlimited’ or the maximum value. That means the contract can spend all your tokens of that type.
Is it safe to use allowance revocation tools?
The safest path is to revoke directly on the block explorer. If you use third-party tools, manually verify the URL and the signed transaction content before confirming.
What happens if I revoke an allowance but still use the application?
The application will ask for a new approval on your next transaction. That is normal and does not affect your funds.
Can allowances expire on their own?
The standard ERC-20 approve has no expiration; Permit2 approvals have an expiration date that you set yourself.