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