tx · 95cZ9HS3MyCatKeULv9dGckYC29t9Q3b6kAdnqkScGCt

3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj:  -0.01300000 Waves

2023.02.01 05:43 [2429959] smart account 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj > SELF 0.00000000 Waves

{ "type": 13, "id": "95cZ9HS3MyCatKeULv9dGckYC29t9Q3b6kAdnqkScGCt", "fee": 1300000, "feeAssetId": null, "timestamp": 1675219435282, "version": 2, "chainId": 84, "sender": "3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj", "senderPublicKey": "A2m227AHcq7gWfSU59Q3UJaqkEa7SccFYmJuWHbFrrKE", "proofs": [ "4dQBM6zNDxjSr6rtfm6GuDYXVmz2E7d8i6N6whM2mJVt7HRcbVyRJLKVC3abfYA9XHoFLhdedkGsiGtQ95dofZYn" ], "script": "base64:BgJRCAISBAoCCAgSBAoCBAgSAwoBBBIICgYICAgIAQgSCAoGCAgICAEIEgQKAggIEgoKCAgICAgBAQEBEgMKAQgSBgoECAgBARIECgIICBIDCgEIKwAHVkVSU0lPTgIDMS41AQ5nZXRTdHJpbmdCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMFA2tleQIAAQ9nZXRCb29sZWFuQnlLZXkBA2tleQkBC3ZhbHVlT3JFbHNlAgkAmwgCBQR0aGlzBQNrZXkHAQ9nZXRJbnRlZ2VyQnlLZXkBA2tleQkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQNrZXkAAAAFY2hyaXMJAQ5nZXRTdHJpbmdCeUtleQECDGNvbmZfYWRtaW5fMQAOZGFwcFJ1bm5pbmdLZXkCFGNvbmZfZGFwcF9pc19ydW5uaW5nABFtYWludGVuYW5jZU1TR0tleQIUY29uZl9tYWludGVuYW5jZV9tc2cAEndoaXRlbGlzdGVkb25seUtleQIVY29uZl93aGl0ZWxpc3RlZF9vbmx5AAtkYXBwUnVubmluZwkBC3ZhbHVlT3JFb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ml0BwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAkA2QQBCQEIYXNTdHJpbmcBCQCRAwIIBQNpbnYEYXJncwACCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5CQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5AhrIDg==", "height": 2429959, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: MQZ6iNnQrGPVjN63PmjDaVJncTAMd2jRrhnHh8ej5rh Next: qpa6Z1fZL6AfRGDrVtccBhFGKXEFqAeqbe9YxAg5j1g Diff:
OldNewDifferences
187187 }
188188
189189
190-func getCaller (i,pubKey) = if (true)
191- then throw(((("Pubkey: " + pubKey) + " Address from pubkey: ") + toString(addressFromPublicKey(fromBase58String(pubKey)))))
192- else {
193- let isSponsored = if ((pubKey != ""))
194- then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0)
195- else 0
196- let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
197- then (isSponsored > 0)
198- else false)
199- then toString(addressFromPublicKey(fromBase58String(pubKey)))
200- else toBase58String(i.caller.bytes)
201- let get_sponsored_waves = if ((pubKey != ""))
202- then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
203- else unit
204- if ((get_sponsored_waves == get_sponsored_waves))
205- then $Tuple2(caller, (isSponsored > 0))
206- else throw("Strict value is not equal to itself.")
207- }
190+func getCaller (i,pubKey) = {
191+ let isSponsored = if ((pubKey != ""))
192+ then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0)
193+ else 0
194+ let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
195+ then (isSponsored > 0)
196+ else false)
197+ then toString(addressFromPublicKey(fromBase58String(pubKey)))
198+ else toBase58String(i.caller.bytes)
199+ let get_sponsored_waves = if ((pubKey != ""))
200+ then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
201+ else unit
202+ if ((get_sponsored_waves == get_sponsored_waves))
203+ then $Tuple2(caller, (isSponsored > 0))
204+ else throw("Strict value is not equal to itself.")
205+ }
208206
209207
210208 @Callable(invoke)
241239 func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
242240 then throw(maintenanceMSG)
243241 else {
244- let $t075377589 = getCaller(invoke, pubKey)
245- let caller = $t075377589._1
246- let isSponsored = $t075377589._2
242+ let $t074067458 = getCaller(invoke, pubKey)
243+ let caller = $t074067458._1
244+ let isSponsored = $t074067458._2
247245 let id = toBase58String(invoke.transactionId)
248246 let timestamp = lastBlock.timestamp
249247 let note = getStringByKey(keyUserNote(caller))
271269 func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
272270 then throw(maintenanceMSG)
273271 else {
274- let $t092749378 = getCaller(invoke, pubKey)
275- let caller = $t092749378._1
276- let isSponsored = $t092749378._2
272+ let $t091439247 = getCaller(invoke, pubKey)
273+ let caller = $t091439247._1
274+ let isSponsored = $t091439247._2
277275 let status = getStringByKey(keyUserStatus(caller))
278276 if (!(validUserData(caller, name, description, thumb, true)))
279277 then throw("Something went wrong")
299297 func setERC20User (erc20,pubKey) = if (!(dappRunning))
300298 then throw(maintenanceMSG)
301299 else {
302- let $t01056510668 = getCaller(invoke, pubKey)
303- let caller = $t01056510668._1
304- let isSponsored = $t01056510668._2
300+ let $t01043410537 = getCaller(invoke, pubKey)
301+ let caller = $t01043410537._1
302+ let isSponsored = $t01043410537._2
305303 let status = getStringByKey(keyUserStatus(caller))
306304 if (if ((status != userRegistered))
307305 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 signDapp = value(addressFromString(getStringByKey("conf_signweb_dapp")))
3232
3333 let userAllowed = "ALLOWED"
3434
3535 let userRegistered = "REGISTERED"
3636
3737 let userVerified = "VERIFIED"
3838
3939 let userSuspended = "SUSPENDED"
4040
4141 let userRemoved = "REMOVED"
4242
4343 let userChangeRequired = "CHANGE_REQUIRED"
4444
4545 let userUnregistered = "UNREGISTERED"
4646
4747 let userReset = "RESET"
4848
4949 func keyUserAddr (caller) = ("user_" + caller)
5050
5151
5252 func keyUserName (caller) = ("user_name_" + caller)
5353
5454
5555 func keyUserDesc (caller) = ("user_desc_" + caller)
5656
5757
5858 func keyUserSocial (caller) = ("user_social_" + caller)
5959
6060
6161 func keyUserThumb (caller) = ("user_thumb_" + caller)
6262
6363
6464 func keyUserStatus (caller) = ("user_status_" + caller)
6565
6666
6767 func keyUserRoyalties (caller) = ("user_royalties_" + caller)
6868
6969
7070 func keyUserDate (caller) = ("user_date_" + caller)
7171
7272
7373 func keyUserERC20 (caller) = ("user_ERC20_" + caller)
7474
7575
7676 func keyUserNote (caller) = ("user_note_" + caller)
7777
7878
7979 func keyUserLabel (caller) = ("user_label_" + caller)
8080
8181
8282 func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr)
8383
8484
8585 func keyAgentArtistAddr (agentAddr,artistAddr) = ((("agent_" + agentAddr) + "_") + artistAddr)
8686
8787
8888 func keyPrimaryShare (artistAddr) = ("artist_agent_primary_" + artistAddr)
8989
9090
9191 func keySecondaryShare (artistAddr) = ("artist_agent_secondary_" + artistAddr)
9292
9393
9494 func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0)
9595
9696
9797 func validateCID (cid) = if (contains(cid, "/"))
9898 then if (if ((76 > size(cid)))
9999 then (size(split(cid, "/")[0]) == 59)
100100 else false)
101101 then (16 > size(split(cid, "/")[1]))
102102 else false
103103 else false
104104
105105
106106 func validUserData (caller,name,description,thumb,isAnUpdate) = {
107107 let validCID = if ((size(thumb) != 0))
108108 then validateCID(thumb)
109109 else true
110110 if (!(validCID))
111111 then throw("CID don't match requirement!")
112112 else if (if ((name == ""))
113113 then true
114114 else (description == ""))
115115 then throw("Name and description cannot be empty")
116116 else if ((size(description) > 600))
117117 then throw("600 Char. max description")
118118 else if ((size(name) > 45))
119119 then throw("45 Char. max name")
120120 else {
121121 let status = getStringByKey(keyUserStatus(caller))
122122 if (if ((status == userSuspended))
123123 then true
124124 else (status == userRemoved))
125125 then throw("Account suspended/ removed.")
126126 else if (if (!(isAnUpdate))
127127 then (status == userRegistered)
128128 else false)
129129 then throw("Already registered")
130130 else if (if (if (!(isAnUpdate))
131131 then (status == "")
132132 else false)
133133 then whitelistedonly
134134 else false)
135135 then throw("Can't register, get approved first.")
136136 else if (if (if (isAnUpdate)
137137 then (status == "")
138138 else false)
139139 then true
140140 else if (isAnUpdate)
141141 then (status == userAllowed)
142142 else false)
143143 then throw("Register first")
144144 else true
145145 }
146146 }
147147
148148
149149 func validateNewStatus (status,address,currentStatus) = {
150150 let allStatus = [userVerified, userRegistered, userSuspended, userRemoved, userAllowed, userChangeRequired]
151151 let statusToSet = if (containsElement(allStatus, status))
152152 then status
153153 else if (if ((status == userReset))
154154 then (currentStatus == userAllowed)
155155 else false)
156156 then ""
157157 else throw("Unknown status")
158158 let userIsRegistered = getIntegerByKey(keyUserDate(address))
159159 if (if ((userIsRegistered == 0))
160160 then (statusToSet != userAllowed)
161161 else false)
162162 then throw("You cant set this status, user is not registered.")
163163 else if (if ((currentStatus == userAllowed))
164164 then (statusToSet == userAllowed)
165165 else false)
166166 then throw("User already allowed")
167167 else if (if ((currentStatus == userRegistered))
168168 then (statusToSet == userAllowed)
169169 else false)
170170 then throw("User already allowed & registered")
171171 else if (if ((currentStatus == userVerified))
172172 then (statusToSet == userAllowed)
173173 else false)
174174 then throw("User already allowed & verified")
175175 else statusToSet
176176 }
177177
178178
179179 func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
180180
181181
182182 func asString (bv) = match bv {
183183 case bv0: String =>
184184 bv0
185185 case _ =>
186186 throw("Sponsored Public Key String expected")
187187 }
188188
189189
190-func getCaller (i,pubKey) = if (true)
191- then throw(((("Pubkey: " + pubKey) + " Address from pubkey: ") + toString(addressFromPublicKey(fromBase58String(pubKey)))))
192- else {
193- let isSponsored = if ((pubKey != ""))
194- then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0)
195- else 0
196- let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
197- then (isSponsored > 0)
198- else false)
199- then toString(addressFromPublicKey(fromBase58String(pubKey)))
200- else toBase58String(i.caller.bytes)
201- let get_sponsored_waves = if ((pubKey != ""))
202- then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
203- else unit
204- if ((get_sponsored_waves == get_sponsored_waves))
205- then $Tuple2(caller, (isSponsored > 0))
206- else throw("Strict value is not equal to itself.")
207- }
190+func getCaller (i,pubKey) = {
191+ let isSponsored = if ((pubKey != ""))
192+ then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0)
193+ else 0
194+ let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
195+ then (isSponsored > 0)
196+ else false)
197+ then toString(addressFromPublicKey(fromBase58String(pubKey)))
198+ else toBase58String(i.caller.bytes)
199+ let get_sponsored_waves = if ((pubKey != ""))
200+ then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
201+ else unit
202+ if ((get_sponsored_waves == get_sponsored_waves))
203+ then $Tuple2(caller, (isSponsored > 0))
204+ else throw("Strict value is not equal to itself.")
205+ }
208206
209207
210208 @Callable(invoke)
211209 func setConf (key,val) = {
212210 let caller = toString(invoke.caller)
213211 if (containsElement([chris, toString(this)], caller))
214212 then [StringEntry(key, val)]
215213 else throw("You are not allowed to change this")
216214 }
217215
218216
219217
220218 @Callable(invoke)
221219 func appRunning (isLive,message) = {
222220 let caller = toString(invoke.caller)
223221 if (containsElement([chris, toString(this)], caller))
224222 then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
225223 else throw("You are not allowed to change this")
226224 }
227225
228226
229227
230228 @Callable(invoke)
231229 func registrationMode (WLonly) = {
232230 let caller = toString(invoke.caller)
233231 if (containsElement([chris, toString(this)], caller))
234232 then [BooleanEntry(whitelistedonlyKey, WLonly)]
235233 else throw("You are not allowed to change this")
236234 }
237235
238236
239237
240238 @Callable(invoke)
241239 func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
242240 then throw(maintenanceMSG)
243241 else {
244- let $t075377589 = getCaller(invoke, pubKey)
245- let caller = $t075377589._1
246- let isSponsored = $t075377589._2
242+ let $t074067458 = getCaller(invoke, pubKey)
243+ let caller = $t074067458._1
244+ let isSponsored = $t074067458._2
247245 let id = toBase58String(invoke.transactionId)
248246 let timestamp = lastBlock.timestamp
249247 let note = getStringByKey(keyUserNote(caller))
250248 let label = getStringByKey(keyUserLabel(caller))
251249 if (!(validUserData(caller, name, description, thumb, false)))
252250 then throw("Something went wrong")
253251 else {
254252 let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
255253 if (if ((0 > royalties))
256254 then true
257255 else (royalties > 1000))
258256 then throw("Royalties cannot be less than 0% or higher than 10%")
259257 else {
260258 let txToCaller = if (isSponsored)
261259 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
262260 else nil
263261 ([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)
264262 }
265263 }
266264 }
267265
268266
269267
270268 @Callable(invoke)
271269 func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
272270 then throw(maintenanceMSG)
273271 else {
274- let $t092749378 = getCaller(invoke, pubKey)
275- let caller = $t092749378._1
276- let isSponsored = $t092749378._2
272+ let $t091439247 = getCaller(invoke, pubKey)
273+ let caller = $t091439247._1
274+ let isSponsored = $t091439247._2
277275 let status = getStringByKey(keyUserStatus(caller))
278276 if (!(validUserData(caller, name, description, thumb, true)))
279277 then throw("Something went wrong")
280278 else {
281279 let date = getIntegerByKey(keyUserDate(caller))
282280 let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
283281 if (if ((0 > royalties))
284282 then true
285283 else (royalties > 1000))
286284 then throw("Royalties cannot be less than 0% or higher than 10%")
287285 else {
288286 let txToCaller = if (isSponsored)
289287 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
290288 else nil
291289 ([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)
292290 }
293291 }
294292 }
295293
296294
297295
298296 @Callable(invoke)
299297 func setERC20User (erc20,pubKey) = if (!(dappRunning))
300298 then throw(maintenanceMSG)
301299 else {
302- let $t01056510668 = getCaller(invoke, pubKey)
303- let caller = $t01056510668._1
304- let isSponsored = $t01056510668._2
300+ let $t01043410537 = getCaller(invoke, pubKey)
301+ let caller = $t01043410537._1
302+ let isSponsored = $t01043410537._2
305303 let status = getStringByKey(keyUserStatus(caller))
306304 if (if ((status != userRegistered))
307305 then (status != userVerified)
308306 else false)
309307 then throw("Not allowed to set ERC20 address")
310308 else {
311309 let firstTwo = take(erc20, 2)
312310 if (if ((firstTwo != "0x"))
313311 then true
314312 else (size(erc20) != 42))
315313 then throw("This is not an erc20 address")
316314 else {
317315 let txToCaller = if (isSponsored)
318316 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
319317 else nil
320318 ([StringEntry(keyUserERC20(caller), erc20)] ++ txToCaller)
321319 }
322320 }
323321 }
324322
325323
326324
327325 @Callable(invoke)
328326 func changeUserStatus (address,status,note,label,wl_certifications,wl_txs,wl_drops,wl_commissions) = {
329327 let caller = toString(invoke.caller)
330328 if ((size(address) == 0))
331329 then throw("Address cannot be empty")
332330 else {
333331 let currentNote = getStringByKey(keyUserNote(address))
334332 let currentLabel = getStringByKey(keyUserLabel(address))
335333 let noteToUse = if ((size(note) != 0))
336334 then note
337335 else currentNote
338336 let labelToUse = if ((size(label) != 0))
339337 then label
340338 else currentLabel
341339 if (containsElement([chris, toString(this)], caller))
342340 then {
343341 let free_certifications = if ((wl_certifications != 0))
344342 then invoke(signDapp, "whitelistFreeCertifications", [address, wl_certifications, true], nil)
345343 else nil
346344 if ((free_certifications == free_certifications))
347345 then {
348346 let free_txs = if ((wl_txs != 0))
349347 then invoke(whitelistDapp, "whitelistFreeTxs", [address, wl_txs, true], nil)
350348 else nil
351349 if ((free_txs == free_txs))
352350 then {
353351 let free_drops = if ((wl_drops != 0))
354352 then invoke(whitelistDapp, "whitelistFreeDrop", [address, wl_drops, true], nil)
355353 else nil
356354 if ((free_drops == free_drops))
357355 then {
358356 let free_commissions = if ((wl_commissions != 0))
359357 then invoke(whitelistDapp, "whitelist", [address, wl_commissions], nil)
360358 else nil
361359 if ((free_commissions == free_commissions))
362360 then {
363361 let currentStatus = getStringByKey(keyUserStatus(address))
364362 if ((size(status) == 0))
365363 then if ((currentStatus == ""))
366364 then throw("User have no status yet")
367365 else [StringEntry(keyUserNote(address), noteToUse), StringEntry(keyUserLabel(address), labelToUse)]
368366 else {
369367 let statusToSet = validateNewStatus(status, address, currentStatus)
370368 let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
371369 let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
372370 let date = getIntegerByKey(keyUserDate(address))
373371 let json = makeJSON(name, thumb, toString(date))
374372 [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(keyUserNote(address), noteToUse), StringEntry(keyUserLabel(address), labelToUse)]
375373 }
376374 }
377375 else throw("Strict value is not equal to itself.")
378376 }
379377 else throw("Strict value is not equal to itself.")
380378 }
381379 else throw("Strict value is not equal to itself.")
382380 }
383381 else throw("Strict value is not equal to itself.")
384382 }
385383 else throw("Not allowed to change user status")
386384 }
387385 }
388386
389387
390388
391389 @Callable(invoke)
392390 func deleteUser (address) = {
393391 let caller = toString(invoke.caller)
394392 let currentStatus = getStringByKey(keyUserStatus(address))
395393 if (containsElement([chris, toString(this)], caller))
396394 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)]
397395 else throw("Not allowed")
398396 }
399397
400398
401399
402400 @Callable(i)
403401 func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning))
404402 then throw(maintenanceMSG)
405403 else {
406404 let caller = toString(i.caller)
407405 if (containsElement([chris, toString(this)], caller))
408406 then if (if ((size(artistAddr) != 35))
409407 then true
410408 else (size(agentAddr) != 35))
411409 then throw("Wrong address")
412410 else [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)]
413411 else throw("You are not allowed")
414412 }
415413
416414
417415
418416 @Callable(i)
419417 func unsetAgent (artistAddr,agentAddr) = if (!(dappRunning))
420418 then throw(maintenanceMSG)
421419 else {
422420 let caller = toString(i.caller)
423421 if (containsElement([chris, toString(this)], caller))
424422 then if (if ((size(artistAddr) != 35))
425423 then true
426424 else (size(agentAddr) != 35))
427425 then throw("Wrong address")
428426 else [DeleteEntry(keyArtistAgentAddr(artistAddr)), DeleteEntry(keyAgentArtistAddr(agentAddr, artistAddr)), DeleteEntry(keyPrimaryShare(artistAddr)), DeleteEntry(keySecondaryShare(artistAddr))]
429427 else throw("You are not allowed")
430428 }
431429
432430
433431
434432 @Callable(i)
435433 func deleteEntry (entry) = {
436434 let caller = toString(i.caller)
437435 if ((caller == chris))
438436 then [DeleteEntry(entry)]
439437 else throw("no")
440438 }
441439
442440
443441 @Verifier(tx)
444442 func verifier () = match tx {
445443 case inv: InvokeScriptTransaction =>
446444 if (if (if (if ((inv.function == "registerUser"))
447445 then (inv.dApp == this)
448446 else false)
449447 then (inv.fee == 500000)
450448 else false)
451449 then (inv.feeAssetId == unit)
452450 else false)
453451 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
454452 else if (if (if (if ((inv.function == "updateUser"))
455453 then (inv.dApp == this)
456454 else false)
457455 then (inv.fee == 500000)
458456 else false)
459457 then (inv.feeAssetId == unit)
460458 else false)
461459 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
462460 else if (if (if (if ((inv.function == "setERC20User"))
463461 then (inv.dApp == this)
464462 else false)
465463 then (inv.fee == 500000)
466464 else false)
467465 then (inv.feeAssetId == unit)
468466 else false)
469467 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[2])))
470468 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
471469 case _ =>
472470 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
473471 }
474472

github/deemru/w8io/026f985 
89.67 ms