D CryptoHome
lang: zh en ja ko
Home Wiki Categories Download Download Register

How to Check Token Approvals? Protecting Your Wallet Security

Download Binance APP to Start Trading

Android users can download APK directly without VPN.

Token approval is one of the most common operations in DeFi interactions — and one of the most overlooked security risks in wallet management. Every time you swap tokens on a DEX or participate in a DeFi protocol, you typically need to first approve a contract to spend your tokens. If you approve a malicious contract or grant an excessive allowance, your assets could be at risk of theft. This article provides a comprehensive breakdown of the token approval mechanism and how to manage it safely.

1. Token Approval Mechanism Explained

1.1 What Is a Token Approval

On Ethereum and EVM-compatible chains, the ERC-20 token standard defines an approve function. When you need to swap a token using a DApp like Uniswap, the process works in two steps:

  1. Approve step: You authorize Uniswap's Router contract to spend a certain token from your wallet
  2. Swap step: Uniswap's contract takes the token from your wallet and completes the exchange

Why two steps? Because ERC-20 tokens are themselves smart contracts — your balance is recorded inside the token contract. For another contract (such as a DEX router) to move your tokens, it must first receive authorization from the token contract.

1.2 Technical Principles of Approvals

approve(spender, amount)
  • spender: The address of the contract being approved
  • amount: The spending allowance

When the spender calls transferFrom to move tokens from your address, the token contract checks whether the approval amount is sufficient.

1.3 The Unlimited Approval Problem

Most DApps request an unlimited approval by default, meaning:

amount = 2^256 - 1 (an astronomically large number)

This means: The approved contract can transfer all of your balance of that token at any time, with no further authorization from you required.

Why DApps use unlimited approvals:

  • Users only need to approve once; subsequent transactions do not require re-approval
  • Saves Gas fees (each approval is an on-chain transaction)
  • Improves user experience (fewer steps)

But the risks include:

  • If the approved contract has a vulnerability, an attacker can exploit it to drain your tokens
  • If you accidentally approve a malicious contract, your tokens can be transferred away immediately
  • Even if you stop using the DApp, the approval remains active indefinitely

2. Approval Risk Case Studies

2.1 Real Security Incidents

Case 1: BadgerDAO Attack (2021)

  • Attackers injected malicious scripts into the front end
  • Users were tricked into approving a malicious contract
  • Attackers used the approval to drain user assets
  • Loss: approximately $120 million

Case 2: Transit Swap Attack (2022)

  • A vulnerability in the aggregator contract was exploited
  • Attackers leveraged users' unlimited approvals
  • User tokens were drained through the exploit
  • Loss: approximately $23 million

2.2 Common Approval Risk Scenarios

Scenario Risk Level Description
Approving well-known protocols (Uniswap, etc.) Low Audited, but non-zero risk
Approving a new project's contract Medium-High Contract may have bugs or backdoors
Approving a phishing site's contract Extremely High Malicious contract will drain tokens immediately
Unlimited approval left unchecked long-term Medium Even if the original contract is safe, it increases the attack surface

3. Token Approval Checking Tools

3.1 Revoke.cash

What it is: The most well-known token approval management tool.

Supported chains: Ethereum, BSC, Polygon, Arbitrum, Optimism, Avalanche, and 50+ other chains.

How to use:

  1. Visit revoke.cash
  2. Connect your wallet or enter your address directly
  3. Select the blockchain network you want to check
  4. The page will list all token approval records

Information displayed:

  • Token name: The token that has been approved
  • Approved amount: Unlimited or a specific quantity
  • Spender: The contract address and label that received the approval
  • Last updated: When the approval was granted

Steps to revoke an approval:

  1. Find the approval record you want to revoke
  2. Click the "Revoke" button
  3. Confirm the transaction in your wallet
  4. Pay a small Gas fee
  5. The approval is revoked

3.2 Etherscan Token Approval Checker

URL: etherscan.io/tokenapprovalchecker

How to use:

  1. Visit the URL above
  2. Connect your wallet or enter your address
  3. View the ERC-20 and ERC-721 approval list
  4. Click "Revoke" to remove unneeded approvals

Advantage: As an official Etherscan tool, data accuracy is reliable.

3.3 BscScan Token Approval Checker

URL: bscscan.com/tokenapprovalchecker

Same functionality as the Etherscan version, specifically for the BSC chain.

3.4 DeBank Approval Management

DeBank provides approval management within its asset dashboard:

  1. View your address on DeBank
  2. Find the "Approval" tab
  3. View and manage all approvals

3.5 Tool Comparison

Tool Chains Supported Interface Revoke Free
Revoke.cash 50+ Clean Yes Yes
Etherscan Ethereum only Standard Yes Yes
BscScan BSC only Standard Yes Yes
DeBank 100+ Comprehensive Yes Basic free
Rabby Wallet Multi-chain Integrated Yes Yes

4. Best Practices for Approval Management

4.1 Checks Before Approving

Before approving any contract:

  1. Verify the website is legitimate: Check the URL carefully; avoid phishing sites
  2. Confirm the contract is verified: Check on a blockchain explorer that the contract source code is public
  3. Know what you are approving: Confirm which contract you are granting permission to
  4. Consider the approval amount: Do you truly need an unlimited approval?

4.2 Using Exact Approvals

Many wallets and DApps support custom approval amounts:

Editing the approval amount in MetaMask:

  1. When the approval pop-up appears, click "Edit Permission"
  2. Enter the exact amount needed for this transaction in "Custom Spend Limit"
  3. Confirm the modified approval

Advantages of exact approvals:

  • Even if the contract is attacked, the maximum potential loss is capped at the approved amount
  • Requires re-approval each time, which costs more Gas but is more secure

Disadvantages of exact approvals:

  • Requires two transactions each time (approve + action)
  • Increases Gas costs
  • More steps in the process

4.3 Regularly Cleaning Up Approvals

It is recommended to make a habit of checking approvals periodically:

Suggested check frequency:

  • Active DeFi users: Once a week
  • Casual users: Once a month
  • Wallets with large holdings: After every operation

Approvals to prioritize revoking:

  1. DApps you no longer use
  2. Unknown or unrecognizable contracts
  3. Projects that have experienced security incidents
  4. Old unlimited approvals that have been dormant

4.4 Wallet Isolation Strategy

Spread assets across different wallets for different purposes:

Wallet Type Purpose Approval Strategy
Hot wallet (small amounts) Daily DeFi interactions Can approve; clean up regularly
Warm wallet (medium amounts) Larger DeFi operations Exact approvals; frequent cleanup
Cold wallet (large amounts) Long-term storage Avoid approving any contracts

4.5 Using Security Wallet Features

Some wallets have built-in approval management features:

Rabby Wallet:

  • Displays an approval risk assessment before transactions
  • Flags high-risk approval requests
  • Built-in approval management page

MetaMask Snaps:

  • Certain security-focused Snaps can warn you before an approval
  • Help identify malicious contracts

5. ERC-721 (NFT) Approvals

5.1 NFT Approval Types

NFT approvals are more complex than ERC-20 and come in two types:

Single NFT approval:

approve(operator, tokenId)

Authorizes an operator to manage one specific NFT.

Full collection approval (setApprovalForAll):

setApprovalForAll(operator, true)

Authorizes an operator to manage all NFTs you own under that NFT contract.

5.2 NFT Approval Risks

setApprovalForAll carries extremely high risk:

  • Once granted, the approved party can transfer every NFT you own in that collection
  • This is the primary method used in NFT phishing attacks
  • Many NFT marketplaces (such as OpenSea) require this approval to list your NFTs for sale

