tx · 4K5kkVk5edrTX9RxFkL1cxAAxi5BrnYC3qeZxMScL1Ms 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj: -0.01400000 Waves 2022.02.24 06:05 [1937183] smart account 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj > SELF 0.00000000 Waves
{ "type": 13, "id": "4K5kkVk5edrTX9RxFkL1cxAAxi5BrnYC3qeZxMScL1Ms", "fee": 1400000, "feeAssetId": null, "timestamp": 1645672013323, "version": 2, "chainId": 84, "sender": "3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj", "senderPublicKey": "A2m227AHcq7gWfSU59Q3UJaqkEa7SccFYmJuWHbFrrKE", "proofs": [ "5J9MAMbZLvnHzFaKxwsyeaGG9cxd8P9dfyLcYHE7SfMYscf5G3LBqx1t8YQEjMhfasFCXmcxjAkVp2MPA9e6S1Ew" ], "script": "base64:AAIFAAAAAAAAAD4IAhIECgIECBIDCgEEEgYKBAgICAgSBgoECAgICBIFCgMICAgSAwoBCBIGCgQICAEBEgYKBAgIAQESAwoBCAAAACIAAAAABWNocmlzAgAAACMzUDRKdXRCS1c2cEFEbTkxRnhNZkdMM0VZeEtKdFdZc1dmWAAAAAAEam9lcAIAAAAjM1BMS1hQSmlnWko0YVZxcE1HeDVhanlQWW1BNFpjcnk5VGIAAAAADmRhcHBSdW5uaW5nS2V5AgAAABRjb25mX2RhcHBfaXNfcnVubmluZwAAAAARbWFpbnRlbmFuY2VNU0dLZXkCAAAAFGNvbmZfbWFpbnRlbmFuY2VfbXNnAAAAABJ3aGl0ZWxpc3RlZG9ubHlLZXkCAAAAFWNvbmZfd2hpdGVsaXN0ZWRfb25seQAAAAALZGFwcFJ1bm5pbmcJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQbAAAAAgUAAAAEdGhpcwUAAAAOZGFwcFJ1bm5pbmdLZXkGAAAAAA5tYWludGVuYW5jZU1TRwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAAC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AEFAAAACmFydGlzdEFkZHIJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAAEWtleVNlY29uZGFyeVNoYXJlAAAAAQUAAAAKYXJ0aXN0QWRkcgUAAAADbmlsCQAAAgAAAAECAAAAE1lvdSBhcmUgbm90IGFsbG93ZWQAAAABaQEAAAALZGVsZXRlRW50cnkAAAABAAAABWVudHJ5BAAAAAZjYWxsZXIJAAQlAAAAAQkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5AwkAAAAAAAACBQAAAAZjYWxsZXIFAAAABWNocmlzCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAABWVudHJ5BQAAAANuaWwJAAACAAAAAQIAAAACbm8AAAAAClFbRQ==", "height": 1937183, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Eu8K7vYJZiwHewQ1SNpMYmSCjE859CidKbTw3JSjxY87 Next: Cemojcz6ZgcMGYiGBoPRi1aqiEizbg4TRNSJ8ySN7pVi Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let chris = " | |
4 | + | let chris = "3P4JutBKW6pADm91FxMfGL3EYxKJtWYsWfX" | |
5 | 5 | ||
6 | - | let joep = " | |
6 | + | let joep = "3PLKXPJigZJ4aVqpMGx5ajyPYmA4Zcry9Tb" | |
7 | 7 | ||
8 | 8 | let dappRunningKey = "conf_dapp_is_running" | |
9 | 9 | ||
252 | 252 | else { | |
253 | 253 | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
254 | 254 | if (containsElement([chris, toString(this)], caller)) | |
255 | - | then [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)] | |
255 | + | then if (if ((size(artistAddr) == 0)) | |
256 | + | then true | |
257 | + | else (size(agentAddr) == 0)) | |
258 | + | then throw("Need both address") | |
259 | + | else [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)] | |
260 | + | else throw("You are not allowed") | |
261 | + | } | |
262 | + | ||
263 | + | ||
264 | + | ||
265 | + | @Callable(i) | |
266 | + | func unsetAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning)) | |
267 | + | then throw(maintenanceMSG) | |
268 | + | else { | |
269 | + | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
270 | + | if (containsElement([chris, toString(this)], caller)) | |
271 | + | then if (if ((size(artistAddr) == 0)) | |
272 | + | then true | |
273 | + | else (size(agentAddr) == 0)) | |
274 | + | then throw("Need both address") | |
275 | + | else [DeleteEntry(keyArtistAgentAddr(artistAddr)), DeleteEntry(keyAgentArtistAddr(agentAddr, artistAddr)), DeleteEntry(keyPrimaryShare(artistAddr)), DeleteEntry(keySecondaryShare(artistAddr))] | |
256 | 276 | else throw("You are not allowed") | |
257 | 277 | } | |
258 | 278 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let chris = " | |
4 | + | let chris = "3P4JutBKW6pADm91FxMfGL3EYxKJtWYsWfX" | |
5 | 5 | ||
6 | - | let joep = " | |
6 | + | let joep = "3PLKXPJigZJ4aVqpMGx5ajyPYmA4Zcry9Tb" | |
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 | 103 | if (if ((status == userSuspended)) | |
104 | 104 | then true | |
105 | 105 | else (status == userRemoved)) | |
106 | 106 | then throw("Account suspended/ removed.") | |
107 | 107 | else if (if (!(isAnUpdate)) | |
108 | 108 | then (status == userRegistered) | |
109 | 109 | else false) | |
110 | 110 | then throw("Already registered") | |
111 | 111 | else if (if (if (!(isAnUpdate)) | |
112 | 112 | then (status == "") | |
113 | 113 | else false) | |
114 | 114 | then whitelistedonly | |
115 | 115 | else false) | |
116 | 116 | then throw("Can't register, get approved first.") | |
117 | 117 | else if (if (if (isAnUpdate) | |
118 | 118 | then (status == "") | |
119 | 119 | else false) | |
120 | 120 | then true | |
121 | 121 | else if (isAnUpdate) | |
122 | 122 | then (status == userAllowed) | |
123 | 123 | else false) | |
124 | 124 | then throw("Register first") | |
125 | 125 | else true | |
126 | 126 | } | |
127 | 127 | } | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func validateNewStatus (status,address,currentStatus) = { | |
131 | 131 | let allStatus = [userVerified, userRegistered, userSuspended, userRemoved, userAllowed, userChangeRequired] | |
132 | 132 | let statusToSet = if (containsElement(allStatus, status)) | |
133 | 133 | then status | |
134 | 134 | else if (if ((status == userReset)) | |
135 | 135 | then (currentStatus == userAllowed) | |
136 | 136 | else false) | |
137 | 137 | then "" | |
138 | 138 | else throw("Unknown status") | |
139 | 139 | let userIsRegistered = getIntegerByKey(keyUserDate(address)) | |
140 | 140 | if (if ((userIsRegistered == 0)) | |
141 | 141 | then (statusToSet != userAllowed) | |
142 | 142 | else false) | |
143 | 143 | then throw("You cant set this status, user is not registered.") | |
144 | 144 | else if (if ((currentStatus == userAllowed)) | |
145 | 145 | then (statusToSet == userAllowed) | |
146 | 146 | else false) | |
147 | 147 | then throw("User already allowed") | |
148 | 148 | else if (if ((currentStatus == userRegistered)) | |
149 | 149 | then (statusToSet == userAllowed) | |
150 | 150 | else false) | |
151 | 151 | then throw("User already allowed & registered") | |
152 | 152 | else if (if ((currentStatus == userVerified)) | |
153 | 153 | then (statusToSet == userAllowed) | |
154 | 154 | else false) | |
155 | 155 | then throw("User already allowed & verified") | |
156 | 156 | else statusToSet | |
157 | 157 | } | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}") | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | @Callable(invoke) | |
164 | 164 | func appRunning (isLive,message) = { | |
165 | 165 | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
166 | 166 | let id = toBase58String(invoke.transactionId) | |
167 | 167 | if (containsElement([chris, joep, toString(this)], caller)) | |
168 | 168 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
169 | 169 | else throw("You are not allowed to change this") | |
170 | 170 | } | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | ||
174 | 174 | @Callable(invoke) | |
175 | 175 | func registrationMode (WLonly) = { | |
176 | 176 | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
177 | 177 | let id = toBase58String(invoke.transactionId) | |
178 | 178 | if (containsElement([chris, toString(this)], caller)) | |
179 | 179 | then [BooleanEntry(whitelistedonlyKey, WLonly)] | |
180 | 180 | else throw("You are not allowed to change this") | |
181 | 181 | } | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | ||
185 | 185 | @Callable(invoke) | |
186 | 186 | func registerUser (name,description,thumb,social) = if (!(dappRunning)) | |
187 | 187 | then throw(maintenanceMSG) | |
188 | 188 | else { | |
189 | 189 | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
190 | 190 | let id = toBase58String(invoke.transactionId) | |
191 | 191 | let timestamp = lastBlock.timestamp | |
192 | 192 | if (!(validUserData(caller, name, description, thumb, false))) | |
193 | 193 | then throw("Something went wrong") | |
194 | 194 | else { | |
195 | 195 | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp)) | |
196 | 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)] | |
197 | 197 | } | |
198 | 198 | } | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | ||
202 | 202 | @Callable(invoke) | |
203 | 203 | func updateUser (name,description,thumb,social) = if (!(dappRunning)) | |
204 | 204 | then throw(maintenanceMSG) | |
205 | 205 | else { | |
206 | 206 | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
207 | 207 | let id = toBase58String(invoke.transactionId) | |
208 | 208 | let status = getStringByKey(keyUserStatus(caller)) | |
209 | 209 | if (!(validUserData(caller, name, description, thumb, true))) | |
210 | 210 | then throw("Something went wrong") | |
211 | 211 | else { | |
212 | 212 | let date = getIntegerByKey(keyUserDate(caller)) | |
213 | 213 | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date)) | |
214 | 214 | [StringEntry(keyUserName(caller), name), StringEntry(keyUserDesc(caller), description), StringEntry(keyUserSocial(caller), social), StringEntry(keyUserThumb(caller), thumb), StringEntry(((status + "_") + caller), json)] | |
215 | 215 | } | |
216 | 216 | } | |
217 | 217 | ||
218 | 218 | ||
219 | 219 | ||
220 | 220 | @Callable(invoke) | |
221 | 221 | func changeUserStatus (address,status,note) = { | |
222 | 222 | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
223 | 223 | let id = toBase58String(invoke.transactionId) | |
224 | 224 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
225 | 225 | let statusToSet = validateNewStatus(status, address, currentStatus) | |
226 | 226 | let name = toBase64String(toBytes(getStringByKey(keyUserName(address)))) | |
227 | 227 | let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address)))) | |
228 | 228 | let date = getIntegerByKey(keyUserDate(address)) | |
229 | 229 | let json = makeJSON(name, thumb, toString(date)) | |
230 | 230 | if (containsElement([chris, joep, toString(this)], caller)) | |
231 | 231 | then [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(("user_note_" + address), note)] | |
232 | 232 | else throw("Not allowed to change user status") | |
233 | 233 | } | |
234 | 234 | ||
235 | 235 | ||
236 | 236 | ||
237 | 237 | @Callable(invoke) | |
238 | 238 | func deleteUser (address) = { | |
239 | 239 | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
240 | 240 | let id = toBase58String(invoke.transactionId) | |
241 | 241 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
242 | 242 | if (containsElement([chris, toString(this)], caller)) | |
243 | 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)] | |
244 | 244 | else throw("Not allowed") | |
245 | 245 | } | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | ||
249 | 249 | @Callable(i) | |
250 | 250 | func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning)) | |
251 | 251 | then throw(maintenanceMSG) | |
252 | 252 | else { | |
253 | 253 | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
254 | 254 | if (containsElement([chris, toString(this)], caller)) | |
255 | - | then [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)] | |
255 | + | then if (if ((size(artistAddr) == 0)) | |
256 | + | then true | |
257 | + | else (size(agentAddr) == 0)) | |
258 | + | then throw("Need both address") | |
259 | + | else [StringEntry(keyArtistAgentAddr(artistAddr), agentAddr), StringEntry(keyAgentArtistAddr(agentAddr, artistAddr), artistAddr), IntegerEntry(keyPrimaryShare(artistAddr), primaryShare), IntegerEntry(keySecondaryShare(artistAddr), secondaryShare)] | |
260 | + | else throw("You are not allowed") | |
261 | + | } | |
262 | + | ||
263 | + | ||
264 | + | ||
265 | + | @Callable(i) | |
266 | + | func unsetAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning)) | |
267 | + | then throw(maintenanceMSG) | |
268 | + | else { | |
269 | + | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
270 | + | if (containsElement([chris, toString(this)], caller)) | |
271 | + | then if (if ((size(artistAddr) == 0)) | |
272 | + | then true | |
273 | + | else (size(agentAddr) == 0)) | |
274 | + | then throw("Need both address") | |
275 | + | else [DeleteEntry(keyArtistAgentAddr(artistAddr)), DeleteEntry(keyAgentArtistAddr(agentAddr, artistAddr)), DeleteEntry(keyPrimaryShare(artistAddr)), DeleteEntry(keySecondaryShare(artistAddr))] | |
256 | 276 | else throw("You are not allowed") | |
257 | 277 | } | |
258 | 278 | ||
259 | 279 | ||
260 | 280 | ||
261 | 281 | @Callable(i) | |
262 | 282 | func deleteEntry (entry) = { | |
263 | 283 | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
264 | 284 | if ((caller == chris)) | |
265 | 285 | then [DeleteEntry(entry)] | |
266 | 286 | else throw("no") | |
267 | 287 | } | |
268 | 288 | ||
269 | 289 |
github/deemru/w8io/026f985 95.16 ms ◑