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