tx · 2JDTZvDqQHAfid7rfw6CL2yQgNsHJxabq3prHorYEW9m

3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj:  -0.01300000 Waves

2023.02.01 05:35 [2429951] smart account 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj > SELF 0.00000000 Waves

{ "type": 13, "id": "2JDTZvDqQHAfid7rfw6CL2yQgNsHJxabq3prHorYEW9m", "fee": 1300000, "feeAssetId": null, "timestamp": 1675218969300, "version": 2, "chainId": 84, "sender": "3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj", "senderPublicKey": "A2m227AHcq7gWfSU59Q3UJaqkEa7SccFYmJuWHbFrrKE", "proofs": [ "3rAG5F796KNfukJQeKeAhwof3B6cduFtjGmSC3tokvqznxNMMS69Kj6NHxCwwPQA3g3Wvp6WhGkHtbjE8VN1e3dm" ], "script": "base64:BgJRCAISBAoCCAgSBAoCBAgSAwoBBBIICgYICAgIAQgSCAoGCAgICAEIEgQKAggIEgoKCAgICAgBAQEBEgMKAQgSBgoECAgBARIECgIICBIDCgEIKwAHVkVSU0lPTgIDMS41AQ5nZXRTdHJpbmdCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMFA2tleQIAAQ9nZXRCb29sZWFuQnlLZXkBA2tleQkBC3ZhbHVlT3JFbHNlAgkAmwgCBQR0aGlzBQNrZXkHAQ9nZXRJbnRlZ2VyQnlLZXkBA2tleQkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQNrZXkAAAAFY2hyaXMJAQ5nZXRTdHJpbmdCeUtleQECDGNvbmZfYWRtaW5fMQAOZGFwcFJ1bm5pbmdLZXkCFGNvbmZfZGFwcF9pc19ydW5uaW5nABFtYWludGVuYW5jZU1TR0tleQIUY29uZl9tYWludGVuYW5jZV9tc2cAEndoaXRlbGlzdGVkb25seUtleQIVY29uZl93aGl0ZWxpc3RlZF9vbmx5AAtkYXBwUnVubmluZwkBC3ZhbHVlT3JFbHN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QAAAggFA2ludgRkQXBwBQR0aGlzBwkAAAIIBQNpbnYDZmVlAKDCHgcJAAACCAUDaW52CmZlZUFzc2V0SWQFBHVuaXQHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACQDZBAEJAQhhc1N0cmluZwEJAJEDAggFA2ludgRhcmdzAAIJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlo3OuV", "height": 2429951, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BqT1mMvxXNdNpjCsKqKENytH33fPqM7kRVNFYL4qWkoX Next: MQZ6iNnQrGPVjN63PmjDaVJncTAMd2jRrhnHh8ej5rh Diff:
OldNewDifferences
187187 }
188188
189189
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- }
190+func getCaller (i,pubKey) = if (true)
191+ then throw(("Pubkey: " + 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+ }
206208
207209
208210 @Callable(invoke)
239241 func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
240242 then throw(maintenanceMSG)
241243 else {
242- let $t074067458 = getCaller(invoke, pubKey)
243- let caller = $t074067458._1
244- let isSponsored = $t074067458._2
244+ let $t074547506 = getCaller(invoke, pubKey)
245+ let caller = $t074547506._1
246+ let isSponsored = $t074547506._2
245247 let id = toBase58String(invoke.transactionId)
246248 let timestamp = lastBlock.timestamp
247249 let note = getStringByKey(keyUserNote(caller))
269271 func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
270272 then throw(maintenanceMSG)
271273 else {
272- let $t091439247 = getCaller(invoke, pubKey)
273- let caller = $t091439247._1
274- let isSponsored = $t091439247._2
274+ let $t091919295 = getCaller(invoke, pubKey)
275+ let caller = $t091919295._1
276+ let isSponsored = $t091919295._2
275277 let status = getStringByKey(keyUserStatus(caller))
276278 if (!(validUserData(caller, name, description, thumb, true)))
277279 then throw("Something went wrong")
297299 func setERC20User (erc20,pubKey) = if (!(dappRunning))
298300 then throw(maintenanceMSG)
299301 else {
300- let $t01043410537 = getCaller(invoke, pubKey)
301- let caller = $t01043410537._1
302- let isSponsored = $t01043410537._2
302+ let $t01048210585 = getCaller(invoke, pubKey)
303+ let caller = $t01048210585._1
304+ let isSponsored = $t01048210585._2
303305 let status = getStringByKey(keyUserStatus(caller))
304306 if (if ((status != userRegistered))
305307 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) = {
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- }
190+func getCaller (i,pubKey) = if (true)
191+ then throw(("Pubkey: " + 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+ }
206208
207209
208210 @Callable(invoke)
209211 func setConf (key,val) = {
210212 let caller = toString(invoke.caller)
211213 if (containsElement([chris, toString(this)], caller))
212214 then [StringEntry(key, val)]
213215 else throw("You are not allowed to change this")
214216 }
215217
216218
217219
218220 @Callable(invoke)
219221 func appRunning (isLive,message) = {
220222 let caller = toString(invoke.caller)
221223 if (containsElement([chris, toString(this)], caller))
222224 then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
223225 else throw("You are not allowed to change this")
224226 }
225227
226228
227229
228230 @Callable(invoke)
229231 func registrationMode (WLonly) = {
230232 let caller = toString(invoke.caller)
231233 if (containsElement([chris, toString(this)], caller))
232234 then [BooleanEntry(whitelistedonlyKey, WLonly)]
233235 else throw("You are not allowed to change this")
234236 }
235237
236238
237239
238240 @Callable(invoke)
239241 func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
240242 then throw(maintenanceMSG)
241243 else {
242- let $t074067458 = getCaller(invoke, pubKey)
243- let caller = $t074067458._1
244- let isSponsored = $t074067458._2
244+ let $t074547506 = getCaller(invoke, pubKey)
245+ let caller = $t074547506._1
246+ let isSponsored = $t074547506._2
245247 let id = toBase58String(invoke.transactionId)
246248 let timestamp = lastBlock.timestamp
247249 let note = getStringByKey(keyUserNote(caller))
248250 let label = getStringByKey(keyUserLabel(caller))
249251 if (!(validUserData(caller, name, description, thumb, false)))
250252 then throw("Something went wrong")
251253 else {
252254 let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
253255 if (if ((0 > royalties))
254256 then true
255257 else (royalties > 1000))
256258 then throw("Royalties cannot be less than 0% or higher than 10%")
257259 else {
258260 let txToCaller = if (isSponsored)
259261 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
260262 else nil
261263 ([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)
262264 }
263265 }
264266 }
265267
266268
267269
268270 @Callable(invoke)
269271 func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
270272 then throw(maintenanceMSG)
271273 else {
272- let $t091439247 = getCaller(invoke, pubKey)
273- let caller = $t091439247._1
274- let isSponsored = $t091439247._2
274+ let $t091919295 = getCaller(invoke, pubKey)
275+ let caller = $t091919295._1
276+ let isSponsored = $t091919295._2
275277 let status = getStringByKey(keyUserStatus(caller))
276278 if (!(validUserData(caller, name, description, thumb, true)))
277279 then throw("Something went wrong")
278280 else {
279281 let date = getIntegerByKey(keyUserDate(caller))
280282 let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
281283 if (if ((0 > royalties))
282284 then true
283285 else (royalties > 1000))
284286 then throw("Royalties cannot be less than 0% or higher than 10%")
285287 else {
286288 let txToCaller = if (isSponsored)
287289 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
288290 else nil
289291 ([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)
290292 }
291293 }
292294 }
293295
294296
295297
296298 @Callable(invoke)
297299 func setERC20User (erc20,pubKey) = if (!(dappRunning))
298300 then throw(maintenanceMSG)
299301 else {
300- let $t01043410537 = getCaller(invoke, pubKey)
301- let caller = $t01043410537._1
302- let isSponsored = $t01043410537._2
302+ let $t01048210585 = getCaller(invoke, pubKey)
303+ let caller = $t01048210585._1
304+ let isSponsored = $t01048210585._2
303305 let status = getStringByKey(keyUserStatus(caller))
304306 if (if ((status != userRegistered))
305307 then (status != userVerified)
306308 else false)
307309 then throw("Not allowed to set ERC20 address")
308310 else {
309311 let firstTwo = take(erc20, 2)
310312 if (if ((firstTwo != "0x"))
311313 then true
312314 else (size(erc20) != 42))
313315 then throw("This is not an erc20 address")
314316 else {
315317 let txToCaller = if (isSponsored)
316318 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
317319 else nil
318320 ([StringEntry(keyUserERC20(caller), erc20)] ++ txToCaller)
319321 }
320322 }
321323 }
322324
323325
324326
325327 @Callable(invoke)
326328 func changeUserStatus (address,status,note,label,wl_certifications,wl_txs,wl_drops,wl_commissions) = {
327329 let caller = toString(invoke.caller)
328330 if ((size(address) == 0))
329331 then throw("Address cannot be empty")
330332 else {
331333 let currentNote = getStringByKey(keyUserNote(address))
332334 let currentLabel = getStringByKey(keyUserLabel(address))
333335 let noteToUse = if ((size(note) != 0))
334336 then note
335337 else currentNote
336338 let labelToUse = if ((size(label) != 0))
337339 then label
338340 else currentLabel
339341 if (containsElement([chris, toString(this)], caller))
340342 then {
341343 let free_certifications = if ((wl_certifications != 0))
342344 then invoke(signDapp, "whitelistFreeCertifications", [address, wl_certifications, true], nil)
343345 else nil
344346 if ((free_certifications == free_certifications))
345347 then {
346348 let free_txs = if ((wl_txs != 0))
347349 then invoke(whitelistDapp, "whitelistFreeTxs", [address, wl_txs, true], nil)
348350 else nil
349351 if ((free_txs == free_txs))
350352 then {
351353 let free_drops = if ((wl_drops != 0))
352354 then invoke(whitelistDapp, "whitelistFreeDrop", [address, wl_drops, true], nil)
353355 else nil
354356 if ((free_drops == free_drops))
355357 then {
356358 let free_commissions = if ((wl_commissions != 0))
357359 then invoke(whitelistDapp, "whitelist", [address, wl_commissions], nil)
358360 else nil
359361 if ((free_commissions == free_commissions))
360362 then {
361363 let currentStatus = getStringByKey(keyUserStatus(address))
362364 if ((size(status) == 0))
363365 then if ((currentStatus == ""))
364366 then throw("User have no status yet")
365367 else [StringEntry(keyUserNote(address), noteToUse), StringEntry(keyUserLabel(address), labelToUse)]
366368 else {
367369 let statusToSet = validateNewStatus(status, address, currentStatus)
368370 let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
369371 let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
370372 let date = getIntegerByKey(keyUserDate(address))
371373 let json = makeJSON(name, thumb, toString(date))
372374 [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(keyUserNote(address), noteToUse), StringEntry(keyUserLabel(address), labelToUse)]
373375 }
374376 }
375377 else throw("Strict value is not equal to itself.")
376378 }
377379 else throw("Strict value is not equal to itself.")
378380 }
379381 else throw("Strict value is not equal to itself.")
380382 }
381383 else throw("Strict value is not equal to itself.")
382384 }
383385 else throw("Not allowed to change user status")
384386 }
385387 }
386388
387389
388390
389391 @Callable(invoke)
390392 func deleteUser (address) = {
391393 let caller = toString(invoke.caller)
392394 let currentStatus = getStringByKey(keyUserStatus(address))
393395 if (containsElement([chris, toString(this)], caller))
394396 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)]
395397 else throw("Not allowed")
396398 }
397399
398400
399401
400402 @Callable(i)
401403 func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning))
402404 then throw(maintenanceMSG)
403405 else {
404406 let caller = toString(i.caller)
405407 if (containsElement([chris, toString(this)], caller))
406408 then if (if ((size(artistAddr) != 35))
407409 then true
408410 else (size(agentAddr) != 35))
409411 then throw("Wrong address")
410412 else [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)]
411413 else throw("You are not allowed")
412414 }
413415
414416
415417
416418 @Callable(i)
417419 func unsetAgent (artistAddr,agentAddr) = if (!(dappRunning))
418420 then throw(maintenanceMSG)
419421 else {
420422 let caller = toString(i.caller)
421423 if (containsElement([chris, toString(this)], caller))
422424 then if (if ((size(artistAddr) != 35))
423425 then true
424426 else (size(agentAddr) != 35))
425427 then throw("Wrong address")
426428 else [DeleteEntry(keyArtistAgentAddr(artistAddr)), DeleteEntry(keyAgentArtistAddr(agentAddr, artistAddr)), DeleteEntry(keyPrimaryShare(artistAddr)), DeleteEntry(keySecondaryShare(artistAddr))]
427429 else throw("You are not allowed")
428430 }
429431
430432
431433
432434 @Callable(i)
433435 func deleteEntry (entry) = {
434436 let caller = toString(i.caller)
435437 if ((caller == chris))
436438 then [DeleteEntry(entry)]
437439 else throw("no")
438440 }
439441
440442
441443 @Verifier(tx)
442444 func verifier () = match tx {
443445 case inv: InvokeScriptTransaction =>
444446 if (if (if (if ((inv.function == "registerUser"))
445447 then (inv.dApp == this)
446448 else false)
447449 then (inv.fee == 500000)
448450 else false)
449451 then (inv.feeAssetId == unit)
450452 else false)
451453 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
452454 else if (if (if (if ((inv.function == "updateUser"))
453455 then (inv.dApp == this)
454456 else false)
455457 then (inv.fee == 500000)
456458 else false)
457459 then (inv.feeAssetId == unit)
458460 else false)
459461 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
460462 else if (if (if (if ((inv.function == "setERC20User"))
461463 then (inv.dApp == this)
462464 else false)
463465 then (inv.fee == 500000)
464466 else false)
465467 then (inv.feeAssetId == unit)
466468 else false)
467469 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[2])))
468470 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
469471 case _ =>
470472 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
471473 }
472474

github/deemru/w8io/026f985 
142.48 ms