tx · 9coC7PKpTkXWApoTZJZG5etZnBGWWCgJD87aHaQcNAc5 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj: -0.01100000 Waves 2023.01.20 08:50 [2412873] smart account 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj > SELF 0.00000000 Waves
{ "type": 13, "id": "9coC7PKpTkXWApoTZJZG5etZnBGWWCgJD87aHaQcNAc5", "fee": 1100000, "feeAssetId": null, "timestamp": 1674193912999, "version": 2, "chainId": 84, "sender": "3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj", "senderPublicKey": "A2m227AHcq7gWfSU59Q3UJaqkEa7SccFYmJuWHbFrrKE", "proofs": [ "yvXrwpPZKTumgRuLFqk742i6ha57LqZHk7QeqYiix9drB9m7eRzXpiuuzuxnAqUCCKw3Nk4rNVzgH8Uu8kG4FTV" ], "script": "base64:BgJMCAISBAoCCAgSBAoCBAgSAwoBBBIICgYICAgIAQgSCAoGCAgICAEIEgQKAggIEgUKAwgICBIDCgEIEgYKBAgIAQESBAoCCAgSAwoBCCgAB1ZFUlNJT04CAzEuNQEOZ2V0U3RyaW5nQnlLZXkBA2tleQkBC3ZhbHVlT3JFbHNlAgkAnQgCBQR0aGlzBQNrZXkCAAEPZ2V0Qm9vbGVhbkJ5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJsIAgUEdGhpcwUDa2V5BwEPZ2V0SW50ZWdlckJ5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwUDa2V5AAAABWNocmlzCQEOZ2V0U3RyaW5nQnlLZXkBAgxjb25mX2FkbWluXzEADmRhcHBSdW5uaW5nS2V5AhRjb25mX2RhcHBfaXNfcnVubmluZwARbWFpbnRlbmFuY2VNU0dLZXkCFGNvbmZfbWFpbnRlbmFuY2VfbXNnABJ3aGl0ZWxpc3RlZG9ubHlLZXkCFWNvbmZfd2hpdGVsaXN0ZWRfb25seQALZGFwcFJ1bm5pbmcJAQt2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exity": 0 } View: original | compacted Prev: 97J8ikmsPZgj9rVJcQ35zmP9fZYH1CH3WDnhf8YD89gB Next: EU8Ct34qHoDypMj3LK5QiPzB8KsdMKMkNMp1GGnPv3jd Diff:
Old | New | Differences | |
---|---|---|---|
180 | 180 | ||
181 | 181 | ||
182 | 182 | func getCaller (i,pubKey) = { | |
183 | - | let isSponsored = valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0) | |
183 | + | let isSponsored = if ((pubKey != "")) | |
184 | + | then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0) | |
185 | + | else 0 | |
184 | 186 | let caller = if (if (if ((toBase58String(i.caller.bytes) == toString(this))) | |
185 | 187 | then (size(i.payments) == 0) | |
186 | 188 | else false) | |
231 | 233 | func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning)) | |
232 | 234 | then throw(maintenanceMSG) | |
233 | 235 | else { | |
234 | - | let $ | |
235 | - | let caller = $ | |
236 | - | let isSponsored = $ | |
236 | + | let $t073057357 = getCaller(invoke, pubKey) | |
237 | + | let caller = $t073057357._1 | |
238 | + | let isSponsored = $t073057357._2 | |
237 | 239 | let id = toBase58String(invoke.transactionId) | |
238 | 240 | let timestamp = lastBlock.timestamp | |
239 | 241 | if (!(validUserData(caller, name, description, thumb, false))) | |
259 | 261 | func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning)) | |
260 | 262 | then throw(maintenanceMSG) | |
261 | 263 | else { | |
262 | - | let $ | |
263 | - | let caller = $ | |
264 | - | let isSponsored = $ | |
264 | + | let $t088008904 = getCaller(invoke, pubKey) | |
265 | + | let caller = $t088008904._1 | |
266 | + | let isSponsored = $t088008904._2 | |
265 | 267 | let status = getStringByKey(keyUserStatus(caller)) | |
266 | 268 | if (!(validUserData(caller, name, description, thumb, true))) | |
267 | 269 | then throw("Something went wrong") | |
287 | 289 | func setERC20User (erc20,pubKey) = if (!(dappRunning)) | |
288 | 290 | then throw(maintenanceMSG) | |
289 | 291 | else { | |
290 | - | let $ | |
291 | - | let caller = $ | |
292 | - | let isSponsored = $ | |
292 | + | let $t01009110194 = getCaller(invoke, pubKey) | |
293 | + | let caller = $t01009110194._1 | |
294 | + | let isSponsored = $t01009110194._2 | |
293 | 295 | let status = getStringByKey(keyUserStatus(caller)) | |
294 | 296 | if (if ((status != userRegistered)) | |
295 | 297 | then (status != userVerified) | |
383 | 385 | @Verifier(tx) | |
384 | 386 | func verifier () = match tx { | |
385 | 387 | case inv: InvokeScriptTransaction => | |
386 | - | if (if ((inv.function == "registerUser")) | |
388 | + | if (if (if ((inv.function == "registerUser")) | |
387 | 389 | then (inv.dApp == this) | |
388 | 390 | else false) | |
391 | + | then (inv.fee == 500000) | |
392 | + | else false) | |
389 | 393 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5]))) | |
390 | - | else if (if ((inv.function == "updateUser")) | |
394 | + | else if (if (if ((inv.function == "updateUser")) | |
391 | 395 | then (inv.dApp == this) | |
392 | 396 | else false) | |
397 | + | then (inv.fee == 500000) | |
398 | + | else false) | |
393 | 399 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5]))) | |
394 | - | else if (if ((inv.function == "setERC20User")) | |
400 | + | else if (if (if ((inv.function == "setERC20User")) | |
395 | 401 | then (inv.dApp == this) | |
402 | + | else false) | |
403 | + | then (inv.fee == 500000) | |
396 | 404 | else false) | |
397 | 405 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[2]))) | |
398 | 406 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
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 | 72 | ||
73 | 73 | ||
74 | 74 | func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func keyAgentArtistAddr (agentAddr,artistAddr) = ((("agent_" + agentAddr) + "_") + artistAddr) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func keyPrimaryShare (artistAddr) = ("artist_agent_primary_" + artistAddr) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func keySecondaryShare (artistAddr) = ("artist_agent_secondary_" + artistAddr) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func validateCID (cid) = if (contains(cid, "/")) | |
90 | 90 | then if (if ((76 > size(cid))) | |
91 | 91 | then (size(split(cid, "/")[0]) == 59) | |
92 | 92 | else false) | |
93 | 93 | then (16 > size(split(cid, "/")[1])) | |
94 | 94 | else false | |
95 | 95 | else false | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func validUserData (caller,name,description,thumb,isAnUpdate) = { | |
99 | 99 | let validCID = if ((size(thumb) != 0)) | |
100 | 100 | then validateCID(thumb) | |
101 | 101 | else true | |
102 | 102 | if (!(validCID)) | |
103 | 103 | then throw("CID don't match requirement!") | |
104 | 104 | else if (if ((name == "")) | |
105 | 105 | then true | |
106 | 106 | else (description == "")) | |
107 | 107 | then throw("Name and description cannot be empty") | |
108 | 108 | else if ((size(description) > 600)) | |
109 | 109 | then throw("600 Char. max description") | |
110 | 110 | else if ((size(name) > 45)) | |
111 | 111 | then throw("45 Char. max name") | |
112 | 112 | else { | |
113 | 113 | let status = getStringByKey(keyUserStatus(caller)) | |
114 | 114 | if (if ((status == userSuspended)) | |
115 | 115 | then true | |
116 | 116 | else (status == userRemoved)) | |
117 | 117 | then throw("Account suspended/ removed.") | |
118 | 118 | else if (if (!(isAnUpdate)) | |
119 | 119 | then (status == userRegistered) | |
120 | 120 | else false) | |
121 | 121 | then throw("Already registered") | |
122 | 122 | else if (if (if (!(isAnUpdate)) | |
123 | 123 | then (status == "") | |
124 | 124 | else false) | |
125 | 125 | then whitelistedonly | |
126 | 126 | else false) | |
127 | 127 | then throw("Can't register, get approved first.") | |
128 | 128 | else if (if (if (isAnUpdate) | |
129 | 129 | then (status == "") | |
130 | 130 | else false) | |
131 | 131 | then true | |
132 | 132 | else if (isAnUpdate) | |
133 | 133 | then (status == userAllowed) | |
134 | 134 | else false) | |
135 | 135 | then throw("Register first") | |
136 | 136 | else true | |
137 | 137 | } | |
138 | 138 | } | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func validateNewStatus (status,address,currentStatus) = { | |
142 | 142 | let allStatus = [userVerified, userRegistered, userSuspended, userRemoved, userAllowed, userChangeRequired] | |
143 | 143 | let statusToSet = if (containsElement(allStatus, status)) | |
144 | 144 | then status | |
145 | 145 | else if (if ((status == userReset)) | |
146 | 146 | then (currentStatus == userAllowed) | |
147 | 147 | else false) | |
148 | 148 | then "" | |
149 | 149 | else throw("Unknown status") | |
150 | 150 | let userIsRegistered = getIntegerByKey(keyUserDate(address)) | |
151 | 151 | if (if ((userIsRegistered == 0)) | |
152 | 152 | then (statusToSet != userAllowed) | |
153 | 153 | else false) | |
154 | 154 | then throw("You cant set this status, user is not registered.") | |
155 | 155 | else if (if ((currentStatus == userAllowed)) | |
156 | 156 | then (statusToSet == userAllowed) | |
157 | 157 | else false) | |
158 | 158 | then throw("User already allowed") | |
159 | 159 | else if (if ((currentStatus == userRegistered)) | |
160 | 160 | then (statusToSet == userAllowed) | |
161 | 161 | else false) | |
162 | 162 | then throw("User already allowed & registered") | |
163 | 163 | else if (if ((currentStatus == userVerified)) | |
164 | 164 | then (statusToSet == userAllowed) | |
165 | 165 | else false) | |
166 | 166 | then throw("User already allowed & verified") | |
167 | 167 | else statusToSet | |
168 | 168 | } | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}") | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func asString (bv) = match bv { | |
175 | 175 | case bv0: String => | |
176 | 176 | bv0 | |
177 | 177 | case _ => | |
178 | 178 | throw("Sponsored Public Key String expected") | |
179 | 179 | } | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | func getCaller (i,pubKey) = { | |
183 | - | let isSponsored = valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0) | |
183 | + | let isSponsored = if ((pubKey != "")) | |
184 | + | then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0) | |
185 | + | else 0 | |
184 | 186 | let caller = if (if (if ((toBase58String(i.caller.bytes) == toString(this))) | |
185 | 187 | then (size(i.payments) == 0) | |
186 | 188 | else false) | |
187 | 189 | then (isSponsored > 0) | |
188 | 190 | else false) | |
189 | 191 | then toString(addressFromPublicKey(fromBase58String(pubKey))) | |
190 | 192 | else toBase58String(i.caller.bytes) | |
191 | 193 | let get_sponsored_waves = if ((pubKey != "")) | |
192 | 194 | then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil) | |
193 | 195 | else unit | |
194 | 196 | if ((get_sponsored_waves == get_sponsored_waves)) | |
195 | 197 | then $Tuple2(caller, (isSponsored > 0)) | |
196 | 198 | else throw("Strict value is not equal to itself.") | |
197 | 199 | } | |
198 | 200 | ||
199 | 201 | ||
200 | 202 | @Callable(invoke) | |
201 | 203 | func setConf (key,val) = { | |
202 | 204 | let caller = toString(invoke.caller) | |
203 | 205 | if (containsElement([chris, toString(this)], caller)) | |
204 | 206 | then [StringEntry(key, val)] | |
205 | 207 | else throw("You are not allowed to change this") | |
206 | 208 | } | |
207 | 209 | ||
208 | 210 | ||
209 | 211 | ||
210 | 212 | @Callable(invoke) | |
211 | 213 | func appRunning (isLive,message) = { | |
212 | 214 | let caller = toString(invoke.caller) | |
213 | 215 | if (containsElement([chris, toString(this)], caller)) | |
214 | 216 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
215 | 217 | else throw("You are not allowed to change this") | |
216 | 218 | } | |
217 | 219 | ||
218 | 220 | ||
219 | 221 | ||
220 | 222 | @Callable(invoke) | |
221 | 223 | func registrationMode (WLonly) = { | |
222 | 224 | let caller = toString(invoke.caller) | |
223 | 225 | if (containsElement([chris, toString(this)], caller)) | |
224 | 226 | then [BooleanEntry(whitelistedonlyKey, WLonly)] | |
225 | 227 | else throw("You are not allowed to change this") | |
226 | 228 | } | |
227 | 229 | ||
228 | 230 | ||
229 | 231 | ||
230 | 232 | @Callable(invoke) | |
231 | 233 | func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning)) | |
232 | 234 | then throw(maintenanceMSG) | |
233 | 235 | else { | |
234 | - | let $ | |
235 | - | let caller = $ | |
236 | - | let isSponsored = $ | |
236 | + | let $t073057357 = getCaller(invoke, pubKey) | |
237 | + | let caller = $t073057357._1 | |
238 | + | let isSponsored = $t073057357._2 | |
237 | 239 | let id = toBase58String(invoke.transactionId) | |
238 | 240 | let timestamp = lastBlock.timestamp | |
239 | 241 | if (!(validUserData(caller, name, description, thumb, false))) | |
240 | 242 | then throw("Something went wrong") | |
241 | 243 | else { | |
242 | 244 | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp)) | |
243 | 245 | if (if ((0 > royalties)) | |
244 | 246 | then true | |
245 | 247 | else (royalties > 1000)) | |
246 | 248 | then throw("Royalties cannot be less than 0% or higher than 10%") | |
247 | 249 | else { | |
248 | 250 | let txToCaller = if (isSponsored) | |
249 | 251 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
250 | 252 | else nil | |
251 | 253 | ([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) | |
252 | 254 | } | |
253 | 255 | } | |
254 | 256 | } | |
255 | 257 | ||
256 | 258 | ||
257 | 259 | ||
258 | 260 | @Callable(invoke) | |
259 | 261 | func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning)) | |
260 | 262 | then throw(maintenanceMSG) | |
261 | 263 | else { | |
262 | - | let $ | |
263 | - | let caller = $ | |
264 | - | let isSponsored = $ | |
264 | + | let $t088008904 = getCaller(invoke, pubKey) | |
265 | + | let caller = $t088008904._1 | |
266 | + | let isSponsored = $t088008904._2 | |
265 | 267 | let status = getStringByKey(keyUserStatus(caller)) | |
266 | 268 | if (!(validUserData(caller, name, description, thumb, true))) | |
267 | 269 | then throw("Something went wrong") | |
268 | 270 | else { | |
269 | 271 | let date = getIntegerByKey(keyUserDate(caller)) | |
270 | 272 | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date)) | |
271 | 273 | if (if ((0 > royalties)) | |
272 | 274 | then true | |
273 | 275 | else (royalties > 1000)) | |
274 | 276 | then throw("Royalties cannot be less than 0% or higher than 10%") | |
275 | 277 | else { | |
276 | 278 | let txToCaller = if (isSponsored) | |
277 | 279 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
278 | 280 | else nil | |
279 | 281 | ([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 | 282 | } | |
281 | 283 | } | |
282 | 284 | } | |
283 | 285 | ||
284 | 286 | ||
285 | 287 | ||
286 | 288 | @Callable(invoke) | |
287 | 289 | func setERC20User (erc20,pubKey) = if (!(dappRunning)) | |
288 | 290 | then throw(maintenanceMSG) | |
289 | 291 | else { | |
290 | - | let $ | |
291 | - | let caller = $ | |
292 | - | let isSponsored = $ | |
292 | + | let $t01009110194 = getCaller(invoke, pubKey) | |
293 | + | let caller = $t01009110194._1 | |
294 | + | let isSponsored = $t01009110194._2 | |
293 | 295 | let status = getStringByKey(keyUserStatus(caller)) | |
294 | 296 | if (if ((status != userRegistered)) | |
295 | 297 | then (status != userVerified) | |
296 | 298 | else false) | |
297 | 299 | then throw("Not allowed to set ERC20 address") | |
298 | 300 | else { | |
299 | 301 | let firstTwo = take(erc20, 2) | |
300 | 302 | if (if ((firstTwo != "0x")) | |
301 | 303 | then true | |
302 | 304 | else (size(erc20) != 42)) | |
303 | 305 | then throw("This is not an erc20 address") | |
304 | 306 | else { | |
305 | 307 | let txToCaller = if (isSponsored) | |
306 | 308 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
307 | 309 | else nil | |
308 | 310 | ([StringEntry(keyUserERC20(caller), erc20)] ++ txToCaller) | |
309 | 311 | } | |
310 | 312 | } | |
311 | 313 | } | |
312 | 314 | ||
313 | 315 | ||
314 | 316 | ||
315 | 317 | @Callable(invoke) | |
316 | 318 | func changeUserStatus (address,status,note) = { | |
317 | 319 | let caller = toString(invoke.caller) | |
318 | 320 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
319 | 321 | let statusToSet = validateNewStatus(status, address, currentStatus) | |
320 | 322 | let name = toBase64String(toBytes(getStringByKey(keyUserName(address)))) | |
321 | 323 | let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address)))) | |
322 | 324 | let date = getIntegerByKey(keyUserDate(address)) | |
323 | 325 | let json = makeJSON(name, thumb, toString(date)) | |
324 | 326 | if (containsElement([chris, toString(this)], caller)) | |
325 | 327 | then [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(("user_note_" + address), note)] | |
326 | 328 | else throw("Not allowed to change user status") | |
327 | 329 | } | |
328 | 330 | ||
329 | 331 | ||
330 | 332 | ||
331 | 333 | @Callable(invoke) | |
332 | 334 | func deleteUser (address) = { | |
333 | 335 | let caller = toString(invoke.caller) | |
334 | 336 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
335 | 337 | if (containsElement([chris, toString(this)], caller)) | |
336 | 338 | 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)] | |
337 | 339 | else throw("Not allowed") | |
338 | 340 | } | |
339 | 341 | ||
340 | 342 | ||
341 | 343 | ||
342 | 344 | @Callable(i) | |
343 | 345 | func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning)) | |
344 | 346 | then throw(maintenanceMSG) | |
345 | 347 | else { | |
346 | 348 | let caller = toString(i.caller) | |
347 | 349 | if (containsElement([chris, toString(this)], caller)) | |
348 | 350 | then if (if ((size(artistAddr) != 35)) | |
349 | 351 | then true | |
350 | 352 | else (size(agentAddr) != 35)) | |
351 | 353 | then throw("Wrong address") | |
352 | 354 | else [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)] | |
353 | 355 | else throw("You are not allowed") | |
354 | 356 | } | |
355 | 357 | ||
356 | 358 | ||
357 | 359 | ||
358 | 360 | @Callable(i) | |
359 | 361 | func unsetAgent (artistAddr,agentAddr) = if (!(dappRunning)) | |
360 | 362 | then throw(maintenanceMSG) | |
361 | 363 | else { | |
362 | 364 | let caller = toString(i.caller) | |
363 | 365 | if (containsElement([chris, toString(this)], caller)) | |
364 | 366 | then if (if ((size(artistAddr) != 35)) | |
365 | 367 | then true | |
366 | 368 | else (size(agentAddr) != 35)) | |
367 | 369 | then throw("Wrong address") | |
368 | 370 | else [DeleteEntry(keyArtistAgentAddr(artistAddr)), DeleteEntry(keyAgentArtistAddr(agentAddr, artistAddr)), DeleteEntry(keyPrimaryShare(artistAddr)), DeleteEntry(keySecondaryShare(artistAddr))] | |
369 | 371 | else throw("You are not allowed") | |
370 | 372 | } | |
371 | 373 | ||
372 | 374 | ||
373 | 375 | ||
374 | 376 | @Callable(i) | |
375 | 377 | func deleteEntry (entry) = { | |
376 | 378 | let caller = toString(i.caller) | |
377 | 379 | if ((caller == chris)) | |
378 | 380 | then [DeleteEntry(entry)] | |
379 | 381 | else throw("no") | |
380 | 382 | } | |
381 | 383 | ||
382 | 384 | ||
383 | 385 | @Verifier(tx) | |
384 | 386 | func verifier () = match tx { | |
385 | 387 | case inv: InvokeScriptTransaction => | |
386 | - | if (if ((inv.function == "registerUser")) | |
388 | + | if (if (if ((inv.function == "registerUser")) | |
387 | 389 | then (inv.dApp == this) | |
388 | 390 | else false) | |
391 | + | then (inv.fee == 500000) | |
392 | + | else false) | |
389 | 393 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5]))) | |
390 | - | else if (if ((inv.function == "updateUser")) | |
394 | + | else if (if (if ((inv.function == "updateUser")) | |
391 | 395 | then (inv.dApp == this) | |
392 | 396 | else false) | |
397 | + | then (inv.fee == 500000) | |
398 | + | else false) | |
393 | 399 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5]))) | |
394 | - | else if (if ((inv.function == "setERC20User")) | |
400 | + | else if (if (if ((inv.function == "setERC20User")) | |
395 | 401 | then (inv.dApp == this) | |
402 | + | else false) | |
403 | + | then (inv.fee == 500000) | |
396 | 404 | else false) | |
397 | 405 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[2]))) | |
398 | 406 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
399 | 407 | case _ => | |
400 | 408 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
401 | 409 | } | |
402 | 410 |
github/deemru/w8io/169f3d6 159.13 ms ◑