Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pragma solidity 0.4.24;
  2. contract SecretClub {
  3. address owner;
  4. mapping (address => bool) authorized;
  5. modifier onlyAuthorized()
  6. {
  7. require(authorized[msg.sender]);
  8. _;
  9. }
  10. modifier onlyOwner()
  11. {
  12. require(owner == msg.sender);
  13. _;
  14. }
  15. constructor() public {
  16. owner = msg.sender;
  17. }
  18. function authorize(address[] _addressesToAuthorize) public onlyOwner {
  19. // Add to the list of authorized addresses
  20. for (uint i=0; i<_addressesToAuthorize.length; i++) {
  21. authorized[_addressesToAuthorize[i]] = true;
  22. }
  23. }
  24. function deauthorize(address[] _addressesToDeauthorize) public onlyOwner {
  25. // Add to the list of authorized addresses
  26. for (uint i=0; i<_addressesToDeauthorize.length; i++) {
  27. authorized[_addressesToDeauthorize[i]] = false;
  28. }
  29. }
  30. function doAwesomeThings() public onlyAuthorized
  31. {
  32. // Only super awesome authorized people can do this
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement