wighawag / hardhat-deploy

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

solution to store in deployments folder for the contracts created via `new` #476

Open 0xpancaker opened 11 months ago

0xpancaker commented 11 months ago

Let's assume that there is a VestorFactory contract and it will make new Vester contract via function call like below.

Vester vester = new Vester( ... )

Since the new Vester contract is not deployed via hardhat-deploy package, we're not storing it in deployments folder.

In deploy script, we will deploy VestoryFactory and will generate multi Vester contracts via multi function calls and we can get those Vester contracts address from event. With this Vester address, can we generate new deployment for the Vestor?

It'd be great if we can use saveDeployment function with compiled contract ABI (or artifact) and address.

wighawag commented 10 months ago

You can use save, see : https://github.com/wighawag/hardhat-deploy/blob/1a216e1584fd10262b365fa0469d099cd094ead4/types.ts#L242C6-L242C6