tx · HXVMrttkBxqoi9ruatwk2CkWv8hARNbc6B289hJmLyhj

3Mu2C9QPkCMbH6JLg6Hz7Netz8WzzsCFuer:  -0.01000000 Waves

2022.05.15 18:31 [2052974] smart account 3Mu2C9QPkCMbH6JLg6Hz7Netz8WzzsCFuer > SELF 0.00000000 Waves

{ "type": 13, "id": "HXVMrttkBxqoi9ruatwk2CkWv8hARNbc6B289hJmLyhj", "fee": 1000000, "feeAssetId": null, "timestamp": 1652628775732, "version": 2, "chainId": 84, "sender": "3Mu2C9QPkCMbH6JLg6Hz7Netz8WzzsCFuer", "senderPublicKey": "EpsQDuBHgjx87GJiEmraTUWwEdeaW4vimku5axvyr238", "proofs": [ "2p3pd4uJYg25FjF78L3NwCjQMMsbgkaRfFx6ySyND9wrqgxt9s4AAnjBM1bJ35SjaSWZwshA9nzNEjjQRVvYn3xw" ], "script": "base64:AAIFAAAAAAAAADYIAhIDCgEIEgQKAgQIEgMKAQQSBwoFCAgICAgSBwoFCAgICAgSBgoECAgICBIDCgEIEgMKAQgAAAAkAAAAAAlvcmFjbGVLZXkCAAAACW9yYWNsZUtleQEAAAAGZ2V0U3RyAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAAAAAAGb3JhY2xlCQEAAAAGZ2V0U3RyAAAAAQUAAAAJb3JhY2xlS2V5AAAAAAlvcmFjbGVGZWUJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQUAAAAGb3JhY2xlAQAAABlnZXRJbnRlZ2VyQnlLZXlGcm9tT3JhY2xlAAAAAQAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABBoAAAACBQAAAAlvcmFjbGVGZWUFAAAAA2tleQIAAAAfSW50ZWdlciB1bmRlZmluZSBvciAwIGluIG9yYWNsZQAA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NlckRlc2MAAAABBQAAAAdhZGRyZXNzCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAQAAAA1rZXlVc2VyU29jaWFsAAAAAQUAAAAHYWRkcmVzcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAAMa2V5VXNlclRodW1iAAAAAQUAAAAHYWRkcmVzcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIJAAEsAAAAAgUAAAANY3VycmVudFN0YXR1cwIAAAABXwUAAAAHYWRkcmVzcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAICAAAACWNhdGVnb3J5XwUAAAAHYWRkcmVzcwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQEAAAANa2V5VXNlclN0YXR1cwAAAAEFAAAAB2FkZHJlc3MFAAAAC3VzZXJSZW1vdmVkBQAAAANuaWwJAAACAAAAAQIAAAALTm90IGFsbG93ZWQAAAABaQEAAAALZGVsZXRlRW50cnkAAAABAAAABWVudHJ5BAAAAAZjYWxsZXIJAAQlAAAAAQkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5AwkBAAAAD2NvbnRhaW5zRWxlbWVudAAAAAIFAAAABm93bmVycwUAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAABWVudHJ5BQAAAANuaWwJAAACAAAAAQIAAAACbm8AAAAAVCp0aw==", "height": 2052974, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D4LWkkCriSxiD5fKGDeRJvdBE1s85SHDdMTHbR16Zuiz Next: FAHznfFVnguCwCsgJtTBvCo8MY8if3sVabWHiqNLqfXA Diff:
OldNewDifferences
1717
1818 func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle")
1919
20-
21-let SconexAssetId = fromBase58String(getStringValue(oracleFee, "SconexAssetId"))
22-
23-let currentFeeSconex = getIntegerByKeyFromOracle(("fee_" + toBase58String(SconexAssetId)))
2420
2521 let stakeDapp = addressFromString(valueOrErrorMessage(getString(oracleFee, "stakeDapp"), "sconexDapp not found"))
2622
151147 func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
152148
153149
154-func isPayment (i) = if ((size(i.payments) == 0))
155- then throw("No payment attached")
156- else {
157- let payment = value(i.payments[0])
158- let amount = value(payment.amount)
159- $Tuple2(payment, amount)
160- }
161-
162-
163-func validatePayment (i) = {
164- let t089829018 = isPayment(i)
165- let payment = t089829018._1
166- let amount = t089829018._2
167- let assetId = if (if (isDefined(payment.assetId))
168- then (payment.assetId == SconexAssetId)
169- else false)
170- then payment.assetId
171- else throw((("Only " + toBase58String(SconexAssetId)) + " token accepted as transaction fee"))
172- if ((amount != currentFeeSconex))
173- then throw(((("Payment amount should be " + toString(currentFeeSconex)) + " but is: ") + toString(amount)))
174- else $Tuple2(amount, assetId)
175- }
176-
177-
178150 @Callable(i)
179151 func initDapp (dappKey) = if ((i.caller != this))
180152 then throw("You cannot do this action")
210182 func registerUser (name,description,thumb,social,banner) = if (!(dappRunning))
211183 then throw(maintenanceMSG)
212184 else {
213- let validP = validatePayment(i)
214- let amountP = validP._1
215- let assetIdP = validP._2
216- if (!(isDefined(amountP)))
217- then throw("Something went wrong")
218- else {
219- let invokeTeamFeeSplit = invoke(valueOrErrorMessage(stakeDapp, "stakeDapp not found"), "topUpReward", nil, [AttachedPayment(assetIdP, amountP)])
220- if ((invokeTeamFeeSplit == invokeTeamFeeSplit))
221- then {
222- let caller = toString(addressFromPublicKey(i.callerPublicKey))
223- let id = toBase58String(i.transactionId)
224- let timestamp = lastBlock.timestamp
225- if (!(validateBanner(banner)))
226- then throw("Invalid banner image!")
227- else if (!(validUserData(caller, name, description, thumb, false)))
228- then throw("Something went wrong")
229- else {
230- let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
185+ let validateAndProcessPaymentInvoke = invoke(valueOrErrorMessage(stakeDapp, "this not found"), "validateAndProcessPayment", nil, [i.payments[0]])
186+ if ((validateAndProcessPaymentInvoke == validateAndProcessPaymentInvoke))
187+ then {
188+ let caller = toString(addressFromPublicKey(i.callerPublicKey))
189+ let id = toBase58String(i.transactionId)
190+ let timestamp = lastBlock.timestamp
191+ if (!(validateBanner(banner)))
192+ then throw("Invalid banner image!")
193+ else if (!(validUserData(caller, name, description, thumb, false)))
194+ then throw("Something went wrong")
195+ else {
196+ let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
231197 [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(keyUserBanner(caller), banner), StringEntry(keyUserStatus(caller), userRegistered), StringEntry(((userRegistered + "_") + caller), json)]
232- }
233- }
234- else throw("Strict value is not equal to itself.")
198+ }
235199 }
200+ else throw("Strict value is not equal to itself.")
236201 }
237202
238203
241206 func updateUser (name,description,thumb,social,banner) = if (!(dappRunning))
242207 then throw(maintenanceMSG)
243208 else {
244- let validP = validatePayment(i)
245- let amountP = validP._1
246- let assetIdP = validP._2
247- if (!(isDefined(amountP)))
248- then throw("Something went wrong")
249- else {
250- let invokeTeamFeeSplit = invoke(valueOrErrorMessage(stakeDapp, "stakeDapp not found"), "topUpReward", nil, [AttachedPayment(assetIdP, amountP)])
251- if ((invokeTeamFeeSplit == invokeTeamFeeSplit))
252- then {
253- let caller = toString(addressFromPublicKey(i.callerPublicKey))
254- let id = toBase58String(i.transactionId)
255- let status = getStringByKey(keyUserStatus(caller))
256- if (!(validateBanner(banner)))
257- then throw("Invalid banner image!")
258- else if (!(validUserData(caller, name, description, thumb, true)))
259- then throw("Something went wrong")
260- else {
261- let date = getIntegerByKey(keyUserDate(caller))
262- let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
209+ let validateAndProcessPaymentInvoke = invoke(valueOrErrorMessage(stakeDapp, "this not found"), "validateAndProcessPayment", nil, [i.payments[0]])
210+ if ((validateAndProcessPaymentInvoke == validateAndProcessPaymentInvoke))
211+ then {
212+ let caller = toString(addressFromPublicKey(i.callerPublicKey))
213+ let id = toBase58String(i.transactionId)
214+ let status = getStringByKey(keyUserStatus(caller))
215+ if (!(validateBanner(banner)))
216+ then throw("Invalid banner image!")
217+ else if (!(validUserData(caller, name, description, thumb, true)))
218+ then throw("Something went wrong")
219+ else {
220+ let date = getIntegerByKey(keyUserDate(caller))
221+ let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
263222 [StringEntry(keyUserName(caller), name), StringEntry(keyUserDesc(caller), description), StringEntry(keyUserSocial(caller), social), StringEntry(keyUserBanner(caller), banner), StringEntry(keyUserThumb(caller), thumb), StringEntry(((status + "_") + caller), json)]
264- }
265- }
266- else throw("Strict value is not equal to itself.")
223+ }
267224 }
225+ else throw("Strict value is not equal to itself.")
268226 }
269227
270228
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let oracleKey = "oracleKey"
55
66 func getStr (key) = match getString(this, key) {
77 case b: String =>
88 b
99 case _ =>
1010 ""
1111 }
1212
1313
1414 let oracle = getStr(oracleKey)
1515
1616 let oracleFee = value(addressFromString(oracle))
1717
1818 func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle")
1919
20-
21-let SconexAssetId = fromBase58String(getStringValue(oracleFee, "SconexAssetId"))
22-
23-let currentFeeSconex = getIntegerByKeyFromOracle(("fee_" + toBase58String(SconexAssetId)))
2420
2521 let stakeDapp = addressFromString(valueOrErrorMessage(getString(oracleFee, "stakeDapp"), "sconexDapp not found"))
2622
2723 let owners = [getString(oracleFee, "owner1"), getString(oracleFee, "owner2")]
2824
2925 let dappRunningKey = "conf_dapp_is_running"
3026
3127 let maintenanceMSGKey = "conf_maintenance_msg"
3228
3329 let whitelistedonlyKey = "conf_whitelisted_only"
3430
3531 let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true)
3632
3733 let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "")
3834
3935 let whitelistedonly = valueOrElse(getBoolean(this, whitelistedonlyKey), true)
4036
4137 let userRegistered = "REGISTERED"
4238
4339 let userVerified = "VERIFIED"
4440
4541 let userSuspended = "SUSPENDED"
4642
4743 let userRemoved = "REMOVED"
4844
4945 let userChangeRequired = "CHANGE_REQUIRED"
5046
5147 let userUnregistered = "UNREGISTERED"
5248
5349 let userReset = "RESET"
5450
5551 func getStringByKey (key) = valueOrElse(getString(this, key), "")
5652
5753
5854 func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false)
5955
6056
6157 func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
6258
6359
6460 func keyUserAddr (caller) = ("user_" + caller)
6561
6662
6763 func keyUserName (caller) = ("user_name_" + caller)
6864
6965
7066 func keyUserDesc (caller) = ("user_desc_" + caller)
7167
7268
7369 func keyUserSocial (caller) = ("user_social_" + caller)
7470
7571
7672 func keyUserThumb (caller) = ("user_thumb_" + caller)
7773
7874
7975 func keyUserBanner (caller) = ("user_banner_" + caller)
8076
8177
8278 func keyUserStatus (caller) = ("user_status_" + caller)
8379
8480
8581 func keyUserDate (caller) = ("user_date_" + caller)
8682
8783
8884 func validateCID (cid) = if (contains(cid, "/"))
8985 then if (if ((63 > size(cid)))
9086 then (size(split(cid, "/")[0]) == 46)
9187 else false)
9288 then (16 > size(split(cid, "/")[1]))
9389 else false
9490 else false
9591
9692
9793 func validateBanner (cid) = if ((size(cid) == 0))
9894 then true
9995 else if ((size(cid) == 46))
10096 then true
10197 else false
10298
10399
104100 func validUserData (caller,name,description,thumb,isAnUpdate) = {
105101 let validCID = if ((size(thumb) != 0))
106102 then validateCID(thumb)
107103 else true
108104 if (!(validCID))
109105 then throw("CID don't match requirement!")
110106 else if (if ((name == ""))
111107 then true
112108 else (description == ""))
113109 then throw("Name and description cannot be empty")
114110 else if ((size(description) > 600))
115111 then throw("600 Char. max description")
116112 else if ((size(name) > 45))
117113 then throw("45 Char. max name")
118114 else {
119115 let status = getStringByKey(keyUserStatus(caller))
120116 if (if ((status == userSuspended))
121117 then true
122118 else (status == userRemoved))
123119 then throw("Account suspended/ removed.")
124120 else if (if (!(isAnUpdate))
125121 then (status == userRegistered)
126122 else false)
127123 then throw("Already registered")
128124 else if (if (isAnUpdate)
129125 then (status == "")
130126 else false)
131127 then throw("Register first")
132128 else true
133129 }
134130 }
135131
136132
137133 func validateNewStatus (status,address,currentStatus) = {
138134 let allStatus = [userVerified, userRegistered, userSuspended, userRemoved, userChangeRequired]
139135 let statusToSet = if (containsElement(allStatus, status))
140136 then status
141137 else if ((status == userReset))
142138 then ""
143139 else throw("Unknown status")
144140 let userIsRegistered = getIntegerByKey(keyUserDate(address))
145141 if ((userIsRegistered == 0))
146142 then throw("You cant set this status, user is not registered.")
147143 else statusToSet
148144 }
149145
150146
151147 func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
152148
153149
154-func isPayment (i) = if ((size(i.payments) == 0))
155- then throw("No payment attached")
156- else {
157- let payment = value(i.payments[0])
158- let amount = value(payment.amount)
159- $Tuple2(payment, amount)
160- }
161-
162-
163-func validatePayment (i) = {
164- let t089829018 = isPayment(i)
165- let payment = t089829018._1
166- let amount = t089829018._2
167- let assetId = if (if (isDefined(payment.assetId))
168- then (payment.assetId == SconexAssetId)
169- else false)
170- then payment.assetId
171- else throw((("Only " + toBase58String(SconexAssetId)) + " token accepted as transaction fee"))
172- if ((amount != currentFeeSconex))
173- then throw(((("Payment amount should be " + toString(currentFeeSconex)) + " but is: ") + toString(amount)))
174- else $Tuple2(amount, assetId)
175- }
176-
177-
178150 @Callable(i)
179151 func initDapp (dappKey) = if ((i.caller != this))
180152 then throw("You cannot do this action")
181153 else if ((oracle != ""))
182154 then throw("oracle already set, you can't override!")
183155 else [StringEntry(oracleKey, dappKey)]
184156
185157
186158
187159 @Callable(invoke)
188160 func appRunning (isLive,message) = {
189161 let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
190162 let id = toBase58String(invoke.transactionId)
191163 if (containsElement((owners :+ toString(this)), caller))
192164 then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
193165 else throw("You are not allowed to change this")
194166 }
195167
196168
197169
198170 @Callable(invoke)
199171 func registrationMode (WLonly) = {
200172 let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
201173 let id = toBase58String(invoke.transactionId)
202174 if (containsElement((owners :+ toString(this)), caller))
203175 then [BooleanEntry(whitelistedonlyKey, WLonly)]
204176 else throw("You are not allowed to change this")
205177 }
206178
207179
208180
209181 @Callable(i)
210182 func registerUser (name,description,thumb,social,banner) = if (!(dappRunning))
211183 then throw(maintenanceMSG)
212184 else {
213- let validP = validatePayment(i)
214- let amountP = validP._1
215- let assetIdP = validP._2
216- if (!(isDefined(amountP)))
217- then throw("Something went wrong")
218- else {
219- let invokeTeamFeeSplit = invoke(valueOrErrorMessage(stakeDapp, "stakeDapp not found"), "topUpReward", nil, [AttachedPayment(assetIdP, amountP)])
220- if ((invokeTeamFeeSplit == invokeTeamFeeSplit))
221- then {
222- let caller = toString(addressFromPublicKey(i.callerPublicKey))
223- let id = toBase58String(i.transactionId)
224- let timestamp = lastBlock.timestamp
225- if (!(validateBanner(banner)))
226- then throw("Invalid banner image!")
227- else if (!(validUserData(caller, name, description, thumb, false)))
228- then throw("Something went wrong")
229- else {
230- let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
185+ let validateAndProcessPaymentInvoke = invoke(valueOrErrorMessage(stakeDapp, "this not found"), "validateAndProcessPayment", nil, [i.payments[0]])
186+ if ((validateAndProcessPaymentInvoke == validateAndProcessPaymentInvoke))
187+ then {
188+ let caller = toString(addressFromPublicKey(i.callerPublicKey))
189+ let id = toBase58String(i.transactionId)
190+ let timestamp = lastBlock.timestamp
191+ if (!(validateBanner(banner)))
192+ then throw("Invalid banner image!")
193+ else if (!(validUserData(caller, name, description, thumb, false)))
194+ then throw("Something went wrong")
195+ else {
196+ let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
231197 [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(keyUserBanner(caller), banner), StringEntry(keyUserStatus(caller), userRegistered), StringEntry(((userRegistered + "_") + caller), json)]
232- }
233- }
234- else throw("Strict value is not equal to itself.")
198+ }
235199 }
200+ else throw("Strict value is not equal to itself.")
236201 }
237202
238203
239204
240205 @Callable(i)
241206 func updateUser (name,description,thumb,social,banner) = if (!(dappRunning))
242207 then throw(maintenanceMSG)
243208 else {
244- let validP = validatePayment(i)
245- let amountP = validP._1
246- let assetIdP = validP._2
247- if (!(isDefined(amountP)))
248- then throw("Something went wrong")
249- else {
250- let invokeTeamFeeSplit = invoke(valueOrErrorMessage(stakeDapp, "stakeDapp not found"), "topUpReward", nil, [AttachedPayment(assetIdP, amountP)])
251- if ((invokeTeamFeeSplit == invokeTeamFeeSplit))
252- then {
253- let caller = toString(addressFromPublicKey(i.callerPublicKey))
254- let id = toBase58String(i.transactionId)
255- let status = getStringByKey(keyUserStatus(caller))
256- if (!(validateBanner(banner)))
257- then throw("Invalid banner image!")
258- else if (!(validUserData(caller, name, description, thumb, true)))
259- then throw("Something went wrong")
260- else {
261- let date = getIntegerByKey(keyUserDate(caller))
262- let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
209+ let validateAndProcessPaymentInvoke = invoke(valueOrErrorMessage(stakeDapp, "this not found"), "validateAndProcessPayment", nil, [i.payments[0]])
210+ if ((validateAndProcessPaymentInvoke == validateAndProcessPaymentInvoke))
211+ then {
212+ let caller = toString(addressFromPublicKey(i.callerPublicKey))
213+ let id = toBase58String(i.transactionId)
214+ let status = getStringByKey(keyUserStatus(caller))
215+ if (!(validateBanner(banner)))
216+ then throw("Invalid banner image!")
217+ else if (!(validUserData(caller, name, description, thumb, true)))
218+ then throw("Something went wrong")
219+ else {
220+ let date = getIntegerByKey(keyUserDate(caller))
221+ let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
263222 [StringEntry(keyUserName(caller), name), StringEntry(keyUserDesc(caller), description), StringEntry(keyUserSocial(caller), social), StringEntry(keyUserBanner(caller), banner), StringEntry(keyUserThumb(caller), thumb), StringEntry(((status + "_") + caller), json)]
264- }
265- }
266- else throw("Strict value is not equal to itself.")
223+ }
267224 }
225+ else throw("Strict value is not equal to itself.")
268226 }
269227
270228
271229
272230 @Callable(invoke)
273231 func changeUserStatus (address,status,note,category) = {
274232 let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
275233 let id = toBase58String(invoke.transactionId)
276234 let addr = addressFromString(address)
277235 match addr {
278236 case addr: Address =>
279237 let currentStatus = getStringByKey(keyUserStatus(address))
280238 let statusToSet = validateNewStatus(status, address, currentStatus)
281239 let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
282240 let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
283241 let date = getIntegerByKey(keyUserDate(address))
284242 let json = makeJSON(name, thumb, toString(date))
285243 if (containsElement((owners :+ toString(this)), caller))
286244 then {
287245 let categoryData = if ((statusToSet == userVerified))
288246 then [StringEntry(("category_" + address), category)]
289247 else [DeleteEntry(("category_" + address))]
290248 (categoryData ++ [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(("user_note_" + address), note)])
291249 }
292250 else throw("Not allowed to change user status")
293251 case _ =>
294252 throw("Seems to be an invalid address!")
295253 }
296254 }
297255
298256
299257
300258 @Callable(invoke)
301259 func deleteUser (address) = {
302260 let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
303261 let id = toBase58String(invoke.transactionId)
304262 let currentStatus = getStringByKey(keyUserStatus(address))
305263 if (containsElement((owners :+ toString(this)), caller))
306264 then [DeleteEntry(keyUserDate(address)), DeleteEntry(keyUserAddr(address)), DeleteEntry(keyUserName(address)), DeleteEntry(keyUserDesc(address)), DeleteEntry(keyUserSocial(address)), DeleteEntry(keyUserThumb(address)), DeleteEntry(((currentStatus + "_") + address)), DeleteEntry(("category_" + address)), StringEntry(keyUserStatus(address), userRemoved)]
307265 else throw("Not allowed")
308266 }
309267
310268
311269
312270 @Callable(i)
313271 func deleteEntry (entry) = {
314272 let caller = toString(addressFromPublicKey(i.callerPublicKey))
315273 if (containsElement(owners, caller))
316274 then [DeleteEntry(entry)]
317275 else throw("no")
318276 }
319277
320278

github/deemru/w8io/169f3d6 
62.73 ms