tx · AEuTNTYCqZ3nR4kj6ZFKvopr3KKMMHzAzqYtnqVNuNLz

3Mz5wFCFSTfF4iW9me9EVrj4Ahm2VTCTsHZ:  -0.01400000 Waves

2019.06.22 20:08 [553530] smart account 3Mz5wFCFSTfF4iW9me9EVrj4Ahm2VTCTsHZ > SELF 0.00000000 Waves

{ "type": 13, "id": "AEuTNTYCqZ3nR4kj6ZFKvopr3KKMMHzAzqYtnqVNuNLz", "fee": 1400000, "feeAssetId": null, "timestamp": 1561223300924, "version": 1, "sender": "3Mz5wFCFSTfF4iW9me9EVrj4Ahm2VTCTsHZ", "senderPublicKey": "55dGDbXbEiK5dkWmRvEkVpQP3ZxxA8qUV3xwxnBuD6Rg", "proofs": [ "4ijjueFjshByThDy6BoKcfaMi3KvuCYgSx4K2wkE4CysMVcLHEik6yy3sihPVT4eS2KH73putFwEx94dHWSyKiM5" ], "script": "base64:AAIDAAAAAAAAAAAAAAAdAAAAAAROT05FAgAAAARub25lAAAAAAZWT1RFUlMAAAAAAAAAAAMAAAAABlFVT1JVTQAAAAAAAAAAAgAAAAAGVk9USU5HAgAAAAZ2b3RpbmcAAAAABlJFVkVBTAIAAAAGcmV2ZWFsAAAAAAhGRUFUVVJFRAIAAAAIZmVhdHVyZWQAAAAACERFTElTVEVEAgAAAAhkZWxpc3RlZAEAAAAKZ2V0S2V5SXRlbQAAAAIAAAAIc3VwcGxpZXIAAAAFdGl0bGUJAAEsAAAAAgIAAAAFaXRlbV8JAAJYAAAAAQkAAfcAAAABCQABmwAAAAEJAAEsAAAAAgUAAAAIc3VwcGxpZXIFAAAABXRpdGxlAQAAABJnZXRLZXlJdGVtU3VwcGxpZXIAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAGX293bmVyAQAAABVnZXRLZXlCYWxhbmNlU3VwcGxpZXIAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAIX2JhbGFuY2UBAAAAD2dldEtleUl0ZW1QcmljZQAAAAE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yeQAAAAIJAQAAAA9nZXRLZXlWb3RlQ291bnQAAAACBQAAAARpdGVtBQAAAAR2b3RlBQAAAAxuZXdWb3RlQ291bnQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABBnZXRLZXlJdGVtU3RhdHVzAAAAAQUAAAAEaXRlbQMJAABnAAAAAgUAAAAMbmV3Vm90ZUNvdW50BQAAAAZRVU9SVU0FAAAABHZvdGUFAAAABlJFVkVBTAUAAAADbmlsAAAAAGxz4Eg=", "chainId": 84, "height": 553530, "spentComplexity": 0 } View: original | compacted Prev: Extu9FGjxMmwGLFCnchkhecD66zTNukLRWKPhc3WWMnN Next: 4bQo3hyxqWoRGs6S4a1WeoH1EeLR2arg5J5tDoDy91nK Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "none"
55
6-let b = 4
6+let b = 3
77
88 let c = 2
99
184184 else if ((E(l, q) != a))
185185 then throw("already participated")
186186 else if ((k(l) == a))
187- then throw("not exist")
187+ then throw("item not exist")
188188 else if (if ((Z != a))
189189 then (Z != d)
190190 else false)
191- then throw("not possible")
191+ then throw("voting not possible")
192192 else WriteSet([DataEntry(D(l, q), X), DataEntry(F(l), (Y + 1)), DataEntry(J(l), if ((Y == b))
193193 then e
194194 else d)])
202202 let Z = K(l)
203203 let ab = (N(l, M) + 1)
204204 if ((toBase58String(sha256(toBytes((M + aa)))) != E(l, q)))
205- then throw("not valid")
205+ then throw("reveal data is not valid")
206206 else if ((b > G(l)))
207- then throw("max not reached")
207+ then throw("max num of voters not reached")
208208 else if ((I(l, q) != a))
209209 then throw("already participated")
210210 else if (if ((Z != d))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "none"
55
6-let b = 4
6+let b = 3
77
88 let c = 2
99
1010 let d = "voting"
1111
1212 let e = "reveal"
1313
1414 let f = "featured"
1515
1616 let g = "delisted"
1717
1818 func h (i,j) = ("item_" + toBase58String(sha256(toBytes((i + j)))))
1919
2020
2121 func k (l) = (l + "_owner")
2222
2323
2424 func m (l) = (l + "_balance")
2525
2626
2727 func n (l) = (l + "_price")
2828
2929
3030 func o (l) = (l + "_data")
3131
3232
3333 func p (q,l) = (((l + "_") + q) + "_cnt")
3434
3535
3636 func r (s) = {
3737 let t = {
3838 let u = getString(this, s)
3939 if ($isInstanceOf(u, "String"))
4040 then {
4141 let v = u
4242 v
4343 }
4444 else a
4545 }
4646 t
4747 }
4848
4949
5050 func w (s) = {
5151 let x = {
5252 let u = getInteger(this, s)
5353 if ($isInstanceOf(u, "Int"))
5454 then {
5555 let v = u
5656 v
5757 }
5858 else 0
5959 }
6060 x
6161 }
6262
6363
6464 func y (l) = r(k(l))
6565
6666
6767 func z (l) = w(n(l))
6868
6969
7070 func A (q,l) = w(p(q, l))
7171
7272
7373 func B (C) = w(m(C))
7474
7575
7676 func D (l,q) = (((l + "_") + q) + "_commit")
7777
7878
7979 func E (l,q) = r(D(l, q))
8080
8181
8282 func F (l) = (l + "_comcnt")
8383
8484
8585 func G (l) = w(F(l))
8686
8787
8888 func H (l,q) = (((l + "_") + q) + "_reveal")
8989
9090
9191 func I (l,q) = r(D(l, q))
9292
9393
9494 func J (l) = (l + "_status")
9595
9696
9797 func K (l) = r(J(l))
9898
9999
100100 func L (l,M) = ((l + "_res:") + M)
101101
102102
103103 func N (l,M) = w(L(l, M))
104104
105105
106106 @Callable(O)
107107 func purchaseOld (P) = {
108108 let Q = extract(O.payment)
109109 if (isDefined(Q.assetId))
110110 then throw("can use WAVES only at the moment")
111111 else {
112112 let R = toBase58String(O.caller.bytes)
113113 let S = {
114114 let u = getInteger(this, (("item_" + P) + "_coupon_price"))
115115 if ($isInstanceOf(u, "Int"))
116116 then {
117117 let v = u
118118 v
119119 }
120120 else 0
121121 }
122122 if ((S > Q.amount))
123123 then throw("purschase amount cannot be less than item price")
124124 else if ((Q.amount > S))
125125 then throw("purchase amount cannot be higher than item price")
126126 else WriteSet([DataEntry(((("status:purchase_item_" + P) + "_customer_") + R), "confirmed"), DataEntry(((("price:purchase_item_" + P) + "_customer_") + R), S)])
127127 }
128128 }
129129
130130
131131
132132 @Callable(O)
133133 func addItem (j,S,T) = {
134134 let U = toBase58String(O.caller.bytes)
135135 let l = h(U, j)
136136 if ((0 >= S))
137137 then throw("purchase amount cannot be less than item price")
138138 else if ((y(l) != a))
139139 then throw("an items is already exist")
140140 else WriteSet([DataEntry(k(l), U), DataEntry(n(l), S), DataEntry(o(l), T)])
141141 }
142142
143143
144144
145145 @Callable(O)
146146 func purchase (l) = {
147147 let Q = extract(O.payment)
148148 if (isDefined(Q.assetId))
149149 then throw("WAVES tokens only at the moment")
150150 else {
151151 let V = toBase58String(O.caller.bytes)
152152 let S = z(l)
153153 let U = y(l)
154154 if ((S > Q.amount))
155155 then throw("purchase amount cannot be less than item price")
156156 else if ((Q.amount > S))
157157 then throw("purchase amount cannot be higher than item price")
158158 else if ((U == a))
159159 then throw("supplier does not exist")
160160 else WriteSet([DataEntry(p(V, l), (A(V, l) + 1)), DataEntry(m(U), (B(U) + Q.amount))])
161161 }
162162 }
163163
164164
165165
166166 @Callable(O)
167167 func withdraw () = {
168168 let U = toBase58String(O.caller.bytes)
169169 let W = B(U)
170170 if ((0 >= W))
171171 then throw("insufficient balance")
172172 else ScriptResult(WriteSet([DataEntry(m(U), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(U), W, unit)]))
173173 }
174174
175175
176176
177177 @Callable(O)
178178 func voteCommit (l,X) = {
179179 let q = toBase58String(O.caller.bytes)
180180 let Y = G(l)
181181 let Z = K(l)
182182 if ((Y >= b))
183183 then throw("max votes")
184184 else if ((E(l, q) != a))
185185 then throw("already participated")
186186 else if ((k(l) == a))
187- then throw("not exist")
187+ then throw("item not exist")
188188 else if (if ((Z != a))
189189 then (Z != d)
190190 else false)
191- then throw("not possible")
191+ then throw("voting not possible")
192192 else WriteSet([DataEntry(D(l, q), X), DataEntry(F(l), (Y + 1)), DataEntry(J(l), if ((Y == b))
193193 then e
194194 else d)])
195195 }
196196
197197
198198
199199 @Callable(O)
200200 func voteReveal (l,M,aa) = {
201201 let q = toBase58String(O.caller.bytes)
202202 let Z = K(l)
203203 let ab = (N(l, M) + 1)
204204 if ((toBase58String(sha256(toBytes((M + aa)))) != E(l, q)))
205- then throw("not valid")
205+ then throw("reveal data is not valid")
206206 else if ((b > G(l)))
207- then throw("max not reached")
207+ then throw("max num of voters not reached")
208208 else if ((I(l, q) != a))
209209 then throw("already participated")
210210 else if (if ((Z != d))
211211 then (Z != e)
212212 else false)
213213 then throw("wrong status")
214214 else if (if ((M != f))
215215 then (M != g)
216216 else false)
217217 then throw("wrong vote")
218218 else if (if ((Z == f))
219219 then true
220220 else (Z == g))
221221 then throw("vote finished")
222222 else WriteSet([DataEntry(H(l, q), M), DataEntry(L(l, M), ab), DataEntry(J(l), if ((ab >= c))
223223 then M
224224 else e)])
225225 }
226226
227227

github/deemru/w8io/026f985 
49.36 ms