Token Approval

A token approval is the permission you sign so a DEX or other app can move your tokens, up to a spending allowance that is often unlimited. It lasts until you cancel it, so check and revoke old approvals regularly.

Before a decentralized exchange can swap your USDC, it has to be allowed to take the USDC from your wallet. That permission is a token approval. It is a normal, necessary step in DeFi, but it outlives the trade it was made for. This entry explains how approvals and allowances work under the ERC-20 standard, why unlimited approvals are risky, and how to revoke them.

Category
Cryptocurrency and Blockchain
Reading time
5 min
Also called
Token allowance, Unlimited approval, Revoke approvals
Updated

A token approval in plain words

Under the ERC-20 token standard, approve lets another address (the spender) withdraw from your balance several times, up to a set amount.1 That amount is the allowance, and anyone can read how much of it is left.1

MetaMask describes an approval as giving an app permission to access and move one specific type of token from your wallet; without it, actions such as a deposit or swap will not work.2

Approvals have no expiry date, and disconnecting your wallet from a site does not remove them.3

How an approval works, step by step

  1. The app asks

    Before a swap or deposit, the app requests a spending cap for one token. MetaMask shows the site, the requesting contract’s address and an editable cap.2

  2. You approve

    Approving is an on-chain transaction, so it costs gas.2 See Gas Fee.

  3. The app spends

    The contract calls transferFrom to move tokens on your behalf, up to the allowance.1

  4. The allowance shrinks

    Spent tokens come off the allowance; once it is used up, a new approval is needed.2

  5. A new approval overwrites

    Calling approve again replaces the old allowance with the new amount rather than adding to it.1

  6. You revoke

    To cancel, use a revoke tool or your wallet, pick the contract and confirm the transaction, which costs a network fee.3

Worked examples

Example 1 — An exact approval

No leftover risk

You want to swap a hypothetical 500 USDC on a DEX and set the spending cap to exactly 500 USDC.

Example 1 — An exact approval — calculation
Allowance granted500 USDC
Spent on the swap500 USDC
Allowance left500 − 500 = 0 USDC

Nothing is left for the app to spend later. Approving only the amount you need is the safer habit.4

Example 2 — An unlimited approval

Full balance at risk

You approve unlimited USDC to save gas on future swaps. Months later the app’s contract is exploited while you hold a hypothetical 4,000 USDC.

Example 2 — An unlimited approval — calculation
Allowance grantedUnlimited
USDC in wallet4,000 USDC
Exposed to the exploit4,000 USDC

An unlimited approval exposes your whole balance of that token, not just one trade. See Reentrancy and Oracle Manipulation.

Example 3 — A clean-up

Permissions cleared

A revoke tool shows three approvals you no longer use. Each revoke costs a hypothetical $0.80 in gas.

Example 3 — A clean-up — calculation
Approvals revoked3
Total gas3 × $0.80 = $2.40
Allowances after0 for each app

You can re-approve later if you return to an app; revoking does not close staking or lending positions.3

Types of token permission

AspectHow it is grantedWhat it covers
ERC-20 approveOn-chain transaction (gas)One token, up to the allowance
PermitSigned off-chain messageOne token, up to the signed amount
setApprovalForAllOn-chain transactionEvery NFT in one collection

Why approvals matter

Advantages and disadvantages

Advantages

  • Lets apps move tokens without ever holding your private key.
  • You can set a spending cap and edit it before confirming.2
  • Unlimited approvals save repeated approval fees on apps you use often.2
  • Any approval can be revoked at any time.3

Disadvantages

  • Permissions never expire on their own.3
  • Unlimited approvals could let a contract drain that token from your wallet.4
  • Revoking costs gas, so people put it off.3
  • Permit signatures grant allowances without any visible on-chain transaction.5

Going deeper

Read as far as you need. Each level builds on the one before it.

Approval is not a transfer

Beginner

Approving does not move tokens. It gives the app the right to move them later, which is why one approval can matter long after the trade.

Permit signatures

Intermediate

ERC-2612 adds permit, which lets you approve a spender by signing a message instead of sending a transaction; anyone can submit that signature on-chain, so you need no ETH for gas.5

Each permit carries a deadline and a nonce so it expires and cannot be replayed.5 Because no transaction appears in your wallet, a signed permit is easy to forget.

The approve race

Advanced

Because approve overwrites the old allowance, a spender who sees a change coming could try to spend the old amount first and then the new one. The ERC-20 text therefore suggests that clients set the allowance to 0 before setting a new value for the same spender.1

Common mistakes

  1. Approving unlimited by default

    Lower the cap to what the trade needs.4

  2. Thinking disconnect revokes

    Disconnecting leaves approvals in place.3

  3. Ignoring the contract address

    Check the spender on a Block Explorer before approving.2

  4. Signing NFT approvals to claim a gift

    You should not need setApprovalForAll to receive anything.2

Check your understanding

Test yourself before moving on. Each answer comes with an explanation.

Q1You approved 1,000 USDC and the app has spent 300. What is the remaining allowance?
Q2Does revoking an approval cost anything?

Key points to remember

  1. A token approval lets an app move one token from your wallet, up to an allowance.
  2. Approvals do not expire and survive disconnecting your wallet.
  3. Unlimited approvals save gas but expose the whole balance.
  4. Permit signatures grant allowances without a transaction.
  5. Review and revoke old approvals regularly.

Frequently asked questions

Do I need to approve ETH?

No. Approvals are for tokens such as ERC-20s; ETH itself is sent directly with a transaction.

Where can I see my approvals?

Revoke tools and block explorers such as Etherscan, Blockscout and Revoke.cash list them; make sure the tool and your wallet are on the same network.3

Should I revoke everything?

You can, but you will have to re-approve the apps you still use. Many people revoke anything they have not used recently.3

Further learning

Sources

This article is written in our own words. The sources below support the specific facts, rules and figures marked with a number in the text. Links open the original publisher’s page.

  1. Ethereum Improvement Proposals. ERC-20: Token Standard (opens in a new tab) Checked .
  2. MetaMask Support. What is a token approval? (opens in a new tab) Checked .
  3. ethereum.org. How to revoke smart contract access to your crypto funds (opens in a new tab) Checked .
  4. ethereum.org. Ethereum security and scam prevention (opens in a new tab) Checked .
  5. Ethereum Improvement Proposals. ERC-2612: Permit Extension for EIP-20 Signed Approvals (opens in a new tab) Checked .

Educational content, not financial advice. Examples use hypothetical prices and simplified costs; actual fees, margin rules and regulations vary by broker, market and country. We are not affiliated with any publisher linked above. Last reviewed . Report an error or request a source credit.