BR Academy
0%
Module 2: Wallets, Keys and Approvals·Lesson 8 of 30·10 min

Smart Contract Approvals: What You're Signing

With a working wallet in hand, you're almost ready to interact with your first DeFi protocol — but there's one more mechanic you need to understand first, because it's the single most misunderstood (and most exploited) part of everyday DeFi use: the token approval.

Most tokens on blockchains like Ethereum follow a standard (ERC-20) that includes a built-in safety feature: a smart contract cannot move tokens out of your wallet on its own initiative, even if you want it to perform an action like a swap. Instead, you must first explicitly grant that specific contract permission — an "approval" — to spend a specific token from your wallet, up to a specified amount, until you revoke that permission. This approval transaction is separate from, and happens before, the actual action you want to perform (like the swap itself). Think of it as two distinct signatures: one saying "this contract is allowed to touch this token," and a second saying "now actually do the swap."

The part that catches new users off guard is the "up to a specified amount" clause. Many wallet interfaces, for convenience, default to requesting an unlimited approval — meaning the contract is authorized to move any quantity of that token from your wallet, at any point in the future, not just the specific amount involved in your current transaction. This is convenient because it means you won't need to sign a new approval every single time you interact with that same contract again. But it also means that approval remains live, as a standing permission, indefinitely — until you notice it and manually revoke it, which is the subject of the next lesson.

It's worth knowing that approvals aren't unique to swaps — the same mechanic underlies depositing into a liquidity pool (Module 4) and supplying collateral to a lending protocol (Module 5). Any time a DeFi interface needs to move a specific ERC-20 token out of your wallet into its contract, it needs a prior approval for that exact token, independent of whatever other approvals you've granted to other contracts. This means a single wallet actively used across several protocols can accumulate a meaningful number of separate, standing approvals over time, each one a small, independent piece of attack surface — which is exactly why the habit taught in the next lesson matters well beyond swapping alone.

Worked Example

Imagine you want to swap 100 USDC for ETH on a decentralized exchange for the first time. Before the exchange's smart contract can pull your USDC into the swap, you must first approve that contract to spend your USDC. Your wallet will present a prompt showing the contract address being approved, the token (USDC), and the amount. If the interface defaults to "unlimited" (sometimes shown as an extremely large number, or literally the word "unlimited" or "infinite"), that single approval signature authorizes the DEX's contract to move any amount of your USDC, at any future time, not just the 100 you intend to swap today — until you separately revoke it.

This is not inherently a scam or a mistake on the DEX's part; it's a legitimate convenience feature used by many reputable, audited protocols, because it means you don't have to pay a gas fee and sign a new approval transaction every single time you trade the same token on that exchange. The risk it introduces isn't about the DEX acting maliciously today — it's about what happens if that contract is later found to have a bug, is exploited, or its ownership changes hands, while your old approval is still sitting there, live and unused. You'll study exactly that failure mode in the next lesson.

Now extend the example to a lending protocol: the same USDC you just swapped into might later be deposited as collateral. That deposit requires its own separate approval for the lending contract's address, entirely independent of the approval you gave the DEX — approving one contract never grants any permission to a different contract, even for the same token. By the end of a few weeks of normal DeFi use across swapping, liquidity provision, and lending, it would be entirely typical to have accumulated four or five separate standing approvals across different contracts, each worth reviewing on its own merits.

It's also worth understanding why this two-step design exists in the first place rather than treating it as an annoying extra click. The ERC-20 standard was finalized years before DeFi's current scale of automated, composable protocols existed, and its authors built in the approval step specifically so that no contract could ever move your tokens without some prior, explicit, on-chain record of your consent. That design choice is a feature, not a bug: it means every single token movement a smart contract ever makes on your behalf can be traced back to a specific transaction where you — and only you, using your private key — authorized it. The trade-off is that this safety mechanism only protects you if you actually read what you're authorizing, which is why this lesson exists before you touch a real DEX.

Common Pitfalls

  • Approving far more than you need "just in case." Some interfaces present unlimited approval as the only visible option, or bury the exact-amount option behind an "advanced" toggle. Look for it before accepting the default.
  • Confusing a read-only wallet connection with a spending approval. Connecting your wallet to a site only lets it see your public address and balances; it cannot move funds until you separately sign an approval for a specific token.
  • Approving a contract from a link you didn't navigate to yourself. Phishing sites frequently mimic real DEX interfaces and present a legitimate-looking approval prompt for a malicious contract — always verify the contract address and the site URL before signing.
  • Treating the approval prompt as a formality. Wallets show the contract address, token, and amount for a reason; skimming past it is how most approval-related losses happen, not technical exploits.

Exercise

Open your wallet's "connected sites" or "token approvals" view if you have an active wallet with prior DeFi activity, or review a screenshot or publicly available example if you don't yet have one. Identify exactly what an approval prompt looks like: what contract address is requesting approval, which token it covers, and what the "spending cap" or amount field shows — note specifically whether it defaults to a specific number or to "unlimited."

Before you ever click "confirm" on a real approval transaction in a later lesson, practice reading one approval prompt line by line, out loud if it helps: name the contract being approved, the token involved, and the exact amount authorized. Then write one sentence listing the different kinds of DeFi actions (swap, liquidity deposit, lending deposit) that each separately require their own approval, so you internalize that approvals accumulate across activities, not just across swaps. Make it a habit to pause and actually read this screen rather than clicking through it automatically — this single habit is the most effective, zero-cost defense against several of the scams covered in Module 6.

Recap

  • An approval is a separate, explicit permission that lets a specific contract spend a specific token from your wallet, up to a set amount, until revoked.
  • "Unlimited" approvals are common and convenient but remain live indefinitely, creating standing risk if the approved contract is later compromised — and swaps, liquidity deposits, and lending deposits each require their own separate approval.
  • Reading every approval prompt line by line — contract, token, amount — before confirming is a free habit that prevents real losses later in this course.

Resources