Metamask: How to fix ‘Execution Reverted’ error step-by-step

Metamask: How to fix 'Execution Reverted' error step-by-step
Visualization: Metamask: How to fix ‘Execution Reverted’ error step-by-step

MetaMask: How to Fix the ‘Execution Reverted’ Error Step-by-Step

The ‘Execution Reverted’ error in MetaMask is a common yet often perplexing message encountered by users interacting with decentralized applications (dApps) on various blockchain networks. This error signifies that a smart contract transaction failed during its execution on the blockchain. Unlike a simple ‘transaction failed’ message which might indicate network congestion or a dropped transaction, ‘Execution Reverted’ specifically means the smart contract’s internal logic prevented the transaction from completing successfully, often due to unmet conditions or incorrect parameters. Understanding the root causes and applying systematic troubleshooting steps are crucial for resolving this issue.

This article, structured for technical clarity, aims to demystify the ‘Execution Reverted’ error and provide a comprehensive, step-by-step guide to diagnose and resolve it.

Understanding the ‘Execution Reverted’ Error

At its core, ‘Execution Reverted’ indicates that a smart contract, upon receiving your transaction, encountered a condition that caused it to stop processing and return any changes it had made to the blockchain state. It’s akin to a program throwing an exception and rolling back to its previous state. This mechanism is vital for contract security and integrity, preventing unintended state changes from invalid operations.

Common scenarios leading to this error include:

  • Insufficient Gas: The transaction ran out of gas before completing all necessary computations.
  • Slippage Tolerance Issues: For token swaps, the price changed too much between transaction submission and execution, exceeding the user-defined slippage tolerance.
  • Contract-Specific Logic: The transaction violated a rule or condition hardcoded within the smart contract (e.g., attempting to buy when a sale is closed, trying to transfer more tokens than allowed, or not meeting minimum/maximum transaction limits).
  • Incorrect Input Parameters: Providing an invalid address, an incorrect amount, or other data that the contract cannot process.
  • Token Approval Issues: Attempting to transfer or swap tokens that the dApp contract has not been approved to spend from your wallet.

Addressing this error requires a methodical approach, examining potential points of failure from the user interface to the underlying blockchain parameters.

Step-by-Step Solutions to ‘Execution Reverted’

The following steps offer a progressive approach to troubleshooting, starting with the most common causes and moving towards more specific solutions.

1. Adjust Gas Limit and Gas Price

The most frequent cause of ‘Execution Reverted’ is insufficient gas. Every operation on a blockchain (like Ethereum, BSC, Polygon) consumes computational resources, measured in ‘gas’. You pay for this gas in the network’s native currency (e.g., ETH for Ethereum, BNB for BSC).

  • Understand Gas Limit vs. Gas Price:
    • Gas Limit: The maximum amount of gas units you are willing to spend on a transaction. If the transaction requires more gas than this limit, it will fail and revert.
    • Gas Price: How much you are willing to pay per unit of gas (e.g., in Gwei for Ethereum). A higher gas price can make your transaction confirm faster.
  • How to Adjust in MetaMask:
    1. Initiate your transaction in the dApp.
    2. When the MetaMask confirmation window appears, click “Edit” next to “Gas:”.
    3. You will see options for “Estimated gas limit” and “Max fee” (or “Gas price” depending on the network and MetaMask version).
    4. Increase Gas Limit: Try increasing the suggested gas limit by 10-20%. Smart contracts sometimes require slightly more gas than initially estimated, especially under network congestion.
    5. Increase Gas Price/Max Fee: While not directly preventing ‘Execution Reverted’ due to *insufficient* gas, a higher gas price ensures your transaction is processed quicker, potentially avoiding revert conditions that arise from network delays (e.g., price changes on a DEX). MetaMask often provides “Low,” “Medium,” and “High” options; consider choosing “High” or manually setting a slightly higher price.
    6. Confirm the transaction with the adjusted gas settings.

2. Modify Slippage Tolerance (for Swaps)

When performing token swaps on decentralized exchanges (DEXs) like Uniswap, PancakeSwap, or QuickSwap, ‘Execution Reverted’ can occur if the price of the asset changes too much between the time you initiate the swap and the time it’s executed on-chain. This is known as slippage.

  • What is Slippage Tolerance? It’s the maximum percentage difference between the quoted price and the executed price you are willing to accept. If the actual price deviates beyond this tolerance, the transaction will revert to protect you from unfavorable trades.
  • How to Adjust Slippage:
    1. Navigate to the settings icon (often a cogwheel) on the DEX interface where you are attempting the swap.
    2. Locate the “Slippage tolerance” or “Max slippage” setting.
    3. The default is often 0.5% or 1%. For highly volatile tokens, or during periods of high network congestion, you might need to increase this to 2-5%, or even higher for very low liquidity tokens.
    4. Caution: Increasing slippage tolerance too much can expose you to front-running bots or significant price differences. Use with discretion.
    5. Attempt the swap again with the new slippage setting.

