tx · 717s9HMkSsMqNqc7RyK9m1QSePsx4Jwb1AV59MX4nu2V

3MvgxS9JmLvNSyx4dJr6Zfke3Siz5p92gao:  -0.01400000 Waves

2019.09.06 01:36 [663349] smart account 3MvgxS9JmLvNSyx4dJr6Zfke3Siz5p92gao > SELF 0.00000000 Waves

{ "type": 13, "id": "717s9HMkSsMqNqc7RyK9m1QSePsx4Jwb1AV59MX4nu2V", "fee": 1400000, "feeAssetId": null, "timestamp": 1567723074874, "version": 1, "sender": "3MvgxS9JmLvNSyx4dJr6Zfke3Siz5p92gao", "senderPublicKey": "DtnvSHiYQnjG4si66eUE3pTReZAnukP13TFUr4QtsJBc", "proofs": [ "67jtFSn1S8sxFavKiV97NwbeRvfM2NGfV129JCA8VDqQct9UQSxXU8gUeZcB7PXNmfBjxcQ6zHWTVr99hruJukzT" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAAAAAABOIj1q", "chainId": 84, "height": 663349, "spentComplexity": 0 } View: original | compacted Prev: 63zUuC8xskeSjxiy9s8cawR4tHhawpcMQm7hF2pbbLvD Next: 7DBSNH8rrz7CqHkwkhpexxPtMVnhrip8fQoPbXs41qTi Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = "none"
54
6-func b (c) = {
7- let d = {
8- let e = getInteger(this, c)
9- if ($isInstanceOf(e, "Int"))
10- then {
11- let f = e
12- f
13- }
14- else 0
15- }
16- d
17- }
18-
19-
20-func g (c) = {
21- let h = {
22- let e = getString(this, c)
23- if ($isInstanceOf(e, "String"))
24- then {
25- let f = e
26- f
27- }
28- else a
29- }
30- h
31- }
32-
33-
34-func i (j) = (j + "_price")
35-
36-
37-func k (j) = b(i(j))
38-
39-
40-func l (m,j) = (((j + "_") + m) + "_cnt")
41-
42-
43-func n (m,j) = b(l(m, j))
44-
45-
46-func o (p,q) = ("item_" + toBase58String(sha256(toBytes((p + q)))))
47-
48-
49-func r (j) = (j + "_data")
50-
51-
52-func s (j) = (j + "_owner")
53-
54-
55-func t (j) = g(s(j))
56-
57-
58-func u (v) = (v + "_balance")
59-
60-
61-func w (v) = b(u(v))
62-
63-
64-let x = 3
65-
66-let y = 2
67-
68-let z = "voting"
69-
70-let A = "reveal"
71-
72-let B = "featured"
73-
74-let C = "delisted"
75-
76-func D (j,m) = (((j + "_") + m) + "_commit")
77-
78-
79-func E (j,m) = g(D(j, m))
80-
81-
82-func F (j) = (j + "_comcnt")
83-
84-
85-func G (j) = b(F(j))
86-
87-
88-func H (j,m) = (((j + "_") + m) + "_reveal")
89-
90-
91-func I (j,m) = g(H(j, m))
92-
93-
94-func J (j) = (j + "_status")
95-
96-
97-func K (j) = g(J(j))
98-
99-
100-func L (j,M) = ((j + "_res:") + M)
101-
102-
103-func N (j,M) = b(L(j, M))
104-
105-
106-@Callable(O)
107-func addItem (q,P,Q) = {
108- let R = toBase58String(O.caller.bytes)
109- let j = o(R, q)
110- if ((0 >= P))
111- then throw("purchase amount cannot be less than price")
112- else if ((t(j) != a))
113- then throw("item already exists")
114- else WriteSet([DataEntry(s(j), R), DataEntry(i(j), P), DataEntry(r(j), Q)])
115- }
116-
117-
118-
119-@Callable(O)
120-func purchase (j) = {
121- let S = extract(O.payment)
122- if (isDefined(S.assetId))
123- then throw("Waves token only at the moment")
124- else {
125- let T = toBase58String(O.caller.bytes)
126- let P = k(j)
127- let R = t(j)
128- if ((P > S.amount))
129- then throw("purchase cannot be less than item price")
130- else if ((S.amount > P))
131- then throw("purchase cannot be higher than item price")
132- else if ((R == a))
133- then throw("supplier does not exists")
134- else WriteSet([DataEntry(l(T, j), (n(T, j) + 1)), DataEntry(u(R), (w(R) + S.amount))])
135- }
136- }
137-
138-
139-
140-@Callable(O)
141-func withdraw () = {
142- let R = toBase58String(O.caller.bytes)
143- let U = w(R)
144- if ((0 >= U))
145- then throw("bad balance")
146- else ScriptResult(WriteSet([DataEntry(u(R), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(R), U, unit)]))
147- }
148-
149-
150-
151-@Callable(O)
152-func voteCommit (j,V) = {
153- let m = toBase58String(O.caller.bytes)
154- let W = G(j)
155- let X = K(j)
156- if ((W > x))
157- then throw("reached max num of voters")
158- else if ((E(j, m) != a))
159- then throw("user has already participated")
160- else if ((s(j) == a))
161- then throw("item does not exist")
162- else if (if ((X != a))
163- then (X != z)
164- else false)
165- then throw("voting is not possible")
166- else WriteSet([DataEntry(D(j, m), V), DataEntry(F(j), (W + 1)), DataEntry(J(j), if ((W == x))
167- then A
168- else z)])
169- }
1705
1716

github/deemru/w8io/169f3d6 
41.20 ms