robertoschler
over 1 year ago  Karma: 50
Confusion over who should be the owner/administrator of a new instance of my smart contract?

I am working on a voting smart contract. I know I can set the owner for a smart contract. But I assumed that "role" was for the programmer of the smart contract so he can maintain control over important data structures (e.g. - preventing the improper deletion of certain users or user assets, etc.)

My current belief is that I would create and publish/migrate a new instance of my voting smart contract for each separate vote (e.g. - each new election, etc.), is that correct? If so, what is the normal best practice for assigning an administrator to the contract, someone that is not the smart contract programmer (myself) but the person who should be acting administrator for the current vote (i.e. - a particular instance of the smart contract that is managing one particular vote)? Should I make them the current owner of the smart contract instance when I create the new smart contract instance for the new vote?

Finally, and this is a dumb question I presume but I want to be absolutely sure about this, the data elements (i.e. - maps, etc.) between smart contract instances are completely isolated correc? In other words, they can only be modified/viewed between smart contract instances if I specifcally create functions that allow them to inspect or change the data held between different instances of the smart contract, correct?

smart contract
owner
instance
migrate
robertoschler
over 1 year ago  Karma: 50
Confusion over who should be the owner/administrator of a new instance of my smart contract?

I am working on a voting smart contract. I know I can set the owner for a smart contract. But I assumed that "role" was for the programmer of the smart contract so he can maintain control over important data structures (e.g. - preventing the improper deletion of certain users or user assets, etc.)

My current belief is that I would create and publish/migrate a new instance of my voting smart contract for each separate vote (e.g. - each new election, etc.), is that correct? If so, what is the normal best practice for assigning an administrator to the contract, someone that is not the smart contract programmer (myself) but the person who should be acting administrator for the current vote (i.e. - a particular instance of the smart contract that is managing one particular vote)? Should I make them the current owner of the smart contract instance when I create the new smart contract instance for the new vote?

Finally, and this is a dumb question I presume but I want to be absolutely sure about this, the data elements (i.e. - maps, etc.) between smart contract instances are completely isolated correc? In other words, they can only be modified/viewed between smart contract instances if I specifcally create functions that allow them to inspect or change the data held between different instances of the smart contract, correct?

smart contract
owner
instance
migrate

ONE ANSWER
matt4
over 1 year ago Karma: 588

Yeah in openzeppelin there is a "ownable" contract you can inherit from and switch the owner if you want.

Yeah you can deploy per user, then switch the owner

Data elements between instances are seperate.

I'll leave more detailed stuff for the community

Yeah in openzeppelin there is a "ownable" contract you can inherit from and switch the owner if you want.

Yeah you can deploy per user, then switch the owner

Data elements between instances are seperate.

I'll leave more detailed stuff for the community

Earn tokens by posting and answering questions about blockchain!
Karma to eth
YOUR ANSWER