Prevention recommendations:

  • Only grant setApprovalForAll on NFT marketplaces you trust
  • Consider revoking the approval after completing an NFT sale
  • Use Revoke.cash or similar tools to check NFT approvals
  • Store high-value NFTs in a dedicated cold wallet

6. Permit Signature Risks

6.1 What Is Permit

ERC-20 Permit (EIP-2612) is a newer type of approval. Unlike the traditional approve, Permit grants authorization through an off-chain signature, without submitting an on-chain transaction.

How it works:

  1. The user signs a Permit message with their wallet (not on-chain; no Gas required)
  2. The signature is passed to a contract
  3. The contract verifies the signature and gains authorization

6.2 Risks of Permit

Permit signatures look like a simple "signature request" and are easy to overlook:

  • Users may not realize they are approving token spending
  • Phishing sites can trick users into signing a Permit
  • Because the signature is off-chain, tools like Revoke.cash cannot detect unused Permit signatures

6.3 Defending Against Permit Phishing

  1. Read the signature content carefully: MetaMask displays the details of a Permit signature
  2. Pay attention to the signature type: Be extra vigilant if you see words like "Permit" or "allowance"
  3. Do not sign anything you do not understand: For any unclear signature request, choose to reject it
  4. Use a security-focused wallet: Wallets like Rabby will clearly warn you about Permit signatures

7. Handling Emergencies

7.1 Discovering a Suspicious Approval

If you find an unrecognized approval in your wallet:

  1. Revoke immediately: Use Revoke.cash to revoke all suspicious approvals
  2. Check your assets: Confirm whether any funds have already been transferred out
  3. Move remaining assets: Transfer remaining assets to a new, secure wallet
  4. Investigate the cause: Recall whether you visited any suspicious sites or signed any unknown requests

7.2 Assets Already Stolen

If assets have already been drained through an approval exploit:

  1. Revoke all approvals immediately: Prevent further losses
  2. Move remaining assets: Transfer whatever is left to a new wallet
  3. Document evidence: Save transaction hashes, the attacker's address, and other details
  4. Report it: Notify the relevant chain's security team and community
  5. Learn from it: Use this as a lesson to strengthen approval management going forward

7.3 The Revoke Race

In some cases, an attacker may drain assets before you can revoke the approval. In this situation:

  • The revoke transaction needs to get on-chain as fast as possible
  • Increase the Gas fee to speed up confirmation
  • On high-Gas chains like Ethereum, this becomes a race against time

8. Approval Security Checklist

Before each DeFi interaction:

  • [ ] Confirm the website URL is correct
  • [ ] Check that the approved contract address makes sense
  • [ ] Consider using an exact approval instead of an unlimited one
  • [ ] Understand what you are signing

Weekly / Monthly:

  • [ ] Use Revoke.cash to check approvals across all chains
  • [ ] Revoke approvals for DApps you no longer use
  • [ ] Check for any unrecognized approval records
  • [ ] Specifically check setApprovalForAll approvals for NFTs

Wallet security:

  • [ ] Use a separate wallet for large holdings
  • [ ] Use a small hot wallet for daily DeFi interactions
  • [ ] Use a hardware wallet to sign large transactions
  • [ ] Enable security warning features in your wallet

Summary

Token approvals are a fundamental mechanism that makes DeFi work, but they are also one of the most commonly exploited attack vectors in wallet security. By understanding how the approval mechanism works, regularly checking and cleaning up approvals with tools like Revoke.cash, and adopting practices like exact approvals and wallet isolation, you can significantly reduce the security risks that approvals introduce.

Remember: Every approval is a grant of trust to a third-party contract. In the blockchain world, verifying always matters more than trusting.

Register on Binance | Download Binance App

📱
Download Binance APP to Start Trading

Android users can download APK directly without VPN.

Download Binance APP to Start Trading

Android users can download APK directly without VPN.

Author
CryptoHome Editorial Team Dedicated to crypto knowledge and encyclopedia writing