hashgraph / hedera-sdk-reference

Hedera SDK specification repository.
Apache License 2.0
5 stars 1 forks source link

Add optional parameter to `ContractCreateFlow` to avoid File removal #138

Open Neurone opened 1 year ago

Neurone commented 1 year ago

Problem

ContractCreateFlow removes the file used as a template for the smart contract deployment. Many times, especially in development or testing environments, the removal is not useful and forces the developer to upload the smart contract again, instead of using the previous created file.

Solution

Alternatives

No response

SimiHunjan commented 1 year ago

hey @Neurone !

This feature was proposed by @gregscullard some time ago to make the flow of deploying a contract in a simple step.

This is the issue: https://github.com/hashgraph/hedera-sdk-java/issues/839.

The alternative if the developer wanted to keep the file was to go through the manual flow (1) Use the FileCreateTransaction (2) Submit a ContractCreateTransaction

Thoughts?

Neurone commented 1 year ago

Hi Simi, yes, the manual procedure is always possible, but usually it requires at least three steps (filecreate, fileappend, contract creation), so I prefer ContractCreateFlow because it is easier. But sometimes, even after using that procedure in my app, keeping the created file on-chain for later use is useful.

With the current SDK, if I want to keep the file, I need to completely give up the already implemented flow and write a new deployment procedure for my app.

I can do it, but it's cleaner if these options remain in the SDK, so I can enable that just by changing a parameter. And by the SDK's code side, the effort seems minimal to implement this feature.