Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pragma solidity 0.4.24;
- contract SecretClub {
- address owner;
- mapping (address => bool) authorized;
- modifier onlyAuthorized()
- {
- require(authorized[msg.sender]);
- _;
- }
- modifier onlyOwner()
- {
- require(owner == msg.sender);
- _;
- }
- constructor() public {
- owner = msg.sender;
- }
- function authorize(address[] _addressesToAuthorize) public onlyOwner {
- // Add to the list of authorized addresses
- for (uint i=0; i<_addressesToAuthorize.length; i++) {
- authorized[_addressesToAuthorize[i]] = true;
- }
- }
- function deauthorize(address[] _addressesToDeauthorize) public onlyOwner {
- // Add to the list of authorized addresses
- for (uint i=0; i<_addressesToDeauthorize.length; i++) {
- authorized[_addressesToDeauthorize[i]] = false;
- }
- }
- function doAwesomeThings() public onlyAuthorized
- {
- // Only super awesome authorized people can do this
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement