tx · H1bYLn1n6CughXPjDrXiLPhCLts9tzsqT7peTDhD3Xdi

3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o:  -0.05000000 Waves

2019.08.12 17:05 [627933] smart account 3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o > SELF 0.00000000 Waves

{ "type": 13, "id": "H1bYLn1n6CughXPjDrXiLPhCLts9tzsqT7peTDhD3Xdi", "fee": 5000000, "feeAssetId": null, "timestamp": 1565618746092, "version": 1, "sender": "3Ms6Ht5bdVJa6sQnRBUg9nfNpEp7obSad8o", "senderPublicKey": "Ebb2ffqL8cMnNmXPNvHLy53xrK7t5WaSFhneCPBSoxop", "proofs": [ "4p29wAXnHbGrSj11hXyJwrbHHiysbRqfD4xw1sNEUuVXndWJge3GBhGVHy1HCFyo3HEUpufRWWv9LZt4EaDYrta7" ], "script": "base64:AAIDAAAAAAAAAAAAAAAhAAAAAAROT05FAgAAAARub25lAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWkFAAAAByRtYXRjaDAFAAAAAWkAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzBQAAAAROT05FBQAAAANzdHIBAAAAD2dldEtleUl0ZW1QcmljZQAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdGVtAgAAAAZfcHJpY2UBAAAAEWdldFZhbHVlSXRlbVByaWNlAAAAAQAAAARpdGVtCQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABCQEAAAAPZ2V0S2V5SXRlbV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dm90ZQUAAAAMbmV3Vm90ZUNvdW50CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAQZ2V0S2V5SXRlbVN0YXR1cwAAAAEFAAAABGl0ZW0DCQAAZwAAAAIFAAAADG5ld1ZvdGVDb3VudAUAAAAGUVVPUlVNBQAAAAR2b3RlBQAAAAZSRVZFQUwFAAAAA25pbAAAAAA6bK+S", "chainId": 84, "height": 627933, "spentComplexity": 0 } View: original | compacted Prev: 33b3ZCKUHopEFAKjKDrPdigTdUDPXJLddNNXvkTgnhJi Next: E88ZinuGmcc7gmjkciyuttLizS5J97mPAx77aqWrDPVL Diff:
OldNewDifferences
103103 func O (k,N) = b(M(k, N))
104104
105105
106-@Callable(P)
107-func addItem (r,Q,R) = {
108- let S = toBase58String(P.caller.bytes)
109- let k = p(S, r)
110- if ((0 >= Q))
106+func P () = extract(addressFromString("3MwyDYbjXQ9VRWnPkubmGgypox7663uCLxT"))
107+
108+
109+let Q = "blacklisted"
110+
111+func R (w) = (w + "_verifier_status")
112+
113+
114+func S (T,w) = {
115+ let h = {
116+ let e = getString(T, R(w))
117+ if ($isInstanceOf(e, "String"))
118+ then {
119+ let U = e
120+ U
121+ }
122+ else a
123+ }
124+ h
125+ }
126+
127+
128+@Callable(V)
129+func addItem (r,W,X) = {
130+ let Y = toBase58String(V.caller.bytes)
131+ let k = p(Y, r)
132+ let Z = S(P(), R(Y))
133+ if ((0 >= W))
111134 then throw("Please add valid price")
112135 else if ((u(k) != a))
113136 then throw((k + " - item already exists"))
114- else WriteSet([DataEntry(t(k), S), DataEntry(j(k), Q), DataEntry(s(k), R)])
137+ else if ((Z == Q))
138+ then throw((("The supplier " + Y) + " was blacklisted"))
139+ else WriteSet([DataEntry(t(k), Y), DataEntry(j(k), W), DataEntry(s(k), X)])
115140 }
116141
117142
118143
119-@Callable(P)
144+@Callable(V)
120145 func purchase (k) = {
121- let T = extract(P.payment)
122- if (isDefined(T.assetId))
146+ let aa = extract(V.payment)
147+ if (isDefined(aa.assetId))
123148 then throw("Only payments in WAVES are avalible")
124149 else {
125- let U = toBase58String(P.caller.bytes)
126- let Q = l(k)
127- let S = u(k)
128- if ((Q > T.amount))
150+ let ab = toBase58String(V.caller.bytes)
151+ let W = l(k)
152+ let Y = u(k)
153+ if ((W > aa.amount))
129154 then throw("Please send exact coupon price")
130- else if ((T.amount > Q))
155+ else if ((aa.amount > W))
131156 then throw("Please send exact coupon price")
132- else WriteSet([DataEntry(m(U, k), (o(U, k) + 1)), DataEntry(v(S), (x(S) + T.amount))])
157+ else WriteSet([DataEntry(m(ab, k), (o(ab, k) + 1)), DataEntry(v(Y), (x(Y) + aa.amount))])
133158 }
134159 }
135160
136161
137162
138-@Callable(P)
163+@Callable(V)
139164 func withdraw () = {
140- let S = toBase58String(P.caller.bytes)
141- let V = x(S)
142- if ((0 >= V))
165+ let Y = toBase58String(V.caller.bytes)
166+ let ac = x(Y)
167+ if ((0 >= ac))
143168 then throw("Ballance is zero")
144- else ScriptResult(WriteSet([DataEntry(v(S), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(S), V, unit)]))
169+ else ScriptResult(WriteSet([DataEntry(v(Y), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(Y), ac, unit)]))
145170 }
146171
147172
148173
149-@Callable(P)
150-func voteCommit (k,W) = {
151- let n = toBase58String(P.caller.bytes)
152- let X = H(k)
153- let Y = L(k)
154- if ((X >= y))
174+@Callable(V)
175+func voteCommit (k,ad) = {
176+ let n = toBase58String(V.caller.bytes)
177+ let ae = H(k)
178+ let af = L(k)
179+ if ((ae >= y))
155180 then throw("We have reached necessary number of voters")
156181 else if ((F(k, n) != a))
157182 then throw("User has already voted")
158183 else if ((t(k) == a))
159184 then throw("Item does not exist")
160- else if (if ((Y != a))
161- then (Y != A)
185+ else if (if ((af != a))
186+ then (af != A)
162187 else false)
163188 then throw("Voting is not possible")
164- else WriteSet([DataEntry(E(k, n), W), DataEntry(G(k), (X + 1)), DataEntry(K(k), if ((X == y))
189+ else WriteSet([DataEntry(E(k, n), ad), DataEntry(G(k), (ae + 1)), DataEntry(K(k), if ((ae == y))
165190 then B
166191 else A)])
167192 }
168193
169194
170195
171-@Callable(P)
172-func revealVotes (k,N,Z) = {
173- let n = toBase58String(P.caller.bytes)
174- let X = H(k)
175- let Y = L(k)
176- let aa = (O(k, N) + 1)
177- if ((toBase58String(sha256(toBytes((N + Z)))) != F(k, n)))
196+@Callable(V)
197+func revealVotes (k,N,ag) = {
198+ let n = toBase58String(V.caller.bytes)
199+ let ae = H(k)
200+ let af = L(k)
201+ let ah = (O(k, N) + 1)
202+ if ((toBase58String(sha256(toBytes((N + ag)))) != F(k, n)))
178203 then throw("Reveal data is not valid")
179204 else if ((y > H(k)))
180205 then throw("Necessary number of voters hasn't reached yet")
181206 else if ((J(k, n) != a))
182207 then throw("User has already revealed his vote")
183- else if (if ((Y != A))
184- then (Y != B)
208+ else if (if ((af != A))
209+ then (af != B)
185210 else false)
186211 then throw("Wrong status of vote")
187212 else if (if ((N != C))
188213 then (N != D)
189214 else false)
190215 then throw("Wrong vote")
191- else if (if ((Y == C))
216+ else if (if ((af == C))
192217 then true
193- else (Y == D))
218+ else (af == D))
194219 then throw("Voting complited")
195- else WriteSet([DataEntry(I(k, n), N), DataEntry(M(k, N), aa), DataEntry(K(k), if ((aa >= z))
220+ else WriteSet([DataEntry(I(k, n), N), DataEntry(M(k, N), ah), DataEntry(K(k), if ((ah >= z))
196221 then N
197222 else B)])
198223 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "none"
55
66 func b (c) = {
77 let d = {
88 let e = getInteger(this, c)
99 if ($isInstanceOf(e, "Int"))
1010 then {
1111 let f = e
1212 f
1313 }
1414 else 0
1515 }
1616 d
1717 }
1818
1919
2020 func g (c) = {
2121 let h = {
2222 let e = getString(this, c)
2323 if ($isInstanceOf(e, "String"))
2424 then {
2525 let i = e
2626 i
2727 }
2828 else a
2929 }
3030 h
3131 }
3232
3333
3434 func j (k) = (k + "_price")
3535
3636
3737 func l (k) = b(j(k))
3838
3939
4040 func m (n,k) = (((k + "_") + n) + "_cnt")
4141
4242
4343 func o (n,k) = b(m(n, k))
4444
4545
4646 func p (q,r) = ("item_" + toBase58String(sha256(toBytes((q + r)))))
4747
4848
4949 func s (k) = (k + "_data")
5050
5151
5252 func t (k) = (k + "_owner")
5353
5454
5555 func u (k) = g(t(k))
5656
5757
5858 func v (w) = (w + "_balance")
5959
6060
6161 func x (w) = b(v(w))
6262
6363
6464 let y = 3
6565
6666 let z = 2
6767
6868 let A = "voting"
6969
7070 let B = "reveal"
7171
7272 let C = "featured"
7373
7474 let D = "delisted"
7575
7676 func E (k,n) = (((k + "_") + n) + "_commit")
7777
7878
7979 func F (k,n) = g(E(k, n))
8080
8181
8282 func G (k) = (k + "_comcnt")
8383
8484
8585 func H (k) = b(G(k))
8686
8787
8888 func I (k,n) = (((k + "_") + n) + "_reveal")
8989
9090
9191 func J (k,n) = g(I(k, n))
9292
9393
9494 func K (k) = (k + "_status")
9595
9696
9797 func L (k) = g(K(k))
9898
9999
100100 func M (k,N) = ((k + "_res:") + N)
101101
102102
103103 func O (k,N) = b(M(k, N))
104104
105105
106-@Callable(P)
107-func addItem (r,Q,R) = {
108- let S = toBase58String(P.caller.bytes)
109- let k = p(S, r)
110- if ((0 >= Q))
106+func P () = extract(addressFromString("3MwyDYbjXQ9VRWnPkubmGgypox7663uCLxT"))
107+
108+
109+let Q = "blacklisted"
110+
111+func R (w) = (w + "_verifier_status")
112+
113+
114+func S (T,w) = {
115+ let h = {
116+ let e = getString(T, R(w))
117+ if ($isInstanceOf(e, "String"))
118+ then {
119+ let U = e
120+ U
121+ }
122+ else a
123+ }
124+ h
125+ }
126+
127+
128+@Callable(V)
129+func addItem (r,W,X) = {
130+ let Y = toBase58String(V.caller.bytes)
131+ let k = p(Y, r)
132+ let Z = S(P(), R(Y))
133+ if ((0 >= W))
111134 then throw("Please add valid price")
112135 else if ((u(k) != a))
113136 then throw((k + " - item already exists"))
114- else WriteSet([DataEntry(t(k), S), DataEntry(j(k), Q), DataEntry(s(k), R)])
137+ else if ((Z == Q))
138+ then throw((("The supplier " + Y) + " was blacklisted"))
139+ else WriteSet([DataEntry(t(k), Y), DataEntry(j(k), W), DataEntry(s(k), X)])
115140 }
116141
117142
118143
119-@Callable(P)
144+@Callable(V)
120145 func purchase (k) = {
121- let T = extract(P.payment)
122- if (isDefined(T.assetId))
146+ let aa = extract(V.payment)
147+ if (isDefined(aa.assetId))
123148 then throw("Only payments in WAVES are avalible")
124149 else {
125- let U = toBase58String(P.caller.bytes)
126- let Q = l(k)
127- let S = u(k)
128- if ((Q > T.amount))
150+ let ab = toBase58String(V.caller.bytes)
151+ let W = l(k)
152+ let Y = u(k)
153+ if ((W > aa.amount))
129154 then throw("Please send exact coupon price")
130- else if ((T.amount > Q))
155+ else if ((aa.amount > W))
131156 then throw("Please send exact coupon price")
132- else WriteSet([DataEntry(m(U, k), (o(U, k) + 1)), DataEntry(v(S), (x(S) + T.amount))])
157+ else WriteSet([DataEntry(m(ab, k), (o(ab, k) + 1)), DataEntry(v(Y), (x(Y) + aa.amount))])
133158 }
134159 }
135160
136161
137162
138-@Callable(P)
163+@Callable(V)
139164 func withdraw () = {
140- let S = toBase58String(P.caller.bytes)
141- let V = x(S)
142- if ((0 >= V))
165+ let Y = toBase58String(V.caller.bytes)
166+ let ac = x(Y)
167+ if ((0 >= ac))
143168 then throw("Ballance is zero")
144- else ScriptResult(WriteSet([DataEntry(v(S), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(S), V, unit)]))
169+ else ScriptResult(WriteSet([DataEntry(v(Y), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(Y), ac, unit)]))
145170 }
146171
147172
148173
149-@Callable(P)
150-func voteCommit (k,W) = {
151- let n = toBase58String(P.caller.bytes)
152- let X = H(k)
153- let Y = L(k)
154- if ((X >= y))
174+@Callable(V)
175+func voteCommit (k,ad) = {
176+ let n = toBase58String(V.caller.bytes)
177+ let ae = H(k)
178+ let af = L(k)
179+ if ((ae >= y))
155180 then throw("We have reached necessary number of voters")
156181 else if ((F(k, n) != a))
157182 then throw("User has already voted")
158183 else if ((t(k) == a))
159184 then throw("Item does not exist")
160- else if (if ((Y != a))
161- then (Y != A)
185+ else if (if ((af != a))
186+ then (af != A)
162187 else false)
163188 then throw("Voting is not possible")
164- else WriteSet([DataEntry(E(k, n), W), DataEntry(G(k), (X + 1)), DataEntry(K(k), if ((X == y))
189+ else WriteSet([DataEntry(E(k, n), ad), DataEntry(G(k), (ae + 1)), DataEntry(K(k), if ((ae == y))
165190 then B
166191 else A)])
167192 }
168193
169194
170195
171-@Callable(P)
172-func revealVotes (k,N,Z) = {
173- let n = toBase58String(P.caller.bytes)
174- let X = H(k)
175- let Y = L(k)
176- let aa = (O(k, N) + 1)
177- if ((toBase58String(sha256(toBytes((N + Z)))) != F(k, n)))
196+@Callable(V)
197+func revealVotes (k,N,ag) = {
198+ let n = toBase58String(V.caller.bytes)
199+ let ae = H(k)
200+ let af = L(k)
201+ let ah = (O(k, N) + 1)
202+ if ((toBase58String(sha256(toBytes((N + ag)))) != F(k, n)))
178203 then throw("Reveal data is not valid")
179204 else if ((y > H(k)))
180205 then throw("Necessary number of voters hasn't reached yet")
181206 else if ((J(k, n) != a))
182207 then throw("User has already revealed his vote")
183- else if (if ((Y != A))
184- then (Y != B)
208+ else if (if ((af != A))
209+ then (af != B)
185210 else false)
186211 then throw("Wrong status of vote")
187212 else if (if ((N != C))
188213 then (N != D)
189214 else false)
190215 then throw("Wrong vote")
191- else if (if ((Y == C))
216+ else if (if ((af == C))
192217 then true
193- else (Y == D))
218+ else (af == D))
194219 then throw("Voting complited")
195- else WriteSet([DataEntry(I(k, n), N), DataEntry(M(k, N), aa), DataEntry(K(k), if ((aa >= z))
220+ else WriteSet([DataEntry(I(k, n), N), DataEntry(M(k, N), ah), DataEntry(K(k), if ((ah >= z))
196221 then N
197222 else B)])
198223 }
199224
200225

github/deemru/w8io/169f3d6 
52.00 ms