What is Token Allowance? Everything You Should Know

If you’ve spent time in crypto, you came across token allowance. But do you really understand what it is? If not, don’t worry. In this post, we’ll explore what token allowance is and then show you how to set a custom token allowance with Zerion Wallet, revoke it, and more.

What is token allowance?

Before any Web3 app can use your tokens, you need to grant it your permission to spend them — this is commonly known as ‘token allowance’ and ‘token approval’.

These terms come from standard functions of any ERC-20 token smart contract. The approve function lets you set the spending allowance for some dapp (like Zerion’s swap tab) for a specific token (like USDC).  The allowance function returns how much some dapp can spend of that token on your behalf.

In practice, you can just sign the transactions with your wallet. Understanding what happens under the hood is still useful — this can protect you from extra risks.

How does token allowance work?

Let’s look at an example of a simple interaction with a dapp: swapping tokens with Zerion.

After you connect your wallet to Zerion’s swap tab, let’s say you try to do a few swaps. You’ll need to do several transactions:

  1. Token approval — you approve Zerion’s smart contract to spend the token

  2. Token swap — you initiate the actual swap

  3. Second, and subsequent swaps — you don’t need to give new permission for the same token because you already gave it in step 1

A token approval transaction in Zerion Wallet
A token approval transaction in Zerion Wallet

In Zerion Wallet's multichain transaction history, token approvals will show up as 'others' type of transaction. By clicking through, you can also see the gas fee you paid for the approval.

Token approval in transaction history in Zerion Wallet
Token approval in transaction history in Zerion Wallet

During high congestion on the mainnet Ethereum, gas costs of these extra transactions can add up quickly.

You also usually first see the (lower) gas cost of the first approval transaction. Only after granting the approval with your wallet, you get to see the total price of the swap. On the Ethereum network, the gas costs of the swap could be higher than what you wanted to swap… at least, that’s what happened during the bull run.

So to save on gas costs, most dapps request an unlimited allowance — but you can also customize your token allowance.

How to set a custom token allowance with Zerion

Most dapps, by default, request unlimited access to a token. This helps to save on gas on additional approvals for subsequent transactions. However...

Unlimited token approvals are dangerous: if the smart contract is hacked or the dapp goes rogue, the infinite allowance allows it to use all your holdings of the approved token.

A scam website can also trick you into granting an unlimited allowance — after that, the scammer will steal all of that token.

Finally, on Layer-2 networks, it usually doesn’t make sense to penny-pinch approval transactions. Gas is cheap anyway.

That’s why, in Zerion Wallet, you can customize your token allowance for any approval transaction.

Set custom token approval in Zerion Wallet
Set custom token approval in Zerion Wallet

Just set the token allowance to only the amount of tokens you want to spend in that specific transaction. Or you can set the allowance to what you feel is safe for that smart contract: higher for something battle-tested decentralized application like Aave and lower for any degen dapp.

Of course, you can also revoke any token approvals at any time.

How to check and revoke your token approval

There are several tools for checking your token approvals.

The easiest way to check and revoke token approvals is with Revoke.cash.

After connecting your wallet, you get a list of token allowances for various smart contracts across dozens of blockchains. You can then update or remove any token allowances.

Revoke your token allowances with Revoke.cash
Revoke your token allowances with Revoke.cash

Keep in mind that revoking each token approval costs some gas because it’s an onchain transaction. Unfortunately, there is currently no easy way to revoke all token approvals in one transaction.

That’s why it’s better always to customize token approvals and set a reasonable limit that doesn’t expose you to unlimited risk and still lets you save on gas.

Token permits: approval and spending in one transaction

As you’ve seen, approvals can be expensive, especially if you swap small amounts.

That’s why devs came up with a way to do both the approval and swap in one transaction.

Some token smart contracts have a newer function: permit.

The permit function lets you set the allowance and spend tokens in one transaction.

This saves gas on the first swap for that pair. You also get to see the total gas cost of the swap right away.

The only problem is that not all tokens and not all dapps support this function.

The best-known DEX that uses this feature is 1inch. They also have an up-to-date list of tokens with permits — it currently includes USDC, DAI, UNI tokens, and other popular tokens.

Conclusion

In this post, we explored what token approval and token allowance are, examined why you should set a custom allowance, and how to do this with Zerion Wallet. We then explained how to check and revoke your token approvals. Finally, we explored the newer function of token permits that can help to save on gas by combining approval and swap in one transaction.

Unlimited token approvals expose you to an unnecessary risk. It’s a good practice to set a custom token allowance, which you can easily do with Zerion Wallet.

Subscribe to Zerion
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.