Open Neurone opened 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?
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.
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
ContractCreateFlow
to let the user override the default behavior, keeping the smart contract template file after the deploy.ContractCreateFlow
should return the FileId to the user (via return value or debug/info logs), so it can be easily used later.Alternatives
No response