Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

501
Views
On hardhat when deploying a contract or minting an NFT getting error: ProviderError: invalid sender

I am using HardHat to deploy contracts on Polygon (Matic), it works most of the time when deploying or minting.. but then it usually breaks when I switch from testnet to mainnet.

For example: I switched from mainnet to rpc-mumbai.maticvigil.com, then I get the error ProviderError: invalid sender.

Then I updated my hardhat.config.js to point to matic-mumbai.chainstacklabs.com and I am able to mint and deploy contracts with no errors.

I am reaching out to see if this is a known issue occurring with polygon and or hardhat?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Add this to your hardhat.config.js, after accounts:

 gasPrice: 8000000000, // default is 'auto' which breaks chains without the london hardfork

Full entry:

  matic: {
      url: "https://matic-mumbai.chainstacklabs.com",
      accounts: [PRIVATE_KEY],
      gasPrice: 8000000000, // default is 'auto' which breaks chains without the london hardfork
    }

Ref: https://github.com/nomiclabs/hardhat/issues/1828

over 4 years ago · Santiago Trujillo Report

0

Confirmed the solution of "The Vikk" is working. Added also the account details and 0x before the private key.

 mumbai: {
  url: "https://polygon-mumbai.g.alchemy.com/v2/<API_KEY>",
  accounts: [`0x${PRIVATE_KEY}`]
  }
over 4 years ago · Santiago Trujillo Report

0

I discovered the issue with "Invalid sender". This for me was that the wallet address had not sent any transactions and only had deposits from the testnet faucet. For whatever reason it made that error disappear when I sent a transaction manually through Metamask then sent it back then tried to issue the hardhat run command again.

From what I am now seeing however, the transaction still hangs without any errors and --verbose provides nothing useful. This appears to be some kind of conflict pertaining to the London Hardfork. I have not resolved the issue. Will report back later with more information if I have it.

What I have done so far:

  1. Tried adding gasPrice and/or gas to the hardhat.config.js networks.matic object
  2. Tried to put 0x in front of the privateKey
  3. Tried adding chainId:80001 to the hardhat.config.js networks.matic object
  4. Tried increasing gasPrice to over 500 gwei
  5. Tried 3 different RPC endpoints including a private one requiring an API key

Hardhat github made an update to 2.6.2, which also does not resolve the problem.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!