Koinlytics

Token Approvals and How to Revoke Them

Securitybeginner6 min read
Every DeFi interaction leaves an approval on-chain. What they let contracts do, why they get exploited, and how to audit and revoke.

Every time you swap on Uniswap, deposit into Aave, or bridge assets, you grant a smart contract permission to move your tokens. That permission is called an approval, and it stays on-chain until you explicitly revoke it. Most wallets set it to "unlimited" by default.

What an approval is

An ERC-20 approve(spender, amount) call. The token contract remembers that spender can spend up to amount of your tokens on your behalf. The DeFi contract can then call transferFrom(you, ..., amount) without a new signature from you.

Why unlimited approvals exist

Gas efficiency. If you approve a fixed amount every time, you pay approval gas twice per interaction. Unlimited approval lets you interact with a protocol repeatedly with a single approval. The trade-off: if that protocol is exploited later, all your tokens are drained even if you last used it years ago.

Historical exploits that used stale approvals

How to audit

Best practice for regular users

PreviousMultisig with Safe (formerly Gnosis Safe) NextWallet Drainers: How to Recognize Them
Powered by Koinlytics · Free crypto education.

Ready to try what you just learned?

Open the Koinlytics dashboard and see the concepts live on your real portfolio.

Launch App