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