3. Verify and Re-Approve Token Permissions

Before a dApp contract can interact with your tokens (e.g., spending them for a swap), you must grant it permission (approval). If this approval is missing, expired, or insufficient, the transaction will revert.

  • Check for Existing Approvals: Use tools like Etherscan’s Token Approvals (for Ethereum mainnet) or BscScan’s Token Approvals (for Binance Smart Chain) to see which contracts have permission to spend your tokens and for what amounts.
  • Re-Approve the Token:
    1. Go back to the dApp and find the option to approve the token you are trying to use (e.g., for swapping, staking, etc.). This often appears as a button like “Approve USDT” or “Enable Token.”
    2. Submit the approval transaction. This is a separate transaction from your main interaction.
    3. Once the approval transaction is confirmed, try your main transaction again.
  • Infinite Approval: Many dApps offer “infinite approval” (or a very large amount). While convenient, be mindful of the security implications.

4. Confirm Input Parameters and Contract Rules

Smart contracts have specific rules and conditions. Providing incorrect data or violating these rules will lead to a revert.

  • Check All Input Fields: Double-check all addresses, amounts, and other data you are inputting into the dApp. A common mistake is using an incorrect token address or sending tokens to a contract that doesn’t accept them.
  • Review Contract-Specific Conditions:
    • Are there minimum or maximum transaction amounts?
    • Is there a specific time window for the action (e.g., presale, staking period)?
    • Is your wallet whitelisted if required?
    • Do you have the necessary balance of the *required* tokens (e.g., sometimes you need a minimum amount of LP tokens to unstake)?
  • Consult Documentation: If you are interacting with a new or complex dApp, review its official documentation, whitepaper, or community channels (Discord, Telegram) for specific operational requirements.

5. Ensure Sufficient Wallet Balance (Native Token and ERC-20)

While seemingly obvious, insufficient balance can cause ‘Execution Reverted’.

  • Native Token for Gas: Always ensure you have enough of the network’s native token (e.g., ETH, BNB, MATIC) in your wallet to cover the transaction fees. A common scenario is having enough ERC-20 tokens but not enough native token for gas.
  • ERC-20/Token Balance: Verify that you possess the exact amount of the specific token you intend to transact with. Sometimes, displaying issues or pending transactions can make it appear you have more than you actually do.

6. Clear Browser Cache and Update MetaMask/Browser

Basic IT troubleshooting steps can resolve underlying software conflicts or outdated configurations.

  • Clear Browser Cache and Cookies: Accumulated cache can sometimes interfere with dApp interactions. Clear your browser’s cache and cookies, then restart the browser.
  • Update MetaMask Extension: Ensure your MetaMask extension is updated to the latest version. Outdated versions might have bugs or compatibility issues with newer contract standards.
  • Update Web Browser: Similarly, ensure your web browser (Chrome, Firefox, Brave, etc.) is up-to-date.

7. Reset MetaMask Account

This action clears your transaction history within MetaMask and resets your account’s nonce. While it doesn’t affect your on-chain assets, it can resolve issues related to stuck or pending transactions that might be preventing new ones from going through.

  • How to Reset:
    1. Open MetaMask.
    2. Click on your account icon (top right).
    3. Go to “Settings”.
    4. Select “Advanced”.
    5. Scroll down and click “Reset Account”.
    6. Confirm the action.
  • Important: Only do this if you understand the implications and have tried other steps first. This will not delete your funds but will clear your local transaction history.

8. Consult Project Documentation and Community Channels

If all else fails, the issue might be specific to the dApp or project you are interacting with.

  • Official Documentation: Review the project’s official website, documentation, or FAQs for known issues or specific requirements.
  • Community Support: Engage with the project’s community on platforms like Discord, Telegram, or Twitter. Other users might have encountered and resolved similar issues, or the development team might provide specific guidance.

By systematically working through these steps, users can effectively diagnose and resolve the ‘Execution Reverted’ error, enabling smoother and more reliable interactions within the decentralized ecosystem.


Disclaimer: This content is for educational purposes only. Not financial advice.

Scroll to Top