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