tx · 4CjRN7imG9WC5doaVq3ZMiJGGHKcUTHEqNNRyp5Ve5yY

3MpjwMAGCaNqNFRa34foE5sTfV6zb76bYja:  -0.01000010 Waves

2021.07.07 15:29 [1603182] smart account 3MpjwMAGCaNqNFRa34foE5sTfV6zb76bYja > SELF 0.00000000 Waves

{ "type": 13, "id": "4CjRN7imG9WC5doaVq3ZMiJGGHKcUTHEqNNRyp5Ve5yY", "fee": 1000010, "feeAssetId": null, "timestamp": 1625661046850, "version": 2, "chainId": 84, "sender": "3MpjwMAGCaNqNFRa34foE5sTfV6zb76bYja", "senderPublicKey": "7Cy4wXHvgCRHP6MMhu9tTdayLHr9P9Dc342DVcCoCPzm", "proofs": [ "3WNPHeA4qjdTuydoUt7RfjyNkDmDPHLsAXe2ruZNqq9Wx7M3TBiZJjEn3TCf3ZEEy9SrS7bJdrfTaouGBbw1Ex7k" ], "script": "base64:AAIFAAAAAAAAAkQIAhIFCgMIAQgSAwoBCBIAGgoKAmExEgROT05FGhQKAmEyEg5nZXROdW1iZXJCeUtleRoJCgJhMxIDa2V5GgkKAmE0EgNudW0aDQoCYTUSByRtYXRjaDAaBwoCYTYSAWEaEQoCYTcSC2dldFN0ckJ5S2V5GgkKAmE4EgNzdHIaFQoCYTkSD2dldEtleUl0ZW1QcmljZRoKCgJiMRIEaXRlbRoXCgJiMhIRZ2V0VmFsdWVJdGVtUHJpY2UaGwoCYjMSFWdldEtleVVzZXJJdGVtQ291bnRlchoKCgJiNBIEdXNlchodCgJiNRIXZ2V0VmFsdWVVc2VySXRlbUNvdW50ZXIaEAoCYjYSCmdldEtleUl0ZW0aDgoCYjcSCHN1cHBsaWVyGgsKAmI4EgV0aXRsZRoUCgJiORIOZ2V0S2V5SXRlbURhdGEaGAoCYzESEmdldEtleUl0ZW1TdXBwbGllchoaCgJjMhIUZ2V0VmFsdWVJdGVtU3VwcGxpZXIaGwoCYzMSFWdldEtleUJhbGFuY2VTdXBwbGllchoNCgJjNBIHYWNjb3VudBodCgJjN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182, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: DwFK241mEgQAXuVhGhBdwJkQdwmeZ1X8F3iTQ4RvM2uu Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# 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+ }
18+
19+
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+ }
32+
33+
34+func i (j) = (j + "_price")
35+
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 + "_data")
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+@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)]
73+ }
74+
75+
76+
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)]
105+ }
106+
107+

github/deemru/w8io/169f3d6 
20.45 ms