Hi, I think the OpenZeppelin Hardhat Upgrades plugin provides the deployProxy
function to deploy upgradeable contract. This deploys implementation
contract, ProxyAdmin
contract and the proxy contract. But for the link you shared, I only find one contract.
And I think for the script, it should be:
this.timeout(110000);
this.accounts = await ethers.getSigners();
({ chainId: this.chainId } = await ethers.provider.getNetwork());
NPort = await ethers.getContractFactory("NPortContract");
console.log(this.accounts);
console.log("about to deploy contract");
const nport = await upgrades.deployProxy(NPort, ["NPortContract", "NPORT", "https://ipfs.io/ipfs/"], {initializer: 'initialize'});
// await nport.deployed(); // <<<<<------ I think you can delete this line.
console.log("contract deployed to " + nport.address);
console.log("initialized contract");