tx · J1qUtT4rxPbsk1z75QTkADKefo7N2Knfve3JottujxUu 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj: -0.01400000 Waves 2022.07.04 11:57 [2124719] smart account 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj > SELF 0.00000000 Waves
{ "type": 13, "id": "J1qUtT4rxPbsk1z75QTkADKefo7N2Knfve3JottujxUu", "fee": 1400000, "feeAssetId": null, "timestamp": 1656925090959, "version": 2, "chainId": 84, "sender": "3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj", "senderPublicKey": "A2m227AHcq7gWfSU59Q3UJaqkEa7SccFYmJuWHbFrrKE", "proofs": [ "2Pp5xbkUCmz84U5dq74wPSnCpUFsx9nZikzdSKFU8TTSwqNeX43h56Tah1anABqubjLHHfsrPNBar4mX93CYvyVt" ], "script": "base64:AAIFAAAAAAAAADwIAhIECgIECBIDCgEEEgYKBAgICAgSBgoECAgICBIFCgMICAgSAwoBCBIGCgQICAEBEgQKAggIEgMKAQgAAAAiAAAAAAVjaHJpcwIAAAAjM01zRzZqUE5DclZKVXRZQjdYSkJ4Uzd1dFdzWEFmNG45VnAAAAAABGpvZXACAAAAIzNNem00Vkx3c045dVp3YlRNelBqM1h1eFY2a0VmQVI4VUROAAAAAA5kYXBwUnVubmluZ0tleQIAAAAUY29uZl9kYXBwX2lzX3J1bm5pbmcAAAAAEW1haW50ZW5hbmNlTVNHS2V5AgAAABRjb25mX21haW50ZW5hbmNlX21zZwAAAAASd2hpdGVsaXN0ZWRvbmx5S2V5AgAAABVjb25mX3doaXRlbGlzdGVkX29ubHkAAAAAC2RhcHBSdW5uaW5nCQEAAAALdmFsdWVPckVsc2UAAAACCQAEGwAAAAIFAAAABHRoaXMFAAAADmRhcHBSdW5uaW5nS2V5BgAAAAAObWFpbnRlbmFuY2VNU0cJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwUAAAARbWFpbnRlbmFuY2VNU0d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0 } View: original | compacted Prev: 56xFbaw9eVk4EKrRpGFNPVjdkTScUSzAKzzBjjacSpNm Next: BuuECFZiZfu31aEQ3SDFVaLcsPRULEyzgusFZQt2pV56 Diff:
Old | New | Differences | |
---|---|---|---|
100 | 100 | then throw("45 Char. max name") | |
101 | 101 | else { | |
102 | 102 | let status = getStringByKey(keyUserStatus(caller)) | |
103 | - | if (true) | |
104 | - | then throw(((("caller = " + caller) + " status = ") + status)) | |
105 | - | else if (if ((status == userSuspended)) | |
106 | - | then true | |
107 | - | else (status == userRemoved)) | |
108 | - | then throw("Account suspended/ removed.") | |
109 | - | else if (if (!(isAnUpdate)) | |
110 | - | then (status == userRegistered) | |
103 | + | if (if ((status == userSuspended)) | |
104 | + | then true | |
105 | + | else (status == userRemoved)) | |
106 | + | then throw("Account suspended/ removed.") | |
107 | + | else if (if (!(isAnUpdate)) | |
108 | + | then (status == userRegistered) | |
109 | + | else false) | |
110 | + | then throw("Already registered") | |
111 | + | else if (if (if (!(isAnUpdate)) | |
112 | + | then (status == "") | |
111 | 113 | else false) | |
112 | - | then throw("Already registered") | |
113 | - | else if (if (if (!(isAnUpdate)) | |
114 | + | then whitelistedonly | |
115 | + | else false) | |
116 | + | then throw("Can't register, get approved first.") | |
117 | + | else if (if (if (isAnUpdate) | |
114 | 118 | then (status == "") | |
115 | 119 | else false) | |
116 | - | then whitelistedonly | |
117 | - | else false) | |
118 | - | then throw("Can't register, get approved first.") | |
119 | - | else if (if (if (isAnUpdate) | |
120 | - | then (status == "") | |
120 | + | then true | |
121 | + | else if (isAnUpdate) | |
122 | + | then (status == userAllowed) | |
121 | 123 | else false) | |
122 | - | then true | |
123 | - | else if (isAnUpdate) | |
124 | - | then (status == userAllowed) | |
125 | - | else false) | |
126 | - | then throw("Register first") | |
127 | - | else true | |
124 | + | then throw("Register first") | |
125 | + | else true | |
128 | 126 | } | |
129 | 127 | } | |
130 | 128 | ||
164 | 162 | ||
165 | 163 | @Callable(invoke) | |
166 | 164 | func appRunning (isLive,message) = { | |
167 | - | let caller = toString( | |
165 | + | let caller = toString(invoke.caller) | |
168 | 166 | let id = toBase58String(invoke.transactionId) | |
169 | 167 | if (containsElement([chris, joep, toString(this)], caller)) | |
170 | 168 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
175 | 173 | ||
176 | 174 | @Callable(invoke) | |
177 | 175 | func registrationMode (WLonly) = { | |
178 | - | let caller = toString( | |
176 | + | let caller = toString(invoke.caller) | |
179 | 177 | let id = toBase58String(invoke.transactionId) | |
180 | 178 | if (containsElement([chris, toString(this)], caller)) | |
181 | 179 | then [BooleanEntry(whitelistedonlyKey, WLonly)] | |
189 | 187 | then throw(maintenanceMSG) | |
190 | 188 | else { | |
191 | 189 | let caller = toString(invoke.caller) | |
192 | - | if (true) | |
193 | - | then throw(("invoke.transactionId = " + toBase58String(invoke.transactionId))) | |
190 | + | let id = toBase58String(invoke.transactionId) | |
191 | + | let timestamp = lastBlock.timestamp | |
192 | + | if (!(validUserData(caller, name, description, thumb, false))) | |
193 | + | then throw("Something went wrong") | |
194 | 194 | else { | |
195 | - | let id = toBase58String(invoke.transactionId) | |
196 | - | let timestamp = lastBlock.timestamp | |
197 | - | if (!(validUserData(caller, name, description, thumb, false))) | |
198 | - | then throw("Something went wrong") | |
199 | - | else { | |
200 | - | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp)) | |
195 | + | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp)) | |
201 | 196 | [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), DeleteEntry(("ALLOWED_" + caller)), StringEntry(((userRegistered + "_") + caller), json)] | |
202 | - | } | |
203 | 197 | } | |
204 | 198 | } | |
205 | 199 | ||
209 | 203 | func updateUser (name,description,thumb,social) = if (!(dappRunning)) | |
210 | 204 | then throw(maintenanceMSG) | |
211 | 205 | else { | |
212 | - | let caller = toString( | |
206 | + | let caller = toString(invoke.caller) | |
213 | 207 | let id = toBase58String(invoke.transactionId) | |
214 | 208 | let status = getStringByKey(keyUserStatus(caller)) | |
215 | 209 | if (!(validUserData(caller, name, description, thumb, true))) | |
225 | 219 | ||
226 | 220 | @Callable(invoke) | |
227 | 221 | func changeUserStatus (address,status,note) = { | |
228 | - | let caller = toString( | |
222 | + | let caller = toString(invoke.caller) | |
229 | 223 | let id = toBase58String(invoke.transactionId) | |
230 | 224 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
231 | 225 | let statusToSet = validateNewStatus(status, address, currentStatus) | |
242 | 236 | ||
243 | 237 | @Callable(invoke) | |
244 | 238 | func deleteUser (address) = { | |
245 | - | let caller = toString( | |
239 | + | let caller = toString(invoke.caller) | |
246 | 240 | let id = toBase58String(invoke.transactionId) | |
247 | 241 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
248 | 242 | if (containsElement([chris, toString(this)], caller)) | |
256 | 250 | func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning)) | |
257 | 251 | then throw(maintenanceMSG) | |
258 | 252 | else { | |
259 | - | let caller = toString( | |
253 | + | let caller = toString(i.caller) | |
260 | 254 | if (containsElement([chris, toString(this)], caller)) | |
261 | 255 | then if (if ((size(artistAddr) != 35)) | |
262 | 256 | then true | |
272 | 266 | func unsetAgent (artistAddr,agentAddr) = if (!(dappRunning)) | |
273 | 267 | then throw(maintenanceMSG) | |
274 | 268 | else { | |
275 | - | let caller = toString( | |
269 | + | let caller = toString(i.caller) | |
276 | 270 | if (containsElement([chris, toString(this)], caller)) | |
277 | 271 | then if (if ((size(artistAddr) != 35)) | |
278 | 272 | then true | |
286 | 280 | ||
287 | 281 | @Callable(i) | |
288 | 282 | func deleteEntry (entry) = { | |
289 | - | let caller = toString( | |
283 | + | let caller = toString(i.caller) | |
290 | 284 | if ((caller == chris)) | |
291 | 285 | then [DeleteEntry(entry)] | |
292 | 286 | else throw("no") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let chris = "3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp" | |
5 | 5 | ||
6 | 6 | let joep = "3Mzm4VLwsN9uZwbTMzPj3XuxV6kEfAR8UDN" | |
7 | 7 | ||
8 | 8 | let dappRunningKey = "conf_dapp_is_running" | |
9 | 9 | ||
10 | 10 | let maintenanceMSGKey = "conf_maintenance_msg" | |
11 | 11 | ||
12 | 12 | let whitelistedonlyKey = "conf_whitelisted_only" | |
13 | 13 | ||
14 | 14 | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
15 | 15 | ||
16 | 16 | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
17 | 17 | ||
18 | 18 | let whitelistedonly = valueOrElse(getBoolean(this, whitelistedonlyKey), true) | |
19 | 19 | ||
20 | 20 | let userAllowed = "ALLOWED" | |
21 | 21 | ||
22 | 22 | let userRegistered = "REGISTERED" | |
23 | 23 | ||
24 | 24 | let userVerified = "VERIFIED" | |
25 | 25 | ||
26 | 26 | let userSuspended = "SUSPENDED" | |
27 | 27 | ||
28 | 28 | let userRemoved = "REMOVED" | |
29 | 29 | ||
30 | 30 | let userChangeRequired = "CHANGE_REQUIRED" | |
31 | 31 | ||
32 | 32 | let userUnregistered = "UNREGISTERED" | |
33 | 33 | ||
34 | 34 | let userReset = "RESET" | |
35 | 35 | ||
36 | 36 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func keyUserAddr (caller) = ("user_" + caller) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func keyUserName (caller) = ("user_name_" + caller) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func keyUserDesc (caller) = ("user_desc_" + caller) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func keyUserSocial (caller) = ("user_social_" + caller) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func keyUserThumb (caller) = ("user_thumb_" + caller) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func keyUserStatus (caller) = ("user_status_" + caller) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func keyUserDate (caller) = ("user_date_" + caller) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func keyAgentArtistAddr (agentAddr,artistAddr) = ((("agent_" + agentAddr) + "_") + artistAddr) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func keyPrimaryShare (artistAddr) = ("artist_agent_primary_" + artistAddr) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func keySecondaryShare (artistAddr) = ("artist_agent_secondary_" + artistAddr) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func validateCID (cid) = if (contains(cid, "/")) | |
79 | 79 | then if (if ((76 > size(cid))) | |
80 | 80 | then (size(split(cid, "/")[0]) == 59) | |
81 | 81 | else false) | |
82 | 82 | then (16 > size(split(cid, "/")[1])) | |
83 | 83 | else false | |
84 | 84 | else false | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func validUserData (caller,name,description,thumb,isAnUpdate) = { | |
88 | 88 | let validCID = if ((size(thumb) != 0)) | |
89 | 89 | then validateCID(thumb) | |
90 | 90 | else true | |
91 | 91 | if (!(validCID)) | |
92 | 92 | then throw("CID don't match requirement!") | |
93 | 93 | else if (if ((name == "")) | |
94 | 94 | then true | |
95 | 95 | else (description == "")) | |
96 | 96 | then throw("Name and description cannot be empty") | |
97 | 97 | else if ((size(description) > 600)) | |
98 | 98 | then throw("600 Char. max description") | |
99 | 99 | else if ((size(name) > 45)) | |
100 | 100 | then throw("45 Char. max name") | |
101 | 101 | else { | |
102 | 102 | let status = getStringByKey(keyUserStatus(caller)) | |
103 | - | if (true) | |
104 | - | then throw(((("caller = " + caller) + " status = ") + status)) | |
105 | - | else if (if ((status == userSuspended)) | |
106 | - | then true | |
107 | - | else (status == userRemoved)) | |
108 | - | then throw("Account suspended/ removed.") | |
109 | - | else if (if (!(isAnUpdate)) | |
110 | - | then (status == userRegistered) | |
103 | + | if (if ((status == userSuspended)) | |
104 | + | then true | |
105 | + | else (status == userRemoved)) | |
106 | + | then throw("Account suspended/ removed.") | |
107 | + | else if (if (!(isAnUpdate)) | |
108 | + | then (status == userRegistered) | |
109 | + | else false) | |
110 | + | then throw("Already registered") | |
111 | + | else if (if (if (!(isAnUpdate)) | |
112 | + | then (status == "") | |
111 | 113 | else false) | |
112 | - | then throw("Already registered") | |
113 | - | else if (if (if (!(isAnUpdate)) | |
114 | + | then whitelistedonly | |
115 | + | else false) | |
116 | + | then throw("Can't register, get approved first.") | |
117 | + | else if (if (if (isAnUpdate) | |
114 | 118 | then (status == "") | |
115 | 119 | else false) | |
116 | - | then whitelistedonly | |
117 | - | else false) | |
118 | - | then throw("Can't register, get approved first.") | |
119 | - | else if (if (if (isAnUpdate) | |
120 | - | then (status == "") | |
120 | + | then true | |
121 | + | else if (isAnUpdate) | |
122 | + | then (status == userAllowed) | |
121 | 123 | else false) | |
122 | - | then true | |
123 | - | else if (isAnUpdate) | |
124 | - | then (status == userAllowed) | |
125 | - | else false) | |
126 | - | then throw("Register first") | |
127 | - | else true | |
124 | + | then throw("Register first") | |
125 | + | else true | |
128 | 126 | } | |
129 | 127 | } | |
130 | 128 | ||
131 | 129 | ||
132 | 130 | func validateNewStatus (status,address,currentStatus) = { | |
133 | 131 | let allStatus = [userVerified, userRegistered, userSuspended, userRemoved, userAllowed, userChangeRequired] | |
134 | 132 | let statusToSet = if (containsElement(allStatus, status)) | |
135 | 133 | then status | |
136 | 134 | else if (if ((status == userReset)) | |
137 | 135 | then (currentStatus == userAllowed) | |
138 | 136 | else false) | |
139 | 137 | then "" | |
140 | 138 | else throw("Unknown status") | |
141 | 139 | let userIsRegistered = getIntegerByKey(keyUserDate(address)) | |
142 | 140 | if (if ((userIsRegistered == 0)) | |
143 | 141 | then (statusToSet != userAllowed) | |
144 | 142 | else false) | |
145 | 143 | then throw("You cant set this status, user is not registered.") | |
146 | 144 | else if (if ((currentStatus == userAllowed)) | |
147 | 145 | then (statusToSet == userAllowed) | |
148 | 146 | else false) | |
149 | 147 | then throw("User already allowed") | |
150 | 148 | else if (if ((currentStatus == userRegistered)) | |
151 | 149 | then (statusToSet == userAllowed) | |
152 | 150 | else false) | |
153 | 151 | then throw("User already allowed & registered") | |
154 | 152 | else if (if ((currentStatus == userVerified)) | |
155 | 153 | then (statusToSet == userAllowed) | |
156 | 154 | else false) | |
157 | 155 | then throw("User already allowed & verified") | |
158 | 156 | else statusToSet | |
159 | 157 | } | |
160 | 158 | ||
161 | 159 | ||
162 | 160 | func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}") | |
163 | 161 | ||
164 | 162 | ||
165 | 163 | @Callable(invoke) | |
166 | 164 | func appRunning (isLive,message) = { | |
167 | - | let caller = toString( | |
165 | + | let caller = toString(invoke.caller) | |
168 | 166 | let id = toBase58String(invoke.transactionId) | |
169 | 167 | if (containsElement([chris, joep, toString(this)], caller)) | |
170 | 168 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
171 | 169 | else throw("You are not allowed to change this") | |
172 | 170 | } | |
173 | 171 | ||
174 | 172 | ||
175 | 173 | ||
176 | 174 | @Callable(invoke) | |
177 | 175 | func registrationMode (WLonly) = { | |
178 | - | let caller = toString( | |
176 | + | let caller = toString(invoke.caller) | |
179 | 177 | let id = toBase58String(invoke.transactionId) | |
180 | 178 | if (containsElement([chris, toString(this)], caller)) | |
181 | 179 | then [BooleanEntry(whitelistedonlyKey, WLonly)] | |
182 | 180 | else throw("You are not allowed to change this") | |
183 | 181 | } | |
184 | 182 | ||
185 | 183 | ||
186 | 184 | ||
187 | 185 | @Callable(invoke) | |
188 | 186 | func registerUser (name,description,thumb,social) = if (!(dappRunning)) | |
189 | 187 | then throw(maintenanceMSG) | |
190 | 188 | else { | |
191 | 189 | let caller = toString(invoke.caller) | |
192 | - | if (true) | |
193 | - | then throw(("invoke.transactionId = " + toBase58String(invoke.transactionId))) | |
190 | + | let id = toBase58String(invoke.transactionId) | |
191 | + | let timestamp = lastBlock.timestamp | |
192 | + | if (!(validUserData(caller, name, description, thumb, false))) | |
193 | + | then throw("Something went wrong") | |
194 | 194 | else { | |
195 | - | let id = toBase58String(invoke.transactionId) | |
196 | - | let timestamp = lastBlock.timestamp | |
197 | - | if (!(validUserData(caller, name, description, thumb, false))) | |
198 | - | then throw("Something went wrong") | |
199 | - | else { | |
200 | - | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp)) | |
195 | + | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp)) | |
201 | 196 | [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), DeleteEntry(("ALLOWED_" + caller)), StringEntry(((userRegistered + "_") + caller), json)] | |
202 | - | } | |
203 | 197 | } | |
204 | 198 | } | |
205 | 199 | ||
206 | 200 | ||
207 | 201 | ||
208 | 202 | @Callable(invoke) | |
209 | 203 | func updateUser (name,description,thumb,social) = if (!(dappRunning)) | |
210 | 204 | then throw(maintenanceMSG) | |
211 | 205 | else { | |
212 | - | let caller = toString( | |
206 | + | let caller = toString(invoke.caller) | |
213 | 207 | let id = toBase58String(invoke.transactionId) | |
214 | 208 | let status = getStringByKey(keyUserStatus(caller)) | |
215 | 209 | if (!(validUserData(caller, name, description, thumb, true))) | |
216 | 210 | then throw("Something went wrong") | |
217 | 211 | else { | |
218 | 212 | let date = getIntegerByKey(keyUserDate(caller)) | |
219 | 213 | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date)) | |
220 | 214 | [StringEntry(keyUserName(caller), name), StringEntry(keyUserDesc(caller), description), StringEntry(keyUserSocial(caller), social), StringEntry(keyUserThumb(caller), thumb), StringEntry(((status + "_") + caller), json)] | |
221 | 215 | } | |
222 | 216 | } | |
223 | 217 | ||
224 | 218 | ||
225 | 219 | ||
226 | 220 | @Callable(invoke) | |
227 | 221 | func changeUserStatus (address,status,note) = { | |
228 | - | let caller = toString( | |
222 | + | let caller = toString(invoke.caller) | |
229 | 223 | let id = toBase58String(invoke.transactionId) | |
230 | 224 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
231 | 225 | let statusToSet = validateNewStatus(status, address, currentStatus) | |
232 | 226 | let name = toBase64String(toBytes(getStringByKey(keyUserName(address)))) | |
233 | 227 | let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address)))) | |
234 | 228 | let date = getIntegerByKey(keyUserDate(address)) | |
235 | 229 | let json = makeJSON(name, thumb, toString(date)) | |
236 | 230 | if (containsElement([chris, joep, toString(this)], caller)) | |
237 | 231 | then [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(("user_note_" + address), note)] | |
238 | 232 | else throw("Not allowed to change user status") | |
239 | 233 | } | |
240 | 234 | ||
241 | 235 | ||
242 | 236 | ||
243 | 237 | @Callable(invoke) | |
244 | 238 | func deleteUser (address) = { | |
245 | - | let caller = toString( | |
239 | + | let caller = toString(invoke.caller) | |
246 | 240 | let id = toBase58String(invoke.transactionId) | |
247 | 241 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
248 | 242 | if (containsElement([chris, toString(this)], caller)) | |
249 | 243 | 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)), StringEntry(keyUserStatus(address), userRemoved)] | |
250 | 244 | else throw("Not allowed") | |
251 | 245 | } | |
252 | 246 | ||
253 | 247 | ||
254 | 248 | ||
255 | 249 | @Callable(i) | |
256 | 250 | func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning)) | |
257 | 251 | then throw(maintenanceMSG) | |
258 | 252 | else { | |
259 | - | let caller = toString( | |
253 | + | let caller = toString(i.caller) | |
260 | 254 | if (containsElement([chris, toString(this)], caller)) | |
261 | 255 | then if (if ((size(artistAddr) != 35)) | |
262 | 256 | then true | |
263 | 257 | else (size(agentAddr) != 35)) | |
264 | 258 | then throw("Wrong address") | |
265 | 259 | else [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)] | |
266 | 260 | else throw("You are not allowed") | |
267 | 261 | } | |
268 | 262 | ||
269 | 263 | ||
270 | 264 | ||
271 | 265 | @Callable(i) | |
272 | 266 | func unsetAgent (artistAddr,agentAddr) = if (!(dappRunning)) | |
273 | 267 | then throw(maintenanceMSG) | |
274 | 268 | else { | |
275 | - | let caller = toString( | |
269 | + | let caller = toString(i.caller) | |
276 | 270 | if (containsElement([chris, toString(this)], caller)) | |
277 | 271 | then if (if ((size(artistAddr) != 35)) | |
278 | 272 | then true | |
279 | 273 | else (size(agentAddr) != 35)) | |
280 | 274 | then throw("Wrong address") | |
281 | 275 | else [DeleteEntry(keyArtistAgentAddr(artistAddr)), DeleteEntry(keyAgentArtistAddr(agentAddr, artistAddr)), DeleteEntry(keyPrimaryShare(artistAddr)), DeleteEntry(keySecondaryShare(artistAddr))] | |
282 | 276 | else throw("You are not allowed") | |
283 | 277 | } | |
284 | 278 | ||
285 | 279 | ||
286 | 280 | ||
287 | 281 | @Callable(i) | |
288 | 282 | func deleteEntry (entry) = { | |
289 | - | let caller = toString( | |
283 | + | let caller = toString(i.caller) | |
290 | 284 | if ((caller == chris)) | |
291 | 285 | then [DeleteEntry(entry)] | |
292 | 286 | else throw("no") | |
293 | 287 | } | |
294 | 288 | ||
295 | 289 |
github/deemru/w8io/026f985 48.19 ms ◑