tx · 77M4F3xd1aaD4vU7BA9neS5Cvu94uYyHSjVKwMeD3m65

3MshLEZwkjz17HtsouWjFBXrXkPBVBHD7gm:  -0.01200000 Waves

2022.07.11 14:20 [2135008] smart account 3MshLEZwkjz17HtsouWjFBXrXkPBVBHD7gm > SELF 0.00000000 Waves

{ "type": 13, "id": "77M4F3xd1aaD4vU7BA9neS5Cvu94uYyHSjVKwMeD3m65", "fee": 1200000, "feeAssetId": null, "timestamp": 1657538449939, "version": 2, "chainId": 84, "sender": "3MshLEZwkjz17HtsouWjFBXrXkPBVBHD7gm", "senderPublicKey": "CAYySFNuYSLU5jGWNBottZuyHbvGh2JxucGYSXF3aEi8", "proofs": [ "3LxAHUT8ZtN9Fsnjtdu2Cwf2pLcaGit4KYKxj5KcydWRmbuqK9XmCyJEWh9nZVArP2y3xzDH2LL8U8AhHLpdMa2o" ], "script": "base64:AAIFAAAAAAAAABIIAhIDCgEIEgMKAQESBAoCAQEAAAAHAAAAAAlzZXBhcmF0b3ICAAAAAV8AAAAAD3NlY29uZFNlcGFyYXRvcgIAAAABLwEAAAAWZ2V0QWRkclRvSW50TWFwcGluZ0tleQAAAAIAAAALbWFwcGluZ05hbWUAAAAEYWRkcgkABLkAAAACCQAETAAAAAIFAAAAC21hcHBpbmdOYW1lCQAETAAAAAIFAAAABGFkZHIFAAAAA25pbAUAAAAJc2VwYXJhdG9yAQAAAA9nZXRMaXN0T2ZBcnJheXMAAAACAAAAC21hcHBpbmdOYW1lAAAABGFkZHIJAAS1AAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwkBAAAAFmdldEFkZHJUb0ludE1hcHBpbmdLZXkAAAACBQAAAAttYXBwaW5nTmFtZQUAAAAEYWRkcgUAAAAJc2VwYXJhdG9yAQAAABhnZXRBZGRyVG9JbnRNYXBwaW5nSW5kZXgAAAACAAAAC21hcHBpbmdOYW1lAAAABGFkZHIJAAGQAAAAAQkBAAAAD2dldExpc3RPZkFycmF5c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yb21BcnJheQAAAAIAAAAFaW5kZXgAAAAHaW5kZXhJbgMJAABnAAAAAgkBAAAAGmdldEFkZHJUb0ludE1hcHBpbmdJbmRleEluAAAAAQUAAAAHaW5kZXhJbgUAAAAHaW5kZXhJbgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAAEyCQABkQAAAAIJAAS1AAAAAgkAAZEAAAACCQEAAAAPZ2V0TGlzdE9mQXJyYXlzAAAAAgIAAAAJbWFwU3RyaW5nCQAEJQAAAAEFAAAABHRoaXMFAAAABWluZGV4BQAAAA9zZWNvbmRTZXBhcmF0b3IFAAAAB2luZGV4SW4FAAAAA25pbAkAAAIAAAABAgAAAAxvdXQgb2YgcmFuZ2UAAAAAWU7fiw==", "height": 2135008, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7Aq7YAn6AevxDSbPRVDsmtHgjZrFdhAb91AyJFPRiodJ Next: ArtvRdD4ygeUSfEYV1BSsBQmKTQ6Z9tX5TnhZgJU6uXy Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = base58'CPtoken'
4+let a = "_"
55
6-let b = 10
6+let b = "/"
77
8-let c = 1000000
9-
10-let d = "_"
11-
12-func e (f) = makeString(["wl", f], d)
8+func c (d,e) = makeString([d, e], a)
139
1410
15-func g (f) = getBooleanValue(this, e(f))
11+func f (d,e) = split(getStringValue(this, c(d, e)), a)
1612
1713
18-func h (f) = makeString(["bl", f], d)
14+func g (d,e) = size(f("mapString", e))
1915
2016
21-func i (f) = valueOrElse(getBoolean(this, h(f)), false)
17+func h (i) = size(split(f("mapString", toString(this))[i], b))
2218
2319
24-func j (f) = makeString(["ticket", f], d)
20+func j (d,e,k) = if ((150 >= size(k)))
21+ then StringEntry(c("mapString", e), k)
22+ else throw("overcrowded")
2523
2624
27-func k (f) = getBinaryValue(this, j(f))
28-
29-
30-func l (m) = makeString(["item", m], d)
31-
32-
33-func n (m) = getIntegerValue(this, l(m))
34-
35-
36-func o (p) = makeString(["votingDetails", p], d)
37-
38-
39-func q (m) = makeString(["sold", "item", m], d)
40-
41-
42-func r (p) = makeString(["votingEnd", p], d)
43-
44-
45-func s (p) = getIntegerValue(this, r(p))
46-
47-
48-func t (p,u) = makeString(["votingId", p, "variant", toString(u)], d)
49-
50-
51-func v (p,u) = getIntegerValue(this, t(p, u))
52-
53-
54-func w (p,x) = makeString(["votingId", p, x], d)
55-
56-
57-func y (z) = {
58- let A = getString(this, "admin")
59- if (!(isDefined(A)))
60- then throw("init first")
61- else (addressFromPublicKey(fromBase58String(value(A))) == z)
62- }
63-
64-
65-func B (p) = {
66- let C = value(blockInfoByHeight(height)).timestamp
67- let D = s(p)
68- (C >= D)
69- }
70-
71-
72-func E (p,F) = !(isDefined(getBoolean(this, w(p, toString(F)))))
73-
74-
75-func G (F) = i(toString(F))
76-
77-
78-func H (p,F,I) = {
79- let J = k(toString(F))
80- let K = value(I.assetId)
81- if ((J == K))
82- then {
83- let L = (assetBalance(F, a) * b)
84- $Tuple4(L, Burn(value(I.assetId), 1), DeleteEntry(j(toString(F))), BooleanEntry(w(p, toString(F)), true))
85- }
86- else throw("Wrong attachment asset")
87- }
88-
89-
90-@Callable(M)
91-func init (N) = {
92- let A = getString(this, "admin")
93- if (!(isDefined(A)))
94- then if ((M.caller == this))
95- then [StringEntry("admin", N)]
96- else throw("Only admin")
97- else throw("Already inited")
98- }
25+@Callable(l)
26+func setStruct (m) = [j("mapString", toString(this), m)]
9927
10028
10129
102-@Callable(M)
103-func startVoting (p,O,P) = if (y(M.caller))
104- then {
105- let C = value(blockInfoByHeight(height)).timestamp
106-[StringEntry(o(p), O), IntegerEntry(r(p), (C + P)), IntegerEntry(t(p, 1), 0), IntegerEntry(t(p, 2), 0), IntegerEntry(t(p, 3), 0)]
107- }
108- else throw("Only admin")
30+@Callable(l)
31+func getArrayFromStruct (n) = if ((g("mapString", toString(this)) >= n))
32+ then [StringEntry("1", f("mapString", toString(this))[n])]
33+ else throw("out of range")
10934
11035
11136
112-@Callable(M)
113-func issueNft (Q) = if (if (y(M.caller))
114- then !(G(addressFromStringValue(Q)))
115- else false)
116- then {
117- let R = j(Q)
118- if (!(isDefined(getBinary(this, R))))
119- then {
120- let S = Issue("Ticket", "Multiplier for voting", 1, 0, false)
121- let T = calculateAssetId(S)
122-[S, ScriptTransfer(addressFromStringValue(Q), 1, T), BinaryEntry(R, T)]
123- }
124- else throw("Already granted")
125- }
126- else throw("Only admin")
37+@Callable(l)
38+func getElementFromArray (n,i) = if ((h(i) >= i))
39+ then [StringEntry("2", split(f("mapString", toString(this))[n], b)[i])]
40+ else throw("out of range")
12741
128-
129-
130-@Callable(M)
131-func getTokens () = {
132- let U = e(toString(M.caller))
133- let V = g(toString(M.caller))
134- if (!(V))
135- then [BooleanEntry(U, true), ScriptTransfer(M.caller, c, a)]
136- else throw("Already got")
137- }
138-
139-
140-
141-@Callable(M)
142-func vote (p,u) = if (!(B(p)))
143- then if (E(p, M.caller))
144- then {
145- let W = t(p, u)
146- let X = v(p, u)
147- let Y = h(toString(M.caller))
148- if ((size(M.payments) != 1))
149- then {
150- let L = assetBalance(M.caller, a)
151-[BooleanEntry(Y, false), BooleanEntry(w(p, toString(M.caller)), true), IntegerEntry(W, (X + L))]
152- }
153- else {
154- let Z = H(p, M.caller, M.payments[0])
155- let aa = Z._1
156- let ab = Z._2
157- let ac = Z._3
158- let ad = Z._4
159-[ab, ac, ad, BooleanEntry(Y, false), IntegerEntry(W, (X + aa))]
160- }
161- }
162- else throw("Invalid voter")
163- else throw("Voting is ended")
164-
165-
166-
167-@Callable(M)
168-func joinProgram (ae) = {
169- let af = g(ae)
170- if (if (af)
171- then !(G(M.caller))
172- else false)
173- then {
174- let U = e(toString(M.caller))
175- let ag = e(ae)
176- let ah = getBoolean(this, U)
177- if (!(isDefined(ah)))
178- then [BooleanEntry(U, true), BooleanEntry(ag, false), ScriptTransfer(M.caller, c, a)]
179- else throw("Already in program")
180- }
181- else throw("Wrong patron or caller from blackList")
182- }
183-
184-
185-
186-@Callable(M)
187-func buyItem (m) = if (!(G(M.caller)))
188- then {
189- let ai = M.payments[0]
190- let aj = ai.amount
191- let ak = n(m)
192- if (if ((value(ai.assetId) == a))
193- then (ak == aj)
194- else false)
195- then [Burn(a, aj), StringEntry(q(m), toString(M.caller))]
196- else throw("Wrong payment assetId")
197- }
198- else throw("Caller from blackList")
199-
200-
201-@Verifier(al)
202-func am () = {
203- let an = al
204- if ($isInstanceOf(an, "DataTransaction"))
205- then {
206- let ao = an
207- if (!(isDefined(getString(ao.data, "admin"))))
208- then sigVerify(al.bodyBytes, al.proofs[0], fromBase58String(getStringValue(this, "admin")))
209- else false
210- }
211- else if ($isInstanceOf(an, "MassTransferTransaction"))
212- then {
213- let ap = an
214- sigVerify(al.bodyBytes, al.proofs[0], fromBase58String(getStringValue(this, "admin")))
215- }
216- else sigVerify(al.bodyBytes, al.proofs[0], al.senderPublicKey)
217- }
21842

github/deemru/w8io/026f985 
95.52 ms