tx · 4YGqG9dSdDrNWxTrEaNzqXjnZEe1MQwu2CK7H2kUbtkt

3N1VCF8r2aeTHUT35kujApqczfUsAKB1F41:  -0.01400000 Waves

2019.06.27 14:19 [560473] smart account 3N1VCF8r2aeTHUT35kujApqczfUsAKB1F41 > SELF 0.00000000 Waves

{ "type": 13, "id": "4YGqG9dSdDrNWxTrEaNzqXjnZEe1MQwu2CK7H2kUbtkt", "fee": 1400000, "feeAssetId": null, "timestamp": 1561634374779, "version": 1, "sender": "3N1VCF8r2aeTHUT35kujApqczfUsAKB1F41", "senderPublicKey": "6Qnw6kH24b4tDuXrsArg297CjQifvndVQ8Crs6Rzao4e", "proofs": [ "2XvxdPs5dWuRD2qCRzu64hvwzUUWhUjzH8JHRZCxjaoePUXtMmEZimfAmeGX5Jxc7YA7JKAmmcR4USMgkkNiAhK1" ], "script": "base64:AAIDAAAAAAAAAAAAAAAdAAAAAAROT05FAgAAAARub25lAAAAAAZWT1RFUlMAAAAAAAAAAAMAAAAABlFVT1JVTQAAAAAAAAAAAgAAAAAGVk9USU5HAgAAAAZ2b3RpbmcAAAAABlJFVkVBTAIAAAAGcmV2ZWFsAAAAAAhGRUFUVVJFRAIAAAAIZmVhdHVyZWQAAAAACERFTElTVEVEAgAAAAhkZWxpc3RlZAEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAADbnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABQAAAANudW0BAAAAC2dldFN0ckJ5S2V5AAAAAQAAAANrZXkEAAAAA3N0cgQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQUAAAAETk9ORQUAAAADc3RyA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GUJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAA9nZXRLZXlWb3RlQ291bnQAAAACBQAAAARpdGVtBQAAAAR2b3RlBQAAAAxuZXdWb3RlQ291bnQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABBnZXRLZXlJdGVtU3RhdHVzAAAAAQUAAAAEaXRlbQMJAABnAAAAAgUAAAAMbmV3Vm90ZUNvdW50BQAAAAZRVU9SVU0FAAAABHZvdGUFAAAABlJFVkVBTAUAAAADbmlsAAAAAEs0rJQ=", "chainId": 84, "height": 560473, "spentComplexity": 0 } View: original | compacted Prev: C96CSbFkTUKw9ycKqDj1GBbN73wh1RiJcDmXJ5ko1nfJ Next: 3MU977mhBocunzE3FwD1c3vqbkRtFi5ZFMYUknrRZADv Diff:
OldNewDifferences
169169 }
170170
171171
172+
173+@Callable(O)
174+func voteReveal (p,M,Y) = {
175+ let s = toBase58String(O.caller.bytes)
176+ let X = K(p)
177+ let Z = (N(p, M) + 1)
178+ if ((toBase58String(sha256(toBytes((M + Y)))) != E(p, s)))
179+ then throw("reveal data is not valid")
180+ else if ((b > G(p)))
181+ then throw("max num of voters hasn't reached yet")
182+ else if ((I(p, s) != a))
183+ then throw("user has already participated")
184+ else if (if ((X != d))
185+ then (X != e)
186+ else false)
187+ then throw("wrong status")
188+ else if (if ((M != f))
189+ then (M != g)
190+ else false)
191+ then throw("wrong vote")
192+ else if (if ((X == f))
193+ then true
194+ else (X == g))
195+ then throw("vote has finished")
196+ else WriteSet([DataEntry(H(p, s), M), DataEntry(L(p, M), Z), DataEntry(J(p), if ((Z >= c))
197+ then M
198+ else e)])
199+ }
200+
201+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "none"
55
66 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) = {
1919 let j = {
2020 let k = getInteger(this, i)
2121 if ($isInstanceOf(k, "Int"))
2222 then {
2323 let l = k
2424 l
2525 }
2626 else 0
2727 }
2828 j
2929 }
3030
3131
3232 func m (i) = {
3333 let n = {
3434 let k = getString(this, i)
3535 if ($isInstanceOf(k, "String"))
3636 then {
3737 let l = k
3838 l
3939 }
4040 else a
4141 }
4242 n
4343 }
4444
4545
4646 func o (p) = (p + "_price")
4747
4848
4949 func q (p) = h(o(p))
5050
5151
5252 func r (s,p) = (((p + "_") + s) + "_cnt")
5353
5454
5555 func t (s,p) = h(r(s, p))
5656
5757
5858 func u (v,w) = ("item_" + toBase58String(sha256(toBytes((v + w)))))
5959
6060
6161 func x (p) = (p + "_data")
6262
6363
6464 func y (p) = (p + "_owner")
6565
6666
6767 func z (p) = m(y(p))
6868
6969
7070 func A (B) = (B + "_balanace")
7171
7272
7373 func C (B) = h(A(B))
7474
7575
7676 func D (p,s) = (((p + "_") + s) + "_commit")
7777
7878
7979 func E (p,s) = m(D(p, s))
8080
8181
8282 func F (p) = (p + "_comcnt")
8383
8484
8585 func G (p) = h(F(p))
8686
8787
8888 func H (p,s) = (((p + "_") + s) + "_reveal")
8989
9090
9191 func I (p,s) = m(H(p, s))
9292
9393
9494 func J (p) = (p + "_status")
9595
9696
9797 func K (p) = m(J(p))
9898
9999
100100 func L (p,M) = ((p + "_res:") + M)
101101
102102
103103 func N (p,M) = h(L(p, M))
104104
105105
106106 @Callable(O)
107107 func addItem (w,P,Q) = {
108108 let R = toBase58String(O.caller.bytes)
109109 let p = u(R, w)
110110 if ((0 >= P))
111111 then throw("purchase ammount cannnot be less than item price")
112112 else if ((z(p) != a))
113113 then throw("an item is already exist")
114114 else WriteSet([DataEntry(y(p), R), DataEntry(o(p), P), DataEntry(x(p), Q)])
115115 }
116116
117117
118118
119119 @Callable(O)
120120 func purchase (p) = {
121121 let S = extract(O.payment)
122122 if (isDefined(S.assetId))
123123 then throw("WAVES tokens only at the moment")
124124 else {
125125 let T = toBase58String(O.caller.bytes)
126126 let P = q(p)
127127 let R = z(p)
128128 if ((P > S.amount))
129129 then throw("purchase amount cannnot be less than item price")
130130 else if ((S.amount > P))
131131 then throw("purchase amount cannnot be higher than item price")
132132 else if ((R == a))
133133 then throw("supplier does not exist")
134134 else WriteSet([DataEntry(r(T, p), (t(T, p) + 1)), DataEntry(A(R), (C(R) + S.amount))])
135135 }
136136 }
137137
138138
139139
140140 @Callable(O)
141141 func withdraw () = {
142142 let R = toBase58String(O.caller.bytes)
143143 let U = C(R)
144144 if ((0 >= U))
145145 then throw("insufficient balance")
146146 else ScriptResult(WriteSet([DataEntry(A(R), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(R), U, unit)]))
147147 }
148148
149149
150150
151151 @Callable(O)
152152 func voteCommit (p,V) = {
153153 let s = toBase58String(O.caller.bytes)
154154 let W = G(p)
155155 let X = K(p)
156156 if ((W >= b))
157157 then throw("reached max num of voters")
158158 else if ((E(p, s) != a))
159159 then throw("user has already participated")
160160 else if ((y(p) == a))
161161 then throw("item does not exist")
162162 else if (if ((X != a))
163163 then (X != d)
164164 else false)
165165 then throw("voting is not possible")
166166 else WriteSet([DataEntry(D(p, s), V), DataEntry(F(p), (W + 1)), DataEntry(J(p), if ((W == b))
167167 then e
168168 else d)])
169169 }
170170
171171
172+
173+@Callable(O)
174+func voteReveal (p,M,Y) = {
175+ let s = toBase58String(O.caller.bytes)
176+ let X = K(p)
177+ let Z = (N(p, M) + 1)
178+ if ((toBase58String(sha256(toBytes((M + Y)))) != E(p, s)))
179+ then throw("reveal data is not valid")
180+ else if ((b > G(p)))
181+ then throw("max num of voters hasn't reached yet")
182+ else if ((I(p, s) != a))
183+ then throw("user has already participated")
184+ else if (if ((X != d))
185+ then (X != e)
186+ else false)
187+ then throw("wrong status")
188+ else if (if ((M != f))
189+ then (M != g)
190+ else false)
191+ then throw("wrong vote")
192+ else if (if ((X == f))
193+ then true
194+ else (X == g))
195+ then throw("vote has finished")
196+ else WriteSet([DataEntry(H(p, s), M), DataEntry(L(p, M), Z), DataEntry(J(p), if ((Z >= c))
197+ then M
198+ else e)])
199+ }
200+
201+

github/deemru/w8io/026f985 
34.18 ms