POLYGON main net fails deploy, mumbai fine, other chains fine, but why?

Do you provide the gas settings or do you use the default provided. I found that it is better to specify gas price because the price the RPC is reporting is always bad for some reason.

In current testing we provide:

maxPriorityFeePerGas: BigNumber { value: "100000000000" },
maxFeePerGas: BigNumber { value: "100000000000" },
gasPrice: null,
gasLimit: BigNumber { value: "2000000" },

But the settings are automatically done in hardhat for EIP1559 when there are no hard settings set, ETH for example it just does the right numbers automatically.

Also Mumbai works fine without maxFeePerGas and MaxPriorityFeePerGas.

This has worked on and off with and without the MaxPriorityFeePerGas before. Such as 1 week ago, this was working randomly as well.

Try to set the MaxFeePerGas higher than the maxPriorityFeePerGas.
You can also set the gasLimit higher to rule this out. I usually provide 3 millions gas units for simple deployment.

The GasLimit does not mean it will get consumed, it's only a limit. What ever is not used will not get charged.

I was looking at the contract you posted and the deployment with create2.
One of the transaction cost 19110540 unit of gas.

Others we're less expensive but the gas price was also much lower.

If your getting it to work on Mumbai over Remix you should be able to validate the gas unit used during that deployment. It should be similar on the mainnet but with higher gas price.

It works on mumbai, without any manual settings flawlessly. Mumbai is a dream, they should change main net to mumbai and then burn main net to the ground.

I have set the max gas limit to really high numbers, right on the max for the chain of 3,000,000 and still deployments will fail.

The problem is, the mainnet is random, sometimes pass, sometimes fail, but with the exact same inputs.

I will try putting in more gas today and with the EIP 1559 inputs, just to see what happens.

It is when inputting the manual deploy using metamask where it works fine. So, there must be a setting that main net wants that metamask is giving it.

These are the exact same code base, deployment settings and deployer. -_-
It seems mumbai is not the same as main net and mumbai is not a good test net if you want to test for polygon main net.

These are both deployed at the same time.

MUMBAI: Returns hash

MAIN NET: returns NULL

Now even the metamask deploys fail, when they never did before.

Terrible network.
MAIN: FAIL


MUMBAI: PASS


Ugh. This is straight up wack.

Anyone care to share their working config for Polygon's mainnet?

Deploying a contract tonight was such a pain. I was able to use the hardhat-deploy plugin and it worked immediately!

Going back to execute hardhat scripts on Polygon mainnet, and it goes back to simply not working. Mumbai works without any issues!

Update: Okay, looks like the transactions are actually going through, but super slow. Is the network being spammed or attacked?

1 Like