tx · GHW7a3uPTqoVsjsSsVqXxaUB1F5sMfeFbaFrqL61PVZA

3MpjwMAGCaNqNFRa34foE5sTfV6zb76bYja:  -0.01000010 Waves

2021.07.08 14:11 [1604546] smart account 3MpjwMAGCaNqNFRa34foE5sTfV6zb76bYja > SELF 0.00000000 Waves

{ "type": 13, "id": "GHW7a3uPTqoVsjsSsVqXxaUB1F5sMfeFbaFrqL61PVZA", "fee": 1000010, "feeAssetId": null, "timestamp": 1625742718100, "version": 2, "chainId": 84, "sender": "3MpjwMAGCaNqNFRa34foE5sTfV6zb76bYja", "senderPublicKey": "7Cy4wXHvgCRHP6MMhu9tTdayLHr9P9Dc342DVcCoCPzm", "proofs": [ "39B6tVbS8VmAfgHZjWpy3ME57YS5c2RoJxG23t4MJ9xUn5NeA3kb6skRxgaLwfDRckYVKQ2K3QCCrprbtEvFyBGx" ], "script": "base64:AAIFAAAAAAAAAkQIAhIFCgMIAQgSAwoBCBIAGgoKAmExEgROT05FGhQKAmEyEg5nZXROdW1iZXJCeUtleRoJCgJhMxIDa2V5GgkKAmE0EgNudW0aDQoCYTUSByRtYXRjaDAaBwoCYTYSAWEaEQoCYTcSC2dldFN0ckJ5S2V5GgkKAmE4EgNzdHIaFQoCYTkSD2dldEtleUl0ZW1QcmljZRoKCgJiMRIEaXRlbRoXCgJiMhIRZ2V0VmFsdWVJdGVtUHJpY2UaGwoCYjMSFWdldEtleVVzZXJJdGVtQ291bnRlchoKCgJiNBIEdXNlchodCgJiNRIXZ2V0VmFsdWVVc2VySXRlbUNvdW50ZXIaEAoCYjYSCmdldEtleUl0ZW0aDgoCYjcSCHN1cHBsaWVyGgsKAmI4EgV0aXRsZRoUCgJiORIOZ2V0S2V5SXRlbURhdGEaGAoCYzESEmdldEtleUl0ZW1TdXBwbGllchoaCgJjMhIUZ2V0VmFsdWVJdGVtU3VwcGxpZXIaGwoCYzMSFWdldEtleUJhbGFuY2VTdXBwbGllchoNCgJjNBIHYWNjb3VudBodCgJjNRIXZ2V0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us": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8YVQTvj68zepSUv9UznKyuNaQGYJYwQPRxwvoDivMJA Next: 7Lfcqsp3pnmuFur37TzNQydAqcHybAbQi9hDGHxP4JKT Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = 3
4+let a = "none"
55
6-let b = 2
7-
8-let c = "voting"
9-
10-let d = "reveal"
11-
12-let e = "featured"
13-
14-let f = "delisted"
15-
16-let g = "none"
17-
18-func h (i) = {
19- let j = {
20- let k = getInteger(this, i)
21- if ($isInstanceOf(k, "Int"))
6+func b (c) = {
7+ let d = {
8+ let e = getInteger(this, c)
9+ if ($isInstanceOf(e, "Int"))
2210 then {
23- let l = k
24- l
11+ let f = e
12+ f
2513 }
2614 else 0
2715 }
28- j
16+ d
2917 }
3018
3119
32-func m (i) = {
33- let n = {
34- let k = getString(this, i)
35- if ($isInstanceOf(k, "String"))
20+func g (c) = {
21+ let h = {
22+ let e = getString(this, c)
23+ if ($isInstanceOf(e, "String"))
3624 then {
37- let l = k
38- l
25+ let f = e
26+ f
3927 }
40- else g
28+ else a
4129 }
42- n
30+ h
4331 }
4432
4533
46-func o (p) = (p + "_data")
34+func i (j) = (j + "_price")
4735
4836
49-func q (p,r) = (((p + "_") + r) + "_commit")
37+func k (j) = b(i(j))
5038
5139
52-func s (p,r) = m(q(p, r))
40+func l (m,j) = (((j + "_") + m) + "_cnt")
5341
5442
55-func t (p) = (p + "_comcnt")
43+func n (m,j) = b(l(m, j))
5644
5745
58-func u (p) = h(t(p))
46+func o (p,q) = ("item_" + toBase58String(sha256(toBytes((p + q)))))
5947
6048
61-func v (p,r) = (((p + "_") + r) + "_reveal")
49+func r (j) = (j + "_data")
6250
6351
64-func w (p,r) = m(v(p, r))
52+func s (j) = (j + "_data")
6553
6654
67-func x (p) = (p + "_status")
55+func t (j) = g(s(j))
6856
6957
70-func y (p) = m(x(p))
58+func u (v) = (v + "_balance")
7159
7260
73-func z (p,A) = ((p + "_res:") + A)
61+func w (v) = b(u(v))
7462
7563
76-func B (p,A) = h(z(p, A))
77-
78-
79-@Callable(C)
80-func voteCommit (p,D) = {
81- let r = toBase58String(C.caller.bytes)
82- let E = u(p)
83- let F = y(p)
84- if ((E >= a))
85- then throw("osiągnięto maksymaną liczbę głosujących")
86- else if ((s(p, r) != g))
87- then throw("użtykownik już głosuje")
88- else if ((o(p) == g))
89- then throw("nie istnieje taki przedmiot")
90- else if (if ((F != g))
91- then (F != c)
92- else false)
93- then throw("głosowanie nie jest możliwe")
94- else [StringEntry(q(p, r), D), IntegerEntry(t(p), (E + 1)), StringEntry(x(p), if ((E == a))
95- then d
96- else c)]
64+@Callable(x)
65+func addItem (q,y,z) = {
66+ let A = toBase58String(x.caller.bytes)
67+ let j = o(A, q)
68+ if ((0 >= y))
69+ then throw("purchase amount cannot be less than item price")
70+ else if ((t(j) != a))
71+ then throw("an item is already exist")
72+ else [StringEntry(s(j), A), IntegerEntry(i(j), y), StringEntry(r(j), z)]
9773 }
9874
9975
10076
101-@Callable(C)
102-func voteReveal (p,A,G) = {
103- let r = toBase58String(C.caller.bytes)
104- let F = y(p)
105- let H = (B(p, A) + 1)
106- if ((toBase58String(sha256(toBytes((A + G)))) != s(p, r)))
107- then throw("reveal data is not valid")
108- else if ((a > u(p)))
109- then throw("max number of voters hasn't reached yet")
110- else if ((w(p, r) != g))
111- then throw("user has already participated")
112- else if (if ((F != c))
113- then (F != d)
114- else false)
115- then throw("wrong status")
116- else if (if ((A != e))
117- then (A != f)
118- else false)
119- then throw("vote has finished")
120- else [StringEntry(v(p, r), A), IntegerEntry(z(p, A), H), StringEntry(x(p), if ((H >= b))
121- then A
122- else d)]
77+@Callable(x)
78+func purchase (j) = {
79+ let B = x.payments[0]
80+ if (isDefined(B.assetId))
81+ then throw("WAVES token only at the moment")
82+ else {
83+ let C = toBase58String(x.caller.bytes)
84+ let y = k(j)
85+ let D = t(j)
86+ if ((y > B.amount))
87+ then throw("purchase amunt cannot be less than item price")
88+ else if ((B.amount > y))
89+ then throw("purchase amount cannot be higher than item price")
90+ else if ((D == a))
91+ then throw("Supplier address doesn't exist")
92+ else [IntegerEntry(l(C, j), (n(C, j) + 1)), IntegerEntry(u(D), (w(D) + B.amount))]
93+ }
94+ }
95+
96+
97+
98+@Callable(x)
99+func withdraw () = {
100+ let A = toBase58String(x.caller.bytes)
101+ let E = w(A)
102+ if ((0 >= E))
103+ then throw("za mało środków")
104+ else [IntegerEntry(u(A), 0), ScriptTransfer(addressFromStringValue(A), E, unit)]
123105 }
124106
125107

github/deemru/w8io/169f3d6 
52.73 ms