tx · H1B3rFHswuUrUTWSpekShTTnBZCZKHdFR8FBG2r9Kcya

3MrmLk5vPSPy1nKpvsbWWaTipvbZqkm6QMS:  -0.00500000 Waves

2022.07.22 15:44 [2150986] smart account 3MrmLk5vPSPy1nKpvsbWWaTipvbZqkm6QMS > SELF 0.00000000 Waves

{ "type": 13, "id": "H1B3rFHswuUrUTWSpekShTTnBZCZKHdFR8FBG2r9Kcya", "fee": 500000, "feeAssetId": null, "timestamp": 1658493833434, "version": 2, "chainId": 84, "sender": "3MrmLk5vPSPy1nKpvsbWWaTipvbZqkm6QMS", "senderPublicKey": "3o8tkYNujFWhAg8vHr9M9TEWpFcDMfM7TRsk933exjy7", "proofs": [ "2th5rzdRTZm9MdAV14jy67FLq719R5Tt9cpB1Su1iDAuSQkpELjYMHwy24EmTU15pg1xr1oHKeN7SWTLuvoPB8KG" ], "script": "base64:AAIFAAAAAAAAABcIAhIDCgEIEgMKAQgSAwoBCBIECgIIBAAAABQAAAAADERZWl9BU1NFVF9JRAEAAAAg3zps0tw/jE/1UGNUg8jPjkHKkKTlI05ittGCsjg0jKYAAAAADk1JTl9EWVpfQU1PVU5UAAAAAAAF9eEAAAAAAA1WT1RJTkdfQkxPQ0tTAAAAAAAAAABkAAAAAAtWT1RFX0NMT1NFRAIAAAAGQ0xPU0VEAAAAAAtWT1RFX09QRU5FRAIAAAAET1BFTgAAAAAPc3RhdHVzS2V5UHJlZml4AgAAAAdzdGF0dXNfAAAAAA1vcGVuS2V5UHJlZml4AgAAAAVvcGVuXwAAAAAOdG90YWxZZXNTdWZmaXgCAAAACl90b3RhbF95ZXMAAAAADXRvdGFsTm9TdWZmaXgCAAAACV90b3RhbF9ubwAAAAAPcmVwYXltZW50UHJlZml4AgAAAApyZXBheW1lbnRfAAAAABBhbGxvd2VkS2V5U3VmZml4AgAAAAhfYWxsb3dlZAEAAAAMZ2V0U3RhdHVzS2V5AAAAAQAAAAJpZAkAASwAAAACBQAAAA9zdGF0dXNLZXlQcmVmaXgF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AAAAAAAAAAABAAAAApuZXdOb1ZvdGVzCQAAZAAAAAIFAAAADG5vVm90ZXNTb0ZhcgAAAAAAAAAAAQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAJbm9Wb3RlS2V5BQAAAApuZXdOb1ZvdGVzCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAxyZXBheW1lbnRLZXkFAAAABmFtb3VudAUAAAADbmlsBQAAAANuaWwFAAAACG5ld0VudHJ5AAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmfL4NT", "height": 2150986, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let a = base58'G2Pb7CMztps7XEVGCiUuJkLiS3ZCo69APQNbJs2nz21j'
5+
6+let b = 100000000
7+
8+let c = 100
9+
10+let d = "CLOSED"
11+
12+let e = "OPEN"
13+
14+let f = "status_"
15+
16+let g = "open_"
17+
18+let h = "_total_yes"
19+
20+let i = "_total_no"
21+
22+let j = "repayment_"
23+
24+let k = "_allowed"
25+
26+func l (m) = (f + m)
27+
28+
29+func n (m) = (g + m)
30+
31+
32+func o (m) = (m + h)
33+
34+
35+func p (m) = (m + i)
36+
37+
38+func q (m) = getString(this, l(m))
39+
40+
41+func r (m,s) = (((j + m) + "_") + toString(s))
42+
43+
44+func t (m) = {
45+ let u = getInteger(this, n(m))
46+ if ($isInstanceOf(u, "Int"))
47+ then {
48+ let v = u
49+ v
50+ }
51+ else -1
52+ }
53+
54+
55+func w (x) = {
56+ let u = getInteger(this, x)
57+ if ($isInstanceOf(u, "Int"))
58+ then {
59+ let v = u
60+ v
61+ }
62+ else -1
63+ }
64+
65+
66+func y (s) = {
67+ let u = getBoolean(this, (toString(s) + k))
68+ if ($isInstanceOf(u, "Boolean"))
69+ then {
70+ let z = u
71+ z
72+ }
73+ else false
74+ }
75+
76+
77+@Callable(A)
78+func openVote (m) = {
79+ let B = n(m)
80+ let C = t(m)
81+ if ((C != -1))
82+ then throw("Vote already ongoing for id!")
83+ else {
84+ let D = l(m)
85+[StringEntry(D, e), IntegerEntry(B, height)]
86+ }
87+ }
88+
89+
90+
91+@Callable(A)
92+func closeVote (m) = {
93+ let E = t(m)
94+ if ((E == -1))
95+ then throw("No vote found for id!")
96+ else if (((E + c) > height))
97+ then throw("Vote can not be closed yet!")
98+ else {
99+ let D = l(m)
100+[StringEntry(D, d)]
101+ }
102+ }
103+
104+
105+
106+@Callable(A)
107+func claim (m) = {
108+ let F = t(m)
109+ if ((F == -1))
110+ then throw("No vote started for this id!")
111+ else if (((F + c) >= height))
112+ then throw("You can only claim after vote ends!")
113+ else {
114+ let G = A.caller
115+ let x = r(m, G)
116+ let H = w(x)
117+ let D = l(m)
118+ if ((H > 0))
119+ then [ScriptTransfer(G, H, a), StringEntry(D, d), IntegerEntry(x, 0)]
120+ else throw("Nothing to claim!")
121+ }
122+ }
123+
124+
125+
126+@Callable(A)
127+func vote (m,I) = if ((size(A.payments) != 1))
128+ then throw("One payment in DZY needs to be attached")
129+ else {
130+ let J = value(A.payments[0])
131+ let G = A.caller
132+ if (!(y(G)))
133+ then throw("Address not allowed to vote!")
134+ else {
135+ let K = J.amount
136+ if (!(isDefined(J.assetId)))
137+ then throw("Payment in Waves not allowed!")
138+ else {
139+ let L = toBase58String(value(J.assetId))
140+ let x = r(m, G)
141+ let M = w(x)
142+ if ((M != -1))
143+ then throw("Only one vote per id per address!")
144+ else if ((L != toBase58String(a)))
145+ then throw("payment in DZY necessary!")
146+ else if ((K != b))
147+ then throw("payment amount wrong!")
148+ else {
149+ let N = q(m)
150+ if ((N == d))
151+ then throw("vote closed!")
152+ else {
153+ let O = {
154+ let u = getInteger(this, n(m))
155+ if ($isInstanceOf(u, "Int"))
156+ then {
157+ let P = u
158+ P
159+ }
160+ else 0
161+ }
162+ if ((height > (O + c)))
163+ then throw("voting ended!")
164+ else {
165+ let Q = if ((I == true))
166+ then {
167+ let R = o(m)
168+ let S = {
169+ let u = getInteger(this, R)
170+ if ($isInstanceOf(u, "Int"))
171+ then {
172+ let P = u
173+ P
174+ }
175+ else 0
176+ }
177+ let T = (S + 1)
178+[IntegerEntry(R, T), IntegerEntry(x, K)]
179+ }
180+ else if ((I == false))
181+ then {
182+ let U = p(m)
183+ let V = {
184+ let u = getInteger(this, U)
185+ if ($isInstanceOf(u, "Int"))
186+ then {
187+ let P = u
188+ P
189+ }
190+ else 0
191+ }
192+ let W = (V + 1)
193+[IntegerEntry(U, W), IntegerEntry(x, K)]
194+ }
195+ else nil
196+ Q
197+ }
198+ }
199+ }
200+ }
201+ }
202+ }
203+
204+
205+@Verifier(X)
206+func Y () = sigVerify(X.bodyBytes, X.proofs[0], X.senderPublicKey)
207+

github/deemru/w8io/026f985 
20.26 ms