Proxy: Partial deployment, is it possible to resume without full-redeploy?

Hey hey,

I have a ERC20 contract that is with proxy. I was deploying to mainnet with hardhat-upgrades when the impl was deployed but then ran out of funds to deploy the admin proxy and the proxy it self.
Is there a way to give hardhat-upgrades an impl address and ask it to deploy only the left over contracts?

Also, shouldn't the hardhat-upgrades be able to either rollback if a deployment runs out of gas mid deployment or just estimate at the beginning and stop before this happens?

Thanks,
João

I was reading around the forum and docs, and it seems like the deploy should be able to recover.
Is there a way to test this or be really sure that this is the case?

Trying to prevent a scenario where it doesn't recover and it runs out of funds again :confused:

Anyone knows a way to be sure it will work?

Thanks,
João

When you run deployProxy, the implementation gets deployed and persisted in the network file under the .openzeppelin directory. Next time you call deployProxy for the same implementation it will be reused.

So you can look at the relevant network file and see if you find the entry for your implementation contract, then it will be reused, even if it timed out the first time. As soon as the transaction is broadcast it gets stored.

Unfortunately there is no way to be sure that it will reuse rather than redeploy. This is a great feature request so I'm opening an issue.