tx · C61ebeiM7iWGYJUJUebHmLWEMcbNizcbDkpqYELujFpe

3Mzz3QCpMamT89CaFaovqXpnCdiUaKtLZ4D:  -0.01400000 Waves

2019.06.22 18:06 [553411] smart account 3Mzz3QCpMamT89CaFaovqXpnCdiUaKtLZ4D > SELF 0.00000000 Waves

{ "type": 13, "id": "C61ebeiM7iWGYJUJUebHmLWEMcbNizcbDkpqYELujFpe", "fee": 1400000, "feeAssetId": null, "timestamp": 1561216022722, "version": 1, "sender": "3Mzz3QCpMamT89CaFaovqXpnCdiUaKtLZ4D", "senderPublicKey": "BJRaSW2saRv7CcFs3mSYpaVFQSFpZq9rGKnCcRKuKgWv", "proofs": [ "43TwVeb3tiimzg6Xscu218XYF1GYRCaLsCWjjVx7xexvifma8KtTE4kxCRcqe1tPJwFW7ABL2EMmH3KDiVuC2GaX" ], "script": "base64:AAIDAAAAAAAAAAAAAAAdAAAAAAROT05FAgAAAARub25lAAAAAAZWT1RFUlMAAAAAAAAAAAMAAAAABlFVT1JVTQAAAAAAAAAAAgAAAAAGVk9USU5HAgAAAAZ2b3RpbmcAAAAABlJFVkVBTAIAAAAGcmV2ZWFsAAAAAAhGRUFUVVJFRAIAAAAIZmVhdHVyZWQAAAAACERFTElTVEVEAgAAAAhkZWxpc3RlZAEAAAAKZ2V0S2V5SXRlbQAAAAIAAAAIc3VwcGxpZXIAAAAFdGl0bGUJAAEsAAAAAgIAAAAFaXRlbV8JAAJYAAAAAQkAAfcAAAABCQABmwAAAAEJAAEsAAAAAgUAAAAIc3VwcGxpZXIFAAAABXRpdGxlAQAAABJnZXRLZXlJdGVtU3VwcGxpZXIAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAGX293bmVyAQAAABVnZXRLZXlCYWxhbmNlU3VwcGxpZXIAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAIX2JhbGFuY2UBAAAAD2dldEtleUl0ZW1QcmljZQAAAAEAAAAEaXRlbQkAASwAAAAC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AZwAAAAIFAAAAB2NvbW1pdHMFAAAABlZPVEVSUwkAAAIAAAABAgAAAAltYXggdm90ZXMDCQEAAAACIT0AAAACCQEAAAAOZ2V0VmFsdWVDb21taXQAAAACBQAAAARpdGVtBQAAAAR1c2VyBQAAAAROT05FCQAAAgAAAAECAAAAFGFscmVhZHkgcGFydGljaXBhdGVkAwkAAAAAAAACCQEAAAASZ2V0S2V5SXRlbVN1cHBsaWVyAAAAAQUAAAAEaXRlbQUAAAAETk9ORQkAAAIAAAABAgAAAAlub3QgZXhpc3QDAwkBAAAAAiE9AAAAAgUAAAAGc3RhdHVzBQAAAAROT05FCQEAAAACIT0AAAACBQAAAAZzdGF0dXMFAAAABlZPVElORwcJAAACAAAAAQIAAAAMbm90IHBvc3NpYmxlCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAMZ2V0S2V5Q29tbWl0AAAAAgUAAAAEaXRlbQUAAAAEdXNlcgUAAAAEaGFzaAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEmdldEtleUNvbW1pdHNDb3VudAAAAAEFAAAABGl0ZW0JAABkAAAAAgUAAAAHY29tbWl0cwAAAAAAAAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEGdldEtleUl0ZW1TdGF0dXMAAAABBQAAAARpdGVtAwkAAAAAAAACBQAAAAdjb21taXRzBQAAAAZWT1RFUlMFAAAABlJFVkVBTAUAAAAGVk9USU5HBQAAAANuaWwAAAAAkzpzfg==", "chainId": 84, "height": 553411, "spentComplexity": 0 } View: original | compacted Prev: 5Aoq76tGWqzsEqxcGnjCgH7a69CvCm7jyV6jF6KXGYGa Next: 7FbgU7APpeQemGDYYZ9Kgh1xpN6Cahwh9JihgpgAGkBY Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "none"
55
6-func b (c,d) = ("item_" + toBase58String(sha256(toBytes((c + d)))))
6+let b = 3
7+
8+let c = 2
9+
10+let d = "voting"
11+
12+let e = "reveal"
13+
14+let f = "featured"
15+
16+let g = "delisted"
17+
18+func h (i,j) = ("item_" + toBase58String(sha256(toBytes((i + j)))))
719
820
9-func e (f) = (f + "_owner")
21+func k (l) = (l + "_owner")
1022
1123
12-func g (f) = (f + "_balance")
24+func m (l) = (l + "_balance")
1325
1426
15-func h (f) = (f + "_price")
27+func n (l) = (l + "_price")
1628
1729
18-func i (f) = (f + "_data")
30+func o (l) = (l + "_data")
1931
2032
21-func j (k,f) = (((f + "_") + k) + "_cnt")
33+func p (q,l) = (((l + "_") + q) + "_cnt")
2234
2335
24-func l (m) = {
25- let n = {
26- let o = getString(this, m)
27- if ($isInstanceOf(o, "String"))
36+func r (s) = {
37+ let t = {
38+ let u = getString(this, s)
39+ if ($isInstanceOf(u, "String"))
2840 then {
29- let p = o
30- p
41+ let v = u
42+ v
3143 }
3244 else a
3345 }
34- n
46+ t
3547 }
3648
3749
38-func q (m) = {
39- let r = {
40- let o = getInteger(this, m)
41- if ($isInstanceOf(o, "Int"))
50+func w (s) = {
51+ let x = {
52+ let u = getInteger(this, s)
53+ if ($isInstanceOf(u, "Int"))
4254 then {
43- let p = o
44- p
55+ let v = u
56+ v
4557 }
4658 else 0
4759 }
48- r
60+ x
4961 }
5062
5163
52-func s (f) = l(e(f))
64+func y (l) = r(k(l))
5365
5466
55-func t (f) = q(h(f))
67+func z (l) = w(n(l))
5668
5769
58-func u (k,f) = q(j(k, f))
70+func A (q,l) = w(p(q, l))
5971
6072
61-func v (w) = q(g(w))
73+func B (C) = w(m(C))
6274
6375
64-@Callable(x)
65-func purchaseOld (y) = {
66- let z = extract(x.payment)
67- if (isDefined(z.assetId))
76+func D (l,q) = (((l + "_") + q) + "_commit")
77+
78+
79+func E (l,q) = r(D(l, q))
80+
81+
82+func F (l) = (l + "_comcnt")
83+
84+
85+func G (l) = w(F(l))
86+
87+
88+func H (l,q) = (((l + "_") + q) + "_reveal")
89+
90+
91+func I (l,q) = r(D(l, q))
92+
93+
94+func J (l) = (l + "_status")
95+
96+
97+func K (l) = r(J(l))
98+
99+
100+func L (l,M) = ((l + "_res:") + M)
101+
102+
103+func N (l,M) = r(L(l, M))
104+
105+
106+@Callable(O)
107+func purchaseOld (P) = {
108+ let Q = extract(O.payment)
109+ if (isDefined(Q.assetId))
68110 then throw("can use WAVES only at the moment")
69111 else {
70- let A = toBase58String(x.caller.bytes)
71- let B = {
72- let o = getInteger(this, (("item_" + y) + "_coupon_price"))
73- if ($isInstanceOf(o, "Int"))
112+ let R = toBase58String(O.caller.bytes)
113+ let S = {
114+ let u = getInteger(this, (("item_" + P) + "_coupon_price"))
115+ if ($isInstanceOf(u, "Int"))
74116 then {
75- let p = o
76- p
117+ let v = u
118+ v
77119 }
78120 else 0
79121 }
80- if ((B > z.amount))
122+ if ((S > Q.amount))
81123 then throw("purschase amount cannot be less than item price")
82- else if ((z.amount > B))
124+ else if ((Q.amount > S))
83125 then throw("purchase amount cannot be higher than item price")
84- else WriteSet([DataEntry(((("status:purchase_item_" + y) + "_customer_") + A), "confirmed"), DataEntry(((("price:purchase_item_" + y) + "_customer_") + A), B)])
126+ else WriteSet([DataEntry(((("status:purchase_item_" + P) + "_customer_") + R), "confirmed"), DataEntry(((("price:purchase_item_" + P) + "_customer_") + R), S)])
85127 }
86128 }
87129
88130
89131
90-@Callable(x)
91-func addItem (d,B,C) = {
92- let D = toBase58String(x.caller.bytes)
93- let f = b(D, d)
94- if ((0 >= B))
132+@Callable(O)
133+func addItem (j,S,T) = {
134+ let U = toBase58String(O.caller.bytes)
135+ let l = h(U, j)
136+ if ((0 >= S))
95137 then throw("purchase amount cannot be less than item price")
96- else if ((s(f) != a))
138+ else if ((y(l) != a))
97139 then throw("an items is already exist")
98- else WriteSet([DataEntry(e(f), D), DataEntry(h(f), B), DataEntry(i(f), C)])
140+ else WriteSet([DataEntry(k(l), U), DataEntry(n(l), S), DataEntry(o(l), T)])
99141 }
100142
101143
102144
103-@Callable(x)
104-func purchase (f) = {
105- let z = extract(x.payment)
106- if (isDefined(z.assetId))
145+@Callable(O)
146+func purchase (l) = {
147+ let Q = extract(O.payment)
148+ if (isDefined(Q.assetId))
107149 then throw("WAVES tokens only at the moment")
108150 else {
109- let E = toBase58String(x.caller.bytes)
110- let B = t(f)
111- let D = s(f)
112- if ((B > z.amount))
151+ let V = toBase58String(O.caller.bytes)
152+ let S = z(l)
153+ let U = y(l)
154+ if ((S > Q.amount))
113155 then throw("purchase amount cannot be less than item price")
114- else if ((z.amount > B))
156+ else if ((Q.amount > S))
115157 then throw("purchase amount cannot be higher than item price")
116- else if ((D == a))
158+ else if ((U == a))
117159 then throw("supplier does not exist")
118- else WriteSet([DataEntry(j(E, f), (u(E, f) + 1)), DataEntry(g(D), (v(D) + z.amount))])
160+ else WriteSet([DataEntry(p(V, l), (A(V, l) + 1)), DataEntry(m(U), (B(U) + Q.amount))])
119161 }
120162 }
121163
122164
123165
124-@Callable(x)
166+@Callable(O)
125167 func withdraw () = {
126- let D = toBase58String(x.caller.bytes)
127- let F = v(D)
128- if ((0 >= F))
168+ let U = toBase58String(O.caller.bytes)
169+ let W = B(U)
170+ if ((0 >= W))
129171 then throw("insufficient balance")
130- else ScriptResult(WriteSet([DataEntry(g(D), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(D), F, unit)]))
172+ else ScriptResult(WriteSet([DataEntry(m(U), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(U), W, unit)]))
173+ }
174+
175+
176+
177+@Callable(O)
178+func voteCommit (l,X) = {
179+ let q = toBase58String(O.caller.bytes)
180+ let Y = G(l)
181+ let Z = K(l)
182+ if ((Y >= b))
183+ then throw("max votes")
184+ else if ((E(l, q) != a))
185+ then throw("already participated")
186+ else if ((k(l) == a))
187+ then throw("not exist")
188+ else if (if ((Z != a))
189+ then (Z != d)
190+ else false)
191+ then throw("not possible")
192+ else WriteSet([DataEntry(D(l, q), X), DataEntry(F(l), (Y + 1)), DataEntry(J(l), if ((Y == b))
193+ then e
194+ else d)])
131195 }
132196
133197
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "none"
55
6-func b (c,d) = ("item_" + toBase58String(sha256(toBytes((c + d)))))
6+let b = 3
7+
8+let c = 2
9+
10+let d = "voting"
11+
12+let e = "reveal"
13+
14+let f = "featured"
15+
16+let g = "delisted"
17+
18+func h (i,j) = ("item_" + toBase58String(sha256(toBytes((i + j)))))
719
820
9-func e (f) = (f + "_owner")
21+func k (l) = (l + "_owner")
1022
1123
12-func g (f) = (f + "_balance")
24+func m (l) = (l + "_balance")
1325
1426
15-func h (f) = (f + "_price")
27+func n (l) = (l + "_price")
1628
1729
18-func i (f) = (f + "_data")
30+func o (l) = (l + "_data")
1931
2032
21-func j (k,f) = (((f + "_") + k) + "_cnt")
33+func p (q,l) = (((l + "_") + q) + "_cnt")
2234
2335
24-func l (m) = {
25- let n = {
26- let o = getString(this, m)
27- if ($isInstanceOf(o, "String"))
36+func r (s) = {
37+ let t = {
38+ let u = getString(this, s)
39+ if ($isInstanceOf(u, "String"))
2840 then {
29- let p = o
30- p
41+ let v = u
42+ v
3143 }
3244 else a
3345 }
34- n
46+ t
3547 }
3648
3749
38-func q (m) = {
39- let r = {
40- let o = getInteger(this, m)
41- if ($isInstanceOf(o, "Int"))
50+func w (s) = {
51+ let x = {
52+ let u = getInteger(this, s)
53+ if ($isInstanceOf(u, "Int"))
4254 then {
43- let p = o
44- p
55+ let v = u
56+ v
4557 }
4658 else 0
4759 }
48- r
60+ x
4961 }
5062
5163
52-func s (f) = l(e(f))
64+func y (l) = r(k(l))
5365
5466
55-func t (f) = q(h(f))
67+func z (l) = w(n(l))
5668
5769
58-func u (k,f) = q(j(k, f))
70+func A (q,l) = w(p(q, l))
5971
6072
61-func v (w) = q(g(w))
73+func B (C) = w(m(C))
6274
6375
64-@Callable(x)
65-func purchaseOld (y) = {
66- let z = extract(x.payment)
67- if (isDefined(z.assetId))
76+func D (l,q) = (((l + "_") + q) + "_commit")
77+
78+
79+func E (l,q) = r(D(l, q))
80+
81+
82+func F (l) = (l + "_comcnt")
83+
84+
85+func G (l) = w(F(l))
86+
87+
88+func H (l,q) = (((l + "_") + q) + "_reveal")
89+
90+
91+func I (l,q) = r(D(l, q))
92+
93+
94+func J (l) = (l + "_status")
95+
96+
97+func K (l) = r(J(l))
98+
99+
100+func L (l,M) = ((l + "_res:") + M)
101+
102+
103+func N (l,M) = r(L(l, M))
104+
105+
106+@Callable(O)
107+func purchaseOld (P) = {
108+ let Q = extract(O.payment)
109+ if (isDefined(Q.assetId))
68110 then throw("can use WAVES only at the moment")
69111 else {
70- let A = toBase58String(x.caller.bytes)
71- let B = {
72- let o = getInteger(this, (("item_" + y) + "_coupon_price"))
73- if ($isInstanceOf(o, "Int"))
112+ let R = toBase58String(O.caller.bytes)
113+ let S = {
114+ let u = getInteger(this, (("item_" + P) + "_coupon_price"))
115+ if ($isInstanceOf(u, "Int"))
74116 then {
75- let p = o
76- p
117+ let v = u
118+ v
77119 }
78120 else 0
79121 }
80- if ((B > z.amount))
122+ if ((S > Q.amount))
81123 then throw("purschase amount cannot be less than item price")
82- else if ((z.amount > B))
124+ else if ((Q.amount > S))
83125 then throw("purchase amount cannot be higher than item price")
84- else WriteSet([DataEntry(((("status:purchase_item_" + y) + "_customer_") + A), "confirmed"), DataEntry(((("price:purchase_item_" + y) + "_customer_") + A), B)])
126+ else WriteSet([DataEntry(((("status:purchase_item_" + P) + "_customer_") + R), "confirmed"), DataEntry(((("price:purchase_item_" + P) + "_customer_") + R), S)])
85127 }
86128 }
87129
88130
89131
90-@Callable(x)
91-func addItem (d,B,C) = {
92- let D = toBase58String(x.caller.bytes)
93- let f = b(D, d)
94- if ((0 >= B))
132+@Callable(O)
133+func addItem (j,S,T) = {
134+ let U = toBase58String(O.caller.bytes)
135+ let l = h(U, j)
136+ if ((0 >= S))
95137 then throw("purchase amount cannot be less than item price")
96- else if ((s(f) != a))
138+ else if ((y(l) != a))
97139 then throw("an items is already exist")
98- else WriteSet([DataEntry(e(f), D), DataEntry(h(f), B), DataEntry(i(f), C)])
140+ else WriteSet([DataEntry(k(l), U), DataEntry(n(l), S), DataEntry(o(l), T)])
99141 }
100142
101143
102144
103-@Callable(x)
104-func purchase (f) = {
105- let z = extract(x.payment)
106- if (isDefined(z.assetId))
145+@Callable(O)
146+func purchase (l) = {
147+ let Q = extract(O.payment)
148+ if (isDefined(Q.assetId))
107149 then throw("WAVES tokens only at the moment")
108150 else {
109- let E = toBase58String(x.caller.bytes)
110- let B = t(f)
111- let D = s(f)
112- if ((B > z.amount))
151+ let V = toBase58String(O.caller.bytes)
152+ let S = z(l)
153+ let U = y(l)
154+ if ((S > Q.amount))
113155 then throw("purchase amount cannot be less than item price")
114- else if ((z.amount > B))
156+ else if ((Q.amount > S))
115157 then throw("purchase amount cannot be higher than item price")
116- else if ((D == a))
158+ else if ((U == a))
117159 then throw("supplier does not exist")
118- else WriteSet([DataEntry(j(E, f), (u(E, f) + 1)), DataEntry(g(D), (v(D) + z.amount))])
160+ else WriteSet([DataEntry(p(V, l), (A(V, l) + 1)), DataEntry(m(U), (B(U) + Q.amount))])
119161 }
120162 }
121163
122164
123165
124-@Callable(x)
166+@Callable(O)
125167 func withdraw () = {
126- let D = toBase58String(x.caller.bytes)
127- let F = v(D)
128- if ((0 >= F))
168+ let U = toBase58String(O.caller.bytes)
169+ let W = B(U)
170+ if ((0 >= W))
129171 then throw("insufficient balance")
130- else ScriptResult(WriteSet([DataEntry(g(D), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(D), F, unit)]))
172+ else ScriptResult(WriteSet([DataEntry(m(U), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(U), W, unit)]))
173+ }
174+
175+
176+
177+@Callable(O)
178+func voteCommit (l,X) = {
179+ let q = toBase58String(O.caller.bytes)
180+ let Y = G(l)
181+ let Z = K(l)
182+ if ((Y >= b))
183+ then throw("max votes")
184+ else if ((E(l, q) != a))
185+ then throw("already participated")
186+ else if ((k(l) == a))
187+ then throw("not exist")
188+ else if (if ((Z != a))
189+ then (Z != d)
190+ else false)
191+ then throw("not possible")
192+ else WriteSet([DataEntry(D(l, q), X), DataEntry(F(l), (Y + 1)), DataEntry(J(l), if ((Y == b))
193+ then e
194+ else d)])
131195 }
132196
133197

github/deemru/w8io/026f985 
56.34 ms