What an ERC-20 approval does
ERC-20 tokens are smart contracts with balances mapped to addresses. By default, only you can move your balance — by calling transfer from your wallet. A decentralized exchange router is a separate contract; it cannot pull USDC from your wallet unless you first call approve(spender, amount) on the token contract.
Approval writes an allowance: “address X may transfer up to N tokens from my balance.” The swap transaction then calls transferFrom to pull exactly what the trade needs, as long as N is large enough.
Native coins (ETH on Ethereum, etc.) do not use ERC-20 approve; you send value with the transaction itself. That is why your first USDC swap costs two signatures — approve, then swap — while a native ETH swap might only need one.
Exact amount vs unlimited
Wallets and dApps historically pushed unlimited approvals (setting allowance to the maximum uint256 value) so users approve once and never think about it again. Convenience trades off against blast radius:
- If the approved router is upgraded maliciously or exploited months later, attackers can drain all past-approved tokens in one transaction.
- If you approve a scam contract disguised as a popular router, unlimited means total loss of that token balance.
Exact-amount approvals set allowance to the precise swap or bridge size (sometimes with tiny rounding). Next time you trade, you approve again. Extra gas, smaller exposure.
| Style | UX | Risk if spender is compromised |
|---|---|---|
| Unlimited | One approval for many future trades | Entire token balance exposed |
| Exact amount | Re-approve when size changes | Limited to last approved quantity (often zero after spend) |
Typical swap approval flow
- You request a quote in Exchange for token A → token B on one EVM chain.
- The aggregator returns a transaction targeting a router contract address (spender).
- If allowance < pay amount, GaurdWallet prompts an
approvetransaction for that spender. - After approval confirms, you sign the swap or bridge transaction that consumes the allowance.
Bridges that start with an ERC-20 on the source chain follow the same pattern. LI.FI routes may involve multiple contracts; the approval target should match what the quote metadata specifies — verify the spender name/address in your wallet preview.
Legitimate swaps approve known router contracts. If a site asks you to approve an unknown address or a random token you did not intend to sell, stop. GaurdWallet never asks for your seed phrase to “fix” approvals.
Approve phishing and malicious spenders
Scam sites mimic DEX UIs and airdrop claim pages. They trigger approve on valuable tokens toward attacker-controlled contracts. Because approvals are invisible until someone pulls funds, victims discover theft later during unrelated activity.
Defense habits:
- Initiate swaps only from the wallet app you installed — e.g. GaurdWallet Exchange — not from random links.
- Prefer exact allowances when offered.
- Periodically audit open allowances with reputable revoke tools (double-check the tool’s domain).
- Treat “increase allowance” prompts on NFT or gaming sites with the same skepticism as swap routers.
Reviewing and revoking allowances
Allowances persist until changed. After a large unlimited approval, revoking or lowering it to zero is prudent even if you trust the protocol today. Revoke is itself an on-chain transaction costing gas.
If you rotate wallets, old approvals on abandoned addresses do not affect a new seed — but anyone with the old keys retains those permissions until revoked.
GaurdWallet exact-amount default
GaurdWallet Exchange v0.2.1 asks routers to spend only the amount you are swapping or bridging, not unlimited rights. That aligns with non-custodial safety: the wallet cannot undo a malicious contract, but it can avoid baking in permanent spend rights by default.
Combined with proxied LI.FI quotes (/api/swap/quote, /api/swap/tx), you still sign every approval and swap locally. Pair this with sensible slippage — see crypto slippage explained — and network checks from our swap & bridge guide.
FAQ
Do Solana swaps use ERC-20 approve? No. Solana uses different account models; Jupiter swaps in GaurdWallet do not use Ethereum-style approve.
Can I skip approval by sending tokens manually? Not for aggregator swaps — the router must pull funds atomically with the trade logic.
Why did approval succeed but swap fail? Common causes: slippage revert, expired quote, or insufficient balance after approval gas. Fix the underlying issue; leftover allowance may remain until spent or revoked.
Permit2, signatures, and future UX
Some modern routers use Permit2 or typed signatures to reduce repeated on-chain approvals. GaurdWallet v0.2.1 emphasizes familiar exact-amount approve transactions for clarity in transaction previews. If future versions add signature-based permits, the security question remains the same: which spender receives how much authority over which token?
USDT on Ethereum historically required resetting allowance to zero before lowering approvals — an ERC-20 quirk. If a revoke tool fails, research token-specific behavior before retrying.
Hardware wallet users should verify token contract, spender, and amount on the device screen even when the desktop UI looks familiar. Phishing sites mimic buttons; cold wallets are the last line when the address does not match a known router.
After the trade: leftover allowances
Exact-amount approvals often leave a zero or dust allowance after transferFrom consumes the swap size. Unlimited approvals leave the full uint256 value until you revoke. Make a habit of checking token approval dashboards after experimenting with new dApps — especially if you ever clicked through a suspicious link.
When bridging, the spender may differ from a simple DEX router because bridge contracts pull tokens before locking them. Treat each new spender with the same scrutiny; do not assume “I already approved Uniswap” covers a bridge you never used.
GaurdWallet’s philosophy is conservative defaults in a non-custodial product: you keep signing power, and the wallet avoids nudging you toward infinite allowances just to save one transaction.
How approvals fit the full Exchange flow
After approval confirms on-chain, the swap transaction consumes allowance in the same block or a later one depending on mempool ordering. Do not assume instant availability — wait for the approval receipt before confirming swap if the UI allows separate steps.
Bridge routes may approve a bridge router distinct from DEX routers you used before. Compare spender addresses across sessions; bookmark verified addresses only after you confirm them on-chain yourself.
Combined with proxied quotes, the approval step is still entirely local signing. If anyone messages you claiming GaurdWallet support needs unlimited approval to “release” stuck funds, that is fraud — see non-custodial swap safety for broader patterns.
Auditing allowances quarterly
Set a calendar reminder to review open approvals on chains you actively use. Revoke dormant spenders tied to dApps you no longer touch. The gas cost of revocation is usually smaller than the cost of leaving unlimited USDC approval on a forgotten farm contract.
When teaching friends to use Exchange, walk them through one exact-amount approval live so the pattern looks familiar when a scam site requests something different.
Export a personal note of spender addresses you trusted after successful swaps. Next time Exchange proposes the same router, you can compare quickly instead of trusting UI skin alone.
Remember that approvals are per token contract: approving USDC does not approve USDT. Each asset needs its own allowance toward the same spender when you trade both.