在 Matic 测试网上铸造 ERC721 时出错

Error When minting ERC721 on Matic Testnet

寻求帮助解决以下错误。我正在尝试在 Matic 测试网上创建一个 ERC721 nft。我正在使用 hardhat 并尝试了以下给了我同样错误的 tesntnet 网络:

https://matic-mumbai.chainstacklabs.com

https://rpc-mumbai.maticvigil.com

https://polygon-mumbai.g.alchemy.com/v2/

我能够在 Matic 测试网上成功部署我的 ERC721 智能合约。但是当我尝试铸造 NFT 时,我 运行 出现以下错误:

(node:53836) UnhandledPromiseRejectionWarning: Error: Network doesn't support eip-1559
    at /Users/gravitywaves/Projects/mynft2/node_modules/web3-eth-accounts/lib/index.js:323:35
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:53836) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:53836) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

我在这里大胆猜测,但您可能在交易中包含 maxFeePerGas,这是根据 EIP-1559 发送交易的方式。据我所知(我可能是错的)Polygon 还没有实现 EIP-1559。

尝试在您的交易中为 gasPrice 链接 maxFeePerGas。我遇到了完全相同的错误,这对我有用。

此外,在我的例子中,我能够通过 Remix 将交易发送到已部署的合约,所以我确信我的代码有问题。您可能想要 运行 同样的检查。