Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- contract Keetiz
- {
- struct CashBack
- {
- uint32 cashback;
- string firstPart;
- string secondPart;
- }
- struct Account
- {
- string name;
- bool allowed;
- }
- struct CommercialAccount
- {
- string name;
- bool allowed;
- CashBack[] cachBack;
- }
- private :
- address owner;
- address rescue;
- mapping(address => CommercialAccount) commercialWL;
- mapping(address => Account) userWL;
- CashBack[] validCashback;
- public :
- function addCommercial(address commercial, string name)
- {
- if (msg->sender != owner)
- throw;
- commmercialWL[commercial].allowed = true;
- commmercialWL[commercial].name = name;
- }
- function addUser(address user, string name)
- {
- if (msg->sender != owner)
- throw;
- userWL[commercial].allowed = true;
- userWL[commercial].name = name;
- }
- function addCashBack(uint32 cashback, string code)
- {
- if (commercialWL[msg->sender].allowed != true)
- throw;
- commercialWL[msg->sender].cashBack.Push(CashBack({cashBack: cashBack, firstPart: code, secondPart: ""}));
- }
- function flashQrCode(string code)
- {
- if (userWL[msg->sender].allowed != true)
- throw;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement