tx · 7JJMK1nGdpBvFcuxXei8sPgYNkKKuu6kPRee34BTkSuu 3MtzQ5QnGrLiPjPkfGhGpZWZ9Sjbbt4ZRp6: -0.01400000 Waves 2019.11.07 10:17 [754191] smart account 3MtzQ5QnGrLiPjPkfGhGpZWZ9Sjbbt4ZRp6 > SELF 0.00000000 Waves
{ "type": 13, "id": "7JJMK1nGdpBvFcuxXei8sPgYNkKKuu6kPRee34BTkSuu", "fee": 1400000, "feeAssetId": null, "timestamp": 1573111049286, "version": 1, "sender": "3MtzQ5QnGrLiPjPkfGhGpZWZ9Sjbbt4ZRp6", "senderPublicKey": "9GQ8vyLFPqkQN3L5B35JPny3E277ZeDdBL6V9cid7JdT", "proofs": [ "HWRUbhyLzzBtSbHjY4fKfFswt4gRFe5rBeGujmqQgh4z67Bwen4FMrvDD6uSzGBfepzCTz9yrY8VBP2D9ugpar4" ], "script": "base64:AAIDAAAAAAAAABwIARIDCgEIEgMKAQgSAwoBCBIECgIICBIDCgEIAAAACAAAAAANZEFwcFB1YmxpY0tleQEAAAAgyJqrWr9pFYiDLi/zauAJxqEvmfTmD23mN9fhnOqW4BkAAAAAEndoaXRlbGlzdGluZ1N1ZmZpeAIAAAAMX3doaXRlbGlzdGVkAAAAABJibGFja2xpc3RpbmdTdWZmaXgCAAAADF9ibGFja2xpc3RlZAAAAAARYmlydGhSZWNvcmRTdWZmaXgCAAAABl9hbGl2ZQAAAAARZGVhdGhSZWNvcmRTdWZmaXgCAAAACV9kZWNlYXNlZAEAAAAPZ2V0TGlzdEZyb21EYXRhAAAAAQAAAANrZXkEAAAADWdldERhdGFTdHJpbmcJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5BAAAAAlwdWJsaWNLZXkEAAAAByRtYXRjaDAFAAAADWdldERhdGFTdHJpbmcDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAAJcHVibGljS2V5BQAAAAckbWF0Y2gwBQAAAAlwdWJsaWNLZXkJAAACAAAAAQIAAAAR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50IHRoYXQgY3JlYXRlZCB0aGlzIHJlY29yZCBjYW4gbWFrZSBpdCBkZWNlYXNlZAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAADWRBcHBQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uBAAAAAFlBQAAAAckbWF0Y2gwAwkBAAAADWlzV2hpdGVsaXN0ZWQAAAABCQACWAAAAAEIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkGCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAANZEFwcFB1YmxpY0tleQdfmBsb", "chainId": 84, "height": 754191, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = base58'EW5L8pthNV1jLZqSb1XAsbWZWfikCDkfsp15mCGiuhHA' | |
5 | + | ||
6 | + | let b = "_whitelisted" | |
7 | + | ||
8 | + | let c = "_blacklisted" | |
9 | + | ||
10 | + | let d = "_alive" | |
11 | + | ||
12 | + | let e = "_deceased" | |
13 | + | ||
14 | + | func f (g) = { | |
15 | + | let h = getString(this, g) | |
16 | + | let i = { | |
17 | + | let j = h | |
18 | + | if ($isInstanceOf(j, "String")) | |
19 | + | then { | |
20 | + | let i = j | |
21 | + | i | |
22 | + | } | |
23 | + | else throw("Account not found") | |
24 | + | } | |
25 | + | split(i, "_") | |
26 | + | } | |
27 | + | ||
28 | + | ||
29 | + | func k (i) = { | |
30 | + | let l = getString(this, i) | |
31 | + | if (isDefined(l)) | |
32 | + | then { | |
33 | + | let m = f(i) | |
34 | + | if ((m[1] == "whitelisted")) | |
35 | + | then true | |
36 | + | else false | |
37 | + | } | |
38 | + | else false | |
39 | + | } | |
40 | + | ||
41 | + | ||
42 | + | func n (i) = { | |
43 | + | let o = getString(this, i) | |
44 | + | if (isDefined(o)) | |
45 | + | then { | |
46 | + | let p = f(i) | |
47 | + | if ((p[1] == "blacklisted")) | |
48 | + | then true | |
49 | + | else false | |
50 | + | } | |
51 | + | else false | |
52 | + | } | |
53 | + | ||
54 | + | ||
55 | + | @Callable(q) | |
56 | + | func whitelist (i) = if ((q.callerPublicKey == a)) | |
57 | + | then if (k(i)) | |
58 | + | then throw("This account has already been whitelisted") | |
59 | + | else { | |
60 | + | let r = (i + b) | |
61 | + | WriteSet([DataEntry(i, r)]) | |
62 | + | } | |
63 | + | else throw("You are not authorized to whitelist accounts. Contact dApp Owner") | |
64 | + | ||
65 | + | ||
66 | + | ||
67 | + | @Callable(q) | |
68 | + | func blacklist (i) = if ((q.callerPublicKey == a)) | |
69 | + | then if (k(i)) | |
70 | + | then { | |
71 | + | let s = (i + c) | |
72 | + | WriteSet([DataEntry(i, s)]) | |
73 | + | } | |
74 | + | else throw("This account was never whitelisted. Do verify") | |
75 | + | else throw("You are not authorized to blacklist accounts. Contact dApp Owner") | |
76 | + | ||
77 | + | ||
78 | + | ||
79 | + | @Callable(q) | |
80 | + | func addBirthRecord (t) = { | |
81 | + | let u = toBase58String(q.callerPublicKey) | |
82 | + | if (k(u)) | |
83 | + | then { | |
84 | + | let v = toString(toInt(q.transactionId)) | |
85 | + | let w = (((t + "_") + toBase58String(q.callerPublicKey)) + d) | |
86 | + | WriteSet([DataEntry(v, w)]) | |
87 | + | } | |
88 | + | else if (n(u)) | |
89 | + | then throw("This account has been blacklisted") | |
90 | + | else throw("Only authorized accounts can add birth records to the blockchain") | |
91 | + | } | |
92 | + | ||
93 | + | ||
94 | + | ||
95 | + | @Callable(q) | |
96 | + | func updateRecord (x,y) = { | |
97 | + | let z = { | |
98 | + | let j = getString(this, x) | |
99 | + | if ($isInstanceOf(j, "String")) | |
100 | + | then { | |
101 | + | let A = j | |
102 | + | A | |
103 | + | } | |
104 | + | else throw("Record not found") | |
105 | + | } | |
106 | + | let t = getStringValue(this, z) | |
107 | + | let B = split(t, "_") | |
108 | + | if ((B[1] == toBase58String(q.callerPublicKey))) | |
109 | + | then { | |
110 | + | let C = ((((y + "_") + toBase58String(q.callerPublicKey)) + "_") + d) | |
111 | + | WriteSet([DataEntry(z, y)]) | |
112 | + | } | |
113 | + | else throw("Access denied. Only the account that created this record can update it.") | |
114 | + | } | |
115 | + | ||
116 | + | ||
117 | + | ||
118 | + | @Callable(q) | |
119 | + | func makeDeceased (x) = { | |
120 | + | let z = { | |
121 | + | let j = getString(this, x) | |
122 | + | if ($isInstanceOf(j, "String")) | |
123 | + | then { | |
124 | + | let A = j | |
125 | + | A | |
126 | + | } | |
127 | + | else throw("Record not found") | |
128 | + | } | |
129 | + | let t = getStringValue(this, z) | |
130 | + | let B = split(t, "_") | |
131 | + | if ((B[1] == toBase58String(q.callerPublicKey))) | |
132 | + | then { | |
133 | + | let y = ((((B[0] + "_") + toBase58String(q.callerPublicKey)) + "_") + B[2]) | |
134 | + | WriteSet([DataEntry(z, y)]) | |
135 | + | } | |
136 | + | else throw("Access denied. Only the account that created this record can make it deceased") | |
137 | + | } | |
138 | + | ||
139 | + | ||
140 | + | @Verifier(D) | |
141 | + | func E () = { | |
142 | + | let j = D | |
143 | + | if ($isInstanceOf(j, "SetScriptTransaction")) | |
144 | + | then { | |
145 | + | let F = j | |
146 | + | sigVerify(D.bodyBytes, D.proofs[0], a) | |
147 | + | } | |
148 | + | else if ($isInstanceOf(j, "InvokeScriptTransaction")) | |
149 | + | then { | |
150 | + | let G = j | |
151 | + | if (k(toBase58String(D.senderPublicKey))) | |
152 | + | then true | |
153 | + | else sigVerify(D.bodyBytes, D.proofs[0], a) | |
154 | + | } | |
155 | + | else false | |
156 | + | } | |
157 | + |
github/deemru/w8io/169f3d6 16.93 ms ◑