ProviderError:孟买测试网上的交易定价过低

发布于 2025-01-11 13:05:08 字数 213 浏览 0 评论 0原文

我正在 Polygon 网络上建立一个 NFT 市场。

我能够在本地主机上部署我的代码,一切正常。

但是当我尝试使用命令将其部署到孟买测试网时 npxhardhat runscripts/deploy.js --network mumbai

我遇到了这个错误。 ProviderError:交易定价过低

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

少女情怀诗 2025-01-18 13:05:08

实际上我早上也遇到了这个错误。不知怎的,我相信默认的gasPrice没有被采纳。所以我只是用以下内容更新了我的安全帽配置文件:-

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

早些时候我没有明确使用gasPrice。当我赋予它一些价值时,它起作用了。

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.

谁对谁错谁最难过 2025-01-18 13:05:08

就我而言,我使用了错误的 RPC 节点,共享以防万一有人犯了与我相同的错误

我如何修复它?

  1. 从 Metamask 网络中删除了 Matic 链
  2. https://umbria.network/connect/matic-testnet-mumbai

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
謸气贵蔟 2025-01-18 13:05:08

UNDERPICED [REPLACMENT_UNDERPICED]

官方文档:https://docs.ethers.org/v5/troubleshooting/errors/#help-REPLACMENT_UNDERPICED

为了防止节点因垃圾交易而过载,只有当交易有合理的机会被实际开采时才会被接受到内存池中,这意味着帐户有足够的余额,随机数是正确的,并且费用似乎合理。

总结:与交易中的 3 个问题有关:

  • 余额不足、
  • 随机数不正确、
  • 费用低

解决方案

  • 增加部署者帐户余额。要么使用水龙头,要么购买 ETH。
  • 增加随机数值(简化:交易数量+1
  • 增加交易费用(设置更高的gasPrice)

官方文档:https://docs.ethers.org/v5/troubleshooting/errors/#help-REPLACMENT_UNDERPICED

UNDERPRICED [REPLACEMENT_UNDERPRICED]

Official doc: https://docs.ethers.org/v5/troubleshooting/errors/#help-REPLACEMENT_UNDERPRICED

To prevent nodes from being overloaded with junk transactions, a transaction is only accepted into the memory pool if it has a reasonable chance of being actually mined, which means that the account has sufficient balance, the nonce is correct and the fee seems reasonable.

Summary: is related to 3 issues on a transaction:

  • Insufficient balance
  • Incorrect nonce
  • Low fee

Solutions:

  • Increase deployer account balance. Either using a faucet or purchasing ETH.
  • Increase nonce value (simplified: number of transactions +1)
  • Increase transaction fee (setting higher gasPrice)

Official documentation: https://docs.ethers.org/v5/troubleshooting/errors/#help-REPLACEMENT_UNDERPRICED

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文