Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

499
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda