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
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
The app spends
The contract calls transferFrom to move tokens on your behalf, up to the allowance.1
The allowance shrinks
Spent tokens come off the allowance; once it is used up, a new approval is needed.2
A new approval overwrites
Calling approve again replaces the old allowance with the new amount rather than adding to it.1
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 riskYou want to swap a hypothetical 500 USDC on a DEX and set the spending cap to exactly 500 USDC.
| Allowance granted | 500 USDC |
| Spent on the swap | 500 USDC |
| Allowance left | 500 − 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 riskYou 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.
| Allowance granted | Unlimited |
| USDC in wallet | 4,000 USDC |
| Exposed to the exploit | 4,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 clearedA revoke tool shows three approvals you no longer use. Each revoke costs a hypothetical $0.80 in gas.
| Approvals revoked | 3 |
| Total gas | 3 × $0.80 = $2.40 |
| Allowances after | 0 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
| Aspect | How it is granted | What it covers |
|---|---|---|
| ERC-20 approve | On-chain transaction (gas) | One token, up to the allowance |
| Permit | Signed off-chain message | One token, up to the signed amount |
| setApprovalForAll | On-chain transaction | Every NFT in one collection |
Why approvals matter
Swapping on a DEX
Every token you sell needs an approval first. See Centralised and Decentralised Exchanges.
Lending and staking
Depositing tokens into a Decentralised Finance (DeFi) protocol uses the same permission.
NFT marketplaces
Marketplaces commonly use setApprovalForAll to list NFTs for sale.2
Security hygiene
Old approvals are an open door, which is why wallet drainers chase them.
Advantages and disadvantages
Advantages
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
Approving unlimited by default
Lower the cap to what the trade needs.4
Thinking disconnect revokes
Disconnecting leaves approvals in place.3
Ignoring the contract address
Check the spender on a Block Explorer before approving.2
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.
Key points to remember
- A token approval lets an app move one token from your wallet, up to an allowance.
- Approvals do not expire and survive disconnecting your wallet.
- Unlimited approvals save gas but expose the whole balance.
- Permit signatures grant allowances without a transaction.
- Review and revoke old approvals regularly.
Frequently asked questions
Do I need to approve ETH?
Where can I see my approvals?
Should I revoke everything?
Further learning
- Wallet Drainer
How scammers abuse approvals.
- Smart Contract
The code that spends your allowance.
- Gas Fee
What approvals and revokes cost.
- Reentrancy and Oracle Manipulation
Why trusted apps can still fail.
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.
- Ethereum Improvement Proposals. ERC-20: Token Standard (opens in a new tab) Checked .
- MetaMask Support. What is a token approval? (opens in a new tab) Checked .
- ethereum.org. How to revoke smart contract access to your crypto funds (opens in a new tab) Checked .
- ethereum.org. Ethereum security and scam prevention (opens in a new tab) Checked .
- 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.