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