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