tx · AxUFqyitAkhAfhyhDbtPAYdpnSDDV34HgTjLa2aNU5Aj

3MzZVNwvKoTH3V7x9x82gVw5dBeytVkY5sA:  -0.01400000 Waves

2019.07.09 07:46 [577633] smart account 3MzZVNwvKoTH3V7x9x82gVw5dBeytVkY5sA > SELF 0.00000000 Waves

{ "type": 13, "id": "AxUFqyitAkhAfhyhDbtPAYdpnSDDV34HgTjLa2aNU5Aj", "fee": 1400000, "feeAssetId": null, "timestamp": 1562647697940, "version": 1, "sender": "3MzZVNwvKoTH3V7x9x82gVw5dBeytVkY5sA", "senderPublicKey": "2zNrrVcRpgUJg9kb4fqpm2HSkQ85LMSwYBY4RAriw6fN", "proofs": [ "8ukeQH3MHTY8BZHkDRxLMQks8JhnDci7XZmGPcHLhmJ7KPJGPk4Zah6os9u3Y6Xw2tA4Q6oPq7amAqkntXHUSZF" ], "script": "base64:AAIDAAAAAAAAAAAAAAAEAQAAAB5nZXRFeHRWYWx1ZUl0ZW1XaGl0ZUxpc3RTdGF0dXMAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAQX3ZlcmlmaWVyX3N0YXR1cwAAAAAIdmVyaWZpZXICAAAAIzNNenR3N0JRUFdoQ1hEeEhFU3JCb1gyREtrMTJ5TkFHSzVFAAAAAAhWRVJJRklFRAIAAAAIdmVyaWZpZWQAAAAAC0JMQUNLTElTVEVEAgAAAAtibGFja2xpc3RlZAAAAAEAAAABaQEAAAAJc2V0c3RhdHVzAAAAAgAAAAhzdXBwbGllcgAAAAZzdGF0dXMEAAAAB2FjY291bnQJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwMJAQAAAAIhPQAAAAIFAAAAB2FjY291bnQFAAAACHZlcmlmaWVyCQAAAgAAAAECAAAAMW9ubHkgb3JhY2xlIHZlcmlmaWVyIGFyZSBhYmxlIHRvIG1hbmFnZSB3aGl0ZWxpc3QDAwkBAAAAAiE9AAAAAgUAAAAGc3RhdHVzBQAAAAhWRVJJRklFRAkBAAAAAiE9AAAAAgUAAAAGc3RhdHVzBQAAAAtCTEFDS0xJU1RFRAcJAAACAAAAAQIAAAAMd3Jvbmcgc3RhdHVzCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAeZ2V0RXh0VmFsdWVJdGVtV2hpdGVMaXN0U3RhdHVzAAAAAQUAAAAIc3VwcGxpZXIFAAAABnN0YXR1cwUAAAADbmlsAAAAAJkGhqc=", "chainId": 84, "height": 577633, "spentComplexity": 0 } View: original | compacted Prev: 9uRcJBo4qMUXxaYpAbuhLutUdxn9gZRMNdW4jfmZutcs Next: 3K7EETbtsdFbMDLBoAzmx8LPCZ43ajRSPicVJuDk9Lf9 Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = "none"
5-
6-func b (c) = {
7- let d = {
8- let e = getInteger(this, c)
9- if ($isInstanceOf(e, "Int"))
10- then {
11- let f = e
12- f
13- }
14- else 0
15- }
16- d
17- }
4+func a (b) = (b + "_verifier_status")
185
196
20-func g (c) = {
21- let h = {
22- let e = getString(this, c)
23- if ($isInstanceOf(e, "String"))
24- then {
25- let f = e
26- f
27- }
28- else a
29- }
30- h
31- }
7+let c = "3Mztw7BQPWhCXDxHESrBoX2DKk12yNAGK5E"
328
9+let d = "verified"
3310
34-func i (j) = (j + "_price")
11+let e = "blacklisted"
3512
36-
37-func k (j) = b(i(j))
38-
39-
40-func l (m,j) = (((j + "_") + m) + "_cnt")
41-
42-
43-func n (m,j) = b(l(m, j))
44-
45-
46-func o (p,q) = ("item_" + toBase58String(sha256(toBytes((p + q)))))
47-
48-
49-func r (j) = (j + "_data")
50-
51-
52-func s (j) = (j + "_owner")
53-
54-
55-func t (j) = g(s(j))
56-
57-
58-func u (v) = (v + "_balance")
59-
60-
61-func w (v) = b(u(v))
62-
63-
64-let x = 3
65-
66-let y = 2
67-
68-let z = "voting"
69-
70-let A = "reveal"
71-
72-let B = "featured"
73-
74-let C = "delisted"
75-
76-func D (j,m) = (((j + "_") + m) + "_commit")
77-
78-
79-func E (j,m) = g(D(j, m))
80-
81-
82-func F (j) = (j + "_comcnt")
83-
84-
85-func G (j) = b(F(j))
86-
87-
88-func H (j,m) = (((j + "_") + m) + "_reveal")
89-
90-
91-func I (j,m) = g(H(j, m))
92-
93-
94-func J (j) = (j + "_status")
95-
96-
97-func K (j) = g(J(j))
98-
99-
100-func L (j,M) = ((j + "_res:") + M)
101-
102-
103-func N (j,M) = b(L(j, M))
104-
105-
106-func O () = extract(addressFromString("3MzZVNwvKoTH3V7x9x82gVw5dBeytVkY5sA"))
107-
108-
109-let P = "blacklisted"
110-
111-func Q (v) = (v + "_verifier_status")
112-
113-
114-func R (S,v) = {
115- let h = {
116- let e = getString(S, Q(v))
117- if ($isInstanceOf(e, "String"))
118- then {
119- let f = e
120- f
121- }
122- else a
123- }
124- h
125- }
126-
127-
128-@Callable(T)
129-func addItem (q,U,V) = {
130- let W = toBase58String(T.caller.bytes)
131- let j = o(W, q)
132- let X = R(O(), W)
133- if ((0 >= U))
134- then throw("purchase amount can't be less than item price")
135- else if ((t(j) != a))
136- then throw("an item already exist")
137- else if ((X == P))
138- then throw("supplier's account has been blacklisted")
139- else WriteSet([DataEntry(s(j), W), DataEntry(i(j), U), DataEntry(r(j), V)])
140- }
141-
142-
143-
144-@Callable(T)
145-func purchase (j) = {
146- let Y = extract(T.payment)
147- if (isDefined(Y.assetId))
148- then throw("can use WAVES only at the moment")
149- else {
150- let Z = toBase58String(T.caller.bytes)
151- let U = k(j)
152- let W = t(j)
153- if ((U > Y.amount))
154- then throw("purchase amount cannot be less than item price")
155- else if ((Y.amount > U))
156- then throw("purchase amount cannot be higher than item price")
157- else if ((W == a))
158- then throw("supplier doesn't exist")
159- else WriteSet([DataEntry(l(Z, j), (n(Z, j) + 1)), DataEntry(u(W), (w(W) + Y.amount))])
160- }
161- }
162-
163-
164-
165-@Callable(T)
166-func withdraw () = {
167- let W = toBase58String(T.caller.bytes)
168- let aa = w(W)
169- if ((0 >= aa))
170- then throw("insufficent funds")
171- else ScriptResult(WriteSet([DataEntry(u(W), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(W), aa, unit)]))
172- }
173-
174-
175-
176-@Callable(T)
177-func voteCommit (j,ab) = {
178- let m = toBase58String(T.caller.bytes)
179- let ac = G(j)
180- let ad = K(j)
181- if ((ac > x))
182- then throw("reached max num of voters")
183- else if ((E(j, m) != a))
184- then throw("user has already participated")
185- else if ((s(j) == a))
186- then throw("item does not exist")
187- else if (if ((ad != a))
188- then (ad != z)
189- else false)
190- then throw("voting is not possible")
191- else WriteSet([DataEntry(D(j, m), ab), DataEntry(F(j), (ac + 1)), DataEntry(J(j), if ((ac == x))
192- then A
193- else z)])
194- }
195-
196-
197-
198-@Callable(T)
199-func voteReveal (j,M,ae) = {
200- let m = toBase58String(T.caller.bytes)
201- let ad = K(j)
202- let af = (N(j, M) + 1)
203- if ((toBase58String(sha256(toBytes((M + ae)))) != E(j, m)))
204- then throw("reveal data is not valid")
205- else if ((x > G(j)))
206- then throw("max run of voters")
207- else if ((I(j, m) != a))
208- then throw("user already participated")
209- else if (if ((ad != z))
210- then (ad != A)
211- else false)
212- then throw("wrong status")
213- else if (if ((M != B))
214- then (M != C)
215- else false)
216- then throw("wrong vote")
217- else if (if ((ad == B))
218- then true
219- else (ad == C))
220- then throw("vote has finished")
221- else WriteSet([DataEntry(H(j, m), M), DataEntry(L(j, M), af), DataEntry(J(j), if ((af >= y))
222- then M
223- else A)])
13+@Callable(f)
14+func setstatus (g,h) = {
15+ let i = toBase58String(f.caller.bytes)
16+ if ((i != c))
17+ then throw("only oracle verifier are able to manage whitelist")
18+ else if (if ((h != d))
19+ then (h != e)
20+ else false)
21+ then throw("wrong status")
22+ else WriteSet([DataEntry(a(g), h)])
22423 }
22524
22625

github/deemru/w8io/873ac7e 
26.35 ms