Ga naar hoofdinhoud

Why does MetaMask Swaps use unlimited token approvals?

Does this article need to be translated?

Contribute to the Help Center

Submit translations, corrections, and suggestions on GitHub, or reach out on our Community forums.

Our token approval is given strictly to our Spender contract, which was created to:

  1. Serve as a protective intermediary that interacts with underlying protocols on the user's behalf
  2. Reduce non-negligible gas costs associated with each token approval transaction

Simply put, we designed our suite of contracts to make our Swaps protocol maximally secure above all, and, when possible, minimize unnecessary gas costs for our users.

notitie

What is a token approval?

In short: permission for a dapp to access and move a specific type of token from your wallet. Learn more here.

It’s no accident that, despite numerous security breaches in the past few years affecting some of the liquidity sources we support, MetaMask Swaps users have remained unaffected.

MetaMask was the first wallet to embed a meta-aggregation swap feature. We invested the time and energy to safeguard our users and save them gas on unnecessary approvals by developing our own smart contracts as a wrapper around the underlying liquidity sources users interact with.

We notify you about token approvals (spending caps) to make sure you understand the implications of each transaction and keep you in control. While we default to ‘unlimited’ to save unnecessary gas costs, we also allow overriding our default value before submitting the swap.

Custom spending cap extension

We are defaulting to non-infinite approvals on L2s where gas is materially cheaper and exploring even more flexible approvals in the future using the new MetaMask delegation tool kit.

To learn more about MetaMask Swaps, dive into this guide.