wighawag / hardhat-deploy

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

Is it possible to reuse implementation when multiple proxy refers to the same implementation? #446

Closed drop19 closed 1 year ago

drop19 commented 1 year ago

For example: Proxy A -> Impl X Proxy B -> Impl X

wighawag commented 1 year ago

Yes you

can use implementationName

so you first deploy your implementation via a normal deploy call and name it whatever you want

await deploy("MyImplementation", ...)

then when deploying proxies

await deploy("ProxyA",  {from: ..., proxy: {implementationName: "MyImplementation"}})
await deploy("ProxyB",  {from: ..., proxy: {implementationName: "MyImplementation"}})