Hello.
I am having another issue with the hardhat upgrades plug in, this one is stranger than the last.
I encountered this issue working on my own, commercial, live project, which is an NFT project that should receive many upgrades over the course of it's life.
I attempted to deploy an upgrade this morning providing a UX feature upgrade, but the tx stalled for two hours so I replaced the tx with a new one in metamask.
Now, I'm not sure why that tx failed, but now when I attempt to demonstrate to myself that upgradeProxy
is working, I get the error execution reverted: Ownable: caller is not the owner
.
The precise flow where I'm receiving this error is:
- Deploy a copy (source copied from existing mainnet etherscan reviewed code) of my original smart contract to the Goerli testnet (works)
- Log the address of the above deployed and use hardhat-verify to verify the implementation, proxy, and link the proxy, implementation, and admin
- Insert the address of the proxy (currently: 0x8c6d5Cc5c95E32626c5A1F45A6a2c5Ec9b789B3A) into an upgrade script as follows:
async function upgrade() {
const oldImplementation = await ethers.getContractFactory(
"v2"
);
const newImplementation = await ethers.getContractFactory(
"v3"
);
console.log("deploying new implementation");
await upgrades.validateUpgrade(
"0x8c6d5Cc5c95E32626c5A1F45A6a2c5Ec9b789B3A",
oldImplementation
);
const deployedUpgrade = await upgrades.upgradeProxy(
"0x8c6d5Cc5c95E32626c5A1F45A6a2c5Ec9b789B3A",
oldImplementation
);
await deployedUpgrade .deployed();
console.log("deployed to: ", deployedUpgrade .address);
}
upgrade().catch((error) => {
console.error(error);
process.exitCode = 1;
});
- Run the script
At this point, I encounter the previously mentioned error, caller is not owner
.
The exact same private key is used for the accounts to deploy to goerli in both scripts, so the account isn't changing.
I've reviewed the docs and don't see any gotchas, any ideas what I'm doing wrong here?