openzeppelin-upgrades icon indicating copy to clipboard operation
openzeppelin-upgrades copied to clipboard

Custom Deployments

Open bh2smith opened this issue 4 years ago • 10 comments

Addresses Issue #272 by allowing projects depending on this plugin to specify their own deploy function. If a deployment executor is not specified, then the initial (default) implementation is used as a fallback.

Currently this remains untested apart from the fact that all existing tests still pass. Open to suggestions for testing!

bh2smith avatar Jan 06 '21 11:01 bh2smith

Hey @frangio and thanks for your response. I will attempt to address your questions/comment, thinking that only 1 of the two will be possible. I am, however, running into some awkward inconveniences with the return value of ContractTransaction from our end and will submit a draft PR pointing out this issue ASAP. At least then we will have a use case in mind and maybe get some impression of how to properly test this.

bh2smith avatar Jan 18 '21 08:01 bh2smith

@bh2smith I took a quick look at your PR. Having to manually fill in the values for a ContractTransaction is definitely bad. It makes sense for the default deployer which simply does factor.deploy(...args) but for other kinds of deployments it forces you to fill in those values, returning only the transaction hash would be a lot easier.

Regarding your ignoring the factory argument, I understood that you will change that instead of hardcoding your contract inside the deployer, right? I didn't understand if that was motivated by a problem in the plugin.

I imagine you weren't able to use your branch because this is a monorepo. Unfortunately I don't know if there is a way to overcome that.

frangio avatar Jan 18 '21 18:01 frangio

Thanks for the work on this front. Really looking forward to being able to pass in a custom deploy function. Ideally, I would be able to use the deploy function (from the Hardhat-Deploy plugin) as my deploy function, as this makes so many things simpler(especially if you're already using the hardhat-deploy plugin in parallel with hardhat-upgrades).

https://hardhat.org/plugins/hardhat-deploy.html

nfurfaro avatar Jan 18 '21 19:01 nfurfaro

returning only the transaction hash would be a lot easier.

Yes, I would really hope we can make a move towards this ASAP!

Regarding your ignoring the factory argument, I understood that you will change that instead of hardcoding your contract inside the deployer, right? I didn't understand if that was motivated by a problem in the plugin.

Yes, this is only temporary so I can see that the authenticator is actually upgradable

bh2smith avatar Jan 19 '21 07:01 bh2smith

@nfurfaro

especially if you're already using the hardhat-deploy

Yes, we are indeed!

bh2smith avatar Jan 19 '21 10:01 bh2smith

I have reverted the introduction of the temporary HardhatDeployment and everything seems fine from this side. I will attempt to make out working example align with this and see how it looks.

bh2smith avatar Jan 19 '21 10:01 bh2smith

This is something we're interested in but are not prioritizing at the moment. If anyone is interested in this feature for their setup let us know!

frangio avatar Feb 09 '21 15:02 frangio

This is something we're interested in but are not prioritizing at the moment. If anyone is interested in this feature for their setup let us know!

Yes, I am looking forward to using this feature

Ratimon avatar Jun 14 '21 01:06 Ratimon

I love this feature, will this merge pass through?

Amjad-W avatar Apr 11 '22 13:04 Amjad-W

I love this feature, will this merge pass through?

This branch is now 10 months old. I think it should be considered stale. But you are welcome to brush the dust off and take over.

bh2smith avatar Apr 11 '22 15:04 bh2smith