tx · CbYwjsTygDWathmSHVkbxufgAwsnpdCvxuVYH6pifXxQ

3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj:  -0.01100000 Waves

2023.01.21 04:37 [2414089] smart account 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj > SELF 0.00000000 Waves

{ "type": 13, "id": "CbYwjsTygDWathmSHVkbxufgAwsnpdCvxuVYH6pifXxQ", "fee": 1100000, "feeAssetId": null, "timestamp": 1674265100806, "version": 2, "chainId": 84, "sender": "3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj", "senderPublicKey": "A2m227AHcq7gWfSU59Q3UJaqkEa7SccFYmJuWHbFrrKE", "proofs": [ "5qLbpBou43iabNHX82PV83RJjYE5mm1UFFMamEqhybUfnzYHooNWZbs45i1qyxjbXjTMCfagRiHsGCh6JvzLxjzE" ], "script": "base64:BgJMCAISBAoCCAgSBAoCBAgSAwoBBBIICgYICAgIAQgSCAoGCAgICAEIEgQKAggIEgUKAwgICBIDCgEIEgYKBAgIAQESBAoCCAgSAwoBCCgAB1ZFUlNJT04CAzEuNQEOZ2V0U3RyaW5nQnlLZXkBA2tleQkBC3ZhbHVlT3JFbHNlAgkAnQgCBQR0aGlzBQNrZXkCAAEPZ2V0Qm9vbGVhbkJ5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJsIAgUEdGhpcwUDa2V5BwEPZ2V0SW50ZWdlckJ5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwUDa2V5AAAABWNocmlzCQEOZ2V0U3RyaW5nQnlLZXkBAgxjb25mX2FkbWluXzEADmRhcHBSdW5uaW5nS2V5AhRjb25mX2RhcHBfaXNfcnVubmluZwARbWFpbnRlbmFuY2VNU0dLZXkCFGNvbmZfbWFpbnRlbmFuY2VfbXNnABJ3aGl0ZWxpc3RlZG9ubHlLZXkCFWNvbmZfd2hpdGVsaXN0ZWRfb25seQALZGFwcFJ1bm5pbmcJAQt2YWx1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QJ0eA9zZW5kZXJQdWJsaWNLZXkJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXnqD+Cs", "height": 2414089, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EU8Ct34qHoDypMj3LK5QiPzB8KsdMKMkNMp1GGnPv3jd Next: J2sRsKPtaTerd4ZZvJNfVWPAriNNofdiZyiokrs4mmY1 Diff:
OldNewDifferences
183183 let isSponsored = if ((pubKey != ""))
184184 then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0)
185185 else 0
186- let caller = if (if (if ((toBase58String(i.caller.bytes) == toString(this)))
187- then (size(i.payments) == 0)
188- else false)
186+ let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
189187 then (isSponsored > 0)
190188 else false)
191189 then toString(addressFromPublicKey(fromBase58String(pubKey)))
233231 func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
234232 then throw(maintenanceMSG)
235233 else {
236- let $t073057357 = getCaller(invoke, pubKey)
237- let caller = $t073057357._1
238- let isSponsored = $t073057357._2
234+ let $t072077259 = getCaller(invoke, pubKey)
235+ let caller = $t072077259._1
236+ let isSponsored = $t072077259._2
239237 let id = toBase58String(invoke.transactionId)
240238 let timestamp = lastBlock.timestamp
241239 if (!(validUserData(caller, name, description, thumb, false)))
261259 func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
262260 then throw(maintenanceMSG)
263261 else {
264- let $t088008904 = getCaller(invoke, pubKey)
265- let caller = $t088008904._1
266- let isSponsored = $t088008904._2
262+ let $t087028806 = getCaller(invoke, pubKey)
263+ let caller = $t087028806._1
264+ let isSponsored = $t087028806._2
267265 let status = getStringByKey(keyUserStatus(caller))
268266 if (!(validUserData(caller, name, description, thumb, true)))
269267 then throw("Something went wrong")
289287 func setERC20User (erc20,pubKey) = if (!(dappRunning))
290288 then throw(maintenanceMSG)
291289 else {
292- let $t01009110194 = getCaller(invoke, pubKey)
293- let caller = $t01009110194._1
294- let isSponsored = $t01009110194._2
290+ let $t0999310096 = getCaller(invoke, pubKey)
291+ let caller = $t0999310096._1
292+ let isSponsored = $t0999310096._2
295293 let status = getStringByKey(keyUserStatus(caller))
296294 if (if ((status != userRegistered))
297295 then (status != userVerified)
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 keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr)
7575
7676
7777 func keyAgentArtistAddr (agentAddr,artistAddr) = ((("agent_" + agentAddr) + "_") + artistAddr)
7878
7979
8080 func keyPrimaryShare (artistAddr) = ("artist_agent_primary_" + artistAddr)
8181
8282
8383 func keySecondaryShare (artistAddr) = ("artist_agent_secondary_" + artistAddr)
8484
8585
8686 func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0)
8787
8888
8989 func validateCID (cid) = if (contains(cid, "/"))
9090 then if (if ((76 > size(cid)))
9191 then (size(split(cid, "/")[0]) == 59)
9292 else false)
9393 then (16 > size(split(cid, "/")[1]))
9494 else false
9595 else false
9696
9797
9898 func validUserData (caller,name,description,thumb,isAnUpdate) = {
9999 let validCID = if ((size(thumb) != 0))
100100 then validateCID(thumb)
101101 else true
102102 if (!(validCID))
103103 then throw("CID don't match requirement!")
104104 else if (if ((name == ""))
105105 then true
106106 else (description == ""))
107107 then throw("Name and description cannot be empty")
108108 else if ((size(description) > 600))
109109 then throw("600 Char. max description")
110110 else if ((size(name) > 45))
111111 then throw("45 Char. max name")
112112 else {
113113 let status = getStringByKey(keyUserStatus(caller))
114114 if (if ((status == userSuspended))
115115 then true
116116 else (status == userRemoved))
117117 then throw("Account suspended/ removed.")
118118 else if (if (!(isAnUpdate))
119119 then (status == userRegistered)
120120 else false)
121121 then throw("Already registered")
122122 else if (if (if (!(isAnUpdate))
123123 then (status == "")
124124 else false)
125125 then whitelistedonly
126126 else false)
127127 then throw("Can't register, get approved first.")
128128 else if (if (if (isAnUpdate)
129129 then (status == "")
130130 else false)
131131 then true
132132 else if (isAnUpdate)
133133 then (status == userAllowed)
134134 else false)
135135 then throw("Register first")
136136 else true
137137 }
138138 }
139139
140140
141141 func validateNewStatus (status,address,currentStatus) = {
142142 let allStatus = [userVerified, userRegistered, userSuspended, userRemoved, userAllowed, userChangeRequired]
143143 let statusToSet = if (containsElement(allStatus, status))
144144 then status
145145 else if (if ((status == userReset))
146146 then (currentStatus == userAllowed)
147147 else false)
148148 then ""
149149 else throw("Unknown status")
150150 let userIsRegistered = getIntegerByKey(keyUserDate(address))
151151 if (if ((userIsRegistered == 0))
152152 then (statusToSet != userAllowed)
153153 else false)
154154 then throw("You cant set this status, user is not registered.")
155155 else if (if ((currentStatus == userAllowed))
156156 then (statusToSet == userAllowed)
157157 else false)
158158 then throw("User already allowed")
159159 else if (if ((currentStatus == userRegistered))
160160 then (statusToSet == userAllowed)
161161 else false)
162162 then throw("User already allowed & registered")
163163 else if (if ((currentStatus == userVerified))
164164 then (statusToSet == userAllowed)
165165 else false)
166166 then throw("User already allowed & verified")
167167 else statusToSet
168168 }
169169
170170
171171 func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
172172
173173
174174 func asString (bv) = match bv {
175175 case bv0: String =>
176176 bv0
177177 case _ =>
178178 throw("Sponsored Public Key String expected")
179179 }
180180
181181
182182 func getCaller (i,pubKey) = {
183183 let isSponsored = if ((pubKey != ""))
184184 then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0)
185185 else 0
186- let caller = if (if (if ((toBase58String(i.caller.bytes) == toString(this)))
187- then (size(i.payments) == 0)
188- else false)
186+ let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
189187 then (isSponsored > 0)
190188 else false)
191189 then toString(addressFromPublicKey(fromBase58String(pubKey)))
192190 else toBase58String(i.caller.bytes)
193191 let get_sponsored_waves = if ((pubKey != ""))
194192 then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
195193 else unit
196194 if ((get_sponsored_waves == get_sponsored_waves))
197195 then $Tuple2(caller, (isSponsored > 0))
198196 else throw("Strict value is not equal to itself.")
199197 }
200198
201199
202200 @Callable(invoke)
203201 func setConf (key,val) = {
204202 let caller = toString(invoke.caller)
205203 if (containsElement([chris, toString(this)], caller))
206204 then [StringEntry(key, val)]
207205 else throw("You are not allowed to change this")
208206 }
209207
210208
211209
212210 @Callable(invoke)
213211 func appRunning (isLive,message) = {
214212 let caller = toString(invoke.caller)
215213 if (containsElement([chris, toString(this)], caller))
216214 then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
217215 else throw("You are not allowed to change this")
218216 }
219217
220218
221219
222220 @Callable(invoke)
223221 func registrationMode (WLonly) = {
224222 let caller = toString(invoke.caller)
225223 if (containsElement([chris, toString(this)], caller))
226224 then [BooleanEntry(whitelistedonlyKey, WLonly)]
227225 else throw("You are not allowed to change this")
228226 }
229227
230228
231229
232230 @Callable(invoke)
233231 func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
234232 then throw(maintenanceMSG)
235233 else {
236- let $t073057357 = getCaller(invoke, pubKey)
237- let caller = $t073057357._1
238- let isSponsored = $t073057357._2
234+ let $t072077259 = getCaller(invoke, pubKey)
235+ let caller = $t072077259._1
236+ let isSponsored = $t072077259._2
239237 let id = toBase58String(invoke.transactionId)
240238 let timestamp = lastBlock.timestamp
241239 if (!(validUserData(caller, name, description, thumb, false)))
242240 then throw("Something went wrong")
243241 else {
244242 let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
245243 if (if ((0 > royalties))
246244 then true
247245 else (royalties > 1000))
248246 then throw("Royalties cannot be less than 0% or higher than 10%")
249247 else {
250248 let txToCaller = if (isSponsored)
251249 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
252250 else nil
253251 ([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)] ++ txToCaller)
254252 }
255253 }
256254 }
257255
258256
259257
260258 @Callable(invoke)
261259 func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
262260 then throw(maintenanceMSG)
263261 else {
264- let $t088008904 = getCaller(invoke, pubKey)
265- let caller = $t088008904._1
266- let isSponsored = $t088008904._2
262+ let $t087028806 = getCaller(invoke, pubKey)
263+ let caller = $t087028806._1
264+ let isSponsored = $t087028806._2
267265 let status = getStringByKey(keyUserStatus(caller))
268266 if (!(validUserData(caller, name, description, thumb, true)))
269267 then throw("Something went wrong")
270268 else {
271269 let date = getIntegerByKey(keyUserDate(caller))
272270 let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
273271 if (if ((0 > royalties))
274272 then true
275273 else (royalties > 1000))
276274 then throw("Royalties cannot be less than 0% or higher than 10%")
277275 else {
278276 let txToCaller = if (isSponsored)
279277 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
280278 else nil
281279 ([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)
282280 }
283281 }
284282 }
285283
286284
287285
288286 @Callable(invoke)
289287 func setERC20User (erc20,pubKey) = if (!(dappRunning))
290288 then throw(maintenanceMSG)
291289 else {
292- let $t01009110194 = getCaller(invoke, pubKey)
293- let caller = $t01009110194._1
294- let isSponsored = $t01009110194._2
290+ let $t0999310096 = getCaller(invoke, pubKey)
291+ let caller = $t0999310096._1
292+ let isSponsored = $t0999310096._2
295293 let status = getStringByKey(keyUserStatus(caller))
296294 if (if ((status != userRegistered))
297295 then (status != userVerified)
298296 else false)
299297 then throw("Not allowed to set ERC20 address")
300298 else {
301299 let firstTwo = take(erc20, 2)
302300 if (if ((firstTwo != "0x"))
303301 then true
304302 else (size(erc20) != 42))
305303 then throw("This is not an erc20 address")
306304 else {
307305 let txToCaller = if (isSponsored)
308306 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
309307 else nil
310308 ([StringEntry(keyUserERC20(caller), erc20)] ++ txToCaller)
311309 }
312310 }
313311 }
314312
315313
316314
317315 @Callable(invoke)
318316 func changeUserStatus (address,status,note) = {
319317 let caller = toString(invoke.caller)
320318 let currentStatus = getStringByKey(keyUserStatus(address))
321319 let statusToSet = validateNewStatus(status, address, currentStatus)
322320 let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
323321 let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
324322 let date = getIntegerByKey(keyUserDate(address))
325323 let json = makeJSON(name, thumb, toString(date))
326324 if (containsElement([chris, toString(this)], caller))
327325 then [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(("user_note_" + address), note)]
328326 else throw("Not allowed to change user status")
329327 }
330328
331329
332330
333331 @Callable(invoke)
334332 func deleteUser (address) = {
335333 let caller = toString(invoke.caller)
336334 let currentStatus = getStringByKey(keyUserStatus(address))
337335 if (containsElement([chris, toString(this)], caller))
338336 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)]
339337 else throw("Not allowed")
340338 }
341339
342340
343341
344342 @Callable(i)
345343 func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning))
346344 then throw(maintenanceMSG)
347345 else {
348346 let caller = toString(i.caller)
349347 if (containsElement([chris, toString(this)], caller))
350348 then if (if ((size(artistAddr) != 35))
351349 then true
352350 else (size(agentAddr) != 35))
353351 then throw("Wrong address")
354352 else [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)]
355353 else throw("You are not allowed")
356354 }
357355
358356
359357
360358 @Callable(i)
361359 func unsetAgent (artistAddr,agentAddr) = if (!(dappRunning))
362360 then throw(maintenanceMSG)
363361 else {
364362 let caller = toString(i.caller)
365363 if (containsElement([chris, toString(this)], caller))
366364 then if (if ((size(artistAddr) != 35))
367365 then true
368366 else (size(agentAddr) != 35))
369367 then throw("Wrong address")
370368 else [DeleteEntry(keyArtistAgentAddr(artistAddr)), DeleteEntry(keyAgentArtistAddr(agentAddr, artistAddr)), DeleteEntry(keyPrimaryShare(artistAddr)), DeleteEntry(keySecondaryShare(artistAddr))]
371369 else throw("You are not allowed")
372370 }
373371
374372
375373
376374 @Callable(i)
377375 func deleteEntry (entry) = {
378376 let caller = toString(i.caller)
379377 if ((caller == chris))
380378 then [DeleteEntry(entry)]
381379 else throw("no")
382380 }
383381
384382
385383 @Verifier(tx)
386384 func verifier () = match tx {
387385 case inv: InvokeScriptTransaction =>
388386 if (if (if (if ((inv.function == "registerUser"))
389387 then (inv.dApp == this)
390388 else false)
391389 then (inv.fee == 500000)
392390 else false)
393391 then (inv.feeAssetId == unit)
394392 else false)
395393 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
396394 else if (if (if (if ((inv.function == "updateUser"))
397395 then (inv.dApp == this)
398396 else false)
399397 then (inv.fee == 500000)
400398 else false)
401399 then (inv.feeAssetId == unit)
402400 else false)
403401 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
404402 else if (if (if (if ((inv.function == "setERC20User"))
405403 then (inv.dApp == this)
406404 else false)
407405 then (inv.fee == 500000)
408406 else false)
409407 then (inv.feeAssetId == unit)
410408 else false)
411409 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[2])))
412410 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
413411 case _ =>
414412 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
415413 }
416414

github/deemru/w8io/026f985 
47.51 ms