Paj Digital Labs
All articles
Web3 & Crypto Tech

Token Approvals Explained: Why 'Unlimited Allowance' Is a Standing Risk

Approving a contract to spend your tokens is routine, and it is behind many wallet-draining incidents. How allowances work, why unlimited approvals linger, and how apps and users can reduce the exposure.

Paj Digital Labs 2 min read
Hardware security key beside a connected circuit board
Editorial illustration · Web3 & Crypto Tech

Before a decentralised exchange can swap your tokens, you approve it to spend them. Most interfaces default to an unlimited approval, so you never have to approve again. Convenient — and it means that contract can move all of that token from your wallet, forever, unless you revoke it.

How allowances work

Standard tokens have an approve(spender, amount) function. It records that a spender may transfer up to amount of your tokens using transferFrom. The tokens stay in your wallet; the permission sits on the token contract.

solidity
token.approve(router, type(uint256).max); // class="text-code-string">"unlimited"
class="text-code-comment">// later, the router can call:
token.transferFrom(user, pool, amount);

Why unlimited approvals are risky

The permission persists after you finish using the app. If that spender contract is later exploited, upgraded maliciously, or was malicious from the start, it can drain the approved token from every wallet that approved it. Many large wallet-draining incidents involved exactly this: old approvals to a contract that later became dangerous.

Phishing sites exploit the same mechanism. They ask you to "connect" or "claim", and the transaction you sign is actually an approval for the attacker's address.

Signature-based approvals

Newer standards allow approvals by signing an off-chain message instead of sending a transaction. This saves gas, but it also means a signature request — which looks harmless because it costs nothing — can grant spending rights. Read what you sign. A signature request mentioning a spender, amount and deadline is an approval.

What apps should do

  • Request exact amounts by default, with unlimited as an explicit choice
  • Show clearly what is being approved, to which contract, and for how much
  • Use permit flows with short deadlines, so signatures expire
  • Keep spender contracts minimal and audited; upgradeable spender contracts increase risk
  • Never ask for approvals of tokens unrelated to the action

What users should do

| Habit | Why | |---|---| | Approve exact amounts | Limits loss if the spender is compromised | | Review approvals regularly | Old approvals are forgotten risk | | Revoke unused approvals | Removes the permission entirely | | Use a separate wallet for experiments | Keeps savings away from new apps | | Read signature requests | Off-chain signatures can still grant spending |

Revoking costs a small transaction fee. Several reputable tools list your existing approvals per network and let you revoke them in a few clicks.

For support teams

When a user reports tokens disappearing without them sending a transaction, check approvals first. Look for Approval events from their address, and then transferFrom calls by that spender. It usually shows exactly which approval was used and when it was granted.

Approvals are a necessary part of how tokens work. The risk is in leaving them open far beyond the moment they were needed. Approve less, revoke more, and treat every signature as a possible transfer of control.

Paj Digital Labs

The engineering journal of Paj Digital Solutions — hosting, server infrastructure and web engineering, written by the people who run the servers.

Related reading