Deploying a proxy to an existing contract


I have deployed an upgradeable contract which timed out during deployment. I got this error

TransactionMinedTimeout [Error]: Timed out waiting for transaction

The contract has deployed but the proxy hasn't.

Is there a way to deploy a proxy to this address without having to republish the implementation contract?

If you rerun the deployProxy function call, it will reuse the implementation contract that has already been deployed. It will not republish.

sorry i don't get your answer @frangio
If i have this line to deploy a proxy

const ActionManagerFactory: ContractFactory = await ethers.getContractFactory('ActionManager');
actionManagerContract = (await upgrades.deployProxy(ActionManagerFactory, [
])) as ActionManager;

How will the deployment script will reuse the implementation contract ? how it will know where is it ?


The upgrades plugin maintains a file under .openzeppelin where it keeps track of deployed implementation contracts. As soon as the transaction is sent it's stored there so the next time you request a proxy for the same contract it will be reused.