tx · FwAUQJxa5XhF1cAT5v3Yqyw6JD4XmPA9giZA4hLPAjpR 3MtQrXdSuLxLhdJpM7Pcw7a4y68VgPVigGx: -0.01400000 Waves 2021.01.05 13:46 [1339988] smart account 3MtQrXdSuLxLhdJpM7Pcw7a4y68VgPVigGx > SELF 0.00000000 Waves
{ "type": 13, "id": "FwAUQJxa5XhF1cAT5v3Yqyw6JD4XmPA9giZA4hLPAjpR", "fee": 1400000, "feeAssetId": null, "timestamp": 1609843643514, "version": 2, "chainId": 84, "sender": "3MtQrXdSuLxLhdJpM7Pcw7a4y68VgPVigGx", "senderPublicKey": "F7UNX3gypCqMdGbbF3AMDLosMA4KsBRVJvHZCt6AphAF", "proofs": [ "4EomC7Qi7zobYD7DrFhQpizamskdKca7PeT3aZTv2kAytPRvvGve6txyCSDGfjaiNpiSLyiApnfSRbkLgnfxdoBv" ], "script": "base64:AAIEAAAAAAAAACgIAhIECgIECBIDCgEEEgYKBAgICAgSBgoECAgICBIECgIICBIDCgEIAAAAHgAAAAAFY2hyaXMCAAAAIzNNc0c2alBOQ3JWSlV0WUI3WEpCeFM3dXRXc1hBZjRuOVZwAAAAAARqb2VwAgAAACMzTXptNFZMd3NOOXVad2JUTXpQajNYdXhWNmtFZkFSOFVETgAAAAAOZGFwcFJ1bm5pbmdLZXkCAAAAFGNvbmZfZGFwcF9pc19ydW5uaW5nAAAAABFtYWludGVuYW5jZU1TR0tleQIAAAAUY29uZl9tYWludGVuYW5jZV9tc2cAAAAAEndoaXRlbGlzdGVkb25seUtleQIAAAAVY29uZl93aGl0ZWxpc3RlZF9vbmx5AAAAAAtkYXBwUnVubmluZwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBsAAAACBQAAAAR0aGlzBQAAAA5kYXBwUnVubmluZ0tleQYAAAAADm1haW50ZW5hbmNlTVNHCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMFAAAAEW1haW50ZW5hbmNlTVNHS2V5AgAAAAAAAAA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XNlckFkZHIAAAABBQAAAAdhZGRyZXNzCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAQAAAAtrZXlVc2VyTmFtZQAAAAEFAAAAB2FkZHJlc3MJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAAC2tleVVzZXJEZXNjAAAAAQUAAAAHYWRkcmVzcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAANa2V5VXNlclNvY2lhbAAAAAEFAAAAB2FkZHJlc3MJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAADGtleVVzZXJUaHVtYgAAAAEFAAAAB2FkZHJlc3MJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACCQABLAAAAAIFAAAADWN1cnJlbnRTdGF0dXMCAAAAAV8FAAAAB2FkZHJlc3MJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAADWtleVVzZXJTdGF0dXMAAAABBQAAAAdhZGRyZXNzBQAAAAt1c2VyUmVtb3ZlZAUAAAADbmlsCQAAAgAAAAECAAAAC05vdCBhbGxvd2VkAAAAAPyZW7s=", "height": 1339988, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let chris = "3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp" | |
5 | + | ||
6 | + | let joep = "3Mzm4VLwsN9uZwbTMzPj3XuxV6kEfAR8UDN" | |
7 | + | ||
8 | + | let dappRunningKey = "conf_dapp_is_running" | |
9 | + | ||
10 | + | let maintenanceMSGKey = "conf_maintenance_msg" | |
11 | + | ||
12 | + | let whitelistedonlyKey = "conf_whitelisted_only" | |
13 | + | ||
14 | + | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
15 | + | ||
16 | + | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
17 | + | ||
18 | + | let whitelistedonly = valueOrElse(getBoolean(this, whitelistedonlyKey), true) | |
19 | + | ||
20 | + | let userAllowed = "ALLOWED" | |
21 | + | ||
22 | + | let userRegistered = "REGISTERED" | |
23 | + | ||
24 | + | let userVerified = "VERIFIED" | |
25 | + | ||
26 | + | let userSuspended = "SUSPENDED" | |
27 | + | ||
28 | + | let userRemoved = "REMOVED" | |
29 | + | ||
30 | + | let userChangeRequired = "CHANGE_REQUIRED" | |
31 | + | ||
32 | + | let userUnregistered = "UNREGISTERED" | |
33 | + | ||
34 | + | let userReset = "RESET" | |
35 | + | ||
36 | + | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
37 | + | ||
38 | + | ||
39 | + | func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false) | |
40 | + | ||
41 | + | ||
42 | + | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0) | |
43 | + | ||
44 | + | ||
45 | + | func keyUserAddr (caller) = ("user_" + caller) | |
46 | + | ||
47 | + | ||
48 | + | func keyUserName (caller) = ("user_name_" + caller) | |
49 | + | ||
50 | + | ||
51 | + | func keyUserDesc (caller) = ("user_desc_" + caller) | |
52 | + | ||
53 | + | ||
54 | + | func keyUserSocial (caller) = ("user_social_" + caller) | |
55 | + | ||
56 | + | ||
57 | + | func keyUserThumb (caller) = ("user_thumb_" + caller) | |
58 | + | ||
59 | + | ||
60 | + | func keyUserStatus (caller) = ("user_status_" + caller) | |
61 | + | ||
62 | + | ||
63 | + | func keyUserDate (caller) = ("user_date_" + caller) | |
64 | + | ||
65 | + | ||
66 | + | func validateCID (cid) = if (contains(cid, "/")) | |
67 | + | then if (if ((76 > size(cid))) | |
68 | + | then (size(split(cid, "/")[0]) == 59) | |
69 | + | else false) | |
70 | + | then (16 > size(split(cid, "/")[1])) | |
71 | + | else false | |
72 | + | else false | |
73 | + | ||
74 | + | ||
75 | + | func validUserData (caller,name,description,thumb,isAnUpdate) = { | |
76 | + | let validCID = if ((size(thumb) != 0)) | |
77 | + | then validateCID(thumb) | |
78 | + | else true | |
79 | + | if (!(validCID)) | |
80 | + | then throw("CID don't match requirement!") | |
81 | + | else if (if ((name == "")) | |
82 | + | then true | |
83 | + | else (description == "")) | |
84 | + | then throw("Name and description cannot be empty") | |
85 | + | else if ((size(description) > 600)) | |
86 | + | then throw("600 Char. max description") | |
87 | + | else if ((size(name) > 45)) | |
88 | + | then throw("45 Char. max name") | |
89 | + | else { | |
90 | + | let status = getStringByKey(keyUserStatus(caller)) | |
91 | + | if (if ((status == userSuspended)) | |
92 | + | then true | |
93 | + | else (status == userRemoved)) | |
94 | + | then throw("Account suspended/ removed.") | |
95 | + | else if (if (!(isAnUpdate)) | |
96 | + | then (status == userRegistered) | |
97 | + | else false) | |
98 | + | then throw("Already registered") | |
99 | + | else if (if (if (!(isAnUpdate)) | |
100 | + | then (status == "") | |
101 | + | else false) | |
102 | + | then whitelistedonly | |
103 | + | else false) | |
104 | + | then throw("Can't register, get approved first.") | |
105 | + | else if (if (if (isAnUpdate) | |
106 | + | then (status == "") | |
107 | + | else false) | |
108 | + | then true | |
109 | + | else if (isAnUpdate) | |
110 | + | then (status == userAllowed) | |
111 | + | else false) | |
112 | + | then throw("Register first") | |
113 | + | else true | |
114 | + | } | |
115 | + | } | |
116 | + | ||
117 | + | ||
118 | + | func validateNewStatus (status,address,currentStatus) = { | |
119 | + | let allStatus = [userVerified, userRegistered, userSuspended, userRemoved, userAllowed, userChangeRequired] | |
120 | + | let statusToSet = if (containsElement(allStatus, status)) | |
121 | + | then status | |
122 | + | else if (if ((status == userReset)) | |
123 | + | then (currentStatus == userAllowed) | |
124 | + | else false) | |
125 | + | then "" | |
126 | + | else throw("Unknown status") | |
127 | + | let userIsRegistered = getIntegerByKey(keyUserDate(address)) | |
128 | + | if (if ((userIsRegistered == 0)) | |
129 | + | then (statusToSet != userAllowed) | |
130 | + | else false) | |
131 | + | then throw("You cant set this status, user is not registered.") | |
132 | + | else if (if ((currentStatus == userAllowed)) | |
133 | + | then (statusToSet == userAllowed) | |
134 | + | else false) | |
135 | + | then throw("User already allowed") | |
136 | + | else if (if ((currentStatus == userRegistered)) | |
137 | + | then (statusToSet == userAllowed) | |
138 | + | else false) | |
139 | + | then throw("User already allowed & registered") | |
140 | + | else if (if ((currentStatus == userVerified)) | |
141 | + | then (statusToSet == userAllowed) | |
142 | + | else false) | |
143 | + | then throw("User already allowed & verified") | |
144 | + | else statusToSet | |
145 | + | } | |
146 | + | ||
147 | + | ||
148 | + | func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}") | |
149 | + | ||
150 | + | ||
151 | + | @Callable(invoke) | |
152 | + | func appRunning (isLive,message) = { | |
153 | + | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
154 | + | let id = toBase58String(invoke.transactionId) | |
155 | + | if (containsElement([chris, joep, toString(this)], caller)) | |
156 | + | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
157 | + | else throw("You are not allowed to change this") | |
158 | + | } | |
159 | + | ||
160 | + | ||
161 | + | ||
162 | + | @Callable(invoke) | |
163 | + | func registrationMode (WLonly) = { | |
164 | + | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
165 | + | let id = toBase58String(invoke.transactionId) | |
166 | + | if (containsElement([chris, toString(this)], caller)) | |
167 | + | then [BooleanEntry(whitelistedonlyKey, WLonly)] | |
168 | + | else throw("You are not allowed to change this") | |
169 | + | } | |
170 | + | ||
171 | + | ||
172 | + | ||
173 | + | @Callable(invoke) | |
174 | + | func registerUser (name,description,thumb,social) = if (!(dappRunning)) | |
175 | + | then throw(maintenanceMSG) | |
176 | + | else { | |
177 | + | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
178 | + | let id = toBase58String(invoke.transactionId) | |
179 | + | let timestamp = lastBlock.timestamp | |
180 | + | if (!(validUserData(caller, name, description, thumb, false))) | |
181 | + | then throw("Something went wrong") | |
182 | + | else { | |
183 | + | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp)) | |
184 | + | [IntegerEntry(keyUserDate(caller), timestamp), StringEntry(keyUserAddr(caller), ((id + "_") + toString(timestamp))), StringEntry(keyUserName(caller), name), StringEntry(keyUserDesc(caller), description), StringEntry(keyUserSocial(caller), social), StringEntry(keyUserThumb(caller), thumb), StringEntry(keyUserStatus(caller), userRegistered), DeleteEntry(("ALLOWED_" + caller)), StringEntry(((userRegistered + "_") + caller), json)] | |
185 | + | } | |
186 | + | } | |
187 | + | ||
188 | + | ||
189 | + | ||
190 | + | @Callable(invoke) | |
191 | + | func updateUser (name,description,thumb,social) = if (!(dappRunning)) | |
192 | + | then throw(maintenanceMSG) | |
193 | + | else { | |
194 | + | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
195 | + | let id = toBase58String(invoke.transactionId) | |
196 | + | let status = getStringByKey(keyUserStatus(caller)) | |
197 | + | if (!(validUserData(caller, name, description, thumb, true))) | |
198 | + | then throw("Something went wrong") | |
199 | + | else { | |
200 | + | let date = getIntegerByKey(keyUserDate(caller)) | |
201 | + | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date)) | |
202 | + | [StringEntry(keyUserName(caller), name), StringEntry(keyUserDesc(caller), description), StringEntry(keyUserSocial(caller), social), StringEntry(keyUserThumb(caller), thumb), StringEntry(((status + "_") + caller), json)] | |
203 | + | } | |
204 | + | } | |
205 | + | ||
206 | + | ||
207 | + | ||
208 | + | @Callable(invoke) | |
209 | + | func changeUserStatus (address,status) = if (!(dappRunning)) | |
210 | + | then throw(maintenanceMSG) | |
211 | + | else { | |
212 | + | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
213 | + | let id = toBase58String(invoke.transactionId) | |
214 | + | let currentStatus = getStringByKey(keyUserStatus(address)) | |
215 | + | let statusToSet = validateNewStatus(status, address, currentStatus) | |
216 | + | let name = toBase64String(toBytes(getStringByKey(keyUserName(address)))) | |
217 | + | let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address)))) | |
218 | + | let date = getIntegerByKey(keyUserDate(address)) | |
219 | + | let json = makeJSON(name, thumb, toString(date)) | |
220 | + | if (containsElement([chris, joep, toString(this)], caller)) | |
221 | + | then [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json)] | |
222 | + | else throw("Not allowed to change user status") | |
223 | + | } | |
224 | + | ||
225 | + | ||
226 | + | ||
227 | + | @Callable(invoke) | |
228 | + | func deleteUser (address) = { | |
229 | + | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
230 | + | let id = toBase58String(invoke.transactionId) | |
231 | + | let currentStatus = getStringByKey(keyUserStatus(address)) | |
232 | + | if (containsElement([chris, toString(this)], caller)) | |
233 | + | then [DeleteEntry(keyUserDate(address)), DeleteEntry(keyUserAddr(address)), DeleteEntry(keyUserName(address)), DeleteEntry(keyUserDesc(address)), DeleteEntry(keyUserSocial(address)), DeleteEntry(keyUserThumb(address)), DeleteEntry(((currentStatus + "_") + address)), StringEntry(keyUserStatus(address), userRemoved)] | |
234 | + | else throw("Not allowed") | |
235 | + | } | |
236 | + | ||
237 | + |
github/deemru/w8io/026f985 29.87 ms ◑