Sezga
English
Sign in

Security · · 6 min read

Token approvals: what they are and how to revoke them

A token approval is permission you give a smart contract to spend a specific token in your wallet on your behalf. The permission stays valid after you leave the app and lasts until you revoke it; an unlimited approval given to a malicious contract, or to one that is later hacked, can lead to the entire balance of that token being drained from your wallet.

A smart contract is a program that runs on a blockchain and carries out pre-written rules when a transaction calls it. The approval mechanism is part of the token standards used on Ethereum and compatible networks in particular. Decentralized exchanges, lending protocols and NFT marketplaces cannot work without these permissions.

Why approvals are needed

Under ERC-20, the common token standard on Ethereum, a contract cannot simply take tokens from your wallet. So the process runs in two steps:

  1. Approval: You sign a transaction saying, "this contract may spend up to this much of this token of mine." That limit is called the allowance.
  2. Use: The contract moves tokens from your wallet to its own address or another address, within the limit you set.

For example, when you want to swap 1,000 USDC for ether on a decentralized exchange, your wallet first asks for an approval and then for the swap. No approval is needed for ether, the network's own coin; ether is sent directly with the transaction.

Four properties of approvals are worth knowing:

  • They are per token and per spender. There is a separate permission for each pair of token and contract (the spender).
  • They are per network. An approval on one network does not apply to the same address on another.
  • They do not expire. The permission stands until you revoke it or the limit is used up.
  • They are tied to the limit, not the balance. If you move the tokens out and deposit them again months later, the old permission applies to the new balance too.

Unlimited approvals: convenience and risk

Many apps request an unlimited approval by default, so users do not have to approve again and pay a network fee for every transaction. The convenience is real, but so is the risk.

A hypothetical example: your wallet holds 20,000 USDC and you make a 1,000 USDC swap.

Limited approval (1,000 USDC)Unlimited approval
First transactionApproval and swapApproval and swap
Later swapsA new approval and fee each timeNo new approval needed
Permission left after the swapZeroUnlimited
Amount at risk if the contract is abusedNoneAll 20,000 USDC plus any USDC deposited later

Unlimited approvals become dangerous in two ways. First, a fake site asks you to approve its own contract directly; this is one of the most common forms of phishing. Second, a legitimate protocol you once used safely later turns out to have a flaw in its contract, or its admin key is compromised. In that case an approval you gave years ago and forgot about can become an attacker's way in.

Collection-wide NFT approvals and signature-based permissions

Collection-wide approval: With NFTs, a contract can be given permission over an entire collection instead of a single item (setApprovalForAll). NFT marketplaces use this permission for listings. But when a fake "free mint" or "claim your reward" page asks for the same permission, every NFT you hold in that collection is put at risk.

Signature-based permissions: Some tokens allow an approval to be granted through an off-chain signature instead of an on-chain transaction (permit). The signature costs nothing, and on a malicious site it can be disguised as an innocent step such as "sign to log in." Whoever receives the signature can later submit it on-chain to activate the permission. Until it is submitted, the permission may not appear in approval lists. If your wallet's signature screen shows fields such as a spender address, a value and a deadline, what you are signing is a spending permission.

Reviewing and revoking approvals

  1. Open the list. Token approval pages on block explorers, the permission screens built into some wallets and approval-checking tools list the permissions an address has granted. Reach these tools through your own bookmarks too; messages saying "your wallet is at risk, revoke your approvals here" can themselves be a phishing method.
  2. Pick the network. Check every network you use, one at a time.
  3. Prioritize. Unknown spenders, unlimited amounts, apps you no longer use, sites you used once and left, and collection-wide NFT approvals go to the top of the list.
  4. Revoke. Revoking is a new approval transaction that sets the permission to zero, and it requires a network fee. Before signing, check on the wallet screen that the transaction really resets the permission.
  5. Verify. Once the transaction is confirmed, refresh the list and make sure the permission is gone.

Revoking also has limits:

  • It does not undo the past. Tokens already taken do not come back; revoking only blocks future use.
  • It is no cure for a leaked key. If your recovery phrase or private key has been compromised, revoking approvals does nothing; the only fix is to move your assets to a new wallet.
  • For unused signatures, moving funds is safer. If you suspect you gave a permit signature to a malicious site, moving the affected tokens to a new address is the most reliable step.
  • Do the fee math. The cost of revoking depends on how busy the network is. On an expensive network, revoking an approval for a small token balance may not be worth it; focus on large balances first.

Good habits

  • If your wallet allows it, limit the approval amount to the transaction amount.
  • On every approval screen, read three things: which token, which spender address and how much.
  • Use a separate low-balance wallet for interacting with apps, and another wallet for savings that never approves any contract.
  • Review your approval list regularly, for example once a month.
  • A hardware wallet shows the transaction on the device screen, but it does not stop you from approving the wrong spender; the decision is still yours.
  • Treat a request for permissions that do not fit what a site does as a warning sign, such as a reward-claim page asking for an unlimited approval on your valuable tokens.

Key takeaways

  • A token approval is a permission, with no expiry, that lets a smart contract spend a specific token on your behalf until you revoke it.
  • Unlimited approvals save transaction fees but put the whole balance of that token at risk if the contract is abused.
  • Collection-wide NFT approvals and off-chain permit signatures are spending permissions too; the spender, value and deadline fields on the signature screen give them away.
  • Approvals can be listed through block explorers or wallet permission screens and revoked with a transaction that sets them to zero.
  • Revoking does not recover past losses and does not help if a key has leaked; in that case assets must be moved to a new wallet.

The Sezga terminal

Live prices, liquidation feed, multilingual news, the Fed calendar, event memory and a paper-trading account on one screen. Access is by invitation.

Sign in

Related articles