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