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:BgJNCAISBAoCCAgSBAoCBAgSAwoBBBIICgYICAgIAQgSCAoGCAgICAEIEgQKAggIEgYKBAgICAgSAwoBCBIGCgQICAEBEgQKAggIEgMKAQgqAAdWRVJTSU9OAgMxLjUBDmdldFN0cmluZ0J5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgABD2dldEJvb2xlYW5CeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCbCAIFBHRoaXMFA2tleQcBD2dldEludGVnZXJCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFA2tleQAAAAVjaHJpcwkBDmdldFN0cmluZ0J5S2V5AQIMY29uZl9hZG1pbl8xAA5kYXBwUnVubmluZ0tleQIUY29uZl9kYXBwX2lzX3J1bm5pbmcAEW1haW50ZW5hbmNlTVNHS2V5AhRjb25mX21haW50ZW5hbmNlX21zZwASd2hpdGVsaXN0ZWRvbmx5S2V5AhVjb25mX3doaXRlbGlzdGVkX29ubHkAC2RhcHBSdW5uaW5nCQELdmFsdWVPckVsc2UCCQCbC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gGcHJvb2ZzAAAJANkEAQkBCGFzU3RyaW5nAQkAkQMCCAUDaW52BGFyZ3MABQMDAwMJAAACCAUDaW52CGZ1bmN0aW9uAgp1cGRhdGVVc2VyCQAAAggFA2ludgRkQXBwBQR0aGlzBwkAAAIIBQNpbnYDZmVlAKDCHgcJAAACCAUDaW52CmZlZUFzc2V0SWQFBHVuaXQHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACQDZBAEJAQhhc1N0cmluZwEJAJEDAggFA2ludgRhcmdzAAUDAwMDCQAAAggFA2ludghmdW5jdGlvbgIMc2V0RVJDMjBVc2VyCQAAAggFA2ludgRkQXBwBQR0aGlzBwkAAAIIBQNpbnYDZmVlAKDCHgcJAAACCAUDaW52CmZlZUFzc2V0SWQFBHVuaXQHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACQDZBAEJAQhhc1N0cmluZwEJAJEDAggFA2ludgRhcmdzAAIJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlUqqmP", "height": 2415524, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: C8q679QND49iekVWNm7eeEXnLKhZiZrapBQeP4GKzGvh Next: 7MNNQHXVM5mXEWKoFQTJGZ2egQFhsWnE2yYTqUaFECxq Diff:
Old | New | Differences | |
---|---|---|---|
69 | 69 | ||
70 | 70 | ||
71 | 71 | func keyUserERC20 (caller) = ("user_ERC20_" + caller) | |
72 | + | ||
73 | + | ||
74 | + | func keyUserNote (caller) = ("user_note_" + caller) | |
75 | + | ||
76 | + | ||
77 | + | func keyUserLabel (caller) = ("user_label_" + caller) | |
72 | 78 | ||
73 | 79 | ||
74 | 80 | func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr) | |
231 | 237 | func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning)) | |
232 | 238 | then throw(maintenanceMSG) | |
233 | 239 | else { | |
234 | - | let $ | |
235 | - | let caller = $ | |
236 | - | let isSponsored = $ | |
240 | + | let $t073197371 = getCaller(invoke, pubKey) | |
241 | + | let caller = $t073197371._1 | |
242 | + | let isSponsored = $t073197371._2 | |
237 | 243 | let id = toBase58String(invoke.transactionId) | |
238 | 244 | let timestamp = lastBlock.timestamp | |
245 | + | let note = getStringByKey(keyUserNote(caller)) | |
246 | + | let label = getStringByKey(keyUserLabel(caller)) | |
239 | 247 | if (!(validUserData(caller, name, description, thumb, false))) | |
240 | 248 | then throw("Something went wrong") | |
241 | 249 | else { | |
248 | 256 | let txToCaller = if (isSponsored) | |
249 | 257 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
250 | 258 | 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) | |
252 | 260 | } | |
253 | 261 | } | |
254 | 262 | } | |
259 | 267 | func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning)) | |
260 | 268 | then throw(maintenanceMSG) | |
261 | 269 | else { | |
262 | - | let $ | |
263 | - | let caller = $ | |
264 | - | let isSponsored = $ | |
270 | + | let $t090179121 = getCaller(invoke, pubKey) | |
271 | + | let caller = $t090179121._1 | |
272 | + | let isSponsored = $t090179121._2 | |
265 | 273 | let status = getStringByKey(keyUserStatus(caller)) | |
266 | 274 | if (!(validUserData(caller, name, description, thumb, true))) | |
267 | 275 | then throw("Something went wrong") | |
287 | 295 | func setERC20User (erc20,pubKey) = if (!(dappRunning)) | |
288 | 296 | then throw(maintenanceMSG) | |
289 | 297 | else { | |
290 | - | let $ | |
291 | - | let caller = $ | |
292 | - | let isSponsored = $ | |
298 | + | let $t01030810411 = getCaller(invoke, pubKey) | |
299 | + | let caller = $t01030810411._1 | |
300 | + | let isSponsored = $t01030810411._2 | |
293 | 301 | let status = getStringByKey(keyUserStatus(caller)) | |
294 | 302 | if (if ((status != userRegistered)) | |
295 | 303 | then (status != userVerified) | |
317 | 325 | let caller = toString(invoke.caller) | |
318 | 326 | if (containsElement([chris, toString(this)], caller)) | |
319 | 327 | then if ((size(status) == 0)) | |
320 | - | then [StringEntry(( | |
328 | + | then [StringEntry(keyUserNote(address), note), StringEntry(keyUserLabel(address), label)] | |
321 | 329 | else { | |
322 | 330 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
323 | 331 | let statusToSet = validateNewStatus(status, address, currentStatus) | |
325 | 333 | let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address)))) | |
326 | 334 | let date = getIntegerByKey(keyUserDate(address)) | |
327 | 335 | let json = makeJSON(name, thumb, toString(date)) | |
328 | - | [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(( | |
336 | + | [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(keyUserNote(address), note), StringEntry(keyUserLabel(address), label)] | |
329 | 337 | } | |
330 | 338 | else throw("Not allowed to change user status") | |
331 | 339 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let VERSION = "1.5" | |
5 | 5 | ||
6 | 6 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false) | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | let chris = getStringByKey("conf_admin_1") | |
16 | 16 | ||
17 | 17 | let dappRunningKey = "conf_dapp_is_running" | |
18 | 18 | ||
19 | 19 | let maintenanceMSGKey = "conf_maintenance_msg" | |
20 | 20 | ||
21 | 21 | let whitelistedonlyKey = "conf_whitelisted_only" | |
22 | 22 | ||
23 | 23 | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
24 | 24 | ||
25 | 25 | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
26 | 26 | ||
27 | 27 | let whitelistedonly = valueOrElse(getBoolean(this, whitelistedonlyKey), true) | |
28 | 28 | ||
29 | 29 | let whitelistDapp = value(addressFromString(getStringByKey("conf_whitelist_dapp"))) | |
30 | 30 | ||
31 | 31 | let userAllowed = "ALLOWED" | |
32 | 32 | ||
33 | 33 | let userRegistered = "REGISTERED" | |
34 | 34 | ||
35 | 35 | let userVerified = "VERIFIED" | |
36 | 36 | ||
37 | 37 | let userSuspended = "SUSPENDED" | |
38 | 38 | ||
39 | 39 | let userRemoved = "REMOVED" | |
40 | 40 | ||
41 | 41 | let userChangeRequired = "CHANGE_REQUIRED" | |
42 | 42 | ||
43 | 43 | let userUnregistered = "UNREGISTERED" | |
44 | 44 | ||
45 | 45 | let userReset = "RESET" | |
46 | 46 | ||
47 | 47 | func keyUserAddr (caller) = ("user_" + caller) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func keyUserName (caller) = ("user_name_" + caller) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func keyUserDesc (caller) = ("user_desc_" + caller) | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func keyUserSocial (caller) = ("user_social_" + caller) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func keyUserThumb (caller) = ("user_thumb_" + caller) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func keyUserStatus (caller) = ("user_status_" + caller) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func keyUserRoyalties (caller) = ("user_royalties_" + caller) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func keyUserDate (caller) = ("user_date_" + caller) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func keyUserERC20 (caller) = ("user_ERC20_" + caller) | |
72 | + | ||
73 | + | ||
74 | + | func keyUserNote (caller) = ("user_note_" + caller) | |
75 | + | ||
76 | + | ||
77 | + | func keyUserLabel (caller) = ("user_label_" + caller) | |
72 | 78 | ||
73 | 79 | ||
74 | 80 | func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr) | |
75 | 81 | ||
76 | 82 | ||
77 | 83 | func keyAgentArtistAddr (agentAddr,artistAddr) = ((("agent_" + agentAddr) + "_") + artistAddr) | |
78 | 84 | ||
79 | 85 | ||
80 | 86 | func keyPrimaryShare (artistAddr) = ("artist_agent_primary_" + artistAddr) | |
81 | 87 | ||
82 | 88 | ||
83 | 89 | func keySecondaryShare (artistAddr) = ("artist_agent_secondary_" + artistAddr) | |
84 | 90 | ||
85 | 91 | ||
86 | 92 | func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0) | |
87 | 93 | ||
88 | 94 | ||
89 | 95 | func validateCID (cid) = if (contains(cid, "/")) | |
90 | 96 | then if (if ((76 > size(cid))) | |
91 | 97 | then (size(split(cid, "/")[0]) == 59) | |
92 | 98 | else false) | |
93 | 99 | then (16 > size(split(cid, "/")[1])) | |
94 | 100 | else false | |
95 | 101 | else false | |
96 | 102 | ||
97 | 103 | ||
98 | 104 | func validUserData (caller,name,description,thumb,isAnUpdate) = { | |
99 | 105 | let validCID = if ((size(thumb) != 0)) | |
100 | 106 | then validateCID(thumb) | |
101 | 107 | else true | |
102 | 108 | if (!(validCID)) | |
103 | 109 | then throw("CID don't match requirement!") | |
104 | 110 | else if (if ((name == "")) | |
105 | 111 | then true | |
106 | 112 | else (description == "")) | |
107 | 113 | then throw("Name and description cannot be empty") | |
108 | 114 | else if ((size(description) > 600)) | |
109 | 115 | then throw("600 Char. max description") | |
110 | 116 | else if ((size(name) > 45)) | |
111 | 117 | then throw("45 Char. max name") | |
112 | 118 | else { | |
113 | 119 | let status = getStringByKey(keyUserStatus(caller)) | |
114 | 120 | if (if ((status == userSuspended)) | |
115 | 121 | then true | |
116 | 122 | else (status == userRemoved)) | |
117 | 123 | then throw("Account suspended/ removed.") | |
118 | 124 | else if (if (!(isAnUpdate)) | |
119 | 125 | then (status == userRegistered) | |
120 | 126 | else false) | |
121 | 127 | then throw("Already registered") | |
122 | 128 | else if (if (if (!(isAnUpdate)) | |
123 | 129 | then (status == "") | |
124 | 130 | else false) | |
125 | 131 | then whitelistedonly | |
126 | 132 | else false) | |
127 | 133 | then throw("Can't register, get approved first.") | |
128 | 134 | else if (if (if (isAnUpdate) | |
129 | 135 | then (status == "") | |
130 | 136 | else false) | |
131 | 137 | then true | |
132 | 138 | else if (isAnUpdate) | |
133 | 139 | then (status == userAllowed) | |
134 | 140 | else false) | |
135 | 141 | then throw("Register first") | |
136 | 142 | else true | |
137 | 143 | } | |
138 | 144 | } | |
139 | 145 | ||
140 | 146 | ||
141 | 147 | func validateNewStatus (status,address,currentStatus) = { | |
142 | 148 | let allStatus = [userVerified, userRegistered, userSuspended, userRemoved, userAllowed, userChangeRequired] | |
143 | 149 | let statusToSet = if (containsElement(allStatus, status)) | |
144 | 150 | then status | |
145 | 151 | else if (if ((status == userReset)) | |
146 | 152 | then (currentStatus == userAllowed) | |
147 | 153 | else false) | |
148 | 154 | then "" | |
149 | 155 | else throw("Unknown status") | |
150 | 156 | let userIsRegistered = getIntegerByKey(keyUserDate(address)) | |
151 | 157 | if (if ((userIsRegistered == 0)) | |
152 | 158 | then (statusToSet != userAllowed) | |
153 | 159 | else false) | |
154 | 160 | then throw("You cant set this status, user is not registered.") | |
155 | 161 | else if (if ((currentStatus == userAllowed)) | |
156 | 162 | then (statusToSet == userAllowed) | |
157 | 163 | else false) | |
158 | 164 | then throw("User already allowed") | |
159 | 165 | else if (if ((currentStatus == userRegistered)) | |
160 | 166 | then (statusToSet == userAllowed) | |
161 | 167 | else false) | |
162 | 168 | then throw("User already allowed & registered") | |
163 | 169 | else if (if ((currentStatus == userVerified)) | |
164 | 170 | then (statusToSet == userAllowed) | |
165 | 171 | else false) | |
166 | 172 | then throw("User already allowed & verified") | |
167 | 173 | else statusToSet | |
168 | 174 | } | |
169 | 175 | ||
170 | 176 | ||
171 | 177 | func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}") | |
172 | 178 | ||
173 | 179 | ||
174 | 180 | func asString (bv) = match bv { | |
175 | 181 | case bv0: String => | |
176 | 182 | bv0 | |
177 | 183 | case _ => | |
178 | 184 | throw("Sponsored Public Key String expected") | |
179 | 185 | } | |
180 | 186 | ||
181 | 187 | ||
182 | 188 | func getCaller (i,pubKey) = { | |
183 | 189 | let isSponsored = if ((pubKey != "")) | |
184 | 190 | then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0) | |
185 | 191 | else 0 | |
186 | 192 | let caller = if (if ((toBase58String(i.caller.bytes) == toString(this))) | |
187 | 193 | then (isSponsored > 0) | |
188 | 194 | else false) | |
189 | 195 | then toString(addressFromPublicKey(fromBase58String(pubKey))) | |
190 | 196 | else toBase58String(i.caller.bytes) | |
191 | 197 | let get_sponsored_waves = if ((pubKey != "")) | |
192 | 198 | then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil) | |
193 | 199 | else unit | |
194 | 200 | if ((get_sponsored_waves == get_sponsored_waves)) | |
195 | 201 | then $Tuple2(caller, (isSponsored > 0)) | |
196 | 202 | else throw("Strict value is not equal to itself.") | |
197 | 203 | } | |
198 | 204 | ||
199 | 205 | ||
200 | 206 | @Callable(invoke) | |
201 | 207 | func setConf (key,val) = { | |
202 | 208 | let caller = toString(invoke.caller) | |
203 | 209 | if (containsElement([chris, toString(this)], caller)) | |
204 | 210 | then [StringEntry(key, val)] | |
205 | 211 | else throw("You are not allowed to change this") | |
206 | 212 | } | |
207 | 213 | ||
208 | 214 | ||
209 | 215 | ||
210 | 216 | @Callable(invoke) | |
211 | 217 | func appRunning (isLive,message) = { | |
212 | 218 | let caller = toString(invoke.caller) | |
213 | 219 | if (containsElement([chris, toString(this)], caller)) | |
214 | 220 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
215 | 221 | else throw("You are not allowed to change this") | |
216 | 222 | } | |
217 | 223 | ||
218 | 224 | ||
219 | 225 | ||
220 | 226 | @Callable(invoke) | |
221 | 227 | func registrationMode (WLonly) = { | |
222 | 228 | let caller = toString(invoke.caller) | |
223 | 229 | if (containsElement([chris, toString(this)], caller)) | |
224 | 230 | then [BooleanEntry(whitelistedonlyKey, WLonly)] | |
225 | 231 | else throw("You are not allowed to change this") | |
226 | 232 | } | |
227 | 233 | ||
228 | 234 | ||
229 | 235 | ||
230 | 236 | @Callable(invoke) | |
231 | 237 | func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning)) | |
232 | 238 | then throw(maintenanceMSG) | |
233 | 239 | else { | |
234 | - | let $ | |
235 | - | let caller = $ | |
236 | - | let isSponsored = $ | |
240 | + | let $t073197371 = getCaller(invoke, pubKey) | |
241 | + | let caller = $t073197371._1 | |
242 | + | let isSponsored = $t073197371._2 | |
237 | 243 | let id = toBase58String(invoke.transactionId) | |
238 | 244 | let timestamp = lastBlock.timestamp | |
245 | + | let note = getStringByKey(keyUserNote(caller)) | |
246 | + | let label = getStringByKey(keyUserLabel(caller)) | |
239 | 247 | if (!(validUserData(caller, name, description, thumb, false))) | |
240 | 248 | then throw("Something went wrong") | |
241 | 249 | else { | |
242 | 250 | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp)) | |
243 | 251 | if (if ((0 > royalties)) | |
244 | 252 | then true | |
245 | 253 | else (royalties > 1000)) | |
246 | 254 | then throw("Royalties cannot be less than 0% or higher than 10%") | |
247 | 255 | else { | |
248 | 256 | let txToCaller = if (isSponsored) | |
249 | 257 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
250 | 258 | 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) | |
252 | 260 | } | |
253 | 261 | } | |
254 | 262 | } | |
255 | 263 | ||
256 | 264 | ||
257 | 265 | ||
258 | 266 | @Callable(invoke) | |
259 | 267 | func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning)) | |
260 | 268 | then throw(maintenanceMSG) | |
261 | 269 | else { | |
262 | - | let $ | |
263 | - | let caller = $ | |
264 | - | let isSponsored = $ | |
270 | + | let $t090179121 = getCaller(invoke, pubKey) | |
271 | + | let caller = $t090179121._1 | |
272 | + | let isSponsored = $t090179121._2 | |
265 | 273 | let status = getStringByKey(keyUserStatus(caller)) | |
266 | 274 | if (!(validUserData(caller, name, description, thumb, true))) | |
267 | 275 | then throw("Something went wrong") | |
268 | 276 | else { | |
269 | 277 | let date = getIntegerByKey(keyUserDate(caller)) | |
270 | 278 | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date)) | |
271 | 279 | if (if ((0 > royalties)) | |
272 | 280 | then true | |
273 | 281 | else (royalties > 1000)) | |
274 | 282 | then throw("Royalties cannot be less than 0% or higher than 10%") | |
275 | 283 | else { | |
276 | 284 | let txToCaller = if (isSponsored) | |
277 | 285 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
278 | 286 | else nil | |
279 | 287 | ([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) | |
280 | 288 | } | |
281 | 289 | } | |
282 | 290 | } | |
283 | 291 | ||
284 | 292 | ||
285 | 293 | ||
286 | 294 | @Callable(invoke) | |
287 | 295 | func setERC20User (erc20,pubKey) = if (!(dappRunning)) | |
288 | 296 | then throw(maintenanceMSG) | |
289 | 297 | else { | |
290 | - | let $ | |
291 | - | let caller = $ | |
292 | - | let isSponsored = $ | |
298 | + | let $t01030810411 = getCaller(invoke, pubKey) | |
299 | + | let caller = $t01030810411._1 | |
300 | + | let isSponsored = $t01030810411._2 | |
293 | 301 | let status = getStringByKey(keyUserStatus(caller)) | |
294 | 302 | if (if ((status != userRegistered)) | |
295 | 303 | then (status != userVerified) | |
296 | 304 | else false) | |
297 | 305 | then throw("Not allowed to set ERC20 address") | |
298 | 306 | else { | |
299 | 307 | let firstTwo = take(erc20, 2) | |
300 | 308 | if (if ((firstTwo != "0x")) | |
301 | 309 | then true | |
302 | 310 | else (size(erc20) != 42)) | |
303 | 311 | then throw("This is not an erc20 address") | |
304 | 312 | else { | |
305 | 313 | let txToCaller = if (isSponsored) | |
306 | 314 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
307 | 315 | else nil | |
308 | 316 | ([StringEntry(keyUserERC20(caller), erc20)] ++ txToCaller) | |
309 | 317 | } | |
310 | 318 | } | |
311 | 319 | } | |
312 | 320 | ||
313 | 321 | ||
314 | 322 | ||
315 | 323 | @Callable(invoke) | |
316 | 324 | func changeUserStatus (address,status,note,label) = { | |
317 | 325 | let caller = toString(invoke.caller) | |
318 | 326 | if (containsElement([chris, toString(this)], caller)) | |
319 | 327 | then if ((size(status) == 0)) | |
320 | - | then [StringEntry(( | |
328 | + | then [StringEntry(keyUserNote(address), note), StringEntry(keyUserLabel(address), label)] | |
321 | 329 | else { | |
322 | 330 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
323 | 331 | let statusToSet = validateNewStatus(status, address, currentStatus) | |
324 | 332 | let name = toBase64String(toBytes(getStringByKey(keyUserName(address)))) | |
325 | 333 | let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address)))) | |
326 | 334 | let date = getIntegerByKey(keyUserDate(address)) | |
327 | 335 | let json = makeJSON(name, thumb, toString(date)) | |
328 | - | [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(( | |
336 | + | [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(keyUserNote(address), note), StringEntry(keyUserLabel(address), label)] | |
329 | 337 | } | |
330 | 338 | else throw("Not allowed to change user status") | |
331 | 339 | } | |
332 | 340 | ||
333 | 341 | ||
334 | 342 | ||
335 | 343 | @Callable(invoke) | |
336 | 344 | func deleteUser (address) = { | |
337 | 345 | let caller = toString(invoke.caller) | |
338 | 346 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
339 | 347 | if (containsElement([chris, toString(this)], caller)) | |
340 | 348 | 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)] | |
341 | 349 | else throw("Not allowed") | |
342 | 350 | } | |
343 | 351 | ||
344 | 352 | ||
345 | 353 | ||
346 | 354 | @Callable(i) | |
347 | 355 | func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning)) | |
348 | 356 | then throw(maintenanceMSG) | |
349 | 357 | else { | |
350 | 358 | let caller = toString(i.caller) | |
351 | 359 | if (containsElement([chris, toString(this)], caller)) | |
352 | 360 | then if (if ((size(artistAddr) != 35)) | |
353 | 361 | then true | |
354 | 362 | else (size(agentAddr) != 35)) | |
355 | 363 | then throw("Wrong address") | |
356 | 364 | else [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)] | |
357 | 365 | else throw("You are not allowed") | |
358 | 366 | } | |
359 | 367 | ||
360 | 368 | ||
361 | 369 | ||
362 | 370 | @Callable(i) | |
363 | 371 | func unsetAgent (artistAddr,agentAddr) = if (!(dappRunning)) | |
364 | 372 | then throw(maintenanceMSG) | |
365 | 373 | else { | |
366 | 374 | let caller = toString(i.caller) | |
367 | 375 | if (containsElement([chris, toString(this)], caller)) | |
368 | 376 | then if (if ((size(artistAddr) != 35)) | |
369 | 377 | then true | |
370 | 378 | else (size(agentAddr) != 35)) | |
371 | 379 | then throw("Wrong address") | |
372 | 380 | else [DeleteEntry(keyArtistAgentAddr(artistAddr)), DeleteEntry(keyAgentArtistAddr(agentAddr, artistAddr)), DeleteEntry(keyPrimaryShare(artistAddr)), DeleteEntry(keySecondaryShare(artistAddr))] | |
373 | 381 | else throw("You are not allowed") | |
374 | 382 | } | |
375 | 383 | ||
376 | 384 | ||
377 | 385 | ||
378 | 386 | @Callable(i) | |
379 | 387 | func deleteEntry (entry) = { | |
380 | 388 | let caller = toString(i.caller) | |
381 | 389 | if ((caller == chris)) | |
382 | 390 | then [DeleteEntry(entry)] | |
383 | 391 | else throw("no") | |
384 | 392 | } | |
385 | 393 | ||
386 | 394 | ||
387 | 395 | @Verifier(tx) | |
388 | 396 | func verifier () = match tx { | |
389 | 397 | case inv: InvokeScriptTransaction => | |
390 | 398 | if (if (if (if ((inv.function == "registerUser")) | |
391 | 399 | then (inv.dApp == this) | |
392 | 400 | else false) | |
393 | 401 | then (inv.fee == 500000) | |
394 | 402 | else false) | |
395 | 403 | then (inv.feeAssetId == unit) | |
396 | 404 | else false) | |
397 | 405 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5]))) | |
398 | 406 | else if (if (if (if ((inv.function == "updateUser")) | |
399 | 407 | then (inv.dApp == this) | |
400 | 408 | else false) | |
401 | 409 | then (inv.fee == 500000) | |
402 | 410 | else false) | |
403 | 411 | then (inv.feeAssetId == unit) | |
404 | 412 | else false) | |
405 | 413 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5]))) | |
406 | 414 | else if (if (if (if ((inv.function == "setERC20User")) | |
407 | 415 | then (inv.dApp == this) | |
408 | 416 | else false) | |
409 | 417 | then (inv.fee == 500000) | |
410 | 418 | else false) | |
411 | 419 | then (inv.feeAssetId == unit) | |
412 | 420 | else false) | |
413 | 421 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[2]))) | |
414 | 422 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
415 | 423 | case _ => | |
416 | 424 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
417 | 425 | } | |
418 | 426 |
github/deemru/w8io/026f985 72.82 ms ◑