Skip to content
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

No need for mapping in Ownable.sol? #6

Open
Nikhil22 opened this issue Sep 23, 2017 · 3 comments
Open

No need for mapping in Ownable.sol? #6

Nikhil22 opened this issue Sep 23, 2017 · 3 comments

Comments

@Nikhil22
Copy link

I am wondering why you are storing owner in a mapping. Since you set the current owner value to false when there is a transfer of ownership, why not just have a single address public owner?

@Ryanmtate
Copy link
Member

Hey @Nikhil22

Thanks for the question.

The single mapping allows for only one owner; which in the future may be preferable, allowing for a second layer of key management (e.g. Shamir secret + central signer).

However, the mapping(address => bool) owners; allows for multiple owners simultaneously. This is used by the GitToken webhook signer and also allows for organization admins to have ownership control.

@Ryanmtate Ryanmtate self-assigned this Sep 25, 2017
@Ryanmtate
Copy link
Member

I am considering using a separate modifier for the webhook signer. something like:

address signer;

modifier isSigner() {
  require(msg.sender == signer);
  _;
}

Would this be preferable in your opinion @Nikhil22 ?

@Nikhil22
Copy link
Author

Using a separate modifier for the signer is more clear, I'm for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants