Skip to the article
Chain Today

Reporting on crypto's moving parts

What a Token Approval Lets a Wallet Swap Do

A token approval gives a swap contract permission to move a set amount of ERC-20 tokens; the allowance, spender address and transaction determine what leaves your wallet.

The Chain Today Desk4 min read

What a Token Approval Lets a Wallet Swap Do

A token approval lets a specified contract move a set amount of an ERC-20 token from your wallet. Before a swap, the wallet or trading app may ask you to approve the token, then submit a separate transaction that performs the trade. The approval is a spending permission, not the swap itself: it does not send your tokens to the app or guarantee that a trade will succeed.

What happens when you approve a token?

The token contract records an allowance: the amount one address, called the spender, may transfer from your address. The ERC-20 standard defines this with approve, which sets the allowance, and transferFrom, which lets an authorized spender move tokens within that limit. Think of it as giving a named contractor a key with a spending limit; the key does not move the funds by itself.

For a typical swap, the app identifies the token and the contract that needs permission. Your wallet asks you to sign an approval transaction. Once it is confirmed on the network, the allowance is recorded in the token contract. The app can then submit the swap transaction, in which the spender uses transferFrom to take the input tokens and the swap contracts carry out the exchange. For more on how a swap route handles execution and settlement, see cowswap.

Some tokens and contracts support permit approvals, based on standards such as ERC-2612. These use a signed message to set an allowance instead of a separate on-chain approval transaction. Support is not universal, and a permit still grants spending permission; check what the wallet says you are signing.

Why does a wallet ask for approval before the swap?

A swap contract cannot spend your ERC-20 tokens just because your wallet is connected to an app. The token contract checks the spender’s allowance when the swap tries to transfer the input tokens. If the allowance is too low, the transfer fails, so an app may request approval first and then ask you to submit the swap.

You may see no approval step if the token is already approved for that spender or if the swap uses a token that does not require this ERC-20 allowance flow, such as the chain’s native asset. An existing allowance can also cover a larger amount than this trade. The ERC-20 allowance function returns the amount the spender is still allowed to withdraw, so the displayed permission relates to that spender and token, not every app or token in your wallet.

How much should you approve?

When the wallet offers a choice, a limited approval for the amount you intend to swap gives the spender less room than an unlimited allowance. Unlimited approval can save a later approval transaction, but it leaves the contract authorized to transfer tokens up to that allowance while it remains in place. Disconnecting the wallet from a site does not cancel an on-chain allowance.

  • Check that the token and spender address match the swap you are making.
  • Read the approval amount in the wallet prompt; choose a limited amount if it meets your needs.
  • Confirm the approval transaction before submitting the swap, and check the swap’s own details separately.

If you no longer want a spender to have permission, use a trusted allowance-management tool or the token’s approval function to set its allowance to zero. That change also requires an on-chain transaction. The ERC-20 standard notes that interfaces should set an existing allowance to zero before changing it to another value for the same spender, which is why a wallet may show an extra approval step when you adjust an allowance. For most occasional swaps, approving only what the trade needs is the clearer choice: it keeps the permission close to the action you intended.