tx · BbGBEwz9MAooFVLUQsUvD2CntLGGH4joV4CTJ4wnzaWF 3Mri1e9GG36KAwbWwHGDRe2FZKfdDF8uJyh: -0.01000000 Waves 2020.12.08 14:32 [1299630] smart account 3Mri1e9GG36KAwbWwHGDRe2FZKfdDF8uJyh > SELF 0.00000000 Waves
{ "type": 13, "id": "BbGBEwz9MAooFVLUQsUvD2CntLGGH4joV4CTJ4wnzaWF", "fee": 1000000, "feeAssetId": null, "timestamp": 1607427129501, "version": 2, "chainId": 84, "sender": "3Mri1e9GG36KAwbWwHGDRe2FZKfdDF8uJyh", "senderPublicKey": "DYqi6CSrV47bRaw9xThsucgyQ1dbdiomu9XxGhTzTHRo", "proofs": [ "4Y6LGBuJGex9qeyrd7BmXPvgyzYKQUjuHmbs6WxxTuYY5MjAmdcqhE1TCGkrUgzmk9i3iKxg2qVGwSypbrsGZEyK" ], "script": "base64:AAIEAAAAAAAAACcIAhIGCgQICAgIEgYKBAgICAgSBAoCCAgSAwoBCBIDCgEIEgMKAQgAAAAYAAAAAAtzaWduQXNzZXRJZAEAAAAg6KVqvMp3QvJwYTI1Sk9Fg7m5HuWZZxfDcerZC6EEresAAAAABWNocmlzAgAAACMzTXNHNmpQTkNyVkpVdFlCN1hKQnhTN3V0V3NYQWY0bjlWcAAAAAAEam9lcAIAAAAjM016bTRWTHdzTjl1WndiVE16UGozWHV4VjZrRWZBUjhVRE4AAAAAD1dISVRFTElTVEVET05MWQYAAAAAC2RhcHBSdW5uaW5nBgAAAAAObWFpbnRlbmFuY2VNU0cCAAAAHVNJR04gQXJ0IGlzIHVuZGVyIG1haW50ZW5hbmNlAAAAAAt1c2VyQWxsb3dlZAIAAAAHQUxMT1dFRAAAAAAOdXNlclJlZ2lzdGVyZWQCAAAAClJFR0lTVEVSRUQAAAAADHVzZXJWZXJpZmllZAIAAAAIVkVSSUZJRUQAAAAADXVzZXJTdXNwZW5kZWQCAAAACVNVU1BFTkRFRAAAAAALdXNlclJlbW92ZWQCAAAAB1JF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JpcwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAAVlbnRyeQUAAAADbmlsCQAAAgAAAAECAAAAAm5vAAAAAP/iIUY=", "height": 1299630, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let signAssetId = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
5 | + | ||
6 | + | let chris = "3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp" | |
7 | + | ||
8 | + | let joep = "3Mzm4VLwsN9uZwbTMzPj3XuxV6kEfAR8UDN" | |
9 | + | ||
10 | + | let WHITELISTEDONLY = true | |
11 | + | ||
12 | + | let dappRunning = true | |
13 | + | ||
14 | + | let maintenanceMSG = "SIGN Art is under maintenance" | |
15 | + | ||
16 | + | let userAllowed = "ALLOWED" | |
17 | + | ||
18 | + | let userRegistered = "REGISTERED" | |
19 | + | ||
20 | + | let userVerified = "VERIFIED" | |
21 | + | ||
22 | + | let userSuspended = "SUSPENDED" | |
23 | + | ||
24 | + | let userRemoved = "REMOVED" | |
25 | + | ||
26 | + | let userChangeRequired = "CHANGE_REQUIRED" | |
27 | + | ||
28 | + | let userUnregistered = "UNREGISTERED" | |
29 | + | ||
30 | + | let userReset = "RESET" | |
31 | + | ||
32 | + | func getStringByKey (key) = match getString(this, key) { | |
33 | + | case a: String => | |
34 | + | a | |
35 | + | case _ => | |
36 | + | "" | |
37 | + | } | |
38 | + | ||
39 | + | ||
40 | + | func getIntegerByKey (key) = match getInteger(this, key) { | |
41 | + | case i: Int => | |
42 | + | i | |
43 | + | case _ => | |
44 | + | 0 | |
45 | + | } | |
46 | + | ||
47 | + | ||
48 | + | func validateCID (cid) = if (if ((75 > size(cid))) | |
49 | + | then (60 > size(split(cid, "/")[0])) | |
50 | + | else false) | |
51 | + | then (16 > size(split(cid, "/")[1])) | |
52 | + | else false | |
53 | + | ||
54 | + | ||
55 | + | func keyUserAddr (caller) = ("user_" + caller) | |
56 | + | ||
57 | + | ||
58 | + | func keyUserName (caller) = ("user_name_" + caller) | |
59 | + | ||
60 | + | ||
61 | + | func keyUserDesc (caller) = ("user_desc_" + caller) | |
62 | + | ||
63 | + | ||
64 | + | func keyUserSocial (caller) = ("user_social_" + caller) | |
65 | + | ||
66 | + | ||
67 | + | func keyUserThumb (caller) = ("user_thumb_" + caller) | |
68 | + | ||
69 | + | ||
70 | + | func keyUserStatus (caller) = ("user_status_" + caller) | |
71 | + | ||
72 | + | ||
73 | + | func keyUserDate (caller) = ("user_date_" + caller) | |
74 | + | ||
75 | + | ||
76 | + | @Callable(i) | |
77 | + | func registerUser (name,description,thumb,social) = if (!(dappRunning)) | |
78 | + | then throw(maintenanceMSG) | |
79 | + | else { | |
80 | + | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
81 | + | let canRegister = getStringByKey(keyUserStatus(caller)) | |
82 | + | let id = toBase58String(i.transactionId) | |
83 | + | let timestamp = lastBlock.timestamp | |
84 | + | if (if ((canRegister == userSuspended)) | |
85 | + | then true | |
86 | + | else (canRegister == userRemoved)) | |
87 | + | then throw("Account suspended/ removed.") | |
88 | + | else if ((canRegister == userRegistered)) | |
89 | + | then throw("Already registered") | |
90 | + | else if (if ((canRegister == "")) | |
91 | + | then WHITELISTEDONLY | |
92 | + | else false) | |
93 | + | then throw("Can't register, get approved first.") | |
94 | + | else if (if ((name == "")) | |
95 | + | then true | |
96 | + | else (description == "")) | |
97 | + | then throw("Name and description cannot be empty") | |
98 | + | else if ((size(description) > 600)) | |
99 | + | then throw("600 Char. max description") | |
100 | + | else if ((size(name) > 45)) | |
101 | + | then throw("45 Char. max name") | |
102 | + | 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)] | |
103 | + | } | |
104 | + | ||
105 | + | ||
106 | + | ||
107 | + | @Callable(i) | |
108 | + | func updateUser (name,description,thumb,social) = if (!(dappRunning)) | |
109 | + | then throw(maintenanceMSG) | |
110 | + | else { | |
111 | + | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
112 | + | let id = toBase58String(i.transactionId) | |
113 | + | let canUpdate = getStringByKey(keyUserStatus(caller)) | |
114 | + | if (if ((canUpdate == userSuspended)) | |
115 | + | then true | |
116 | + | else (canUpdate == userRemoved)) | |
117 | + | then throw("Account suspended/ removed.") | |
118 | + | else if (if ((canUpdate == "")) | |
119 | + | then true | |
120 | + | else (canUpdate == userAllowed)) | |
121 | + | then throw("Register first") | |
122 | + | else if (if ((name == "")) | |
123 | + | then true | |
124 | + | else (description == "")) | |
125 | + | then throw("Name & description cannot be empty") | |
126 | + | else if ((size(description) > 600)) | |
127 | + | then throw("600 Char. max for description") | |
128 | + | else if ((size(name) > 45)) | |
129 | + | then throw("45 Char. max name") | |
130 | + | else [StringEntry(keyUserName(caller), name), StringEntry(keyUserDesc(caller), description), StringEntry(keyUserSocial(caller), social), StringEntry(keyUserThumb(caller), thumb)] | |
131 | + | } | |
132 | + | ||
133 | + | ||
134 | + | ||
135 | + | @Callable(i) | |
136 | + | func changeUserStatus (address,status) = if (!(dappRunning)) | |
137 | + | then throw(maintenanceMSG) | |
138 | + | else { | |
139 | + | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
140 | + | let id = toBase58String(i.transactionId) | |
141 | + | let currentStatus = getStringByKey(keyUserStatus(address)) | |
142 | + | let statusToSet = if ((status == userVerified)) | |
143 | + | then userVerified | |
144 | + | else if ((status == userRegistered)) | |
145 | + | then userRegistered | |
146 | + | else if ((status == userSuspended)) | |
147 | + | then userSuspended | |
148 | + | else if ((status == userRemoved)) | |
149 | + | then userRemoved | |
150 | + | else if ((status == userAllowed)) | |
151 | + | then userAllowed | |
152 | + | else if ((status == userChangeRequired)) | |
153 | + | then userChangeRequired | |
154 | + | else if (if ((status == userReset)) | |
155 | + | then (currentStatus == userAllowed) | |
156 | + | else false) | |
157 | + | then "" | |
158 | + | else throw("Unknown status") | |
159 | + | let userIsRegistered = getIntegerByKey(keyUserDate(address)) | |
160 | + | if (if ((userIsRegistered == 0)) | |
161 | + | then (status != userAllowed) | |
162 | + | else false) | |
163 | + | then throw("You cant set this status, user is not registered.") | |
164 | + | else if (if ((currentStatus == userAllowed)) | |
165 | + | then (status == userAllowed) | |
166 | + | else false) | |
167 | + | then throw("User already allowed") | |
168 | + | else if (if ((currentStatus == userRegistered)) | |
169 | + | then (status == userAllowed) | |
170 | + | else false) | |
171 | + | then throw("User already allowed & registered") | |
172 | + | else if (if ((currentStatus == userVerified)) | |
173 | + | then (status == userAllowed) | |
174 | + | else false) | |
175 | + | then throw("User already allowed & verified") | |
176 | + | else if (containsElement([chris, joep, toString(this)], caller)) | |
177 | + | then [StringEntry(keyUserStatus(address), statusToSet)] | |
178 | + | else throw(((("Not allowed to change user status " + caller) + " / ") + chris)) | |
179 | + | } | |
180 | + | ||
181 | + | ||
182 | + | ||
183 | + | @Callable(i) | |
184 | + | func creditUser (address) = { | |
185 | + | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
186 | + | let id = toBase58String(i.transactionId) | |
187 | + | if (containsElement([chris, joep], caller)) | |
188 | + | then [ScriptTransfer(Address(fromBase58String(address)), 30000000000, signAssetId)] | |
189 | + | else throw("Not allowed") | |
190 | + | } | |
191 | + | ||
192 | + | ||
193 | + | ||
194 | + | @Callable(i) | |
195 | + | func deleteUser (address) = { | |
196 | + | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
197 | + | let id = toBase58String(i.transactionId) | |
198 | + | if (containsElement([chris, joep], caller)) | |
199 | + | then [DeleteEntry(keyUserDate(address)), DeleteEntry(keyUserAddr(address)), DeleteEntry(keyUserName(address)), DeleteEntry(keyUserDesc(address)), DeleteEntry(keyUserSocial(address)), DeleteEntry(keyUserThumb(address)), StringEntry(keyUserStatus(address), userRemoved)] | |
200 | + | else throw("Not allowed") | |
201 | + | } | |
202 | + | ||
203 | + | ||
204 | + | ||
205 | + | @Callable(i) | |
206 | + | func deleteEntry (entry) = { | |
207 | + | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
208 | + | if ((caller == chris)) | |
209 | + | then [DeleteEntry(entry)] | |
210 | + | else throw("no") | |
211 | + | } | |
212 | + | ||
213 | + |
github/deemru/w8io/026f985 21.09 ms ◑