tx · 6JFcVEWo1PbA3P5YrPgfZgsSM9LtjLBdu3JJHDTdALoD

3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj:  -0.11000000 Waves

2023.01.22 04:50 [2415524] smart account 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj > SELF 0.00000000 Waves

{ "type": 13, "id": "6JFcVEWo1PbA3P5YrPgfZgsSM9LtjLBdu3JJHDTdALoD", "fee": 11000000, "feeAssetId": null, "timestamp": 1674352202810, "version": 2, "chainId": 84, "sender": "3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj", "senderPublicKey": "A2m227AHcq7gWfSU59Q3UJaqkEa7SccFYmJuWHbFrrKE", "proofs": [ "251uR4bfRP33QetaGyXtEd8biaM18Pq7VLr2KAp2jv2ZfV6pxGHdtUKqih2VNzETApfwnmDqfjQ4WHc4rtWV3Tc6" ], "script": "base64:BgJNCAISBAoCCAgSBAoCBAgSAwoBBBIICgYICAgIAQgSCAoGCAgICAEIEgQKAggIEgYKBAgICAgSAwoBCBIGCgQICAEBEgQKAggIEgMKAQgqAAdWRVJTSU9OAgMxLjUBDmdldFN0cmluZ0J5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgABD2dldEJvb2xlYW5CeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCbCAIFBHRoaXMFA2tleQcBD2dldEludGVnZXJCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFA2tleQAAAAVjaHJpcwkBDmdldFN0cmluZ0J5S2V5AQIMY29uZl9hZG1pbl8xAA5kYXBwUnVubmluZ0tleQIUY29uZl9kYXBwX2lzX3J1bm5pbmcAEW1haW50ZW5hbmNlTVNHS2V5AhRjb25mX21haW50ZW5hbmNlX21zZwASd2hpdGVsaXN0ZWRvbmx5S2V5AhVjb25mX3doaXRlbGlzdGVkX29ubHkAC2RhcHBSdW5uaW5nCQELdmFsdWVPckVsc2UCCQCb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HgGcHJvb2ZzAAAJANkEAQkBCGFzU3RyaW5nAQkAkQMCCAUDaW52BGFyZ3MABQMDAwMJAAACCAUDaW52CGZ1bmN0aW9uAgp1cGRhdGVVc2VyCQAAAggFA2ludgRkQXBwBQR0aGlzBwkAAAIIBQNpbnYDZmVlAKDCHgcJAAACCAUDaW52CmZlZUFzc2V0SWQFBHVuaXQHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACQDZBAEJAQhhc1N0cmluZwEJAJEDAggFA2ludgRhcmdzAAUDAwMDCQAAAggFA2ludghmdW5jdGlvbgIMc2V0RVJDMjBVc2VyCQAAAggFA2ludgRkQXBwBQR0aGlzBwkAAAIIBQNpbnYDZmVlAKDCHgcJAAACCAUDaW52CmZlZUFzc2V0SWQFBHVuaXQHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACQDZBAEJAQhhc1N0cmluZwEJAJEDAggFA2ludgRhcmdzAAIJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlUqqmP", "height": 2415524, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: C8q679QND49iekVWNm7eeEXnLKhZiZrapBQeP4GKzGvh Next: 7MNNQHXVM5mXEWKoFQTJGZ2egQFhsWnE2yYTqUaFECxq Diff:
OldNewDifferences
6969
7070
7171 func keyUserERC20 (caller) = ("user_ERC20_" + caller)
72+
73+
74+func keyUserNote (caller) = ("user_note_" + caller)
75+
76+
77+func keyUserLabel (caller) = ("user_label_" + caller)
7278
7379
7480 func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr)
231237 func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
232238 then throw(maintenanceMSG)
233239 else {
234- let $t072077259 = getCaller(invoke, pubKey)
235- let caller = $t072077259._1
236- let isSponsored = $t072077259._2
240+ let $t073197371 = getCaller(invoke, pubKey)
241+ let caller = $t073197371._1
242+ let isSponsored = $t073197371._2
237243 let id = toBase58String(invoke.transactionId)
238244 let timestamp = lastBlock.timestamp
245+ let note = getStringByKey(keyUserNote(caller))
246+ let label = getStringByKey(keyUserLabel(caller))
239247 if (!(validUserData(caller, name, description, thumb, false)))
240248 then throw("Something went wrong")
241249 else {
248256 let txToCaller = if (isSponsored)
249257 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
250258 else nil
251- ([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)
259+ ([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)
252260 }
253261 }
254262 }
259267 func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
260268 then throw(maintenanceMSG)
261269 else {
262- let $t087028806 = getCaller(invoke, pubKey)
263- let caller = $t087028806._1
264- let isSponsored = $t087028806._2
270+ let $t090179121 = getCaller(invoke, pubKey)
271+ let caller = $t090179121._1
272+ let isSponsored = $t090179121._2
265273 let status = getStringByKey(keyUserStatus(caller))
266274 if (!(validUserData(caller, name, description, thumb, true)))
267275 then throw("Something went wrong")
287295 func setERC20User (erc20,pubKey) = if (!(dappRunning))
288296 then throw(maintenanceMSG)
289297 else {
290- let $t0999310096 = getCaller(invoke, pubKey)
291- let caller = $t0999310096._1
292- let isSponsored = $t0999310096._2
298+ let $t01030810411 = getCaller(invoke, pubKey)
299+ let caller = $t01030810411._1
300+ let isSponsored = $t01030810411._2
293301 let status = getStringByKey(keyUserStatus(caller))
294302 if (if ((status != userRegistered))
295303 then (status != userVerified)
317325 let caller = toString(invoke.caller)
318326 if (containsElement([chris, toString(this)], caller))
319327 then if ((size(status) == 0))
320- then [StringEntry(("user_note_" + address), note), StringEntry(("user_label_" + address), label)]
328+ then [StringEntry(keyUserNote(address), note), StringEntry(keyUserLabel(address), label)]
321329 else {
322330 let currentStatus = getStringByKey(keyUserStatus(address))
323331 let statusToSet = validateNewStatus(status, address, currentStatus)
325333 let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
326334 let date = getIntegerByKey(keyUserDate(address))
327335 let json = makeJSON(name, thumb, toString(date))
328-[StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(("user_note_" + address), note), StringEntry(("user_label_" + address), label)]
336+[StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(keyUserNote(address), note), StringEntry(keyUserLabel(address), label)]
329337 }
330338 else throw("Not allowed to change user status")
331339 }
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)
72+
73+
74+func keyUserNote (caller) = ("user_note_" + caller)
75+
76+
77+func keyUserLabel (caller) = ("user_label_" + caller)
7278
7379
7480 func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr)
7581
7682
7783 func keyAgentArtistAddr (agentAddr,artistAddr) = ((("agent_" + agentAddr) + "_") + artistAddr)
7884
7985
8086 func keyPrimaryShare (artistAddr) = ("artist_agent_primary_" + artistAddr)
8187
8288
8389 func keySecondaryShare (artistAddr) = ("artist_agent_secondary_" + artistAddr)
8490
8591
8692 func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0)
8793
8894
8995 func validateCID (cid) = if (contains(cid, "/"))
9096 then if (if ((76 > size(cid)))
9197 then (size(split(cid, "/")[0]) == 59)
9298 else false)
9399 then (16 > size(split(cid, "/")[1]))
94100 else false
95101 else false
96102
97103
98104 func validUserData (caller,name,description,thumb,isAnUpdate) = {
99105 let validCID = if ((size(thumb) != 0))
100106 then validateCID(thumb)
101107 else true
102108 if (!(validCID))
103109 then throw("CID don't match requirement!")
104110 else if (if ((name == ""))
105111 then true
106112 else (description == ""))
107113 then throw("Name and description cannot be empty")
108114 else if ((size(description) > 600))
109115 then throw("600 Char. max description")
110116 else if ((size(name) > 45))
111117 then throw("45 Char. max name")
112118 else {
113119 let status = getStringByKey(keyUserStatus(caller))
114120 if (if ((status == userSuspended))
115121 then true
116122 else (status == userRemoved))
117123 then throw("Account suspended/ removed.")
118124 else if (if (!(isAnUpdate))
119125 then (status == userRegistered)
120126 else false)
121127 then throw("Already registered")
122128 else if (if (if (!(isAnUpdate))
123129 then (status == "")
124130 else false)
125131 then whitelistedonly
126132 else false)
127133 then throw("Can't register, get approved first.")
128134 else if (if (if (isAnUpdate)
129135 then (status == "")
130136 else false)
131137 then true
132138 else if (isAnUpdate)
133139 then (status == userAllowed)
134140 else false)
135141 then throw("Register first")
136142 else true
137143 }
138144 }
139145
140146
141147 func validateNewStatus (status,address,currentStatus) = {
142148 let allStatus = [userVerified, userRegistered, userSuspended, userRemoved, userAllowed, userChangeRequired]
143149 let statusToSet = if (containsElement(allStatus, status))
144150 then status
145151 else if (if ((status == userReset))
146152 then (currentStatus == userAllowed)
147153 else false)
148154 then ""
149155 else throw("Unknown status")
150156 let userIsRegistered = getIntegerByKey(keyUserDate(address))
151157 if (if ((userIsRegistered == 0))
152158 then (statusToSet != userAllowed)
153159 else false)
154160 then throw("You cant set this status, user is not registered.")
155161 else if (if ((currentStatus == userAllowed))
156162 then (statusToSet == userAllowed)
157163 else false)
158164 then throw("User already allowed")
159165 else if (if ((currentStatus == userRegistered))
160166 then (statusToSet == userAllowed)
161167 else false)
162168 then throw("User already allowed & registered")
163169 else if (if ((currentStatus == userVerified))
164170 then (statusToSet == userAllowed)
165171 else false)
166172 then throw("User already allowed & verified")
167173 else statusToSet
168174 }
169175
170176
171177 func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
172178
173179
174180 func asString (bv) = match bv {
175181 case bv0: String =>
176182 bv0
177183 case _ =>
178184 throw("Sponsored Public Key String expected")
179185 }
180186
181187
182188 func getCaller (i,pubKey) = {
183189 let isSponsored = if ((pubKey != ""))
184190 then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0)
185191 else 0
186192 let caller = if (if ((toBase58String(i.caller.bytes) == toString(this)))
187193 then (isSponsored > 0)
188194 else false)
189195 then toString(addressFromPublicKey(fromBase58String(pubKey)))
190196 else toBase58String(i.caller.bytes)
191197 let get_sponsored_waves = if ((pubKey != ""))
192198 then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil)
193199 else unit
194200 if ((get_sponsored_waves == get_sponsored_waves))
195201 then $Tuple2(caller, (isSponsored > 0))
196202 else throw("Strict value is not equal to itself.")
197203 }
198204
199205
200206 @Callable(invoke)
201207 func setConf (key,val) = {
202208 let caller = toString(invoke.caller)
203209 if (containsElement([chris, toString(this)], caller))
204210 then [StringEntry(key, val)]
205211 else throw("You are not allowed to change this")
206212 }
207213
208214
209215
210216 @Callable(invoke)
211217 func appRunning (isLive,message) = {
212218 let caller = toString(invoke.caller)
213219 if (containsElement([chris, toString(this)], caller))
214220 then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
215221 else throw("You are not allowed to change this")
216222 }
217223
218224
219225
220226 @Callable(invoke)
221227 func registrationMode (WLonly) = {
222228 let caller = toString(invoke.caller)
223229 if (containsElement([chris, toString(this)], caller))
224230 then [BooleanEntry(whitelistedonlyKey, WLonly)]
225231 else throw("You are not allowed to change this")
226232 }
227233
228234
229235
230236 @Callable(invoke)
231237 func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
232238 then throw(maintenanceMSG)
233239 else {
234- let $t072077259 = getCaller(invoke, pubKey)
235- let caller = $t072077259._1
236- let isSponsored = $t072077259._2
240+ let $t073197371 = getCaller(invoke, pubKey)
241+ let caller = $t073197371._1
242+ let isSponsored = $t073197371._2
237243 let id = toBase58String(invoke.transactionId)
238244 let timestamp = lastBlock.timestamp
245+ let note = getStringByKey(keyUserNote(caller))
246+ let label = getStringByKey(keyUserLabel(caller))
239247 if (!(validUserData(caller, name, description, thumb, false)))
240248 then throw("Something went wrong")
241249 else {
242250 let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
243251 if (if ((0 > royalties))
244252 then true
245253 else (royalties > 1000))
246254 then throw("Royalties cannot be less than 0% or higher than 10%")
247255 else {
248256 let txToCaller = if (isSponsored)
249257 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
250258 else nil
251- ([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)
259+ ([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)
252260 }
253261 }
254262 }
255263
256264
257265
258266 @Callable(invoke)
259267 func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning))
260268 then throw(maintenanceMSG)
261269 else {
262- let $t087028806 = getCaller(invoke, pubKey)
263- let caller = $t087028806._1
264- let isSponsored = $t087028806._2
270+ let $t090179121 = getCaller(invoke, pubKey)
271+ let caller = $t090179121._1
272+ let isSponsored = $t090179121._2
265273 let status = getStringByKey(keyUserStatus(caller))
266274 if (!(validUserData(caller, name, description, thumb, true)))
267275 then throw("Something went wrong")
268276 else {
269277 let date = getIntegerByKey(keyUserDate(caller))
270278 let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
271279 if (if ((0 > royalties))
272280 then true
273281 else (royalties > 1000))
274282 then throw("Royalties cannot be less than 0% or higher than 10%")
275283 else {
276284 let txToCaller = if (isSponsored)
277285 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
278286 else nil
279287 ([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)
280288 }
281289 }
282290 }
283291
284292
285293
286294 @Callable(invoke)
287295 func setERC20User (erc20,pubKey) = if (!(dappRunning))
288296 then throw(maintenanceMSG)
289297 else {
290- let $t0999310096 = getCaller(invoke, pubKey)
291- let caller = $t0999310096._1
292- let isSponsored = $t0999310096._2
298+ let $t01030810411 = getCaller(invoke, pubKey)
299+ let caller = $t01030810411._1
300+ let isSponsored = $t01030810411._2
293301 let status = getStringByKey(keyUserStatus(caller))
294302 if (if ((status != userRegistered))
295303 then (status != userVerified)
296304 else false)
297305 then throw("Not allowed to set ERC20 address")
298306 else {
299307 let firstTwo = take(erc20, 2)
300308 if (if ((firstTwo != "0x"))
301309 then true
302310 else (size(erc20) != 42))
303311 then throw("This is not an erc20 address")
304312 else {
305313 let txToCaller = if (isSponsored)
306314 then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)]
307315 else nil
308316 ([StringEntry(keyUserERC20(caller), erc20)] ++ txToCaller)
309317 }
310318 }
311319 }
312320
313321
314322
315323 @Callable(invoke)
316324 func changeUserStatus (address,status,note,label) = {
317325 let caller = toString(invoke.caller)
318326 if (containsElement([chris, toString(this)], caller))
319327 then if ((size(status) == 0))
320- then [StringEntry(("user_note_" + address), note), StringEntry(("user_label_" + address), label)]
328+ then [StringEntry(keyUserNote(address), note), StringEntry(keyUserLabel(address), label)]
321329 else {
322330 let currentStatus = getStringByKey(keyUserStatus(address))
323331 let statusToSet = validateNewStatus(status, address, currentStatus)
324332 let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
325333 let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
326334 let date = getIntegerByKey(keyUserDate(address))
327335 let json = makeJSON(name, thumb, toString(date))
328-[StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(("user_note_" + address), note), StringEntry(("user_label_" + address), label)]
336+[StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(keyUserNote(address), note), StringEntry(keyUserLabel(address), label)]
329337 }
330338 else throw("Not allowed to change user status")
331339 }
332340
333341
334342
335343 @Callable(invoke)
336344 func deleteUser (address) = {
337345 let caller = toString(invoke.caller)
338346 let currentStatus = getStringByKey(keyUserStatus(address))
339347 if (containsElement([chris, toString(this)], caller))
340348 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)]
341349 else throw("Not allowed")
342350 }
343351
344352
345353
346354 @Callable(i)
347355 func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning))
348356 then throw(maintenanceMSG)
349357 else {
350358 let caller = toString(i.caller)
351359 if (containsElement([chris, toString(this)], caller))
352360 then if (if ((size(artistAddr) != 35))
353361 then true
354362 else (size(agentAddr) != 35))
355363 then throw("Wrong address")
356364 else [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)]
357365 else throw("You are not allowed")
358366 }
359367
360368
361369
362370 @Callable(i)
363371 func unsetAgent (artistAddr,agentAddr) = if (!(dappRunning))
364372 then throw(maintenanceMSG)
365373 else {
366374 let caller = toString(i.caller)
367375 if (containsElement([chris, toString(this)], caller))
368376 then if (if ((size(artistAddr) != 35))
369377 then true
370378 else (size(agentAddr) != 35))
371379 then throw("Wrong address")
372380 else [DeleteEntry(keyArtistAgentAddr(artistAddr)), DeleteEntry(keyAgentArtistAddr(agentAddr, artistAddr)), DeleteEntry(keyPrimaryShare(artistAddr)), DeleteEntry(keySecondaryShare(artistAddr))]
373381 else throw("You are not allowed")
374382 }
375383
376384
377385
378386 @Callable(i)
379387 func deleteEntry (entry) = {
380388 let caller = toString(i.caller)
381389 if ((caller == chris))
382390 then [DeleteEntry(entry)]
383391 else throw("no")
384392 }
385393
386394
387395 @Verifier(tx)
388396 func verifier () = match tx {
389397 case inv: InvokeScriptTransaction =>
390398 if (if (if (if ((inv.function == "registerUser"))
391399 then (inv.dApp == this)
392400 else false)
393401 then (inv.fee == 500000)
394402 else false)
395403 then (inv.feeAssetId == unit)
396404 else false)
397405 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
398406 else if (if (if (if ((inv.function == "updateUser"))
399407 then (inv.dApp == this)
400408 else false)
401409 then (inv.fee == 500000)
402410 else false)
403411 then (inv.feeAssetId == unit)
404412 else false)
405413 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5])))
406414 else if (if (if (if ((inv.function == "setERC20User"))
407415 then (inv.dApp == this)
408416 else false)
409417 then (inv.fee == 500000)
410418 else false)
411419 then (inv.feeAssetId == unit)
412420 else false)
413421 then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[2])))
414422 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
415423 case _ =>
416424 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
417425 }
418426

github/deemru/w8io/026f985 
72.82 ms