tx · D4LWkkCriSxiD5fKGDeRJvdBE1s85SHDdMTHbR16Zuiz

3Mu2C9QPkCMbH6JLg6Hz7Netz8WzzsCFuer:  -0.01000000 Waves

2022.05.10 15:30 [2045570] smart account 3Mu2C9QPkCMbH6JLg6Hz7Netz8WzzsCFuer > SELF 0.00000000 Waves

{ "type": 13, "id": "D4LWkkCriSxiD5fKGDeRJvdBE1s85SHDdMTHbR16Zuiz", "fee": 1000000, "feeAssetId": null, "timestamp": 1652185819870, "version": 2, "chainId": 84, "sender": "3Mu2C9QPkCMbH6JLg6Hz7Netz8WzzsCFuer", "senderPublicKey": "EpsQDuBHgjx87GJiEmraTUWwEdeaW4vimku5axvyr238", "proofs": [ "46fQrBH7jmCQMrdBGdRJrp96R6fSQwcHUcJTXbaMEwvCWGqFbt1cwVRxHfbae92SRJSH7FqitUzkqThQuBZsycpF" ], "script": "base64:AAIFAAAAAAAAADYIAhIDCgEIEgQKAgQIEgMKAQQSBwoFCAgICAgSBwoFCAgICAgSBgoECAgICBIDCgEIEgMKAQgAAAAoAAAAAAlvcmFjbGVLZXkCAAAACW9yYWNsZUtleQEAAAAGZ2V0U3RyAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAAAAAAGb3JhY2xlCQEAAAAGZ2V0U3RyAAAAAQUAAAAJb3JhY2xlS2V5AAAAAAlvcmFjbGVGZWUJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQUAAAAGb3JhY2xlAQAAABlnZXRJbnRlZ2VyQnlLZXlGcm9tT3JhY2xlAAAAAQAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABBoAAAACBQAAAAlvcmFjbGVGZWUFAAAAA2tleQIAAAAfSW50ZWdlciB1bmRlZmluZSBvciAwIGluIG9yYWNsZ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mVkBQAAAANuaWwJAAACAAAAAQIAAAALTm90IGFsbG93ZWQAAAABaQEAAAALZGVsZXRlRW50cnkAAAABAAAABWVudHJ5BAAAAAZjYWxsZXIJAAQlAAAAAQkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5AwkBAAAAD2NvbnRhaW5zRWxlbWVudAAAAAIFAAAABm93bmVycwUAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAABWVudHJ5BQAAAANuaWwJAAACAAAAAQIAAAACbm8AAAAAhTWKuw==", "height": 2045570, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 23gMkHRxQ3Me6vXudX1EC8hsFtQo8mKEdkWU1dRdF4zd Next: HXVMrttkBxqoi9ruatwk2CkWv8hARNbc6B289hJmLyhj Diff:
OldNewDifferences
1414 let oracle = getStr(oracleKey)
1515
1616 let oracleFee = value(addressFromString(oracle))
17+
18+func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle")
19+
20+
21+let SconexAssetId = fromBase58String(getStringValue(oracleFee, "SconexAssetId"))
22+
23+let currentFeeSconex = getIntegerByKeyFromOracle(("fee_" + toBase58String(SconexAssetId)))
24+
25+let stakeDapp = addressFromString(valueOrErrorMessage(getString(oracleFee, "stakeDapp"), "sconexDapp not found"))
1726
1827 let owners = [getString(oracleFee, "owner1"), getString(oracleFee, "owner2")]
1928
142151 func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
143152
144153
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+
145178 @Callable(i)
146179 func initDapp (dappKey) = if ((i.caller != this))
147180 then throw("You cannot do this action")
173206
174207
175208
176-@Callable(invoke)
209+@Callable(i)
177210 func registerUser (name,description,thumb,social,banner) = if (!(dappRunning))
178211 then throw(maintenanceMSG)
179212 else {
180- let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
181- let id = toBase58String(invoke.transactionId)
182- let timestamp = lastBlock.timestamp
183- if (!(validateBanner(banner)))
184- then throw("Invalid banner image!")
185- else if (!(validUserData(caller, name, description, thumb, false)))
186- then throw("Something went wrong")
187- else {
188- let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
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))
189231 [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)]
190- }
232+ }
233+ }
234+ else throw("Strict value is not equal to itself.")
235+ }
191236 }
192237
193238
194239
195-@Callable(invoke)
240+@Callable(i)
196241 func updateUser (name,description,thumb,social,banner) = if (!(dappRunning))
197242 then throw(maintenanceMSG)
198243 else {
199- let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
200- let id = toBase58String(invoke.transactionId)
201- let status = getStringByKey(keyUserStatus(caller))
202- if (!(validateBanner(banner)))
203- then throw("Invalid banner image!")
204- else if (!(validUserData(caller, name, description, thumb, true)))
205- then throw("Something went wrong")
206- else {
207- let date = getIntegerByKey(keyUserDate(caller))
208- let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
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))
209263 [StringEntry(keyUserName(caller), name), StringEntry(keyUserDesc(caller), description), StringEntry(keyUserSocial(caller), social), StringEntry(keyUserBanner(caller), banner), StringEntry(keyUserThumb(caller), thumb), StringEntry(((status + "_") + caller), json)]
210- }
264+ }
265+ }
266+ else throw("Strict value is not equal to itself.")
267+ }
211268 }
212269
213270
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))
17+
18+func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle")
19+
20+
21+let SconexAssetId = fromBase58String(getStringValue(oracleFee, "SconexAssetId"))
22+
23+let currentFeeSconex = getIntegerByKeyFromOracle(("fee_" + toBase58String(SconexAssetId)))
24+
25+let stakeDapp = addressFromString(valueOrErrorMessage(getString(oracleFee, "stakeDapp"), "sconexDapp not found"))
1726
1827 let owners = [getString(oracleFee, "owner1"), getString(oracleFee, "owner2")]
1928
2029 let dappRunningKey = "conf_dapp_is_running"
2130
2231 let maintenanceMSGKey = "conf_maintenance_msg"
2332
2433 let whitelistedonlyKey = "conf_whitelisted_only"
2534
2635 let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true)
2736
2837 let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "")
2938
3039 let whitelistedonly = valueOrElse(getBoolean(this, whitelistedonlyKey), true)
3140
3241 let userRegistered = "REGISTERED"
3342
3443 let userVerified = "VERIFIED"
3544
3645 let userSuspended = "SUSPENDED"
3746
3847 let userRemoved = "REMOVED"
3948
4049 let userChangeRequired = "CHANGE_REQUIRED"
4150
4251 let userUnregistered = "UNREGISTERED"
4352
4453 let userReset = "RESET"
4554
4655 func getStringByKey (key) = valueOrElse(getString(this, key), "")
4756
4857
4958 func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false)
5059
5160
5261 func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
5362
5463
5564 func keyUserAddr (caller) = ("user_" + caller)
5665
5766
5867 func keyUserName (caller) = ("user_name_" + caller)
5968
6069
6170 func keyUserDesc (caller) = ("user_desc_" + caller)
6271
6372
6473 func keyUserSocial (caller) = ("user_social_" + caller)
6574
6675
6776 func keyUserThumb (caller) = ("user_thumb_" + caller)
6877
6978
7079 func keyUserBanner (caller) = ("user_banner_" + caller)
7180
7281
7382 func keyUserStatus (caller) = ("user_status_" + caller)
7483
7584
7685 func keyUserDate (caller) = ("user_date_" + caller)
7786
7887
7988 func validateCID (cid) = if (contains(cid, "/"))
8089 then if (if ((63 > size(cid)))
8190 then (size(split(cid, "/")[0]) == 46)
8291 else false)
8392 then (16 > size(split(cid, "/")[1]))
8493 else false
8594 else false
8695
8796
8897 func validateBanner (cid) = if ((size(cid) == 0))
8998 then true
9099 else if ((size(cid) == 46))
91100 then true
92101 else false
93102
94103
95104 func validUserData (caller,name,description,thumb,isAnUpdate) = {
96105 let validCID = if ((size(thumb) != 0))
97106 then validateCID(thumb)
98107 else true
99108 if (!(validCID))
100109 then throw("CID don't match requirement!")
101110 else if (if ((name == ""))
102111 then true
103112 else (description == ""))
104113 then throw("Name and description cannot be empty")
105114 else if ((size(description) > 600))
106115 then throw("600 Char. max description")
107116 else if ((size(name) > 45))
108117 then throw("45 Char. max name")
109118 else {
110119 let status = getStringByKey(keyUserStatus(caller))
111120 if (if ((status == userSuspended))
112121 then true
113122 else (status == userRemoved))
114123 then throw("Account suspended/ removed.")
115124 else if (if (!(isAnUpdate))
116125 then (status == userRegistered)
117126 else false)
118127 then throw("Already registered")
119128 else if (if (isAnUpdate)
120129 then (status == "")
121130 else false)
122131 then throw("Register first")
123132 else true
124133 }
125134 }
126135
127136
128137 func validateNewStatus (status,address,currentStatus) = {
129138 let allStatus = [userVerified, userRegistered, userSuspended, userRemoved, userChangeRequired]
130139 let statusToSet = if (containsElement(allStatus, status))
131140 then status
132141 else if ((status == userReset))
133142 then ""
134143 else throw("Unknown status")
135144 let userIsRegistered = getIntegerByKey(keyUserDate(address))
136145 if ((userIsRegistered == 0))
137146 then throw("You cant set this status, user is not registered.")
138147 else statusToSet
139148 }
140149
141150
142151 func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
143152
144153
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+
145178 @Callable(i)
146179 func initDapp (dappKey) = if ((i.caller != this))
147180 then throw("You cannot do this action")
148181 else if ((oracle != ""))
149182 then throw("oracle already set, you can't override!")
150183 else [StringEntry(oracleKey, dappKey)]
151184
152185
153186
154187 @Callable(invoke)
155188 func appRunning (isLive,message) = {
156189 let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
157190 let id = toBase58String(invoke.transactionId)
158191 if (containsElement((owners :+ toString(this)), caller))
159192 then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
160193 else throw("You are not allowed to change this")
161194 }
162195
163196
164197
165198 @Callable(invoke)
166199 func registrationMode (WLonly) = {
167200 let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
168201 let id = toBase58String(invoke.transactionId)
169202 if (containsElement((owners :+ toString(this)), caller))
170203 then [BooleanEntry(whitelistedonlyKey, WLonly)]
171204 else throw("You are not allowed to change this")
172205 }
173206
174207
175208
176-@Callable(invoke)
209+@Callable(i)
177210 func registerUser (name,description,thumb,social,banner) = if (!(dappRunning))
178211 then throw(maintenanceMSG)
179212 else {
180- let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
181- let id = toBase58String(invoke.transactionId)
182- let timestamp = lastBlock.timestamp
183- if (!(validateBanner(banner)))
184- then throw("Invalid banner image!")
185- else if (!(validUserData(caller, name, description, thumb, false)))
186- then throw("Something went wrong")
187- else {
188- let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
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))
189231 [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)]
190- }
232+ }
233+ }
234+ else throw("Strict value is not equal to itself.")
235+ }
191236 }
192237
193238
194239
195-@Callable(invoke)
240+@Callable(i)
196241 func updateUser (name,description,thumb,social,banner) = if (!(dappRunning))
197242 then throw(maintenanceMSG)
198243 else {
199- let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
200- let id = toBase58String(invoke.transactionId)
201- let status = getStringByKey(keyUserStatus(caller))
202- if (!(validateBanner(banner)))
203- then throw("Invalid banner image!")
204- else if (!(validUserData(caller, name, description, thumb, true)))
205- then throw("Something went wrong")
206- else {
207- let date = getIntegerByKey(keyUserDate(caller))
208- let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
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))
209263 [StringEntry(keyUserName(caller), name), StringEntry(keyUserDesc(caller), description), StringEntry(keyUserSocial(caller), social), StringEntry(keyUserBanner(caller), banner), StringEntry(keyUserThumb(caller), thumb), StringEntry(((status + "_") + caller), json)]
210- }
264+ }
265+ }
266+ else throw("Strict value is not equal to itself.")
267+ }
211268 }
212269
213270
214271
215272 @Callable(invoke)
216273 func changeUserStatus (address,status,note,category) = {
217274 let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
218275 let id = toBase58String(invoke.transactionId)
219276 let addr = addressFromString(address)
220277 match addr {
221278 case addr: Address =>
222279 let currentStatus = getStringByKey(keyUserStatus(address))
223280 let statusToSet = validateNewStatus(status, address, currentStatus)
224281 let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
225282 let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
226283 let date = getIntegerByKey(keyUserDate(address))
227284 let json = makeJSON(name, thumb, toString(date))
228285 if (containsElement((owners :+ toString(this)), caller))
229286 then {
230287 let categoryData = if ((statusToSet == userVerified))
231288 then [StringEntry(("category_" + address), category)]
232289 else [DeleteEntry(("category_" + address))]
233290 (categoryData ++ [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(("user_note_" + address), note)])
234291 }
235292 else throw("Not allowed to change user status")
236293 case _ =>
237294 throw("Seems to be an invalid address!")
238295 }
239296 }
240297
241298
242299
243300 @Callable(invoke)
244301 func deleteUser (address) = {
245302 let caller = toString(addressFromPublicKey(invoke.callerPublicKey))
246303 let id = toBase58String(invoke.transactionId)
247304 let currentStatus = getStringByKey(keyUserStatus(address))
248305 if (containsElement((owners :+ toString(this)), caller))
249306 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)]
250307 else throw("Not allowed")
251308 }
252309
253310
254311
255312 @Callable(i)
256313 func deleteEntry (entry) = {
257314 let caller = toString(addressFromPublicKey(i.callerPublicKey))
258315 if (containsElement(owners, caller))
259316 then [DeleteEntry(entry)]
260317 else throw("no")
261318 }
262319
263320

github/deemru/w8io/169f3d6 
37.66 ms