I am going to deploy an upgradeable smart contract to polygon mainnet.
I am using hardhat to deploy it and I already tested it in polygon testnet, and I deployed my contract to testnet successfully.
However, when I deploy it to mainnet today, I just got stuck.
After running the script of deploying contract, the implementation contract and ProxyAdmin contract were deployed successfully within just 1 minute, but I wait for the transparent proxy contract for a very long time. I've retry to deploy it for a few times, but still not succeed to deploy the transparent transparent proxy.
My script is like below, just following your example:
// scripts/deploy_upgradeable_box.js
const { ethers, upgrades } = require("hardhat");
async function main() {
const OurNft = await ethers.getContractFactory("NFT");
console.log("Deploying OurNft...");
const ourNft = await upgrades.deployProxy(
OurNft,
[
"name",
"symbol",
"url",
],
{
initializer: "initialize",
}
);
await ourNft.deployed();
console.log("OurNft deployed to:", ourNft.address);
}
main();
After I run the above script, it only shows "Deploying Our Nft...", and never shows "OurNft deployed to: address".
My hardhat.config.js is as below:
module.exports = {
solidity: "0.8.10",
networks: {
matic_mainnet: {
url: `https://polygon-mainnet.infura.io/v3/[app_id]`,
accounts: [process.env.PRI_KEY],
},
},
etherscan: {
apiKey: process.env.POLYGONSCAN_API_KEY,
},
};
I tried to connect polygon mainnet by different node, like maticvigil and moralis, but still failed to deploy.
Any ideas how can I resolve this problem?
Thanks.