tx · HUBnemqiBAEuFsRwe4GNxdgjSSXdW3LnFEjb1up741yK

3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj:  -0.01300000 Waves

2023.01.28 07:24 [2424334] smart account 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj > SELF 0.00000000 Waves

{ "type": 13, "id": "HUBnemqiBAEuFsRwe4GNxdgjSSXdW3LnFEjb1up741yK", "fee": 1300000, "feeAssetId": null, "timestamp": 1674879880502, "version": 2, "chainId": 84, "sender": "3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj", "senderPublicKey": "A2m227AHcq7gWfSU59Q3UJaqkEa7SccFYmJuWHbFrrKE", "proofs": [ "xnNF2E7pzg2JvvZXKHz25TXRZbRHDSwPtHNitjqQVbP3aNiQNjqbMGAx9sh1zS8rJ33vreNax9ZZbad2Ldb5i8r" ], "script": "base64:BgJQCAISBAoCCAgSBAoCBAgSAwoBBBIICgYICAgIAQgSCAoGCAgICAEIEgQKAggIEgkKBwgICAgBAQESAwoBCBIGCgQICAEBEgQKAggIEgMKAQgrAAdWRVJTSU9OAgMxLjUBDmdldFN0cmluZ0J5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgABD2dldEJvb2xlYW5CeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCbCAIFBHRoaXMFA2tleQcBD2dldEludGVnZXJCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFA2tleQAAAAVjaHJpcwkBDmdldFN0cmluZ0J5S2V5AQIMY29uZl9hZG1pbl8xAA5kYXBwUnVubmluZ0tleQIUY29uZl9kYXBwX2lzX3J1bm5pbmcAEW1haW50ZW5hbmNlTVNHS2V5AhRjb25mX21haW50ZW5hbmNlX21zZwASd2hpdGVsaXN0ZWRvbmx5S2V5AhVjb25mX3doaXRlbGlzdGVkX29ubHkAC2RhcHBSdW5uaW5nCQELdmFsdWVPckVsc2UCCQCbCAI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UCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tlecxOjA0=", "height": 2424334, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9k4EuFxvBSvXY4PAitq9h8L8TQAv67BRyCqttdd2SL4R Next: 6Cmwdk9yHVTM44W42ZThcWCs9NWpGgHqPJ3WewfqK6AA Diff:
OldNewDifferences
2727 let whitelistedonly = valueOrElse(getBoolean(this, whitelistedonlyKey), true)
2828
2929 let whitelistDapp = value(addressFromString(getStringByKey("conf_whitelist_dapp")))
30+
31+let signDapp = value(addressFromString(getStringByKey("conf_signweb_dapp")))
3032
3133 let userAllowed = "ALLOWED"
3234
237239 func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
238240 then throw(maintenanceMSG)
239241 else {
240- let $t073197371 = getCaller(invoke, pubKey)
241- let caller = $t073197371._1
242- let isSponsored = $t073197371._2
242+ let $t073967448 = getCaller(invoke, pubKey)
243+ let caller = $t073967448._1
244+ let isSponsored = $t073967448._2
243245 let id = toBase58String(invoke.transactionId)
244246 let timestamp = lastBlock.timestamp
245247 let note = getStringByKey(keyUserNote(caller))
267269 func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
268270 then throw(maintenanceMSG)
269271 else {
270- let $t090179121 = getCaller(invoke, pubKey)
271- let caller = $t090179121._1
272- let isSponsored = $t090179121._2
272+ let $t090949198 = getCaller(invoke, pubKey)
273+ let caller = $t090949198._1
274+ let isSponsored = $t090949198._2
273275 let status = getStringByKey(keyUserStatus(caller))
274276 if (!(validUserData(caller, name, description, thumb, true)))
275277 then throw("Something went wrong")
295297 func setERC20User (erc20,pubKey) = if (!(dappRunning))
296298 then throw(maintenanceMSG)
297299 else {
298- let $t01030810411 = getCaller(invoke, pubKey)
299- let caller = $t01030810411._1
300- let isSponsored = $t01030810411._2
300+ let $t01038510488 = getCaller(invoke, pubKey)
301+ let caller = $t01038510488._1
302+ let isSponsored = $t01038510488._2
301303 let status = getStringByKey(keyUserStatus(caller))
302304 if (if ((status != userRegistered))
303305 then (status != userVerified)
321323
322324
323325 @Callable(invoke)
324-func changeUserStatus (address,status,note,label) = {
326+func changeUserStatus (address,status,note,label,wl_certifications,wl_txs,wl_drops) = {
325327 let caller = toString(invoke.caller)
326328 if ((size(address) == 0))
327329 then throw("Address cannot be empty")
335337 then label
336338 else currentLabel
337339 if (containsElement([chris, toString(this)], caller))
338- then if ((size(status) == 0))
339- then {
340- let currentStatus = getStringByKey(keyUserStatus(address))
341- if ((currentStatus == ""))
342- then throw("User have no status yet")
343- else [StringEntry(keyUserNote(address), noteToUse), StringEntry(keyUserLabel(address), labelToUse)]
344- }
345- else {
346- let currentStatus = getStringByKey(keyUserStatus(address))
347- let statusToSet = validateNewStatus(status, address, currentStatus)
348- let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
349- let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
350- let date = getIntegerByKey(keyUserDate(address))
351- let json = makeJSON(name, thumb, toString(date))
340+ then {
341+ let free_certifications = if ((wl_certifications != 0))
342+ then invoke(signDapp, "whitelistFreeCertifications", [address, wl_certifications, true], nil)
343+ else nil
344+ if ((free_certifications == free_certifications))
345+ then {
346+ let free_txs = if ((wl_txs != 0))
347+ then invoke(whitelistDapp, "whitelistFreeTxs", [address, wl_txs, true], nil)
348+ else nil
349+ if ((free_txs == free_txs))
350+ then {
351+ let free_drops = if ((wl_drops != 0))
352+ then invoke(whitelistDapp, "whitelistFreeDrop", [address, wl_drops, true], nil)
353+ else nil
354+ if ((free_drops == free_drops))
355+ then if ((size(status) == 0))
356+ then {
357+ let currentStatus = getStringByKey(keyUserStatus(address))
358+ if ((currentStatus == ""))
359+ then throw("User have no status yet")
360+ else [StringEntry(keyUserNote(address), noteToUse), StringEntry(keyUserLabel(address), labelToUse)]
361+ }
362+ else {
363+ let currentStatus = getStringByKey(keyUserStatus(address))
364+ let statusToSet = validateNewStatus(status, address, currentStatus)
365+ let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
366+ let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
367+ let date = getIntegerByKey(keyUserDate(address))
368+ let json = makeJSON(name, thumb, toString(date))
352369 [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(keyUserNote(address), noteToUse), StringEntry(keyUserLabel(address), labelToUse)]
353- }
370+ }
371+ else throw("Strict value is not equal to itself.")
372+ }
373+ else throw("Strict value is not equal to itself.")
374+ }
375+ else throw("Strict value is not equal to itself.")
376+ }
354377 else throw("Not allowed to change user status")
355378 }
356379 }
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")))
30+
31+let signDapp = value(addressFromString(getStringByKey("conf_signweb_dapp")))
3032
3133 let userAllowed = "ALLOWED"
3234
3335 let userRegistered = "REGISTERED"
3436
3537 let userVerified = "VERIFIED"
3638
3739 let userSuspended = "SUSPENDED"
3840
3941 let userRemoved = "REMOVED"
4042
4143 let userChangeRequired = "CHANGE_REQUIRED"
4244
4345 let userUnregistered = "UNREGISTERED"
4446
4547 let userReset = "RESET"
4648
4749 func keyUserAddr (caller) = ("user_" + caller)
4850
4951
5052 func keyUserName (caller) = ("user_name_" + caller)
5153
5254
5355 func keyUserDesc (caller) = ("user_desc_" + caller)
5456
5557
5658 func keyUserSocial (caller) = ("user_social_" + caller)
5759
5860
5961 func keyUserThumb (caller) = ("user_thumb_" + caller)
6062
6163
6264 func keyUserStatus (caller) = ("user_status_" + caller)
6365
6466
6567 func keyUserRoyalties (caller) = ("user_royalties_" + caller)
6668
6769
6870 func keyUserDate (caller) = ("user_date_" + caller)
6971
7072
7173 func keyUserERC20 (caller) = ("user_ERC20_" + caller)
7274
7375
7476 func keyUserNote (caller) = ("user_note_" + caller)
7577
7678
7779 func keyUserLabel (caller) = ("user_label_" + caller)
7880
7981
8082 func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr)
8183
8284
8385 func keyAgentArtistAddr (agentAddr,artistAddr) = ((("agent_" + agentAddr) + "_") + artistAddr)
8486
8587
8688 func keyPrimaryShare (artistAddr) = ("artist_agent_primary_" + artistAddr)
8789
8890
8991 func keySecondaryShare (artistAddr) = ("artist_agent_secondary_" + artistAddr)
9092
9193
9294 func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0)
9395
9496
9597 func validateCID (cid) = if (contains(cid, "/"))
9698 then if (if ((76 > size(cid)))
9799 then (size(split(cid, "/")[0]) == 59)
98100 else false)
99101 then (16 > size(split(cid, "/")[1]))
100102 else false
101103 else false
102104
103105
104106 func validUserData (caller,name,description,thumb,isAnUpdate) = {
105107 let validCID = if ((size(thumb) != 0))
106108 then validateCID(thumb)
107109 else true
108110 if (!(validCID))
109111 then throw("CID don't match requirement!")
110112 else if (if ((name == ""))
111113 then true
112114 else (description == ""))
113115 then throw("Name and description cannot be empty")
114116 else if ((size(description) > 600))
115117 then throw("600 Char. max description")
116118 else if ((size(name) > 45))
117119 then throw("45 Char. max name")
118120 else {
119121 let status = getStringByKey(keyUserStatus(caller))
120122 if (if ((status == userSuspended))
121123 then true
122124 else (status == userRemoved))
123125 then throw("Account suspended/ removed.")
124126 else if (if (!(isAnUpdate))
125127 then (status == userRegistered)
126128 else false)
127129 then throw("Already registered")
128130 else if (if (if (!(isAnUpdate))
129131 then (status == "")
130132 else false)
131133 then whitelistedonly
132134 else false)
133135 then throw("Can't register, get approved first.")
134136 else if (if (if (isAnUpdate)
135137 then (status == "")
136138 else false)
137139 then true
138140 else if (isAnUpdate)
139141 then (status == userAllowed)
140142 else false)
141143 then throw("Register first")
142144 else true
143145 }
144146 }
145147
146148
147149 func validateNewStatus (status,address,currentStatus) = {
148150 let allStatus = [userVerified, userRegistered, userSuspended, userRemoved, userAllowed, userChangeRequired]
149151 let statusToSet = if (containsElement(allStatus, status))
150152 then status
151153 else if (if ((status == userReset))
152154 then (currentStatus == userAllowed)
153155 else false)
154156 then ""
155157 else throw("Unknown status")
156158 let userIsRegistered = getIntegerByKey(keyUserDate(address))
157159 if (if ((userIsRegistered == 0))
158160 then (statusToSet != userAllowed)
159161 else false)
160162 then throw("You cant set this status, user is not registered.")
161163 else if (if ((currentStatus == userAllowed))
162164 then (statusToSet == userAllowed)
163165 else false)
164166 then throw("User already allowed")
165167 else if (if ((currentStatus == userRegistered))
166168 then (statusToSet == userAllowed)
167169 else false)
168170 then throw("User already allowed & registered")
169171 else if (if ((currentStatus == userVerified))
170172 then (statusToSet == userAllowed)
171173 else false)
172174 then throw("User already allowed & verified")
173175 else statusToSet
174176 }
175177
176178
177179 func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
178180
179181
180182 func asString (bv) = match bv {
181183 case bv0: String =>
182184 bv0
183185 case _ =>
184186 throw("Sponsored Public Key String expected")
185187 }
186188
187189
188190 func getCaller (i,pubKey) = {
189191 let isSponsored = if ((pubKey != ""))
190192 then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0)
191193 else 0
192194 let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
193195 then (isSponsored > 0)
194196 else false)
195197 then toString(addressFromPublicKey(fromBase58String(pubKey)))
196198 else toBase58String(i.caller.bytes)
197199 let get_sponsored_waves = if ((pubKey != ""))
198200 then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
199201 else unit
200202 if ((get_sponsored_waves == get_sponsored_waves))
201203 then $Tuple2(caller, (isSponsored > 0))
202204 else throw("Strict value is not equal to itself.")
203205 }
204206
205207
206208 @Callable(invoke)
207209 func setConf (key,val) = {
208210 let caller = toString(invoke.caller)
209211 if (containsElement([chris, toString(this)], caller))
210212 then [StringEntry(key, val)]
211213 else throw("You are not allowed to change this")
212214 }
213215
214216
215217
216218 @Callable(invoke)
217219 func appRunning (isLive,message) = {
218220 let caller = toString(invoke.caller)
219221 if (containsElement([chris, toString(this)], caller))
220222 then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
221223 else throw("You are not allowed to change this")
222224 }
223225
224226
225227
226228 @Callable(invoke)
227229 func registrationMode (WLonly) = {
228230 let caller = toString(invoke.caller)
229231 if (containsElement([chris, toString(this)], caller))
230232 then [BooleanEntry(whitelistedonlyKey, WLonly)]
231233 else throw("You are not allowed to change this")
232234 }
233235
234236
235237
236238 @Callable(invoke)
237239 func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
238240 then throw(maintenanceMSG)
239241 else {
240- let $t073197371 = getCaller(invoke, pubKey)
241- let caller = $t073197371._1
242- let isSponsored = $t073197371._2
242+ let $t073967448 = getCaller(invoke, pubKey)
243+ let caller = $t073967448._1
244+ let isSponsored = $t073967448._2
243245 let id = toBase58String(invoke.transactionId)
244246 let timestamp = lastBlock.timestamp
245247 let note = getStringByKey(keyUserNote(caller))
246248 let label = getStringByKey(keyUserLabel(caller))
247249 if (!(validUserData(caller, name, description, thumb, false)))
248250 then throw("Something went wrong")
249251 else {
250252 let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
251253 if (if ((0 > royalties))
252254 then true
253255 else (royalties > 1000))
254256 then throw("Royalties cannot be less than 0% or higher than 10%")
255257 else {
256258 let txToCaller = if (isSponsored)
257259 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
258260 else nil
259261 ([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)
260262 }
261263 }
262264 }
263265
264266
265267
266268 @Callable(invoke)
267269 func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
268270 then throw(maintenanceMSG)
269271 else {
270- let $t090179121 = getCaller(invoke, pubKey)
271- let caller = $t090179121._1
272- let isSponsored = $t090179121._2
272+ let $t090949198 = getCaller(invoke, pubKey)
273+ let caller = $t090949198._1
274+ let isSponsored = $t090949198._2
273275 let status = getStringByKey(keyUserStatus(caller))
274276 if (!(validUserData(caller, name, description, thumb, true)))
275277 then throw("Something went wrong")
276278 else {
277279 let date = getIntegerByKey(keyUserDate(caller))
278280 let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
279281 if (if ((0 > royalties))
280282 then true
281283 else (royalties > 1000))
282284 then throw("Royalties cannot be less than 0% or higher than 10%")
283285 else {
284286 let txToCaller = if (isSponsored)
285287 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
286288 else nil
287289 ([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)
288290 }
289291 }
290292 }
291293
292294
293295
294296 @Callable(invoke)
295297 func setERC20User (erc20,pubKey) = if (!(dappRunning))
296298 then throw(maintenanceMSG)
297299 else {
298- let $t01030810411 = getCaller(invoke, pubKey)
299- let caller = $t01030810411._1
300- let isSponsored = $t01030810411._2
300+ let $t01038510488 = getCaller(invoke, pubKey)
301+ let caller = $t01038510488._1
302+ let isSponsored = $t01038510488._2
301303 let status = getStringByKey(keyUserStatus(caller))
302304 if (if ((status != userRegistered))
303305 then (status != userVerified)
304306 else false)
305307 then throw("Not allowed to set ERC20 address")
306308 else {
307309 let firstTwo = take(erc20, 2)
308310 if (if ((firstTwo != "0x"))
309311 then true
310312 else (size(erc20) != 42))
311313 then throw("This is not an erc20 address")
312314 else {
313315 let txToCaller = if (isSponsored)
314316 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
315317 else nil
316318 ([StringEntry(keyUserERC20(caller), erc20)] ++ txToCaller)
317319 }
318320 }
319321 }
320322
321323
322324
323325 @Callable(invoke)
324-func changeUserStatus (address,status,note,label) = {
326+func changeUserStatus (address,status,note,label,wl_certifications,wl_txs,wl_drops) = {
325327 let caller = toString(invoke.caller)
326328 if ((size(address) == 0))
327329 then throw("Address cannot be empty")
328330 else {
329331 let currentNote = getStringByKey(keyUserNote(address))
330332 let currentLabel = getStringByKey(keyUserLabel(address))
331333 let noteToUse = if ((size(note) != 0))
332334 then note
333335 else currentNote
334336 let labelToUse = if ((size(label) != 0))
335337 then label
336338 else currentLabel
337339 if (containsElement([chris, toString(this)], caller))
338- then if ((size(status) == 0))
339- then {
340- let currentStatus = getStringByKey(keyUserStatus(address))
341- if ((currentStatus == ""))
342- then throw("User have no status yet")
343- else [StringEntry(keyUserNote(address), noteToUse), StringEntry(keyUserLabel(address), labelToUse)]
344- }
345- else {
346- let currentStatus = getStringByKey(keyUserStatus(address))
347- let statusToSet = validateNewStatus(status, address, currentStatus)
348- let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
349- let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
350- let date = getIntegerByKey(keyUserDate(address))
351- let json = makeJSON(name, thumb, toString(date))
340+ then {
341+ let free_certifications = if ((wl_certifications != 0))
342+ then invoke(signDapp, "whitelistFreeCertifications", [address, wl_certifications, true], nil)
343+ else nil
344+ if ((free_certifications == free_certifications))
345+ then {
346+ let free_txs = if ((wl_txs != 0))
347+ then invoke(whitelistDapp, "whitelistFreeTxs", [address, wl_txs, true], nil)
348+ else nil
349+ if ((free_txs == free_txs))
350+ then {
351+ let free_drops = if ((wl_drops != 0))
352+ then invoke(whitelistDapp, "whitelistFreeDrop", [address, wl_drops, true], nil)
353+ else nil
354+ if ((free_drops == free_drops))
355+ then if ((size(status) == 0))
356+ then {
357+ let currentStatus = getStringByKey(keyUserStatus(address))
358+ if ((currentStatus == ""))
359+ then throw("User have no status yet")
360+ else [StringEntry(keyUserNote(address), noteToUse), StringEntry(keyUserLabel(address), labelToUse)]
361+ }
362+ else {
363+ let currentStatus = getStringByKey(keyUserStatus(address))
364+ let statusToSet = validateNewStatus(status, address, currentStatus)
365+ let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
366+ let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
367+ let date = getIntegerByKey(keyUserDate(address))
368+ let json = makeJSON(name, thumb, toString(date))
352369 [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(keyUserNote(address), noteToUse), StringEntry(keyUserLabel(address), labelToUse)]
353- }
370+ }
371+ else throw("Strict value is not equal to itself.")
372+ }
373+ else throw("Strict value is not equal to itself.")
374+ }
375+ else throw("Strict value is not equal to itself.")
376+ }
354377 else throw("Not allowed to change user status")
355378 }
356379 }
357380
358381
359382
360383 @Callable(invoke)
361384 func deleteUser (address) = {
362385 let caller = toString(invoke.caller)
363386 let currentStatus = getStringByKey(keyUserStatus(address))
364387 if (containsElement([chris, toString(this)], caller))
365388 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)]
366389 else throw("Not allowed")
367390 }
368391
369392
370393
371394 @Callable(i)
372395 func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning))
373396 then throw(maintenanceMSG)
374397 else {
375398 let caller = toString(i.caller)
376399 if (containsElement([chris, toString(this)], caller))
377400 then if (if ((size(artistAddr) != 35))
378401 then true
379402 else (size(agentAddr) != 35))
380403 then throw("Wrong address")
381404 else [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)]
382405 else throw("You are not allowed")
383406 }
384407
385408
386409
387410 @Callable(i)
388411 func unsetAgent (artistAddr,agentAddr) = if (!(dappRunning))
389412 then throw(maintenanceMSG)
390413 else {
391414 let caller = toString(i.caller)
392415 if (containsElement([chris, toString(this)], caller))
393416 then if (if ((size(artistAddr) != 35))
394417 then true
395418 else (size(agentAddr) != 35))
396419 then throw("Wrong address")
397420 else [DeleteEntry(keyArtistAgentAddr(artistAddr)), DeleteEntry(keyAgentArtistAddr(agentAddr, artistAddr)), DeleteEntry(keyPrimaryShare(artistAddr)), DeleteEntry(keySecondaryShare(artistAddr))]
398421 else throw("You are not allowed")
399422 }
400423
401424
402425
403426 @Callable(i)
404427 func deleteEntry (entry) = {
405428 let caller = toString(i.caller)
406429 if ((caller == chris))
407430 then [DeleteEntry(entry)]
408431 else throw("no")
409432 }
410433
411434
412435 @Verifier(tx)
413436 func verifier () = match tx {
414437 case inv: InvokeScriptTransaction =>
415438 if (if (if (if ((inv.function == "registerUser"))
416439 then (inv.dApp == this)
417440 else false)
418441 then (inv.fee == 500000)
419442 else false)
420443 then (inv.feeAssetId == unit)
421444 else false)
422445 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
423446 else if (if (if (if ((inv.function == "updateUser"))
424447 then (inv.dApp == this)
425448 else false)
426449 then (inv.fee == 500000)
427450 else false)
428451 then (inv.feeAssetId == unit)
429452 else false)
430453 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
431454 else if (if (if (if ((inv.function == "setERC20User"))
432455 then (inv.dApp == this)
433456 else false)
434457 then (inv.fee == 500000)
435458 else false)
436459 then (inv.feeAssetId == unit)
437460 else false)
438461 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[2])))
439462 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
440463 case _ =>
441464 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
442465 }
443466

github/deemru/w8io/026f985 
50.92 ms