tx · 7MNNQHXVM5mXEWKoFQTJGZ2egQFhsWnE2yYTqUaFECxq

3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj:  -0.01200000 Waves

2023.01.22 05:01 [2415532] smart account 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj > SELF 0.00000000 Waves

{ "type": 13, "id": "7MNNQHXVM5mXEWKoFQTJGZ2egQFhsWnE2yYTqUaFECxq", "fee": 1200000, "feeAssetId": null, "timestamp": 1674352904729, "version": 2, "chainId": 84, "sender": "3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj", "senderPublicKey": "A2m227AHcq7gWfSU59Q3UJaqkEa7SccFYmJuWHbFrrKE", "proofs": [ "2ecpbffsMMNo1fjLJ95yz68TJ3XNU71sM8TK6jdZNu2Kuih2YUAzcBGYiRTjbUamj4kJ8kCkcY1dyGqtM7mY1poE" ], "script": "base64:BgJNCAISBAoCCAgSBAoCBAgSAwoBBBIICgYICAgIAQgSCAoGCAgICAEIEgQKAggIEgYKBAgICAgSAwoBCBIGCgQICAEBEgQKAggIEgMKAQgqAAdWRVJTSU9OAgMxLjUBDmdldFN0cmluZ0J5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgABD2dldEJvb2xlYW5CeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCbCAIFBHRoaXMFA2tleQcBD2dldEludGVnZXJCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFA2tleQAAAAVjaHJpcwkBDmdldFN0cmluZ0J5S2V5AQIMY29uZl9hZG1pbl8xAA5kYXBwUnVubmluZ0tleQIUY29uZl9kYXBwX2lzX3J1bm5pbmcAEW1haW50ZW5hbmNlTVNHS2V5AhRjb25mX21haW50ZW5hbmNlX21zZwASd2hpdGVsaXN0ZWRvbmx5S2V5AhVjb25mX3doaXRlbGlzdGVkX29ubHkAC2RhcHBSdW5uaW5nCQELdmFsdWVPckVsc2UCCQ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EFwcAUEdGhpcwcJAAACCAUDaW52A2ZlZQCgwh4HCQAAAggFA2ludgpmZWVBc3NldElkBQR1bml0BwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAkA2QQBCQEIYXNTdHJpbmcBCQCRAwIIBQNpbnYEYXJncwAFAwMDAwkAAAIIBQNpbnYIZnVuY3Rpb24CCnVwZGF0ZVVzZXIJAAACCAUDaW52BGRBcHAFBHRoaXMHCQAAAggFA2ludgNmZWUAoMIeBwkAAAIIBQNpbnYKZmVlQXNzZXRJZAUEdW5pdAcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAJANkEAQkBCGFzU3RyaW5nAQkAkQMCCAUDaW52BGFyZ3MABQMDAwMJAAACCAUDaW52CGZ1bmN0aW9uAgxzZXRFUkMyMFVzZXIJAAACCAUDaW52BGRBcHAFBHRoaXMHCQAAAggFA2ludgNmZWUAoMIeBwkAAAIIBQNpbnYKZmVlQXNzZXRJZAUEdW5pdAcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAJANkEAQkBCGFzU3RyaW5nAQkAkQMCCAUDaW52BGFyZ3MAAgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleX4wfw0=", "height": 2415532, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6JFcVEWo1PbA3P5YrPgfZgsSM9LtjLBdu3JJHDTdALoD Next: 9k4EuFxvBSvXY4PAitq9h8L8TQAv67BRyCqttdd2SL4R Diff:
OldNewDifferences
325325 let caller = toString(invoke.caller)
326326 if (containsElement([chris, toString(this)], caller))
327327 then if ((size(status) == 0))
328- then [StringEntry(keyUserNote(address), note), StringEntry(keyUserLabel(address), label)]
328+ then {
329+ let currentStatus = getStringByKey(keyUserStatus(address))
330+ if ((currentStatus == ""))
331+ then throw("User have no status yet")
332+ else [StringEntry(keyUserNote(address), note), StringEntry(keyUserLabel(address), label)]
333+ }
329334 else {
330335 let currentStatus = getStringByKey(keyUserStatus(address))
331336 let statusToSet = validateNewStatus(status, address, currentStatus)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let VERSION = "1.5"
55
66 func getStringByKey (key) = valueOrElse(getString(this, key), "")
77
88
99 func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false)
1010
1111
1212 func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
1313
1414
1515 let chris = getStringByKey("conf_admin_1")
1616
1717 let dappRunningKey = "conf_dapp_is_running"
1818
1919 let maintenanceMSGKey = "conf_maintenance_msg"
2020
2121 let whitelistedonlyKey = "conf_whitelisted_only"
2222
2323 let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true)
2424
2525 let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "")
2626
2727 let whitelistedonly = valueOrElse(getBoolean(this, whitelistedonlyKey), true)
2828
2929 let whitelistDapp = value(addressFromString(getStringByKey("conf_whitelist_dapp")))
3030
3131 let userAllowed = "ALLOWED"
3232
3333 let userRegistered = "REGISTERED"
3434
3535 let userVerified = "VERIFIED"
3636
3737 let userSuspended = "SUSPENDED"
3838
3939 let userRemoved = "REMOVED"
4040
4141 let userChangeRequired = "CHANGE_REQUIRED"
4242
4343 let userUnregistered = "UNREGISTERED"
4444
4545 let userReset = "RESET"
4646
4747 func keyUserAddr (caller) = ("user_" + caller)
4848
4949
5050 func keyUserName (caller) = ("user_name_" + caller)
5151
5252
5353 func keyUserDesc (caller) = ("user_desc_" + caller)
5454
5555
5656 func keyUserSocial (caller) = ("user_social_" + caller)
5757
5858
5959 func keyUserThumb (caller) = ("user_thumb_" + caller)
6060
6161
6262 func keyUserStatus (caller) = ("user_status_" + caller)
6363
6464
6565 func keyUserRoyalties (caller) = ("user_royalties_" + caller)
6666
6767
6868 func keyUserDate (caller) = ("user_date_" + caller)
6969
7070
7171 func keyUserERC20 (caller) = ("user_ERC20_" + caller)
7272
7373
7474 func keyUserNote (caller) = ("user_note_" + caller)
7575
7676
7777 func keyUserLabel (caller) = ("user_label_" + caller)
7878
7979
8080 func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr)
8181
8282
8383 func keyAgentArtistAddr (agentAddr,artistAddr) = ((("agent_" + agentAddr) + "_") + artistAddr)
8484
8585
8686 func keyPrimaryShare (artistAddr) = ("artist_agent_primary_" + artistAddr)
8787
8888
8989 func keySecondaryShare (artistAddr) = ("artist_agent_secondary_" + artistAddr)
9090
9191
9292 func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0)
9393
9494
9595 func validateCID (cid) = if (contains(cid, "/"))
9696 then if (if ((76 > size(cid)))
9797 then (size(split(cid, "/")[0]) == 59)
9898 else false)
9999 then (16 > size(split(cid, "/")[1]))
100100 else false
101101 else false
102102
103103
104104 func validUserData (caller,name,description,thumb,isAnUpdate) = {
105105 let validCID = if ((size(thumb) != 0))
106106 then validateCID(thumb)
107107 else true
108108 if (!(validCID))
109109 then throw("CID don't match requirement!")
110110 else if (if ((name == ""))
111111 then true
112112 else (description == ""))
113113 then throw("Name and description cannot be empty")
114114 else if ((size(description) > 600))
115115 then throw("600 Char. max description")
116116 else if ((size(name) > 45))
117117 then throw("45 Char. max name")
118118 else {
119119 let status = getStringByKey(keyUserStatus(caller))
120120 if (if ((status == userSuspended))
121121 then true
122122 else (status == userRemoved))
123123 then throw("Account suspended/ removed.")
124124 else if (if (!(isAnUpdate))
125125 then (status == userRegistered)
126126 else false)
127127 then throw("Already registered")
128128 else if (if (if (!(isAnUpdate))
129129 then (status == "")
130130 else false)
131131 then whitelistedonly
132132 else false)
133133 then throw("Can't register, get approved first.")
134134 else if (if (if (isAnUpdate)
135135 then (status == "")
136136 else false)
137137 then true
138138 else if (isAnUpdate)
139139 then (status == userAllowed)
140140 else false)
141141 then throw("Register first")
142142 else true
143143 }
144144 }
145145
146146
147147 func validateNewStatus (status,address,currentStatus) = {
148148 let allStatus = [userVerified, userRegistered, userSuspended, userRemoved, userAllowed, userChangeRequired]
149149 let statusToSet = if (containsElement(allStatus, status))
150150 then status
151151 else if (if ((status == userReset))
152152 then (currentStatus == userAllowed)
153153 else false)
154154 then ""
155155 else throw("Unknown status")
156156 let userIsRegistered = getIntegerByKey(keyUserDate(address))
157157 if (if ((userIsRegistered == 0))
158158 then (statusToSet != userAllowed)
159159 else false)
160160 then throw("You cant set this status, user is not registered.")
161161 else if (if ((currentStatus == userAllowed))
162162 then (statusToSet == userAllowed)
163163 else false)
164164 then throw("User already allowed")
165165 else if (if ((currentStatus == userRegistered))
166166 then (statusToSet == userAllowed)
167167 else false)
168168 then throw("User already allowed & registered")
169169 else if (if ((currentStatus == userVerified))
170170 then (statusToSet == userAllowed)
171171 else false)
172172 then throw("User already allowed & verified")
173173 else statusToSet
174174 }
175175
176176
177177 func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
178178
179179
180180 func asString (bv) = match bv {
181181 case bv0: String =>
182182 bv0
183183 case _ =>
184184 throw("Sponsored Public Key String expected")
185185 }
186186
187187
188188 func getCaller (i,pubKey) = {
189189 let isSponsored = if ((pubKey != ""))
190190 then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0)
191191 else 0
192192 let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
193193 then (isSponsored > 0)
194194 else false)
195195 then toString(addressFromPublicKey(fromBase58String(pubKey)))
196196 else toBase58String(i.caller.bytes)
197197 let get_sponsored_waves = if ((pubKey != ""))
198198 then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
199199 else unit
200200 if ((get_sponsored_waves == get_sponsored_waves))
201201 then $Tuple2(caller, (isSponsored > 0))
202202 else throw("Strict value is not equal to itself.")
203203 }
204204
205205
206206 @Callable(invoke)
207207 func setConf (key,val) = {
208208 let caller = toString(invoke.caller)
209209 if (containsElement([chris, toString(this)], caller))
210210 then [StringEntry(key, val)]
211211 else throw("You are not allowed to change this")
212212 }
213213
214214
215215
216216 @Callable(invoke)
217217 func appRunning (isLive,message) = {
218218 let caller = toString(invoke.caller)
219219 if (containsElement([chris, toString(this)], caller))
220220 then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
221221 else throw("You are not allowed to change this")
222222 }
223223
224224
225225
226226 @Callable(invoke)
227227 func registrationMode (WLonly) = {
228228 let caller = toString(invoke.caller)
229229 if (containsElement([chris, toString(this)], caller))
230230 then [BooleanEntry(whitelistedonlyKey, WLonly)]
231231 else throw("You are not allowed to change this")
232232 }
233233
234234
235235
236236 @Callable(invoke)
237237 func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
238238 then throw(maintenanceMSG)
239239 else {
240240 let $t073197371 = getCaller(invoke, pubKey)
241241 let caller = $t073197371._1
242242 let isSponsored = $t073197371._2
243243 let id = toBase58String(invoke.transactionId)
244244 let timestamp = lastBlock.timestamp
245245 let note = getStringByKey(keyUserNote(caller))
246246 let label = getStringByKey(keyUserLabel(caller))
247247 if (!(validUserData(caller, name, description, thumb, false)))
248248 then throw("Something went wrong")
249249 else {
250250 let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
251251 if (if ((0 > royalties))
252252 then true
253253 else (royalties > 1000))
254254 then throw("Royalties cannot be less than 0% or higher than 10%")
255255 else {
256256 let txToCaller = if (isSponsored)
257257 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
258258 else nil
259259 ([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), IntegerEntry(keyUserRoyalties(caller), royalties), DeleteEntry(("ALLOWED_" + caller)), StringEntry(((userRegistered + "_") + caller), json), StringEntry(keyUserNote(caller), note), StringEntry(keyUserLabel(caller), label)] ++ txToCaller)
260260 }
261261 }
262262 }
263263
264264
265265
266266 @Callable(invoke)
267267 func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
268268 then throw(maintenanceMSG)
269269 else {
270270 let $t090179121 = getCaller(invoke, pubKey)
271271 let caller = $t090179121._1
272272 let isSponsored = $t090179121._2
273273 let status = getStringByKey(keyUserStatus(caller))
274274 if (!(validUserData(caller, name, description, thumb, true)))
275275 then throw("Something went wrong")
276276 else {
277277 let date = getIntegerByKey(keyUserDate(caller))
278278 let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
279279 if (if ((0 > royalties))
280280 then true
281281 else (royalties > 1000))
282282 then throw("Royalties cannot be less than 0% or higher than 10%")
283283 else {
284284 let txToCaller = if (isSponsored)
285285 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
286286 else nil
287287 ([StringEntry(keyUserName(caller), name), StringEntry(keyUserDesc(caller), description), StringEntry(keyUserSocial(caller), social), StringEntry(keyUserThumb(caller), thumb), IntegerEntry(keyUserRoyalties(caller), royalties), StringEntry(((status + "_") + caller), json)] ++ txToCaller)
288288 }
289289 }
290290 }
291291
292292
293293
294294 @Callable(invoke)
295295 func setERC20User (erc20,pubKey) = if (!(dappRunning))
296296 then throw(maintenanceMSG)
297297 else {
298298 let $t01030810411 = getCaller(invoke, pubKey)
299299 let caller = $t01030810411._1
300300 let isSponsored = $t01030810411._2
301301 let status = getStringByKey(keyUserStatus(caller))
302302 if (if ((status != userRegistered))
303303 then (status != userVerified)
304304 else false)
305305 then throw("Not allowed to set ERC20 address")
306306 else {
307307 let firstTwo = take(erc20, 2)
308308 if (if ((firstTwo != "0x"))
309309 then true
310310 else (size(erc20) != 42))
311311 then throw("This is not an erc20 address")
312312 else {
313313 let txToCaller = if (isSponsored)
314314 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
315315 else nil
316316 ([StringEntry(keyUserERC20(caller), erc20)] ++ txToCaller)
317317 }
318318 }
319319 }
320320
321321
322322
323323 @Callable(invoke)
324324 func changeUserStatus (address,status,note,label) = {
325325 let caller = toString(invoke.caller)
326326 if (containsElement([chris, toString(this)], caller))
327327 then if ((size(status) == 0))
328- then [StringEntry(keyUserNote(address), note), StringEntry(keyUserLabel(address), label)]
328+ then {
329+ let currentStatus = getStringByKey(keyUserStatus(address))
330+ if ((currentStatus == ""))
331+ then throw("User have no status yet")
332+ else [StringEntry(keyUserNote(address), note), StringEntry(keyUserLabel(address), label)]
333+ }
329334 else {
330335 let currentStatus = getStringByKey(keyUserStatus(address))
331336 let statusToSet = validateNewStatus(status, address, currentStatus)
332337 let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
333338 let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
334339 let date = getIntegerByKey(keyUserDate(address))
335340 let json = makeJSON(name, thumb, toString(date))
336341 [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(keyUserNote(address), note), StringEntry(keyUserLabel(address), label)]
337342 }
338343 else throw("Not allowed to change user status")
339344 }
340345
341346
342347
343348 @Callable(invoke)
344349 func deleteUser (address) = {
345350 let caller = toString(invoke.caller)
346351 let currentStatus = getStringByKey(keyUserStatus(address))
347352 if (containsElement([chris, toString(this)], caller))
348353 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)), DeleteEntry(keyUserRoyalties(address)), StringEntry(keyUserStatus(address), userRemoved)]
349354 else throw("Not allowed")
350355 }
351356
352357
353358
354359 @Callable(i)
355360 func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning))
356361 then throw(maintenanceMSG)
357362 else {
358363 let caller = toString(i.caller)
359364 if (containsElement([chris, toString(this)], caller))
360365 then if (if ((size(artistAddr) != 35))
361366 then true
362367 else (size(agentAddr) != 35))
363368 then throw("Wrong address")
364369 else [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)]
365370 else throw("You are not allowed")
366371 }
367372
368373
369374
370375 @Callable(i)
371376 func unsetAgent (artistAddr,agentAddr) = if (!(dappRunning))
372377 then throw(maintenanceMSG)
373378 else {
374379 let caller = toString(i.caller)
375380 if (containsElement([chris, toString(this)], caller))
376381 then if (if ((size(artistAddr) != 35))
377382 then true
378383 else (size(agentAddr) != 35))
379384 then throw("Wrong address")
380385 else [DeleteEntry(keyArtistAgentAddr(artistAddr)), DeleteEntry(keyAgentArtistAddr(agentAddr, artistAddr)), DeleteEntry(keyPrimaryShare(artistAddr)), DeleteEntry(keySecondaryShare(artistAddr))]
381386 else throw("You are not allowed")
382387 }
383388
384389
385390
386391 @Callable(i)
387392 func deleteEntry (entry) = {
388393 let caller = toString(i.caller)
389394 if ((caller == chris))
390395 then [DeleteEntry(entry)]
391396 else throw("no")
392397 }
393398
394399
395400 @Verifier(tx)
396401 func verifier () = match tx {
397402 case inv: InvokeScriptTransaction =>
398403 if (if (if (if ((inv.function == "registerUser"))
399404 then (inv.dApp == this)
400405 else false)
401406 then (inv.fee == 500000)
402407 else false)
403408 then (inv.feeAssetId == unit)
404409 else false)
405410 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
406411 else if (if (if (if ((inv.function == "updateUser"))
407412 then (inv.dApp == this)
408413 else false)
409414 then (inv.fee == 500000)
410415 else false)
411416 then (inv.feeAssetId == unit)
412417 else false)
413418 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
414419 else if (if (if (if ((inv.function == "setERC20User"))
415420 then (inv.dApp == this)
416421 else false)
417422 then (inv.fee == 500000)
418423 else false)
419424 then (inv.feeAssetId == unit)
420425 else false)
421426 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[2])))
422427 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
423428 case _ =>
424429 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
425430 }
426431

github/deemru/w8io/026f985 
60.33 ms