An ERC-20 token approval is a separate on-chain transaction that grants a specific smart contract permission to move a set number of your tokens from your wallet. Nothing moves when you approve; you are handing out spending authority, not sending funds. The risk is that most decentralized applications default that authority to unlimited and it never expires, so a contract you approved months ago can still drain every token of that type from your wallet if it is later exploited.
What Happens When You Click Approve
The ERC-20 standard defines a function called approve that authorizes another address to withdraw tokens from your wallet up to a specified amount. The specification says the function “allows _spender to withdraw from your account multiple times, up to the _value amount.”1Ethereum Improvement Proposals. ERC-20: Token Standard When you confirm the approval in your wallet, the token’s contract records that the spender now has permission to move that many tokens on your behalf.
That record lives in the token contract’s storage indefinitely. Closing the browser, disconnecting the wallet, or switching networks changes nothing. When the application later executes a trade, it calls a different function, transferFrom, which checks the stored allowance, moves the tokens, and reduces the remaining amount.2OpenZeppelin Docs. ERC20 – OpenZeppelin Docs Think of the approval as a limited power of attorney over one specific token: the authorized party can act whenever it chooses, right up to the limit you set.
Why the Unlimited Default Is Dangerous
Most decentralized applications request an allowance set to the maximum value a 256-bit unsigned integer can hold. That is a number so large it effectively means “everything, forever.” Developers use it so you only pay gas once for the approval rather than re-approving before every trade. The convenience is real, and so is the exposure.
If the contract you approved is later exploited, an attacker can use your existing unlimited allowance to drain every token of that type in your wallet. The damage is limited to the specific token you approved, so an unlimited USDC approval does not put your ETH at risk, but the attacker can take every last USDC regardless of how small your original trade was. In early 2025, attackers exploited a flaw in the Ekubo DEX swap router and drained roughly $1.4 million in wrapped bitcoin from users who had left approvals active. That pattern repeats constantly. Users interact with a protocol once, forget about the approval, and lose funds months later when the contract is compromised.
The lingering nature of these permissions is what makes them so dangerous. Even if you move all your tokens to a different wallet, the approval stays active on your original address. Any tokens of that type deposited later, whether from a friend, an airdrop, or a forgotten transaction, are immediately accessible to the approved contract.
The Race Condition When Lowering an Allowance
The ERC-20 standard has a known design flaw that catches people off guard when they try to reduce an existing allowance. Say you previously approved a contract to spend 100 tokens and now want to lower that to 50. You submit a new approval for 50. Before your transaction confirms, the spender can see it in the pending transaction pool, quickly spend the original 100, and then still spend the new 50 after your update goes through. The spender ends up with 150 tokens instead of the 50 you intended.3Smart Contract Weakness Classification. SWC-114
The EIP-20 specification itself warns about this and recommends setting the allowance to zero first, then setting it to the new value in a second transaction.1Ethereum Improvement Proposals. ERC-20: Token Standard Some wallets handle this automatically, but many do not. If you need to reduce an existing allowance, always reset it to zero first.
Off-Chain Permit Signatures
Traditional approvals require an on-chain transaction that costs gas and leaves a visible trail. EIP-2612 introduced a permit function that changes the equation: you sign a message off-chain, and anyone holding that signed message can submit it to the token contract to set an allowance on your behalf.4Ethereum Improvement Proposals. ERC-2612: Permit Extension for EIP-20 Signed Approvals The signature includes the spender address, the allowance amount, a deadline, and a nonce to prevent replay attacks.
The problem is that this mechanism is invisible. Because the signature happens off-chain, there is no blockchain record until someone actually submits it. An attacker running a phishing site can disguise a permit signature request as a simple “connect wallet” or “claim airdrop” prompt. If you sign it, the attacker holds a valid authorization and can execute it whenever they want, even days later. Between March and April 2023, security researchers identified at least $7.7 million stolen through permit phishing, with a single wallet losing $4 million in one incident.
A standard login message looks nothing like a permit signature, which contains fields like spender, value, and deadline. If an unfamiliar site asks you to sign a structured message with those fields, close the tab. Shorter deadlines reduce your exposure window, but the safest habit is never signing a permit on a site you do not fully trust.
Permit2 and Centralized Approval Management
Uniswap’s Permit2 contract tries to reduce the risks of scattered approvals by acting as an intermediary. Instead of granting unlimited approval directly to every application you use, you approve the Permit2 contract once per token. Each application then requests permission from Permit2, which enforces time-limited and optionally amount-limited access.5Uniswap Labs. Permit2 Approval
The tradeoff is concentration. If Permit2 itself were ever compromised, every token you have approved through it would be at risk. The contract has been heavily audited and is widely used, which reduces but does not eliminate that possibility. Permit2 is a meaningful improvement over the old model of scattering unlimited approvals across dozens of contracts, but it introduces a single point of failure that did not exist before.
NFT Approvals Work the Same Way
ERC-20 tokens are not the only assets with approval risks. The ERC-721 standard for NFTs includes two approval mechanisms. The approve function works like its ERC-20 counterpart but targets a single specific NFT. The more dangerous one is setApprovalForAll, which grants a contract permission to transfer every NFT you hold in that entire collection. Marketplaces typically require it because they need the ability to transfer whichever NFT a buyer purchases, but the permission applies to your whole collection sitting in that wallet.
If you hold ten NFTs in a collection and the marketplace contract is compromised, all ten are exposed. Using per-token approve is safer when the platform supports it. Many do not, so revoke setApprovalForAll permissions promptly after completing a sale.
How to Check and Revoke Your Approvals
Free tools let you see every active approval tied to your wallet. Revoke.cash supports over 100 networks and works by connecting your wallet, displaying all outstanding approvals with their allowance amounts, and letting you revoke them individually.6Revoke.cash. Revoke Your Token Approvals on Over 100 Networks Etherscan’s Token Approval Checker offers a similar interface for Ethereum mainnet: enter your wallet address, connect the wallet, and click revoke next to any contract you no longer use.
Revoking is itself a transaction that sets the allowance to zero, so it costs gas. On Ethereum mainnet, that cost fluctuates with network demand but has dropped significantly since earlier years. On Layer 2 networks like Arbitrum or Optimism, revocations typically cost fractions of a cent. Each approval must be revoked separately, so 15 old approvals means 15 individual transactions.
You can also lower an allowance to a specific amount instead of revoking entirely. If you want a contract to hold exactly 500 USDC of authority, you can enter that figure during the approval step instead of accepting the default maximum. Remember the race condition: if you are lowering a non-zero allowance, set it to zero first, then set it to the new number.
Gas Fees on Approvals and Your Taxes
The IRS defines digital asset transaction costs as amounts paid to effect the “purchase, sale, or disposition” of a digital asset, and explicitly includes gas fees in that definition.7Internal Revenue Service. Frequently Asked Questions on Digital Asset Transactions Qualifying gas fees get added to your cost basis on purchases or subtracted from your amount realized on sales.
Approval and revocation transactions do not themselves buy, sell, or dispose of anything. They only modify a permission. The IRS guidance specifically notes that gas fees paid to transfer digital assets between your own wallets are not treated as transaction costs, because those transfers are not purchases, sales, or dispositions.7Internal Revenue Service. Frequently Asked Questions on Digital Asset Transactions Approval gas fees fall into a similar gray area. If the approval is tied directly to an immediate swap, there is a reasonable argument for including it in that transaction’s cost basis. Revoking an old approval for security reasons with no associated trade is far less clear. Keep records of every gas fee, because the IRS has not issued specific guidance on approvals and the rules could later be clarified in your favor.
Habits That Cut Your Exposure
The single most effective habit is setting a custom allowance instead of accepting the default unlimited amount. If you are swapping 200 USDC, approve 200 USDC. You will pay gas for a new approval next time you trade, but you eliminate the risk of a lingering permission draining your entire balance. Most wallet interfaces let you edit the approval amount before confirming.
- Keep a hot wallet with small balances for active on-chain use and a separate cold wallet for long-term holdings. If every approval on the hot wallet is exploited, the damage is capped at whatever you chose to deposit there.
- Check your approvals through Revoke.cash or a block explorer at least monthly, and revoke anything you are not actively using.
- If a site asks you to sign a structured message containing fields like “spender,” “value,” or “deadline,” you are likely signing a permit. Do not proceed unless you initiated a specific transaction on a trusted platform.
- When you finish using a protocol, revoke its approval immediately rather than leaving it active indefinitely.
Approvals are how token contracts delegate spending authority, and the ERC-20 standard was not designed with today’s threat landscape in mind. The race condition, the unlimited default, and the invisible permit signature are all artifacts of a system built for developer convenience first. Treating every approval as a calculated risk rather than a routine checkbox is the most reliable way to keep your tokens where they belong.