tx · HW186RTVs18x4qX7wqseGHXFDZDPVGd6vE3Z6Zgo2S7L

3MvpFffWWo5or6sUZeRmSSxKSbiZkArx7En:  -0.01400000 Waves

2022.10.22 09:46 [2283266] smart account 3MvpFffWWo5or6sUZeRmSSxKSbiZkArx7En > SELF 0.00000000 Waves

{ "type": 13, "id": "HW186RTVs18x4qX7wqseGHXFDZDPVGd6vE3Z6Zgo2S7L", "fee": 1400000, "feeAssetId": null, "timestamp": 1666421230152, "version": 2, "chainId": 84, "sender": "3MvpFffWWo5or6sUZeRmSSxKSbiZkArx7En", "senderPublicKey": "4pdv1bda9eVqVBp5VvxCh7vZWnTAYzoQuidCZhupq1Ak", "proofs": [ "3fLu5xoFcbgTQ94RHo2NU8WAZsMp5XGU2wJXbJa5dRoFEtW7masuSQXprnZKimSXbW4LbaCknsoQebK4yDdr2RJ" ], "script": "base64:BgIqCAISBAoCCAgSBAoCBAgSBgoECAgICBIGCgQICAgIEgUKAwgICBIDCgEIGAAHVkVSU0lPTgIDMS4wAQ5nZXRTdHJpbmdCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMFA2tleQIAAQ9nZXRCb29sZWFuQnlLZXkBA2tleQkBC3ZhbHVlT3JFbHNlAgkAmwgCBQR0aGlzBQNrZXkHAQ9nZXRJbnRlZ2VyQnlLZXkBA2tleQkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBQNrZXkAAAAFY2hyaXMJAQ5nZXRTdHJpbmdCeUtleQECDGNvbmZfYWRtaW5fMQAOZGFwcFJ1bm5pbmdLZXkCFGNvbmZfZGFwcF9pc19ydW5uaW5nABFtYWludGVuYW5jZU1TR0tleQIUY29uZl9tYWludGVuYW5jZV9tc2cAC2RhcHBSdW5uaW5nCQELdmFsdWVPckVsc2UCCQCbCAIFBHRoaXMFDmRhcHBSdW5uaW5nS2V5BgAObWFpbnRlbmFuY2VNU0cJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwURbWFpbn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XkBCQEMa2V5VXNlclRodW1iAQUHYWRkcmVzcwQLZGVzY3JpcHRpb24JANoEAQkAmwMBCQEOZ2V0U3RyaW5nQnlLZXkBCQELa2V5VXNlckRlc2MBBQdhZGRyZXNzBAZzb2NpYWwJANoEAQkAmwMBCQEOZ2V0U3RyaW5nQnlLZXkBCQENa2V5VXNlclNvY2lhbAEFB2FkZHJlc3MEBGRhdGUJAQ9nZXRJbnRlZ2VyQnlLZXkBCQELa2V5VXNlckRhdGUBBQdhZGRyZXNzBARqc29uCQEIbWFrZUpTT04FBQRuYW1lBQtkZXNjcmlwdGlvbgUGc29jaWFsBQV0aHVtYgkApAMBBQRkYXRlAwkBD2NvbnRhaW5zRWxlbWVudAIJAMwIAgUFY2hyaXMJAMwIAgkApQgBBQR0aGlzBQNuaWwFBmNhbGxlcgkAzAgCCQELU3RyaW5nRW50cnkCCQENa2V5VXNlclN0YXR1cwEFB2FkZHJlc3MFC3N0YXR1c1RvU2V0CQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgkArAICBQ1jdXJyZW50U3RhdHVzAgFfBQdhZGRyZXNzCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICBQtzdGF0dXNUb1NldAIBXwUHYWRkcmVzcwUEanNvbgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgICCnVzZXJfbm90ZV8FB2FkZHJlc3MFBG5vdGUFA25pbAkAAgECIU5vdCBhbGxvd2VkIHRvIGNoYW5nZSB1c2VyIHN0YXR1cwFpAQtkZWxldGVFbnRyeQEFZW50cnkEBmNhbGxlcgkApQgBCAUBaQZjYWxsZXIDCQAAAgUGY2FsbGVyBQVjaHJpcwkAzAgCCQELRGVsZXRlRW50cnkBBQVlbnRyeQUDbmlsCQACAQICbm8Af3kUVg==", "height": 2283266, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FJs5jKw9FTDMmMiQCXY2WjNFzM1Fr6m82pgXhe4ncLNz Next: 9DfxXRLS4AaXTEWzdA9ZSguZGE2W352uFHkhTJ5NKZHn Diff:
OldNewDifferences
105105 }
106106
107107
108-func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
108+func makeJSON (name,description,social,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
109109
110110
111111 @Callable(invoke)
138138 if (!(validUserData(caller, name, description, thumb, false)))
139139 then throw("Something went wrong")
140140 else {
141- let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
141+ let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(description)), toBase64String(toBytes(social)), toBase64String(toBytes(thumb)), toString(timestamp))
142142 [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), StringEntry(((userRegistered + "_") + caller), json)]
143143 }
144144 }
155155 then throw("Something went wrong")
156156 else {
157157 let date = getIntegerByKey(keyUserDate(caller))
158- let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
158+ let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(description)), toBase64String(toBytes(social)), toBase64String(toBytes(thumb)), toString(date))
159159 [StringEntry(keyUserName(caller), name), StringEntry(keyUserDesc(caller), description), StringEntry(keyUserSocial(caller), social), StringEntry(keyUserThumb(caller), thumb), StringEntry(((status + "_") + caller), json)]
160160 }
161161 }
169169 let statusToSet = validateNewStatus(status, address, currentStatus)
170170 let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
171171 let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
172+ let description = toBase64String(toBytes(getStringByKey(keyUserDesc(address))))
173+ let social = toBase64String(toBytes(getStringByKey(keyUserSocial(address))))
172174 let date = getIntegerByKey(keyUserDate(address))
173- let json = makeJSON(name, thumb, toString(date))
175+ let json = makeJSON(name, description, social, thumb, toString(date))
174176 if (containsElement([chris, toString(this)], caller))
175177 then [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(("user_note_" + address), note)]
176178 else throw("Not allowed to change user status")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let VERSION = "1.0"
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 dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true)
2222
2323 let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "")
2424
2525 let userRegistered = "REGISTERED"
2626
2727 let userVerified = "VERIFIED"
2828
2929 let userSuspended = "SUSPENDED"
3030
3131 let userChangeRequired = "CHANGE_REQUIRED"
3232
3333 func keyUserAddr (caller) = ("user_" + caller)
3434
3535
3636 func keyUserName (caller) = ("user_name_" + caller)
3737
3838
3939 func keyUserDesc (caller) = ("user_desc_" + caller)
4040
4141
4242 func keyUserSocial (caller) = ("user_social_" + caller)
4343
4444
4545 func keyUserThumb (caller) = ("user_thumb_" + caller)
4646
4747
4848 func keyUserStatus (caller) = ("user_status_" + caller)
4949
5050
5151 func keyUserDate (caller) = ("user_date_" + caller)
5252
5353
5454 func validateCID (cid) = if (contains(cid, "/"))
5555 then if (if ((76 > size(cid)))
5656 then (size(split(cid, "/")[0]) == 59)
5757 else false)
5858 then (16 > size(split(cid, "/")[1]))
5959 else false
6060 else false
6161
6262
6363 func validUserData (caller,name,description,thumb,isAnUpdate) = {
6464 let validCID = if ((size(thumb) != 0))
6565 then validateCID(thumb)
6666 else true
6767 if (!(validCID))
6868 then throw("CID don't match requirement!")
6969 else if (if ((name == ""))
7070 then true
7171 else (description == ""))
7272 then throw("Name and description cannot be empty")
7373 else if ((size(description) > 600))
7474 then throw("600 Char. max description")
7575 else if ((size(name) > 100))
7676 then throw("100 Char. max name")
7777 else {
7878 let status = getStringByKey(keyUserStatus(caller))
7979 if ((status == userSuspended))
8080 then throw("Account suspended.")
8181 else if (if (!(isAnUpdate))
8282 then (status == userRegistered)
8383 else false)
8484 then throw("Already registered")
8585 else if (if (if (isAnUpdate)
8686 then (status == "")
8787 else false)
8888 then true
8989 else isAnUpdate)
9090 then throw("Register first")
9191 else true
9292 }
9393 }
9494
9595
9696 func validateNewStatus (status,address,currentStatus) = {
9797 let allStatus = [userVerified, userRegistered, userSuspended, userChangeRequired]
9898 let statusToSet = if (containsElement(allStatus, status))
9999 then status
100100 else throw("Unknown status")
101101 let userIsRegistered = getIntegerByKey(keyUserDate(address))
102102 if ((userIsRegistered == 0))
103103 then throw("You cant set this status, user is not registered.")
104104 else statusToSet
105105 }
106106
107107
108-func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
108+func makeJSON (name,description,social,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
109109
110110
111111 @Callable(invoke)
112112 func setConf (key,val) = {
113113 let caller = toString(invoke.caller)
114114 if (containsElement([chris, toString(this)], caller))
115115 then [StringEntry(key, val)]
116116 else throw("You are not allowed to change this")
117117 }
118118
119119
120120
121121 @Callable(invoke)
122122 func appRunning (isLive,message) = {
123123 let caller = toString(invoke.caller)
124124 if (containsElement([chris, toString(this)], caller))
125125 then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
126126 else throw("You are not allowed to change this")
127127 }
128128
129129
130130
131131 @Callable(invoke)
132132 func registerUser (name,description,thumb,social) = if (!(dappRunning))
133133 then throw(maintenanceMSG)
134134 else {
135135 let caller = toString(invoke.caller)
136136 let id = toBase58String(invoke.transactionId)
137137 let timestamp = lastBlock.timestamp
138138 if (!(validUserData(caller, name, description, thumb, false)))
139139 then throw("Something went wrong")
140140 else {
141- let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
141+ let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(description)), toBase64String(toBytes(social)), toBase64String(toBytes(thumb)), toString(timestamp))
142142 [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), StringEntry(((userRegistered + "_") + caller), json)]
143143 }
144144 }
145145
146146
147147
148148 @Callable(invoke)
149149 func updateUser (name,description,thumb,social) = if (!(dappRunning))
150150 then throw(maintenanceMSG)
151151 else {
152152 let caller = toString(invoke.caller)
153153 let status = getStringByKey(keyUserStatus(caller))
154154 if (!(validUserData(caller, name, description, thumb, true)))
155155 then throw("Something went wrong")
156156 else {
157157 let date = getIntegerByKey(keyUserDate(caller))
158- let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
158+ let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(description)), toBase64String(toBytes(social)), toBase64String(toBytes(thumb)), toString(date))
159159 [StringEntry(keyUserName(caller), name), StringEntry(keyUserDesc(caller), description), StringEntry(keyUserSocial(caller), social), StringEntry(keyUserThumb(caller), thumb), StringEntry(((status + "_") + caller), json)]
160160 }
161161 }
162162
163163
164164
165165 @Callable(invoke)
166166 func changeUserStatus (address,status,note) = {
167167 let caller = toString(invoke.caller)
168168 let currentStatus = getStringByKey(keyUserStatus(address))
169169 let statusToSet = validateNewStatus(status, address, currentStatus)
170170 let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
171171 let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
172+ let description = toBase64String(toBytes(getStringByKey(keyUserDesc(address))))
173+ let social = toBase64String(toBytes(getStringByKey(keyUserSocial(address))))
172174 let date = getIntegerByKey(keyUserDate(address))
173- let json = makeJSON(name, thumb, toString(date))
175+ let json = makeJSON(name, description, social, thumb, toString(date))
174176 if (containsElement([chris, toString(this)], caller))
175177 then [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(("user_note_" + address), note)]
176178 else throw("Not allowed to change user status")
177179 }
178180
179181
180182
181183 @Callable(i)
182184 func deleteEntry (entry) = {
183185 let caller = toString(i.caller)
184186 if ((caller == chris))
185187 then [DeleteEntry(entry)]
186188 else throw("no")
187189 }
188190
189191

github/deemru/w8io/026f985 
50.19 ms