Upgrades Plugins - lost my network files

Hi!

What should we do when network file has been lost, but we still want to upgrade our contract?
Any chance we can keep using Upgrades Plugin in this situation?

Thanks!

Hi, welcome! :wave:

I am not sure, maybe you can compile contracts again and then try to use the plugin to upgrade your contracts.

Don’t think this is the case. When doing it without network file I’m getting Proxy admin is not the one registered in the network manifest error. When doing it with manually created network file that contains actual information on the last deployment I’m getting Deployment at address ... is not registered error.

Hi, have you solved your problem?

Not, yet. Trying to manually restore my network file.

guys any update on this? I also have lost my network manifest files and wondering how upgrade will work without it now. the deployment did not build the network files properly and it still shows old network files and that too not for all contracts that were deployed.

If you have the source code to your original contract you could rebuild the network file by deploy a proxy to a local network (Hardhat Network or Ganache), and then copying it over to .openzeppelin/mainnet.json changing the addresses (including the admin address) in the file to match your mainnet contracts.