tx · Eu8K7vYJZiwHewQ1SNpMYmSCjE859CidKbTw3JSjxY87 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj: -0.01400000 Waves 2022.02.24 04:39 [1937095] smart account 3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj > SELF 0.00000000 Waves
{ "type": 13, "id": "Eu8K7vYJZiwHewQ1SNpMYmSCjE859CidKbTw3JSjxY87", "fee": 1400000, "feeAssetId": null, "timestamp": 1645666748554, "version": 2, "chainId": 84, "sender": "3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj", "senderPublicKey": "A2m227AHcq7gWfSU59Q3UJaqkEa7SccFYmJuWHbFrrKE", "proofs": [ "3pBWiLgWSyQVHcsPTbdgADJXFHEN1Sxj8zCoUMjpkwWkYe5rt1HkzdURhbYxP8kRXPa3ZRBK1SnZEYvxKf6qCJZB" ], "script": "base64:AAIFAAAAAAAAADYIAhIECgIECBIDCgEEEgYKBAgICAgSBgoECAgICBIFCgMICAgSAwoBCBIGCgQICAEBEgMKAQgAAAAiAAAAAAVjaHJpcwIAAAAjM01zRzZqUE5DclZKVXRZQjdYSkJ4Uzd1dFdzWEFmNG45VnAAAAAABGpvZXACAAAAIzNNem00Vkx3c045dVp3YlRNelBqM1h1eFY2a0VmQVI4VUROAAAAAA5kYXBwUnVubmluZ0tleQIAAAAUY29uZl9kYXBwX2lzX3J1bm5pbmcAAAAAEW1haW50ZW5hbmNlTVNHS2V5AgAAABRjb25mX21haW50ZW5hbmNlX21zZwAAAAASd2hpdGVsaXN0ZWRvbmx5S2V5AgAAABVjb25mX3doaXRlbGlzdGVkX29ubHkAAAAAC2RhcHBSdW5uaW5nCQEAAAALdmFsdWVPckVsc2UAAAACCQAEGwAAAAIFAAAABHRoaXMFAAAADmRhcHBSdW5uaW5nS2V5BgAAAAAObWFpbnRlbmFuY2VNU0cJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwUAAAARbWFpbnRlb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AARa2V5U2Vjb25kYXJ5U2hhcmUAAAABBQAAAAphcnRpc3RBZGRyBQAAAA5zZWNvbmRhcnlTaGFyZQUAAAADbmlsCQAAAgAAAAECAAAAE1lvdSBhcmUgbm90IGFsbG93ZWQAAAABaQEAAAALZGVsZXRlRW50cnkAAAABAAAABWVudHJ5BAAAAAZjYWxsZXIJAAQlAAAAAQkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5AwkAAAAAAAACBQAAAAZjYWxsZXIFAAAABWNocmlzCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAABWVudHJ5BQAAAANuaWwJAAACAAAAAQIAAAACbm8AAAAA83o0yg==", "height": 1937095, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AzcMqT2KzArnLCKN3VBV1U2DD2m7xfawAqdEhAZnv1qa Next: 4K5kkVk5edrTX9RxFkL1cxAAxi5BrnYC3qeZxMScL1Ms Diff:
Old | New | Differences | |
---|---|---|---|
61 | 61 | ||
62 | 62 | ||
63 | 63 | func keyUserDate (caller) = ("user_date_" + caller) | |
64 | + | ||
65 | + | ||
66 | + | func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr) | |
67 | + | ||
68 | + | ||
69 | + | func keyAgentArtistAddr (agentAddr,artistAddr) = ((("agent_" + agentAddr) + "_") + artistAddr) | |
70 | + | ||
71 | + | ||
72 | + | func keyPrimaryShare (artistAddr) = ("artist_agent_primary_" + artistAddr) | |
73 | + | ||
74 | + | ||
75 | + | func keySecondaryShare (artistAddr) = ("artist_agent_secondary" + artistAddr) | |
64 | 76 | ||
65 | 77 | ||
66 | 78 | func validateCID (cid) = if (contains(cid, "/")) | |
228 | 240 | let id = toBase58String(invoke.transactionId) | |
229 | 241 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
230 | 242 | if (containsElement([chris, toString(this)], caller)) | |
231 | - | then [DeleteEntry(keyUserDate(address)), DeleteEntry(keyUserAddr(address)), DeleteEntry(keyUserName(address)), DeleteEntry(keyUserDesc(address)), DeleteEntry(keyUserSocial(address)), DeleteEntry(keyUserThumb(address)), DeleteEntry(((currentStatus + "_") + address)), StringEntry(keyUserStatus(address), userRemoved)] | |
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)] | |
232 | 244 | else throw("Not allowed") | |
245 | + | } | |
246 | + | ||
247 | + | ||
248 | + | ||
249 | + | @Callable(i) | |
250 | + | func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning)) | |
251 | + | then throw(maintenanceMSG) | |
252 | + | else { | |
253 | + | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
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)] | |
256 | + | else throw("You are not allowed") | |
257 | + | } | |
258 | + | ||
259 | + | ||
260 | + | ||
261 | + | @Callable(i) | |
262 | + | func deleteEntry (entry) = { | |
263 | + | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
264 | + | if ((caller == chris)) | |
265 | + | then [DeleteEntry(entry)] | |
266 | + | else throw("no") | |
233 | 267 | } | |
234 | 268 | ||
235 | 269 |
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 | + | ||
65 | + | ||
66 | + | func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr) | |
67 | + | ||
68 | + | ||
69 | + | func keyAgentArtistAddr (agentAddr,artistAddr) = ((("agent_" + agentAddr) + "_") + artistAddr) | |
70 | + | ||
71 | + | ||
72 | + | func keyPrimaryShare (artistAddr) = ("artist_agent_primary_" + artistAddr) | |
73 | + | ||
74 | + | ||
75 | + | func keySecondaryShare (artistAddr) = ("artist_agent_secondary" + artistAddr) | |
64 | 76 | ||
65 | 77 | ||
66 | 78 | func validateCID (cid) = if (contains(cid, "/")) | |
67 | 79 | then if (if ((76 > size(cid))) | |
68 | 80 | then (size(split(cid, "/")[0]) == 59) | |
69 | 81 | else false) | |
70 | 82 | then (16 > size(split(cid, "/")[1])) | |
71 | 83 | else false | |
72 | 84 | else false | |
73 | 85 | ||
74 | 86 | ||
75 | 87 | func validUserData (caller,name,description,thumb,isAnUpdate) = { | |
76 | 88 | let validCID = if ((size(thumb) != 0)) | |
77 | 89 | then validateCID(thumb) | |
78 | 90 | else true | |
79 | 91 | if (!(validCID)) | |
80 | 92 | then throw("CID don't match requirement!") | |
81 | 93 | else if (if ((name == "")) | |
82 | 94 | then true | |
83 | 95 | else (description == "")) | |
84 | 96 | then throw("Name and description cannot be empty") | |
85 | 97 | else if ((size(description) > 600)) | |
86 | 98 | then throw("600 Char. max description") | |
87 | 99 | else if ((size(name) > 45)) | |
88 | 100 | then throw("45 Char. max name") | |
89 | 101 | else { | |
90 | 102 | let status = getStringByKey(keyUserStatus(caller)) | |
91 | 103 | if (if ((status == userSuspended)) | |
92 | 104 | then true | |
93 | 105 | else (status == userRemoved)) | |
94 | 106 | then throw("Account suspended/ removed.") | |
95 | 107 | else if (if (!(isAnUpdate)) | |
96 | 108 | then (status == userRegistered) | |
97 | 109 | else false) | |
98 | 110 | then throw("Already registered") | |
99 | 111 | else if (if (if (!(isAnUpdate)) | |
100 | 112 | then (status == "") | |
101 | 113 | else false) | |
102 | 114 | then whitelistedonly | |
103 | 115 | else false) | |
104 | 116 | then throw("Can't register, get approved first.") | |
105 | 117 | else if (if (if (isAnUpdate) | |
106 | 118 | then (status == "") | |
107 | 119 | else false) | |
108 | 120 | then true | |
109 | 121 | else if (isAnUpdate) | |
110 | 122 | then (status == userAllowed) | |
111 | 123 | else false) | |
112 | 124 | then throw("Register first") | |
113 | 125 | else true | |
114 | 126 | } | |
115 | 127 | } | |
116 | 128 | ||
117 | 129 | ||
118 | 130 | func validateNewStatus (status,address,currentStatus) = { | |
119 | 131 | let allStatus = [userVerified, userRegistered, userSuspended, userRemoved, userAllowed, userChangeRequired] | |
120 | 132 | let statusToSet = if (containsElement(allStatus, status)) | |
121 | 133 | then status | |
122 | 134 | else if (if ((status == userReset)) | |
123 | 135 | then (currentStatus == userAllowed) | |
124 | 136 | else false) | |
125 | 137 | then "" | |
126 | 138 | else throw("Unknown status") | |
127 | 139 | let userIsRegistered = getIntegerByKey(keyUserDate(address)) | |
128 | 140 | if (if ((userIsRegistered == 0)) | |
129 | 141 | then (statusToSet != userAllowed) | |
130 | 142 | else false) | |
131 | 143 | then throw("You cant set this status, user is not registered.") | |
132 | 144 | else if (if ((currentStatus == userAllowed)) | |
133 | 145 | then (statusToSet == userAllowed) | |
134 | 146 | else false) | |
135 | 147 | then throw("User already allowed") | |
136 | 148 | else if (if ((currentStatus == userRegistered)) | |
137 | 149 | then (statusToSet == userAllowed) | |
138 | 150 | else false) | |
139 | 151 | then throw("User already allowed & registered") | |
140 | 152 | else if (if ((currentStatus == userVerified)) | |
141 | 153 | then (statusToSet == userAllowed) | |
142 | 154 | else false) | |
143 | 155 | then throw("User already allowed & verified") | |
144 | 156 | else statusToSet | |
145 | 157 | } | |
146 | 158 | ||
147 | 159 | ||
148 | 160 | func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}") | |
149 | 161 | ||
150 | 162 | ||
151 | 163 | @Callable(invoke) | |
152 | 164 | func appRunning (isLive,message) = { | |
153 | 165 | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
154 | 166 | let id = toBase58String(invoke.transactionId) | |
155 | 167 | if (containsElement([chris, joep, toString(this)], caller)) | |
156 | 168 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
157 | 169 | else throw("You are not allowed to change this") | |
158 | 170 | } | |
159 | 171 | ||
160 | 172 | ||
161 | 173 | ||
162 | 174 | @Callable(invoke) | |
163 | 175 | func registrationMode (WLonly) = { | |
164 | 176 | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
165 | 177 | let id = toBase58String(invoke.transactionId) | |
166 | 178 | if (containsElement([chris, toString(this)], caller)) | |
167 | 179 | then [BooleanEntry(whitelistedonlyKey, WLonly)] | |
168 | 180 | else throw("You are not allowed to change this") | |
169 | 181 | } | |
170 | 182 | ||
171 | 183 | ||
172 | 184 | ||
173 | 185 | @Callable(invoke) | |
174 | 186 | func registerUser (name,description,thumb,social) = if (!(dappRunning)) | |
175 | 187 | then throw(maintenanceMSG) | |
176 | 188 | else { | |
177 | 189 | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
178 | 190 | let id = toBase58String(invoke.transactionId) | |
179 | 191 | let timestamp = lastBlock.timestamp | |
180 | 192 | if (!(validUserData(caller, name, description, thumb, false))) | |
181 | 193 | then throw("Something went wrong") | |
182 | 194 | else { | |
183 | 195 | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp)) | |
184 | 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)] | |
185 | 197 | } | |
186 | 198 | } | |
187 | 199 | ||
188 | 200 | ||
189 | 201 | ||
190 | 202 | @Callable(invoke) | |
191 | 203 | func updateUser (name,description,thumb,social) = if (!(dappRunning)) | |
192 | 204 | then throw(maintenanceMSG) | |
193 | 205 | else { | |
194 | 206 | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
195 | 207 | let id = toBase58String(invoke.transactionId) | |
196 | 208 | let status = getStringByKey(keyUserStatus(caller)) | |
197 | 209 | if (!(validUserData(caller, name, description, thumb, true))) | |
198 | 210 | then throw("Something went wrong") | |
199 | 211 | else { | |
200 | 212 | let date = getIntegerByKey(keyUserDate(caller)) | |
201 | 213 | let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date)) | |
202 | 214 | [StringEntry(keyUserName(caller), name), StringEntry(keyUserDesc(caller), description), StringEntry(keyUserSocial(caller), social), StringEntry(keyUserThumb(caller), thumb), StringEntry(((status + "_") + caller), json)] | |
203 | 215 | } | |
204 | 216 | } | |
205 | 217 | ||
206 | 218 | ||
207 | 219 | ||
208 | 220 | @Callable(invoke) | |
209 | 221 | func changeUserStatus (address,status,note) = { | |
210 | 222 | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
211 | 223 | let id = toBase58String(invoke.transactionId) | |
212 | 224 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
213 | 225 | let statusToSet = validateNewStatus(status, address, currentStatus) | |
214 | 226 | let name = toBase64String(toBytes(getStringByKey(keyUserName(address)))) | |
215 | 227 | let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address)))) | |
216 | 228 | let date = getIntegerByKey(keyUserDate(address)) | |
217 | 229 | let json = makeJSON(name, thumb, toString(date)) | |
218 | 230 | if (containsElement([chris, joep, toString(this)], caller)) | |
219 | 231 | then [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(("user_note_" + address), note)] | |
220 | 232 | else throw("Not allowed to change user status") | |
221 | 233 | } | |
222 | 234 | ||
223 | 235 | ||
224 | 236 | ||
225 | 237 | @Callable(invoke) | |
226 | 238 | func deleteUser (address) = { | |
227 | 239 | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
228 | 240 | let id = toBase58String(invoke.transactionId) | |
229 | 241 | let currentStatus = getStringByKey(keyUserStatus(address)) | |
230 | 242 | if (containsElement([chris, toString(this)], caller)) | |
231 | - | then [DeleteEntry(keyUserDate(address)), DeleteEntry(keyUserAddr(address)), DeleteEntry(keyUserName(address)), DeleteEntry(keyUserDesc(address)), DeleteEntry(keyUserSocial(address)), DeleteEntry(keyUserThumb(address)), DeleteEntry(((currentStatus + "_") + address)), StringEntry(keyUserStatus(address), userRemoved)] | |
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)] | |
232 | 244 | else throw("Not allowed") | |
245 | + | } | |
246 | + | ||
247 | + | ||
248 | + | ||
249 | + | @Callable(i) | |
250 | + | func setAgent (artistAddr,agentAddr,primaryShare,secondaryShare) = if (!(dappRunning)) | |
251 | + | then throw(maintenanceMSG) | |
252 | + | else { | |
253 | + | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
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)] | |
256 | + | else throw("You are not allowed") | |
257 | + | } | |
258 | + | ||
259 | + | ||
260 | + | ||
261 | + | @Callable(i) | |
262 | + | func deleteEntry (entry) = { | |
263 | + | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
264 | + | if ((caller == chris)) | |
265 | + | then [DeleteEntry(entry)] | |
266 | + | else throw("no") | |
233 | 267 | } | |
234 | 268 | ||
235 | 269 |
github/deemru/w8io/026f985 59.00 ms ◑