TransactionMinedTimeout [Error]: Timed out waiting for transaction

Hey guys,

I am getting the following error when trying to deploy my NFT.sol contract (It is basically an ERC721 with some added features) to mumbai testnet. I am working with hardhat:

I have tried different gas settings on my hardhat config file, but it does not affect the performance. As you can see on the file below deploy-NFT.js I am using Infura, but I have also tried Alchemy, and it does not change anything. I am using transparent proxies but still getting the same error when I tried UUPS.

Yesterday I deployed this same contract to mumbai several times and it stopped working. When checking through mumbai polygonscan, there are some differences on the logs.

You can check it here:

Successful deployment:

Failed deployment:

Maybe the proxy contract is not being deployed properly?

Config file and script:



const privateKey = process.env.privateKey || "";
const infuraId = process.env.infuraKey || "";
const alchemyId = process.env.alchemyKey || "";

module.exports = {
  defaultNetwork: "hardhat",
  networks: {
    hardhat: {
      chainId: 1337,
    development: {
      url: "",
      chainId: 1337, // Match any network id
      gas: 500000000,
    ...(infuraId && {
      mumbai_infura: {
        url: `${infuraId}`,
        accounts: [privateKey],
        gasLimit: 20000000,
        gasPrice: 25000000000,
      matic_infura: {
        url: `${infuraId}`,
        accounts: [privateKey],
    ...(alchemyId && {
      mumbai_alchemy: {
        url: `${alchemyId}`,
        accounts: [privateKey],
        gasLimit: 20000000,
        gasPrice: 25000000000,
      matic_alchemy: {
        url: `${alchemyId}`,
        accounts: [privateKey],
  solidity: {
    version: "0.8.4",
    settings: {
      optimizer: {
        enabled: true,
        runs: 200,

deployment script:

const { ethers, upgrades } = require("hardhat");
import { nftmarketaddress } from "../../../config";
import NFTData from "../../../artifacts/contracts/NFT.sol/NFT.json";
import MarketData from "../../../artifacts/contracts/Market.sol/NFTMarket.json";
import { getSecretConfig } from "../services/secret-manager";

async function getKeys() {
  let config;

  if (process.env.DEPLOY_SECRET_KEY) {
    config = await getSecretConfig(process.env.DEPLOY_SECRET_KEY);
  } else {
    config = {
      privateKey: process.env.privateKey ?? "",
      alchemyKey: process.env.alchemyKey ?? "",

  return config;

async function getSigner() {
  const network = process.env.NETWORK || "";

  let provider, kloovWallet, kloovAddress;
  if (network) {
    const keys = await getKeys();
    provider = new ethers.providers.JsonRpcProvider(
    kloovWallet = new ethers.Wallet(keys.privateKey, provider);
    kloovAddress = kloovWallet.address;
    console.log(await provider.getFeeData());
  } else {
    provider = new ethers.providers.JsonRpcProvider();
    kloovWallet = provider.getSigner();
    kloovAddress = await kloovWallet.getAddress();

  return { kloovWallet, kloovAddress };

export async function deployNFT(price, supply, url, artist) {
    "Deploying contract to: " +
      (process.env.NETWORK ? process.env.NETWORK : "local ") +
      " network"

  const { kloovWallet, kloovAddress } = await getSigner();

  console.log("NFT contract being deployed from: " + kloovAddress);

  const NFT = await ethers.getContractFactory("NFT", kloovWallet);
  const nft = await upgrades.deployProxy(NFT, [nftmarketaddress, artist], {kind: "uups"});
  await nft.deployed();
  console.log("NFT deployed to:", nft.address);

  /* next, create the token */
  let contract = new ethers.Contract(nft.address, NFTData.abi, kloovWallet);
  await contract.createToken(url, supply);
  const priceValue = ethers.utils.parseUnits(price, "ether");
  console.log("Token/s created");

  /* then list the item for sale on the marketplace */
  contract = new ethers.Contract(nftmarketaddress, MarketData.abi, kloovWallet);

  const transaction = await contract.createMarketItem(
  const tx = await transaction.wait();
  console.log("Item/s created");
  const marketItemsCreated =[ - 1];

  return marketItemsCreated.args;

I would really appreciate your help, since this problem is difficulting the progress of the project.

Request any other file if you think is needed!

Thank you in advance.

Update: It does not work either in Kovan network and Ganache.

TransactionMinedTimeout can happen if a deployment takes longer to mine than the plugin waits for.

You can resolve this by re-running the exact same deployProxy function call, and the plugin will resume waiting for the same transaction without re-deploying things.

I solved it a few days ago. It was an issue related with the default network, I believe it was deploying proxy and implementation contracts to different networks. Anyways, thank you for you answer!