Skip to content

Instantly share code, notes, and snippets.

@Roger-Wu
Created April 3, 2018 07:53
Show Gist options
  • Save Roger-Wu/ccbbd41678343ac47e572e97fc78fbec to your computer and use it in GitHub Desktop.
Save Roger-Wu/ccbbd41678343ac47e572e97fc78fbec to your computer and use it in GitHub Desktop.
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