wighawag / hardhat-deploy

hardhat deployment plugin
MIT License
1.17k stars 283 forks source link

How to configure deploy when proxy admin is owned by timelock? #449

Closed jack-wombat closed 1 year ago

jack-wombat commented 1 year ago

How do we configure hardhat to support the following set up?

  1. The proxy contract is owned by Multisig.
  2. The ProxyAdmin is owned by a TimelockContoller.

When running a deploy, we hit the following errors

Error: To change owner/admin, you need to call transferOwnership on DefaultProxyAdmin
    at _deployViaProxy (/Users/jack/wombat-exchange/wombat/node_modules/hardhat-deploy/src/helpers.ts:1487:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async deployBasePool (/Users/jack/wombat-exchange/wombat/utils/deploy.ts:64:24)
    at async Object.deployFunc [as func] (/Users/jack/wombat-exchange/wombat/deploy/020_HighCovRatioFeePool.ts:22:46)
    at async DeploymentsManager.executeDeployScripts (/Users/jack/wombat-exchange/wombat/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1222:22)

This is thrown by the snippet below which check if the proxy is owned by the same owner as the proxy admin. https://github.com/wighawag/hardhat-deploy/blob/658561e3d7239514ea0cf6407aa365d2762f3e23/src/helpers.ts#L1486-L1490

jack-wombat commented 1 year ago

Ok. I found out I can set the owner field to timelock, rather than the multisig.