tx · EU8Ct34qHoDypMj3LK5QiPzB8KsdMKMkNMp1GGnPv3jd 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj: -0.01100000 Waves 2023.01.21 04:32 [2414083] smart account 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj > SELF 0.00000000 Waves
{ "type": 13, "id": "EU8Ct34qHoDypMj3LK5QiPzB8KsdMKMkNMp1GGnPv3jd", "fee": 1100000, "feeAssetId": null, "timestamp": 1674264793240, "version": 2, "chainId": 84, "sender": "3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj", "senderPublicKey": "A2m227AHcq7gWfSU59Q3UJaqkEa7SccFYmJuWHbFrrKE", "proofs": [ "2DZF7eYa8Dzq83ywqmqsKvnZDbG3tKnwvW7eTVhfgKdt6xe1wuqhNA2yeeAvTEp3M72gnsoZQdXQ45RStMa7Les4" ], "script": "base64:BgJMCAISBAoCCAgSBAoCBAgSAwoBBBIICgYICAgIAQgSCAoGCAgICAEIEgQKAggIEgUKAwgICBIDCgEIEgYKBAgIAQESBAoCCAgSAwoBCCgAB1ZFUlNJT04CAzEuNQEOZ2V0U3RyaW5nQnlLZXkBA2tleQkBC3ZhbHVlT3JFbHNlAgkAnQgCBQR0aGlzBQNrZXkCAAEPZ2V0Qm9vbGVhbkJ5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJsIAgUEdGhpcwUDa2V5BwEPZ2V0SW50ZWdlckJ5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwUDa2V5AAAABWNocmlzCQEOZ2V0U3RyaW5nQnlLZXkBAgxjb25mX2FkbWluXzEADmRhcHBSdW5uaW5nS2V5AhRjb25mX2RhcHBfaXNfcnVubmluZwARbWFpbnRlbmFuY2VNU0dLZXkCFGNvbmZfbWFpbnRlbmFuY2VfbXNnABJ3aGl0ZWxpc3RlZG9ubHlLZXkCFWNvbmZfd2hpdGVsaXN0ZWRfb25seQALZGFwcFJ1bm5pb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YmxpY0tleQkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleZxI4Bc=", "height": 2414083, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9coC7PKpTkXWApoTZJZG5etZnBGWWCgJD87aHaQcNAc5 Next: CbYwjsTygDWathmSHVkbxufgAwsnpdCvxuVYH6pifXxQ Diff:
Old | New | Differences | |
---|---|---|---|
385 | 385 | @Verifier(tx) | |
386 | 386 | func verifier () = match tx { | |
387 | 387 | case inv: InvokeScriptTransaction => | |
388 | - | if (if (if ((inv.function == "registerUser")) | |
388 | + | if (if (if (if ((inv.function == "registerUser")) | |
389 | 389 | then (inv.dApp == this) | |
390 | 390 | else false) | |
391 | 391 | then (inv.fee == 500000) | |
392 | 392 | else false) | |
393 | + | then (inv.feeAssetId == unit) | |
394 | + | else false) | |
393 | 395 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5]))) | |
394 | - | else if (if (if ((inv.function == "updateUser")) | |
396 | + | else if (if (if (if ((inv.function == "updateUser")) | |
395 | 397 | then (inv.dApp == this) | |
396 | 398 | else false) | |
397 | 399 | then (inv.fee == 500000) | |
398 | 400 | else false) | |
401 | + | then (inv.feeAssetId == unit) | |
402 | + | else false) | |
399 | 403 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5]))) | |
400 | - | else if (if (if ((inv.function == "setERC20User")) | |
404 | + | else if (if (if (if ((inv.function == "setERC20User")) | |
401 | 405 | then (inv.dApp == this) | |
402 | 406 | else false) | |
403 | 407 | then (inv.fee == 500000) | |
408 | + | else false) | |
409 | + | then (inv.feeAssetId == unit) | |
404 | 410 | else false) | |
405 | 411 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[2]))) | |
406 | 412 | 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 | 183 | let isSponsored = if ((pubKey != "")) | |
184 | 184 | then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0) | |
185 | 185 | else 0 | |
186 | 186 | let caller = if (if (if ((toBase58String(i.caller.bytes) == toString(this))) | |
187 | 187 | then (size(i.payments) == 0) | |
188 | 188 | else false) | |
189 | 189 | then (isSponsored > 0) | |
190 | 190 | else false) | |
191 | 191 | then toString(addressFromPublicKey(fromBase58String(pubKey))) | |
192 | 192 | else toBase58String(i.caller.bytes) | |
193 | 193 | let get_sponsored_waves = if ((pubKey != "")) | |
194 | 194 | then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil) | |
195 | 195 | else unit | |
196 | 196 | if ((get_sponsored_waves == get_sponsored_waves)) | |
197 | 197 | then $Tuple2(caller, (isSponsored > 0)) | |
198 | 198 | else throw("Strict value is not equal to itself.") | |
199 | 199 | } | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | @Callable(invoke) | |
203 | 203 | func setConf (key,val) = { | |
204 | 204 | let caller = toString(invoke.caller) | |
205 | 205 | if (containsElement([chris, toString(this)], caller)) | |
206 | 206 | then [StringEntry(key, val)] | |
207 | 207 | else throw("You are not allowed to change this") | |
208 | 208 | } | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | ||
212 | 212 | @Callable(invoke) | |
213 | 213 | func appRunning (isLive,message) = { | |
214 | 214 | let caller = toString(invoke.caller) | |
215 | 215 | if (containsElement([chris, toString(this)], caller)) | |
216 | 216 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
217 | 217 | else throw("You are not allowed to change this") | |
218 | 218 | } | |
219 | 219 | ||
220 | 220 | ||
221 | 221 | ||
222 | 222 | @Callable(invoke) | |
223 | 223 | func registrationMode (WLonly) = { | |
224 | 224 | let caller = toString(invoke.caller) | |
225 | 225 | if (containsElement([chris, toString(this)], caller)) | |
226 | 226 | then [BooleanEntry(whitelistedonlyKey, WLonly)] | |
227 | 227 | else throw("You are not allowed to change this") | |
228 | 228 | } | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | ||
232 | 232 | @Callable(invoke) | |
233 | 233 | func registerUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning)) | |
234 | 234 | then throw(maintenanceMSG) | |
235 | 235 | else { | |
236 | 236 | let $t073057357 = getCaller(invoke, pubKey) | |
237 | 237 | let caller = $t073057357._1 | |
238 | 238 | let isSponsored = $t073057357._2 | |
239 | 239 | let id = toBase58String(invoke.transactionId) | |
240 | 240 | let timestamp = lastBlock.timestamp | |
241 | 241 | if (!(validUserData(caller, name, description, thumb, false))) | |
242 | 242 | then throw("Something went wrong") | |
243 | 243 | else { | |
244 | 244 | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp)) | |
245 | 245 | if (if ((0 > royalties)) | |
246 | 246 | then true | |
247 | 247 | else (royalties > 1000)) | |
248 | 248 | then throw("Royalties cannot be less than 0% or higher than 10%") | |
249 | 249 | else { | |
250 | 250 | let txToCaller = if (isSponsored) | |
251 | 251 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
252 | 252 | else nil | |
253 | 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) | |
254 | 254 | } | |
255 | 255 | } | |
256 | 256 | } | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | ||
260 | 260 | @Callable(invoke) | |
261 | 261 | func updateUser (name,description,thumb,social,royalties,pubKey) = if (!(dappRunning)) | |
262 | 262 | then throw(maintenanceMSG) | |
263 | 263 | else { | |
264 | 264 | let $t088008904 = getCaller(invoke, pubKey) | |
265 | 265 | let caller = $t088008904._1 | |
266 | 266 | let isSponsored = $t088008904._2 | |
267 | 267 | let status = getStringByKey(keyUserStatus(caller)) | |
268 | 268 | if (!(validUserData(caller, name, description, thumb, true))) | |
269 | 269 | then throw("Something went wrong") | |
270 | 270 | else { | |
271 | 271 | let date = getIntegerByKey(keyUserDate(caller)) | |
272 | 272 | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date)) | |
273 | 273 | if (if ((0 > royalties)) | |
274 | 274 | then true | |
275 | 275 | else (royalties > 1000)) | |
276 | 276 | then throw("Royalties cannot be less than 0% or higher than 10%") | |
277 | 277 | else { | |
278 | 278 | let txToCaller = if (isSponsored) | |
279 | 279 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
280 | 280 | else nil | |
281 | 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) | |
282 | 282 | } | |
283 | 283 | } | |
284 | 284 | } | |
285 | 285 | ||
286 | 286 | ||
287 | 287 | ||
288 | 288 | @Callable(invoke) | |
289 | 289 | func setERC20User (erc20,pubKey) = if (!(dappRunning)) | |
290 | 290 | then throw(maintenanceMSG) | |
291 | 291 | else { | |
292 | 292 | let $t01009110194 = getCaller(invoke, pubKey) | |
293 | 293 | let caller = $t01009110194._1 | |
294 | 294 | let isSponsored = $t01009110194._2 | |
295 | 295 | let status = getStringByKey(keyUserStatus(caller)) | |
296 | 296 | if (if ((status != userRegistered)) | |
297 | 297 | then (status != userVerified) | |
298 | 298 | else false) | |
299 | 299 | then throw("Not allowed to set ERC20 address") | |
300 | 300 | else { | |
301 | 301 | let firstTwo = take(erc20, 2) | |
302 | 302 | if (if ((firstTwo != "0x")) | |
303 | 303 | then true | |
304 | 304 | else (size(erc20) != 42)) | |
305 | 305 | then throw("This is not an erc20 address") | |
306 | 306 | else { | |
307 | 307 | let txToCaller = if (isSponsored) | |
308 | 308 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
309 | 309 | else nil | |
310 | 310 | ([StringEntry(keyUserERC20(caller), erc20)] ++ txToCaller) | |
311 | 311 | } | |
312 | 312 | } | |
313 | 313 | } | |
314 | 314 | ||
315 | 315 | ||
316 | 316 | ||
317 | 317 | @Callable(invoke) | |
318 | 318 | func changeUserStatus (address,status,note) = { | |
319 | 319 | let caller = toString(invoke.caller) | |
320 | 320 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
321 | 321 | let statusToSet = validateNewStatus(status, address, currentStatus) | |
322 | 322 | let name = toBase64String(toBytes(getStringByKey(keyUserName(address)))) | |
323 | 323 | let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address)))) | |
324 | 324 | let date = getIntegerByKey(keyUserDate(address)) | |
325 | 325 | let json = makeJSON(name, thumb, toString(date)) | |
326 | 326 | if (containsElement([chris, toString(this)], caller)) | |
327 | 327 | then [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(("user_note_" + address), note)] | |
328 | 328 | else throw("Not allowed to change user status") | |
329 | 329 | } | |
330 | 330 | ||
331 | 331 | ||
332 | 332 | ||
333 | 333 | @Callable(invoke) | |
334 | 334 | func deleteUser (address) = { | |
335 | 335 | let caller = toString(invoke.caller) | |
336 | 336 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
337 | 337 | if (containsElement([chris, toString(this)], caller)) | |
338 | 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)] | |
339 | 339 | else throw("Not allowed") | |
340 | 340 | } | |
341 | 341 | ||
342 | 342 | ||
343 | 343 | ||
344 | 344 | @Callable(i) | |
345 | 345 | func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning)) | |
346 | 346 | then throw(maintenanceMSG) | |
347 | 347 | else { | |
348 | 348 | let caller = toString(i.caller) | |
349 | 349 | if (containsElement([chris, toString(this)], caller)) | |
350 | 350 | then if (if ((size(artistAddr) != 35)) | |
351 | 351 | then true | |
352 | 352 | else (size(agentAddr) != 35)) | |
353 | 353 | then throw("Wrong address") | |
354 | 354 | else [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)] | |
355 | 355 | else throw("You are not allowed") | |
356 | 356 | } | |
357 | 357 | ||
358 | 358 | ||
359 | 359 | ||
360 | 360 | @Callable(i) | |
361 | 361 | func unsetAgent (artistAddr,agentAddr) = if (!(dappRunning)) | |
362 | 362 | then throw(maintenanceMSG) | |
363 | 363 | else { | |
364 | 364 | let caller = toString(i.caller) | |
365 | 365 | if (containsElement([chris, toString(this)], caller)) | |
366 | 366 | then if (if ((size(artistAddr) != 35)) | |
367 | 367 | then true | |
368 | 368 | else (size(agentAddr) != 35)) | |
369 | 369 | then throw("Wrong address") | |
370 | 370 | else [DeleteEntry(keyArtistAgentAddr(artistAddr)), DeleteEntry(keyAgentArtistAddr(agentAddr, artistAddr)), DeleteEntry(keyPrimaryShare(artistAddr)), DeleteEntry(keySecondaryShare(artistAddr))] | |
371 | 371 | else throw("You are not allowed") | |
372 | 372 | } | |
373 | 373 | ||
374 | 374 | ||
375 | 375 | ||
376 | 376 | @Callable(i) | |
377 | 377 | func deleteEntry (entry) = { | |
378 | 378 | let caller = toString(i.caller) | |
379 | 379 | if ((caller == chris)) | |
380 | 380 | then [DeleteEntry(entry)] | |
381 | 381 | else throw("no") | |
382 | 382 | } | |
383 | 383 | ||
384 | 384 | ||
385 | 385 | @Verifier(tx) | |
386 | 386 | func verifier () = match tx { | |
387 | 387 | case inv: InvokeScriptTransaction => | |
388 | - | if (if (if ((inv.function == "registerUser")) | |
388 | + | if (if (if (if ((inv.function == "registerUser")) | |
389 | 389 | then (inv.dApp == this) | |
390 | 390 | else false) | |
391 | 391 | then (inv.fee == 500000) | |
392 | 392 | else false) | |
393 | + | then (inv.feeAssetId == unit) | |
394 | + | else false) | |
393 | 395 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5]))) | |
394 | - | else if (if (if ((inv.function == "updateUser")) | |
396 | + | else if (if (if (if ((inv.function == "updateUser")) | |
395 | 397 | then (inv.dApp == this) | |
396 | 398 | else false) | |
397 | 399 | then (inv.fee == 500000) | |
398 | 400 | else false) | |
401 | + | then (inv.feeAssetId == unit) | |
402 | + | else false) | |
399 | 403 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5]))) | |
400 | - | else if (if (if ((inv.function == "setERC20User")) | |
404 | + | else if (if (if (if ((inv.function == "setERC20User")) | |
401 | 405 | then (inv.dApp == this) | |
402 | 406 | else false) | |
403 | 407 | then (inv.fee == 500000) | |
408 | + | else false) | |
409 | + | then (inv.feeAssetId == unit) | |
404 | 410 | else false) | |
405 | 411 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[2]))) | |
406 | 412 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
407 | 413 | case _ => | |
408 | 414 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
409 | 415 | } | |
410 | 416 |
github/deemru/w8io/026f985 46.22 ms ◑