Error When minting ERC721 on Matic Testnet

351 Views Asked by At

Looking for help to trouble shoot the error below. I am trying to mint an ERC721 nft on the Matic Testnet. I am using hardhat and have tried the following tesntnet networks that gave me the same error:

https://matic-mumbai.chainstacklabs.com

https://rpc-mumbai.maticvigil.com

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

I was able to successfully deploy my ERC721 smart contract on the Matic Testnet. But when I tried minting the NFT I ran into the following error:

(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.
1

There are 1 best solutions below

1
On BEST ANSWER

I'm taking a wild guess here, but you might be including maxFeePerGas in your transaction, which is how transactions should be sent according to EIP-1559. AFAIK (I might be wrong) Polygon hasn't implemented EIP-1559 yet.

Try chaing maxFeePerGas for gasPrice in your transaction. I was experiencing the exact same error and that's what worked for me.

Also, in my case I was able to send transactions to the deployed contract through Remix, so I was sure there was something wrong with my code. You might want to run the same check.