tx · GYnxM71YvMp6wtjcJX9KgVWNT4jdQUBBf6zVSZ5XRAsT

3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR:  -0.01400000 Waves

2019.07.14 04:19 [584745] smart account 3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR > SELF 0.00000000 Waves

{ "type": 13, "id": "GYnxM71YvMp6wtjcJX9KgVWNT4jdQUBBf6zVSZ5XRAsT", "fee": 1400000, "feeAssetId": null, "timestamp": 1563067145840, "version": 1, "sender": "3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR", "senderPublicKey": "Adn8NfJZ8ZXuWNMXb9VaY6X6kh6k6G3KMb1WQUesFUV", "proofs": [ "5R4EqhqY8zZ3HHWR3wJCX3NMAxMKqsCf4FZNqVygAKFXWD1gkf38FDcREJb12UNqTPxRC1gYrgpVdx4KmopeNNey" ], "script": "base64:AAIDAAAAAAAAAAAAAAAeAAAAAA5vd25lclB1YmxpY0tleQEAAAAgAnfP9tCFuj2k2BUY5PW9DVGxrCHBHKJwugv8WyiaGXIAAAAABE5PTkUCAAAABG5vbmUAAAAABlZPVEVSUwAAAAAAAAAAAwAAAAAGUVVPUlVNAAAAAAAAAAACAAAAAAZWT1RJTkcCAAAABnZvdGluZwAAAAAGUkVWRUFMAgAAAAZyZXZlYWwAAAAACEZFQVRVUkVEAgAAAAhmZWF0dXJlZAAAAAAIREVMSVNURUQCAAAACGRlbGlzdGVkAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAA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AHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAADm93bmVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgfLshTk", "chainId": 84, "height": 584745, "spentComplexity": 0 } View: original | compacted Prev: A112PUstuUFk6AZBXzvqiAPqYjPdJdosZ63qvimexPF7 Next: AVpRTwsoD2iQKCsRZAHTDdUNkSj9iXze222qHyuDZ1Yv Diff:
OldNewDifferences
106106
107107
108108 @Callable(P)
109+func voteCommit (q,Q) = {
110+ let r = toBase58String(P.caller.bytes)
111+ let R = u(q)
112+ let S = y(q)
113+ if ((R >= c))
114+ then throw("reached max num of voters")
115+ else if ((s(q, r) != b))
116+ then throw("user has already participated")
117+ else if ((K(q) == b))
118+ then throw("item does not exist")
119+ else if (if ((S != b))
120+ then (S != e)
121+ else false)
122+ then throw("voting is not possible")
123+ else WriteSet([DataEntry(p(q, r), Q), DataEntry(t(q), (R + 1)), DataEntry(x(q), if ((R == c))
124+ then f
125+ else e)])
126+ }
127+
128+
129+
130+@Callable(P)
109131 func purchase (q) = {
110- let Q = extract(P.payment)
111- if (isDefined(Q.assetId))
132+ let T = extract(P.payment)
133+ if (isDefined(T.assetId))
112134 then throw("can use WAVES only at the moment")
113135 else {
114- let R = toBase58String(P.caller.bytes)
115- let S = D(q)
116- let T = L(q)
117- if ((S > Q.amount))
136+ let U = toBase58String(P.caller.bytes)
137+ let V = D(q)
138+ let W = L(q)
139+ if ((V > T.amount))
118140 then throw("purchase amount cannot be less than item price")
119- else if ((Q.amount > S))
141+ else if ((T.amount > V))
120142 then throw("purchase amount cannot be higher than item price")
121- else if ((T == b))
143+ else if ((W == b))
122144 then throw("supplier does not exist")
123- else WriteSet([DataEntry(E(R, q), (F(R, q) + 1)), DataEntry(M(T), (O(T) + Q.amount))])
145+ else WriteSet([DataEntry(E(U, q), (F(U, q) + 1)), DataEntry(M(W), (O(W) + T.amount))])
124146 }
125147 }
126148
128150
129151 @Callable(P)
130152 func withdraw () = {
131- let T = toBase58String(P.caller.bytes)
132- let U = O(T)
133- if ((0 >= U))
153+ let W = toBase58String(P.caller.bytes)
154+ let X = O(W)
155+ if ((0 >= X))
134156 then throw("insufficient balance")
135- else ScriptResult(WriteSet([DataEntry(M(T), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(T), U, unit)]))
157+ else ScriptResult(WriteSet([DataEntry(M(W), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(W), X, unit)]))
136158 }
137159
138160
139161
140162 @Callable(P)
141-func addItem (I,S,V) = {
142- let T = toBase58String(P.caller.bytes)
143- let q = G(T, I)
144- if ((0 >= S))
163+func addItem (I,V,Y) = {
164+ let W = toBase58String(P.caller.bytes)
165+ let q = G(W, I)
166+ if ((0 >= V))
145167 then throw("purchase amount cannot be less than item price")
146168 else if ((L(q) != b))
147169 then throw("an item is already exist")
148- else WriteSet([DataEntry(K(q), T), DataEntry(C(q), S), DataEntry(J(q), V)])
170+ else WriteSet([DataEntry(K(q), W), DataEntry(C(q), V), DataEntry(J(q), Y)])
149171 }
150172
151173
152-@Verifier(W)
153-func X () = {
154- let l = W
174+@Verifier(Z)
175+func aa () = {
176+ let l = Z
155177 if ($isInstanceOf(l, "SetScriptTransaction"))
156178 then {
157- let Y = l
158- sigVerify(W.bodyBytes, W.proofs[0], a)
179+ let ab = l
180+ sigVerify(Z.bodyBytes, Z.proofs[0], a)
159181 }
160182 else if ($isInstanceOf(l, "DataTransaction"))
161183 then {
162- let Y = l
184+ let ab = l
163185 true
164186 }
165187 else if ($isInstanceOf(l, "TransferTransaction"))
166188 then {
167- let Y = l
189+ let ab = l
168190 true
169191 }
170192 else false
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'Adn8NfJZ8ZXuWNMXb9VaY6X6kh6k6G3KMb1WQUesFUV'
55
66 let b = "none"
77
88 let c = 3
99
1010 let d = 2
1111
1212 let e = "voting"
1313
1414 let f = "reveal"
1515
1616 let g = "featured"
1717
1818 let h = "delisted"
1919
2020 func i (j) = {
2121 let k = {
2222 let l = getInteger(this, j)
2323 if ($isInstanceOf(l, "Int"))
2424 then {
2525 let m = l
2626 m
2727 }
2828 else 0
2929 }
3030 k
3131 }
3232
3333
3434 func n (j) = {
3535 let o = {
3636 let l = getString(this, j)
3737 if ($isInstanceOf(l, "String"))
3838 then {
3939 let m = l
4040 m
4141 }
4242 else b
4343 }
4444 o
4545 }
4646
4747
4848 func p (q,r) = (((q + "_") + r) + "_commit")
4949
5050
5151 func s (q,r) = n(p(q, r))
5252
5353
5454 func t (q) = (q + "_comcnt")
5555
5656
5757 func u (q) = i(t(q))
5858
5959
6060 func v (q,r) = (((q + "_") + r) + "_reveal")
6161
6262
6363 func w (q,r) = n(v(q, r))
6464
6565
6666 func x (q) = (q + "_status")
6767
6868
6969 func y (q) = n(x(q))
7070
7171
7272 func z (q,A) = ((q + "_res:") + A)
7373
7474
7575 func B (q,A) = i(z(q, A))
7676
7777
7878 func C (q) = (q + "_price")
7979
8080
8181 func D (q) = i(C(q))
8282
8383
8484 func E (r,q) = (((q + "_") + r) + "_cnt")
8585
8686
8787 func F (r,q) = i(E(r, q))
8888
8989
9090 func G (H,I) = ("item_" + toBase58String(sha256(toBytes((H + I)))))
9191
9292
9393 func J (q) = (q + "_data")
9494
9595
9696 func K (q) = (q + "_owner")
9797
9898
9999 func L (q) = n(K(q))
100100
101101
102102 func M (N) = (N + "_balance")
103103
104104
105105 func O (N) = i(M(N))
106106
107107
108108 @Callable(P)
109+func voteCommit (q,Q) = {
110+ let r = toBase58String(P.caller.bytes)
111+ let R = u(q)
112+ let S = y(q)
113+ if ((R >= c))
114+ then throw("reached max num of voters")
115+ else if ((s(q, r) != b))
116+ then throw("user has already participated")
117+ else if ((K(q) == b))
118+ then throw("item does not exist")
119+ else if (if ((S != b))
120+ then (S != e)
121+ else false)
122+ then throw("voting is not possible")
123+ else WriteSet([DataEntry(p(q, r), Q), DataEntry(t(q), (R + 1)), DataEntry(x(q), if ((R == c))
124+ then f
125+ else e)])
126+ }
127+
128+
129+
130+@Callable(P)
109131 func purchase (q) = {
110- let Q = extract(P.payment)
111- if (isDefined(Q.assetId))
132+ let T = extract(P.payment)
133+ if (isDefined(T.assetId))
112134 then throw("can use WAVES only at the moment")
113135 else {
114- let R = toBase58String(P.caller.bytes)
115- let S = D(q)
116- let T = L(q)
117- if ((S > Q.amount))
136+ let U = toBase58String(P.caller.bytes)
137+ let V = D(q)
138+ let W = L(q)
139+ if ((V > T.amount))
118140 then throw("purchase amount cannot be less than item price")
119- else if ((Q.amount > S))
141+ else if ((T.amount > V))
120142 then throw("purchase amount cannot be higher than item price")
121- else if ((T == b))
143+ else if ((W == b))
122144 then throw("supplier does not exist")
123- else WriteSet([DataEntry(E(R, q), (F(R, q) + 1)), DataEntry(M(T), (O(T) + Q.amount))])
145+ else WriteSet([DataEntry(E(U, q), (F(U, q) + 1)), DataEntry(M(W), (O(W) + T.amount))])
124146 }
125147 }
126148
127149
128150
129151 @Callable(P)
130152 func withdraw () = {
131- let T = toBase58String(P.caller.bytes)
132- let U = O(T)
133- if ((0 >= U))
153+ let W = toBase58String(P.caller.bytes)
154+ let X = O(W)
155+ if ((0 >= X))
134156 then throw("insufficient balance")
135- else ScriptResult(WriteSet([DataEntry(M(T), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(T), U, unit)]))
157+ else ScriptResult(WriteSet([DataEntry(M(W), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(W), X, unit)]))
136158 }
137159
138160
139161
140162 @Callable(P)
141-func addItem (I,S,V) = {
142- let T = toBase58String(P.caller.bytes)
143- let q = G(T, I)
144- if ((0 >= S))
163+func addItem (I,V,Y) = {
164+ let W = toBase58String(P.caller.bytes)
165+ let q = G(W, I)
166+ if ((0 >= V))
145167 then throw("purchase amount cannot be less than item price")
146168 else if ((L(q) != b))
147169 then throw("an item is already exist")
148- else WriteSet([DataEntry(K(q), T), DataEntry(C(q), S), DataEntry(J(q), V)])
170+ else WriteSet([DataEntry(K(q), W), DataEntry(C(q), V), DataEntry(J(q), Y)])
149171 }
150172
151173
152-@Verifier(W)
153-func X () = {
154- let l = W
174+@Verifier(Z)
175+func aa () = {
176+ let l = Z
155177 if ($isInstanceOf(l, "SetScriptTransaction"))
156178 then {
157- let Y = l
158- sigVerify(W.bodyBytes, W.proofs[0], a)
179+ let ab = l
180+ sigVerify(Z.bodyBytes, Z.proofs[0], a)
159181 }
160182 else if ($isInstanceOf(l, "DataTransaction"))
161183 then {
162- let Y = l
184+ let ab = l
163185 true
164186 }
165187 else if ($isInstanceOf(l, "TransferTransaction"))
166188 then {
167- let Y = l
189+ let ab = l
168190 true
169191 }
170192 else false
171193 }
172194

github/deemru/w8io/169f3d6 
52.75 ms