tx · Gt8czhHGAEVx2AXzEXDg1eGJZ4Eygpggf7EM6zuNmYLX

3N8X6wT7GZLavL2ayUQzwRD2kRFRSDyhkKS:  -0.01000000 Waves

2021.07.07 14:44 [1603142] smart account 3N8X6wT7GZLavL2ayUQzwRD2kRFRSDyhkKS > SELF 0.00000000 Waves

{ "type": 13, "id": "Gt8czhHGAEVx2AXzEXDg1eGJZ4Eygpggf7EM6zuNmYLX", "fee": 1000000, "feeAssetId": null, "timestamp": 1625658286409, "version": 2, "chainId": 84, "sender": "3N8X6wT7GZLavL2ayUQzwRD2kRFRSDyhkKS", "senderPublicKey": "7DT6yPGiY3eZiSytDKBx5ToZcjhem3SyxdX6Zz9fsMED", "proofs": [ "382DSoJHYEUofefkqKYFgymwJcCncYYHC2oT9E744eMnf2afq7C8M1ct64ZgY48cBzVqXRsQrGTBQRB4km8FDSJ7" ], "script": "base64:AAIFAAAAAAAAA9QIAhIFCgMIAQgSAwoBCBIAEgQKAggIEgUKAwgICBoKCgJhMRIETk9ORRoUCgJhMhIOZ2V0TnVtYmVyQnlLZXkaCQoCYTMSA2tleRoJCgJhNBIDbnVtGg0KAmE1EgckbWF0Y2gwGgcKAmE2EgFhGhEKAmE3EgtnZXRTdHJCeUtleRoJCgJhOBIDc3RyGhUKAmE5Eg9nZXRLZXlJdGVtUHJpY2UaCgoCYjESBGl0ZW0aFwoCYjISEWdldFZhbHVlSXRlbVByaWNlGhsKAmIzEhVnZXRLZXlVc2VySXRlbUNvdW50ZXIaCgoCYjQSBHVzZXIaHQoCYjUSF2dldFZhbHVlVXNlckl0ZW1Db3VudGVyGhAKAmI2EgpnZXRLZXlJdGVtGg4KAmI3EghzdXBwbGllchoLCgJiOBIFdGl0bGUaFAoCYjkSDmdldEtleUl0ZW1EYXRhGhgKAmMxEhJnZXRLZXlJdGVtU3VwcGxpZXIaGgoCYzISFGdldFZhbHVlSXRlbVN1cHBsaWVyGhsKAmMzEhVnZXRLZXlCYWxhbmNlU3VwcGxpZXIaDQo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mUzBQAAAAJmNwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQEAAAACZDkAAAABBQAAAAJiMQMJAABnAAAAAgUAAAACZjcFAAAAAmM3BQAAAAJlMwUAAAACYzkFAAAAA25pbAAAAABINCkL", "height": 1603142, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CxJDMt1pswwB5qoGmjnEmz5Ms1a9LmLechpxUmxRBkHJ Next: BHv4ThBwR6kcmZS9QrRxDDsDBb8CP9SPhmJeDJxE7zAH Diff:
OldNewDifferences
179179 then throw("max num of voters hasnt reached yet")
180180 else if ((I(j, m) != a))
181181 then throw("user has already participated")
182- else if (if ((M != B))
183- then (M != C)
182+ else if (if ((X != z))
183+ then (X != A)
184184 else false)
185- then throw("wrong vote")
186- else [StringEntry(H(j, m), M), IntegerEntry(L(j, M), Z), StringEntry(J(j), if ((Z >= y))
187- then M
188- else A)]
185+ then throw("wrong status")
186+ else if (if ((M != B))
187+ then (M != C)
188+ else false)
189+ then throw("wrong vote")
190+ else if (if ((X == B))
191+ then true
192+ else (X == C))
193+ then throw("vote has finished")
194+ else [StringEntry(H(j, m), M), IntegerEntry(L(j, M), Z), StringEntry(J(j), if ((Z >= y))
195+ then M
196+ else A)]
189197 }
190198
191199
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
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 f = e
2626 f
2727 }
2828 else a
2929 }
3030 h
3131 }
3232
3333
3434 func i (j) = (j + "_price")
3535
3636
3737 func k (j) = b(i(j))
3838
3939
4040 func l (m,j) = (((j + "_") + m) + "_cnt")
4141
4242
4343 func n (m,j) = b(l(m, j))
4444
4545
4646 func o (p,q) = ("item_" + toBase58String(sha256(toBytes((p + q)))))
4747
4848
4949 func r (j) = (j + "_data")
5050
5151
5252 func s (j) = (j + "_owner")
5353
5454
5555 func t (j) = g(s(j))
5656
5757
5858 func u (v) = (v + "_balance")
5959
6060
6161 func w (v) = b(u(v))
6262
6363
6464 let x = 3
6565
6666 let y = 2
6767
6868 let z = "voting"
6969
7070 let A = "reveal"
7171
7272 let B = "featured"
7373
7474 let C = "delisted"
7575
7676 func D (j,m) = (((j + "_") + m) + "_commit")
7777
7878
7979 func E (j,m) = g(D(j, m))
8080
8181
8282 func F (j) = (j + "_comcnt")
8383
8484
8585 func G (j) = b(F(j))
8686
8787
8888 func H (j,m) = (((j + "_") + m) + "_reveal")
8989
9090
9191 func I (j,m) = g(H(j, m))
9292
9393
9494 func J (j) = (j + "_status")
9595
9696
9797 func K (j) = g(J(j))
9898
9999
100100 func L (j,M) = ((j + "_res:") + M)
101101
102102
103103 func N (j,M) = b(L(j, M))
104104
105105
106106 @Callable(O)
107107 func addItem (q,P,Q) = {
108108 let R = toBase58String(O.caller.bytes)
109109 let j = o(R, q)
110110 if ((0 >= P))
111111 then throw("Purchase amount cannot be less than item price")
112112 else if ((t(j) != a))
113113 then throw("an item already exists")
114114 else [StringEntry(s(j), R), IntegerEntry(i(j), P), StringEntry(r(j), Q)]
115115 }
116116
117117
118118
119119 @Callable(O)
120120 func purchase (j) = {
121121 let S = O.payments[0]
122122 if (isDefined(S.assetId))
123123 then throw("WAVES ONLY HHEUAWHEUAS")
124124 else {
125125 let T = toBase58String(O.caller.bytes)
126126 let P = k(j)
127127 let R = t(j)
128128 if ((P > S.amount))
129129 then throw("Purchase amount cannot be less than item price")
130130 else if ((R == a))
131131 then throw("Supplier does not exist")
132132 else [IntegerEntry(l(T, j), (n(T, j) + 1)), IntegerEntry(u(R), (w(R) + S.amount))]
133133 }
134134 }
135135
136136
137137
138138 @Callable(O)
139139 func withdraw () = {
140140 let R = toBase58String(O.caller.bytes)
141141 let U = w(R)
142142 if ((0 >= U))
143143 then throw("insuficient balance")
144144 else [IntegerEntry(u(R), 0), ScriptTransfer(addressFromStringValue(R), U, unit)]
145145 }
146146
147147
148148
149149 @Callable(O)
150150 func voteCommit (j,V) = {
151151 let m = toBase58String(O.caller.bytes)
152152 let W = G(j)
153153 let X = K(j)
154154 if ((W >= x))
155155 then throw("Reached max num of voters")
156156 else if ((E(j, m) != a))
157157 then throw("b1")
158158 else if ((s(j) == a))
159159 then throw("b2")
160160 else if (if ((X != a))
161161 then (X != z)
162162 else false)
163163 then throw("b3")
164164 else [StringEntry(D(j, m), V), IntegerEntry(F(j), (W + 1)), StringEntry(J(j), if ((W == x))
165165 then A
166166 else z)]
167167 }
168168
169169
170170
171171 @Callable(O)
172172 func voteReveal (j,M,Y) = {
173173 let m = toBase58String(O.caller.bytes)
174174 let X = K(j)
175175 let Z = (N(j, M) + 1)
176176 if ((toBase58String(sha256(toBytes((M + Y)))) != E(j, m)))
177177 then throw("Reveal data is not valid")
178178 else if ((x > G(j)))
179179 then throw("max num of voters hasnt reached yet")
180180 else if ((I(j, m) != a))
181181 then throw("user has already participated")
182- else if (if ((M != B))
183- then (M != C)
182+ else if (if ((X != z))
183+ then (X != A)
184184 else false)
185- then throw("wrong vote")
186- else [StringEntry(H(j, m), M), IntegerEntry(L(j, M), Z), StringEntry(J(j), if ((Z >= y))
187- then M
188- else A)]
185+ then throw("wrong status")
186+ else if (if ((M != B))
187+ then (M != C)
188+ else false)
189+ then throw("wrong vote")
190+ else if (if ((X == B))
191+ then true
192+ else (X == C))
193+ then throw("vote has finished")
194+ else [StringEntry(H(j, m), M), IntegerEntry(L(j, M), Z), StringEntry(J(j), if ((Z >= y))
195+ then M
196+ else A)]
189197 }
190198
191199

github/deemru/w8io/026f985 
32.79 ms