4547onsol.xyz

How to Revoke Smart Contract Allowances in MetaMask: A Step-by-Step Guide

The safest way to stop a smart contract from spending your tokens is to revoke its allowance - the permission you previously gave it. In MetaMask, you do this by sending a transaction that sets the allowance to zero. This page walks you through that process for Ethereum and compatible networks.

Why you need to revoke allowances

When you approve a token for a DeFi app or NFT marketplace, you give that contract permission to spend a specific amount of that token from your wallet. That allowance remains active until you revoke it. If the contract turns out to be malicious or gets compromised, it can drain those tokens - even if you no longer use the app.

Revoking unused allowances is a basic hygiene step, similar to closing old bank accounts you don't use anymore.

What you need before starting

Step-by-Step: revoke using a block explorer

This method works on any network and does not require a separate tool.

Step 1: Find the Allowance You Want to Revoke

  1. Open Etherscan (or the equivalent block explorer for your network - e.g., Polygonscan for Polygon).
  2. Enter your wallet address in the search bar.
  3. Click the Token Approvals tab (some explorers call it ERC20 Token Txns or Approvals).
  4. You will see a list of tokens and the contracts they are approved for. Note the Token Contract Address and the Spender Address for the allowance you want to revoke.

Step 2: Get the Revocation Function Data

You need to call the approve function of the token contract, setting the spender's allowance to zero. The easiest way is to use the block explorer's Write Contract feature.

  1. On the token's contract page in the block explorer, click Contract then Write Contract.
  2. Connect MetaMask by clicking Connect to Web3 (if prompted).
  3. Find the approve function. It usually asks for two inputs:
  4. spender (address): Paste the spender contract address you noted.
  5. amount (uint256): Enter 0 (zero).

Step 3: Submit the Transaction

  1. Click Write to trigger the transaction.
  2. MetaMask will open a window showing the transaction details. Read the warning carefully. It will say something like "You are interacting with a contract at [token address]." This is normal - you are calling the token contract, not the spender.
  3. Confirm the transaction.
  4. Wait for it to be mined. Once confirmed, the allowance is revoked.

Step-by-Step: revoke using a dedicated tool

Several free tools exist that simplify the process. They use the same underlying method but present a cleaner interface.

Step 1: Visit a Reputable Revocation Tool

Common options include Revoke.cash or Etherscan's Token Approval Checker. Always verify the URL - phishing sites look similar.

Step 2: connect your wallet

Click Connect Wallet and select MetaMask. The tool will scan the connected wallet's allowances.

Step 3: Select Allowances to Revoke

You will see a table of approved contracts and tokens. Check the ones you want to revoke, or use the Revoke All option if you want to clear everything. Be cautious: revoking an allowance for a contract you still actively use will break your ability to trade, stake, or otherwise interact with it until you approve again.

Step 4: Confirm the Transactions

Each revocation is a separate transaction. MetaMask will prompt you to confirm each one. You pay gas for each transaction, so revoking many allowances at once can be expensive on congested networks.

What happens after revocation

Common mistakes to avoid

When to Revoke

What this does not protect against

Revoking allowances stops future token transfers initiated by the spender. It does not protect against:

For broader wallet security, combine allowance management with the advice covered elsewhere on this site, such as avoiding blind signing and using a hardware wallet.

Not financial advice. 4547onsol.xyz publishes market data and general information about digital assets. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.

Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.

Back to wallet security