I have a contract, and I want set owners for my contract without using set address in code.
Code of costructor contract:
function StepanToken2 (address _ownerFirst, address _ownerSecond){
ownerFirst = _ownerFirst;
ownerSecond = _ownerSecond;
balances[ownerFirst] = SafeMath.div(totalTokens, 3);
balances[ownerSecond] = SafeMath.sub( totalTokens, balances[ownerFirst]);
}
Can I set owners in myEtherWallet or other way?
Best Answer
The easiest way to set an owner(s) is to do it like so:
You create the owner of the contract on first initialization which is yourself, then you are free to add and remove owners as you go. You could also do the master admin concept to of:
This way none of your other admins can remove the master admin.
There's other ways to limit functionality too such as:
This limits functionality to the contract address its self.
Hope this answered your question.