Guest User

Untitled

a guest
Jan 22nd, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. pragma solidity ^0.5.2;
  2.  
  3. contract ScrumMeetingsAuthor {
  4. // Author Scrum Meetings LSP
  5. address payable public _addresAuthor;
  6. string public Authorized = "As author of the rights of the of the Scrum Meetings LSP © I authorize the title of 'Facilitator' by me declared for commercial or personal use, use of the content for educational materials. In Global territory.";
  7.  
  8. function Author() private justAuthor {
  9. _addresAuthor = msg.sender;
  10. }
  11.  
  12. modifier justAuthor() {
  13. require (msg.sender == _addresAuthor);
  14. _;
  15. }
  16.  
  17. //delete contract
  18. function deleteContract() public justAuthor {
  19. selfdestruct (_addresAuthor);
  20. }
  21. }
  22.  
  23. contract ScrumMeetingsFacilitator is ScrumMeetingsAuthor {
  24.  
  25.  
  26. mapping(string => Licensed) _facilitators;
  27.  
  28. struct Licensed {
  29. string name;
  30. string email;
  31. uint256 timestamp;
  32. }
  33.  
  34.  
  35. function checkLicensed(string memory _name, string memory _email) public view returns(bool) {
  36. return _facilitators[_email].timestamp !=0;
  37.  
  38. }
  39.  
  40. function registerFacilitators(string memory _name, string memory _email) public {
  41. require(!checkLicensed(_email, _name));
  42. Licensed memory licensed = Licensed ({
  43. name: _name,
  44. email: _email,
  45. timestamp: now
  46. });
  47. _facilitators[_name] = licensed;
  48. }
  49. function seeFacilitator(string memory _name, string memory _email) public view returns(uint256 timestamp, string memory name, string memory email){
  50. Licensed memory lice = _facilitators[_name];
  51. return(lice.timestamp, lice.name, lice.email);
  52.  
  53. }
  54.  
  55. //receive payments
  56. function() external payable {
  57.  
  58. }
  59.  
  60. function _sake() public justAuthor {
  61. _addresAuthor.transfer(address(this).balance);
  62.  
  63.  
  64.  
  65. }
  66.  
  67. //money reversal
  68. event moneyReversal(address payable, uint change);
  69.  
  70. function set(uint sent) public payable Royalty(1.000 ether) justAuthor {
  71. uint licensed = sent;
  72.  
  73. if (msg.value > 1.000) {
  74. uint change = msg.value - 1.000;
  75. msg.sender.transfer(change);
  76. emit moneyReversal(msg.sender, change);
  77. }
  78. }
  79.  
  80. modifier Royalty(uint min) {
  81. require(msg.value >= min, "Insufficient Value");
  82. _;
  83.  
  84. }
  85. }
Add Comment
Please, Sign In to add comment