Created
April 3, 2018 07:53
-
-
Save Roger-Wu/ccbbd41678343ac47e572e97fc78fbec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.18; | |
import 'zeppelin-solidity/contracts/ownership/Ownable.sol'; | |
contract HasAdmins is Ownable { | |
mapping (address => bool) public admins; | |
event AdminAdded(address indexed newAdmin); | |
event AdminRemoved(address indexed admin); | |
function HasAdmins() public { | |
admins[owner] = true; | |
} | |
modifier onlyAdmins() { | |
require(admins[msg.sender]); | |
_; | |
} | |
function addAdmin (address _admin) onlyOwner public { | |
admins[_admin] = true; | |
AdminAdded(_admin); | |
} | |
function removeAdmin (address _admin) onlyOwner public { | |
delete admins[_admin]; | |
AdminRemoved(_admin); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment