patractlabs / redspot

Redspot is an Substrate pallet-contracts (ink!) development environment. Compile your contracts and run them on a different networks. Redspot's core forks from Hardhat but changed a lot to suit substrate.
https://redspot.patract.io/
Other
67 stars 22 forks source link

[feature request] Add `deploy` functionality #149

Open VargSupercolony opened 2 years ago

VargSupercolony commented 2 years ago

For bigger projects, it would be nice to have deploy functionality, similar to hardhat.

Basically, instead of writing individual scripts, a developer would write the deploy functions, which would execute synchronously within one API instance (instead of doing for script in ./deploy/*; do npx redspot run "$script" --no-compile; done, which would in turn connect and disconnect node API).

ii-ii-ii commented 2 years ago

As far as I know, hardhat doesn't provide a deploy command either, https://hardhat.org/tutorial/deploying-to-a-live-network.html#_7-deploying-to-a-live-network. Did I miss something?

ii-ii-ii commented 2 years ago

You mean the deploy function? Can't this function work? https://github.com/patractlabs/redspot/blob/master/examples/erc20/scripts/deploy.ts#L24

VargSupercolony commented 2 years ago

As far as I know, hardhat doesn't provide a deploy command either, https://hardhat.org/tutorial/deploying-to-a-live-network.html#_7-deploying-to-a-live-network. Did I miss something?

Hardhat indeed does not provide hardhat deploy command. It is done by hardhat-deploy plugin. I was curious, if you'd be interested in having such in Redspot.

You mean the deploy function? Can't this function work? https://github.com/patractlabs/redspot/blob/master/examples/erc20/scripts/deploy.ts#L24

This works yeah, but as soon as we get to deploying 15-20 contracts, the deploy file gets convoluted and there is an urge to logically separate the deploys. Obviously, we can do this separation into functions (each function deploys one contract), but that'd mean that we lose dependency management, metadata about each deployment and so on. Please see hardhat-deploy readme.

ii-ii-ii commented 2 years ago

Well, I think it does look OK. We'll add this in the next version.