Advertisement
Guest User

raw code smart contract keetiz V0.0

a guest
Nov 24th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. contract Keetiz
  2. {
  3. struct CashBack
  4. {
  5. uint32 cashback;
  6. string firstPart;
  7. string secondPart;
  8. }
  9.  
  10. struct Account
  11. {
  12. string name;
  13. bool allowed;
  14. }
  15.  
  16. struct CommercialAccount
  17. {
  18. string name;
  19. bool allowed;
  20. CashBack[] cachBack;
  21. }
  22.  
  23. private :
  24.  
  25. address owner;
  26. address rescue;
  27.  
  28. mapping(address => CommercialAccount) commercialWL;
  29. mapping(address => Account) userWL;
  30. CashBack[] validCashback;
  31.  
  32. public :
  33.  
  34. function addCommercial(address commercial, string name)
  35. {
  36. if (msg->sender != owner)
  37. throw;
  38. commmercialWL[commercial].allowed = true;
  39. commmercialWL[commercial].name = name;
  40. }
  41.  
  42. function addUser(address user, string name)
  43. {
  44. if (msg->sender != owner)
  45. throw;
  46. userWL[commercial].allowed = true;
  47. userWL[commercial].name = name;
  48. }
  49.  
  50. function addCashBack(uint32 cashback, string code)
  51. {
  52. if (commercialWL[msg->sender].allowed != true)
  53. throw;
  54. commercialWL[msg->sender].cashBack.Push(CashBack({cashBack: cashBack, firstPart: code, secondPart: ""}));
  55. }
  56.  
  57. function flashQrCode(string code)
  58. {
  59. if (userWL[msg->sender].allowed != true)
  60. throw;
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement