-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contract factory example #2233
Comments
The problem that the hash is based on NefFile and sender, so if you have the NefFile static, you won't be able to deploy multiple contracts with the same file/sender, I think that we can change from sender to TX.Hash |
My solution is that we can change the way of generating contract hash. First, we can add a
|
Will that work Erik? How can we change the nonce before deploying the new contract? (from a smart contract) Can't we add some sort of constructor? We need a way to customize the deployed contract. I know that we can dismiss the need for a constructor if we add the initialization methods ourselves and call it when we deploy the contract. |
Use Or we can add a new method |
I'm in favor of a more 'developer-friendly' solution. It is too dangerous to change bytes 'manually'. Maybe the second option is better. |
Maybe we just take the name from the manifest and add it into the hash mix? This will require preparing a number of manifests, but that should be feasible and I think one would like to have these contracts have different names anyway (like NeoFS alphabet contracts, https://github.com/nspcc-dev/neofs-spec/blob/master/02-blockchain/01-governance.md). Though it makes upgrade somewhat more complicated. Another option could be adding an explicit name parameter to override (and replace) the one we have in the manifest. |
Why not use the Transaction hash? |
Because you can't compute the hash at the compile time. |
Then we can use a nonce based on the |
But there is no standard on the data. |
Add a new field on |
Too many fields. What about add |
Maybe we can do it like this.
|
Hi,
How can I create a contract that creates other contract?
I want to allow my smart-contract to vote, but I want to be able to split their votes into multiple candidates. For that to work, I need to deploy one smart contract per candidate.
I would like to know the best way to create and deploy these 'child' contracts. Is there any kind of constructor concept or equivalent feature? Is there an example?
The text was updated successfully, but these errors were encountered: