5

I am building an NFT Market on the Polygon network.

I am able to deploy my code on localhost and everything works fine.

But when I try to it deploy to the mumbai testnet using the command npx hardhat run scripts/deploy.js --network mumbai

I run into this error. ProviderError: transaction underpriced

TylerH
  • 20,799
  • 66
  • 75
  • 101

2 Answers2

16

Actually I too got this error in morning. Somehow I believe default gasPrice is not picked up. So I just updated my hardhat config file with following :-

mumbai: {
      // Infura
      url: `https://polygon-mumbai.infura.io/v3/${INFURA_API_KEY}`,
      accounts: [privateKey1],
      gasPrice: 35000000000,
      saveDeployments: true,
    },

Earlier I was not using gasPrice explicitly. When I put some value it, it worked.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Satya
  • 328
  • 2
  • 8
2

In my case, I was using the wrong RPC node, sharing just in case someone made the same mistake as I did

How did I fix it?

  1. Removed Matic chain from Metamask networks
  2. Added it again from https://umbria.network/connect/matic-testnet-mumbai
Deep patel
  • 71
  • 2