tx · DhUgY6xooFoeFGQQrmqgGzt9VwKbgBbucBXtLRKHVMLa

3N24U7vUNFXve2yWeQXWEyaQSBfjiHzYLiM:  -0.01000000 Waves

2022.11.26 14:05 [2333999] smart account 3N24U7vUNFXve2yWeQXWEyaQSBfjiHzYLiM > SELF 0.00000000 Waves

{ "type": 13, "id": "DhUgY6xooFoeFGQQrmqgGzt9VwKbgBbucBXtLRKHVMLa", "fee": 1000000, "feeAssetId": null, "timestamp": 1669460730531, "version": 2, "chainId": 84, "sender": "3N24U7vUNFXve2yWeQXWEyaQSBfjiHzYLiM", "senderPublicKey": "4ghXvNF7TZ89SqD1hoLCtkgKFemNDC1eUJNe6CtAerNu", "proofs": [ "5GWHKcszTFY57tw3WebCZh1YKkRrSCEepBTSReu2L2BAaZGivScTzjPxp9HmArGKNqPmp7EWEzwetTq6tT7JFYF1" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAAAAAAAEAAAABaQEAAAAHZGVmYXVsdAAAAAAEAAAAAXkJAAP8AAAABAkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM1BDYnZQVlFmU3ZWdTg4aXA4Rm01WWp3SmhqRVlrMVR4aGsCAAAAFXdpdGhkcmF3VmVzdGVkQWxsVVNETgkABEwAAAACBwkABEwAAAACBgUAAAADbmlsBQAAAANuaWwDCQAAAAAAAAIFAAAAAXkFAAAAAXkFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24EAAAAAnR4BQAAAAckbWF0Y2gwBgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXk3mTU1", "height": 2333999, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 36TYEvyke3UUtMJYoJErPRZaZS3WTy1pqNTD88D4CpHR Next: 2Bfuk2J7MCRhDt5QLuenH2GQbdpQQdhTyQvgXFJLYYUc Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let chris = "3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp"
5-
6-let joep = "3Mzm4VLwsN9uZwbTMzPj3XuxV6kEfAR8UDN"
7-
8-let dappRunningKey = "conf_dapp_is_running"
9-
10-let maintenanceMSGKey = "conf_maintenance_msg"
11-
12-let whitelistedonlyKey = "conf_whitelisted_only"
13-
14-let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true)
15-
16-let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "")
17-
18-let whitelistedonly = valueOrElse(getBoolean(this, whitelistedonlyKey), true)
19-
20-let userAllowed = "ALLOWED"
21-
22-let userRegistered = "REGISTERED"
23-
24-let userVerified = "VERIFIED"
25-
26-let userSuspended = "SUSPENDED"
27-
28-let userRemoved = "REMOVED"
29-
30-let userChangeRequired = "CHANGE_REQUIRED"
31-
32-let userUnregistered = "UNREGISTERED"
33-
34-let userReset = "RESET"
35-
36-func getStringByKey (key) = valueOrElse(getString(this, key), "")
374
385
39-func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false)
40-
41-
42-func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
43-
44-
45-func keyUserAddr (caller) = ("user_" + caller)
46-
47-
48-func keyUserName (caller) = ("user_name_" + caller)
49-
50-
51-func keyUserDesc (caller) = ("user_desc_" + caller)
52-
53-
54-func keyUserSocial (caller) = ("user_social_" + caller)
55-
56-
57-func keyUserThumb (caller) = ("user_thumb_" + caller)
58-
59-
60-func keyUserStatus (caller) = ("user_status_" + caller)
61-
62-
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)
76-
77-
78-func validateCID (cid) = if (contains(cid, "/"))
79- then if (if ((76 > size(cid)))
80- then (size(split(cid, "/")[0]) == 59)
81- else false)
82- then (16 > size(split(cid, "/")[1]))
83- else false
84- else false
85-
86-
87-func validUserData (caller,name,description,thumb,isAnUpdate) = {
88- let validCID = if ((size(thumb) != 0))
89- then validateCID(thumb)
90- else true
91- if (!(validCID))
92- then throw("CID don't match requirement!")
93- else if (if ((name == ""))
94- then true
95- else (description == ""))
96- then throw("Name and description cannot be empty")
97- else if ((size(description) > 600))
98- then throw("600 Char. max description")
99- else if ((size(name) > 45))
100- then throw("45 Char. max name")
101- else {
102- let status = getStringByKey(keyUserStatus(caller))
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 == "")
113- else false)
114- then whitelistedonly
115- else false)
116- then throw("Can't register, get approved first.")
117- else if (if (if (isAnUpdate)
118- then (status == "")
119- else false)
120- then true
121- else if (isAnUpdate)
122- then (status == userAllowed)
123- else false)
124- then throw("Register first")
125- else true
126- }
6+@Callable(i)
7+func default () = {
8+ let y = invoke(addressFromStringValue("3PCbvPVQfSvVu88ip8Fm5YjwJhjEYk1Txhk"), "withdrawVestedAllUSDN", [false, true], nil)
9+ if ((y == y))
10+ then nil
11+ else throw("Strict value is not equal to itself.")
12712 }
12813
12914
130-func validateNewStatus (status,address,currentStatus) = {
131- let allStatus = [userVerified, userRegistered, userSuspended, userRemoved, userAllowed, userChangeRequired]
132- let statusToSet = if (containsElement(allStatus, status))
133- then status
134- else if (if ((status == userReset))
135- then (currentStatus == userAllowed)
136- else false)
137- then ""
138- else throw("Unknown status")
139- let userIsRegistered = getIntegerByKey(keyUserDate(address))
140- if (if ((userIsRegistered == 0))
141- then (statusToSet != userAllowed)
142- else false)
143- then throw("You cant set this status, user is not registered.")
144- else if (if ((currentStatus == userAllowed))
145- then (statusToSet == userAllowed)
146- else false)
147- then throw("User already allowed")
148- else if (if ((currentStatus == userRegistered))
149- then (statusToSet == userAllowed)
150- else false)
151- then throw("User already allowed & registered")
152- else if (if ((currentStatus == userVerified))
153- then (statusToSet == userAllowed)
154- else false)
155- then throw("User already allowed & verified")
156- else statusToSet
157- }
158-
159-
160-func makeJSON (name,thumb,date) = (((((("{\"user_name\": \"" + name) + "\", \"user_thumb\":\"") + thumb) + "\",\"user_date\":\"") + date) + "\"}")
161-
162-
163-@Callable(invoke)
164-func appRunning (isLive,message) = {
165- let caller = toString(invoke.caller)
166- let id = toBase58String(invoke.transactionId)
167- if (containsElement([chris, joep, toString(this)], caller))
168- then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
169- else throw("You are not allowed to change this")
170- }
171-
172-
173-
174-@Callable(invoke)
175-func registrationMode (WLonly) = {
176- let caller = toString(invoke.caller)
177- let id = toBase58String(invoke.transactionId)
178- if (containsElement([chris, toString(this)], caller))
179- then [BooleanEntry(whitelistedonlyKey, WLonly)]
180- else throw("You are not allowed to change this")
181- }
182-
183-
184-
185-@Callable(invoke)
186-func registerUser (name,description,thumb,social) = if (!(dappRunning))
187- then throw(maintenanceMSG)
188- else {
189- let caller = toString(invoke.caller)
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- else {
195- let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(timestamp))
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- }
198- }
199-
200-
201-
202-@Callable(invoke)
203-func updateUser (name,description,thumb,social) = if (!(dappRunning))
204- then throw(maintenanceMSG)
205- else {
206- let caller = toString(invoke.caller)
207- let id = toBase58String(invoke.transactionId)
208- let status = getStringByKey(keyUserStatus(caller))
209- if (!(validUserData(caller, name, description, thumb, true)))
210- then throw("Something went wrong")
211- else {
212- let date = getIntegerByKey(keyUserDate(caller))
213- let json = makeJSON(toBase64String(toBytes(name)), toBase64String(toBytes(thumb)), toString(date))
214-[StringEntry(keyUserName(caller), name), StringEntry(keyUserDesc(caller), description), StringEntry(keyUserSocial(caller), social), StringEntry(keyUserThumb(caller), thumb), StringEntry(((status + "_") + caller), json)]
215- }
216- }
217-
218-
219-
220-@Callable(invoke)
221-func changeUserStatus (address,status,note) = {
222- let caller = toString(invoke.caller)
223- let id = toBase58String(invoke.transactionId)
224- let currentStatus = getStringByKey(keyUserStatus(address))
225- let statusToSet = validateNewStatus(status, address, currentStatus)
226- let name = toBase64String(toBytes(getStringByKey(keyUserName(address))))
227- let thumb = toBase64String(toBytes(getStringByKey(keyUserThumb(address))))
228- let date = getIntegerByKey(keyUserDate(address))
229- let json = makeJSON(name, thumb, toString(date))
230- if (containsElement([chris, joep, toString(this)], caller))
231- then [StringEntry(keyUserStatus(address), statusToSet), DeleteEntry(((currentStatus + "_") + address)), StringEntry(((statusToSet + "_") + address), json), StringEntry(("user_note_" + address), note)]
232- else throw("Not allowed to change user status")
233- }
234-
235-
236-
237-@Callable(invoke)
238-func deleteUser (address) = {
239- let caller = toString(invoke.caller)
240- let id = toBase58String(invoke.transactionId)
241- let currentStatus = getStringByKey(keyUserStatus(address))
242- if (containsElement([chris, toString(this)], caller))
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- 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(i.caller)
254- if (containsElement([chris, toString(this)], caller))
255- then if (if ((size(artistAddr) != 35))
256- then true
257- else (size(agentAddr) != 35))
258- then throw("Wrong 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) = if (!(dappRunning))
267- then throw(maintenanceMSG)
268- else {
269- let caller = toString(i.caller)
270- if (containsElement([chris, toString(this)], caller))
271- then if (if ((size(artistAddr) != 35))
272- then true
273- else (size(agentAddr) != 35))
274- then throw("Wrong address")
275- else [DeleteEntry(keyArtistAgentAddr(artistAddr)), DeleteEntry(keyAgentArtistAddr(agentAddr, artistAddr)), DeleteEntry(keyPrimaryShare(artistAddr)), DeleteEntry(keySecondaryShare(artistAddr))]
276- else throw("You are not allowed")
277- }
278-
279-
280-
281-@Callable(i)
282-func deleteEntry (entry) = {
283- let caller = toString(i.caller)
284- if ((caller == chris))
285- then [DeleteEntry(entry)]
286- else throw("no")
287- }
288-
15+@Verifier(tx)
16+func verify () = match tx {
17+ case tx: InvokeScriptTransaction =>
18+ true
19+ case _ =>
20+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
21+}
28922

github/deemru/w8io/169f3d6 
40.26 ms