tx · A112PUstuUFk6AZBXzvqiAPqYjPdJdosZ63qvimexPF7

3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR:  -0.01400000 Waves

2019.07.14 04:09 [584737] smart account 3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR > SELF 0.00000000 Waves

{ "type": 13, "id": "A112PUstuUFk6AZBXzvqiAPqYjPdJdosZ63qvimexPF7", "fee": 1400000, "feeAssetId": null, "timestamp": 1563066654089, "version": 1, "sender": "3N7MT5t1Gmyb9tcpdoUrd47pxXtTkAcgLsR", "senderPublicKey": "Adn8NfJZ8ZXuWNMXb9VaY6X6kh6k6G3KMb1WQUesFUV", "proofs": [ "JDgqSGAEK9pb78gN1cDhPZHGSf2uWPYpp5jx6GaU3WuSA4hAYnjqvhLgCHW5uautyUzptmkiD1SPSXsde9RS6H5" ], "script": "base64:AAIDAAAAAAAAAAAAAAAeAAAAAA5vd25lclB1YmxpY0tleQEAAAAgAnfP9tCFuj2k2BUY5PW9DVGxrCHBHKJwugv8WyiaGXIAAAAABE5PTkUCAAAABG5vbmUAAAAABlZPVEVSUwAAAAAAAAAAAwAAAAAGUVVPUlVNAAAAAAAAAAACAAAAAAZWT1RJTkcCAAAABnZvdGluZwAAAAAGUkVWRUFMAgAAAAZyZXZlYWwAAAAACEZFQVRVUkVEAgAAAAhmZWF0dXJlZAAAAAAIREVMSVNURUQCAAAACGRlbGlzdGVkAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1h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cm9vZnMAAAAAAAAAAAAFAAAADm93bmVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgeYrMVo", "chainId": 84, "height": 584737, "spentComplexity": 0 } View: original | compacted Prev: 894iPjxFqLcpYsmtd9R8mtGehzij8DQbRaKRQFUjnSr2 Next: GYnxM71YvMp6wtjcJX9KgVWNT4jdQUBBf6zVSZ5XRAsT Diff:
OldNewDifferences
55
66 let b = "none"
77
8-func c (d) = {
9- let e = {
10- let f = getInteger(this, d)
11- if ($isInstanceOf(f, "Int"))
8+let c = 3
9+
10+let d = 2
11+
12+let e = "voting"
13+
14+let f = "reveal"
15+
16+let g = "featured"
17+
18+let h = "delisted"
19+
20+func i (j) = {
21+ let k = {
22+ let l = getInteger(this, j)
23+ if ($isInstanceOf(l, "Int"))
1224 then {
13- let g = f
14- g
25+ let m = l
26+ m
1527 }
1628 else 0
1729 }
18- e
30+ k
1931 }
2032
2133
22-func h (d) = {
23- let i = {
24- let f = getString(this, d)
25- if ($isInstanceOf(f, "String"))
34+func n (j) = {
35+ let o = {
36+ let l = getString(this, j)
37+ if ($isInstanceOf(l, "String"))
2638 then {
27- let g = f
28- g
39+ let m = l
40+ m
2941 }
3042 else b
3143 }
32- i
44+ o
3345 }
3446
3547
36-func j (k) = (k + "_price")
48+func p (q,r) = (((q + "_") + r) + "_commit")
3749
3850
39-func l (k) = c(j(k))
51+func s (q,r) = n(p(q, r))
4052
4153
42-func m (n,k) = (((k + "_") + n) + "_cnt")
54+func t (q) = (q + "_comcnt")
4355
4456
45-func o (n,k) = c(m(n, k))
57+func u (q) = i(t(q))
4658
4759
48-func p (q,r) = ("item_" + toBase58String(sha256(toBytes((q + r)))))
60+func v (q,r) = (((q + "_") + r) + "_reveal")
4961
5062
51-func s (k) = (k + "_data")
63+func w (q,r) = n(v(q, r))
5264
5365
54-func t (k) = (k + "_owner")
66+func x (q) = (q + "_status")
5567
5668
57-func u (k) = h(t(k))
69+func y (q) = n(x(q))
5870
5971
60-func v (w) = (w + "_balance")
72+func z (q,A) = ((q + "_res:") + A)
6173
6274
63-func x (w) = c(v(w))
75+func B (q,A) = i(z(q, A))
6476
6577
66-func y (k,n) = (((k + "_") + n) + "_commit")
78+func C (q) = (q + "_price")
6779
6880
69-func z (k,n) = h(y(k, n))
81+func D (q) = i(C(q))
7082
7183
72-func A (k) = (k + "_comcnt")
84+func E (r,q) = (((q + "_") + r) + "_cnt")
7385
7486
75-func B (k) = c(A(k))
87+func F (r,q) = i(E(r, q))
7688
7789
78-func C (k,n) = (((k + "_") + n) + "_reveal")
90+func G (H,I) = ("item_" + toBase58String(sha256(toBytes((H + I)))))
7991
8092
81-func D (k,n) = h(C(k, n))
93+func J (q) = (q + "_data")
8294
8395
84-func E (k) = (k + "_status")
96+func K (q) = (q + "_owner")
8597
8698
87-func F (k) = h(E(k))
99+func L (q) = n(K(q))
88100
89101
90-func G (k,H) = ((k + "_res:") + H)
102+func M (N) = (N + "_balance")
91103
92104
93-@Callable(I)
94-func purchase (k) = {
95- let J = extract(I.payment)
96- if (isDefined(J.assetId))
105+func O (N) = i(M(N))
106+
107+
108+@Callable(P)
109+func purchase (q) = {
110+ let Q = extract(P.payment)
111+ if (isDefined(Q.assetId))
97112 then throw("can use WAVES only at the moment")
98113 else {
99- let K = toBase58String(I.caller.bytes)
100- let L = l(k)
101- let M = u(k)
102- if ((L > J.amount))
114+ let R = toBase58String(P.caller.bytes)
115+ let S = D(q)
116+ let T = L(q)
117+ if ((S > Q.amount))
103118 then throw("purchase amount cannot be less than item price")
104- else if ((J.amount > L))
119+ else if ((Q.amount > S))
105120 then throw("purchase amount cannot be higher than item price")
106- else if ((M == b))
121+ else if ((T == b))
107122 then throw("supplier does not exist")
108- else WriteSet([DataEntry(m(K, k), (o(K, k) + 1)), DataEntry(v(M), (x(M) + J.amount))])
123+ else WriteSet([DataEntry(E(R, q), (F(R, q) + 1)), DataEntry(M(T), (O(T) + Q.amount))])
109124 }
110125 }
111126
112127
113128
114-@Callable(I)
129+@Callable(P)
115130 func withdraw () = {
116- let M = toBase58String(I.caller.bytes)
117- let N = x(M)
118- if ((0 >= N))
131+ let T = toBase58String(P.caller.bytes)
132+ let U = O(T)
133+ if ((0 >= U))
119134 then throw("insufficient balance")
120- else ScriptResult(WriteSet([DataEntry(v(M), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(M), N, unit)]))
135+ else ScriptResult(WriteSet([DataEntry(M(T), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(T), U, unit)]))
121136 }
122137
123138
124139
125-@Callable(I)
126-func addItem (r,L,O) = {
127- let M = toBase58String(I.caller.bytes)
128- let k = p(M, r)
129- if ((0 >= L))
140+@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))
130145 then throw("purchase amount cannot be less than item price")
131- else if ((u(k) != b))
146+ else if ((L(q) != b))
132147 then throw("an item is already exist")
133- else WriteSet([DataEntry(t(k), M), DataEntry(j(k), L), DataEntry(s(k), O)])
148+ else WriteSet([DataEntry(K(q), T), DataEntry(C(q), S), DataEntry(J(q), V)])
134149 }
135150
136151
137-@Verifier(P)
138-func Q () = {
139- let f = P
140- if ($isInstanceOf(f, "SetScriptTransaction"))
152+@Verifier(W)
153+func X () = {
154+ let l = W
155+ if ($isInstanceOf(l, "SetScriptTransaction"))
141156 then {
142- let R = f
143- sigVerify(P.bodyBytes, P.proofs[0], a)
157+ let Y = l
158+ sigVerify(W.bodyBytes, W.proofs[0], a)
144159 }
145- else if ($isInstanceOf(f, "DataTransaction"))
160+ else if ($isInstanceOf(l, "DataTransaction"))
146161 then {
147- let R = f
162+ let Y = l
148163 true
149164 }
150- else if ($isInstanceOf(f, "TransferTransaction"))
165+ else if ($isInstanceOf(l, "TransferTransaction"))
151166 then {
152- let R = f
167+ let Y = l
153168 true
154169 }
155170 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
8-func c (d) = {
9- let e = {
10- let f = getInteger(this, d)
11- if ($isInstanceOf(f, "Int"))
8+let c = 3
9+
10+let d = 2
11+
12+let e = "voting"
13+
14+let f = "reveal"
15+
16+let g = "featured"
17+
18+let h = "delisted"
19+
20+func i (j) = {
21+ let k = {
22+ let l = getInteger(this, j)
23+ if ($isInstanceOf(l, "Int"))
1224 then {
13- let g = f
14- g
25+ let m = l
26+ m
1527 }
1628 else 0
1729 }
18- e
30+ k
1931 }
2032
2133
22-func h (d) = {
23- let i = {
24- let f = getString(this, d)
25- if ($isInstanceOf(f, "String"))
34+func n (j) = {
35+ let o = {
36+ let l = getString(this, j)
37+ if ($isInstanceOf(l, "String"))
2638 then {
27- let g = f
28- g
39+ let m = l
40+ m
2941 }
3042 else b
3143 }
32- i
44+ o
3345 }
3446
3547
36-func j (k) = (k + "_price")
48+func p (q,r) = (((q + "_") + r) + "_commit")
3749
3850
39-func l (k) = c(j(k))
51+func s (q,r) = n(p(q, r))
4052
4153
42-func m (n,k) = (((k + "_") + n) + "_cnt")
54+func t (q) = (q + "_comcnt")
4355
4456
45-func o (n,k) = c(m(n, k))
57+func u (q) = i(t(q))
4658
4759
48-func p (q,r) = ("item_" + toBase58String(sha256(toBytes((q + r)))))
60+func v (q,r) = (((q + "_") + r) + "_reveal")
4961
5062
51-func s (k) = (k + "_data")
63+func w (q,r) = n(v(q, r))
5264
5365
54-func t (k) = (k + "_owner")
66+func x (q) = (q + "_status")
5567
5668
57-func u (k) = h(t(k))
69+func y (q) = n(x(q))
5870
5971
60-func v (w) = (w + "_balance")
72+func z (q,A) = ((q + "_res:") + A)
6173
6274
63-func x (w) = c(v(w))
75+func B (q,A) = i(z(q, A))
6476
6577
66-func y (k,n) = (((k + "_") + n) + "_commit")
78+func C (q) = (q + "_price")
6779
6880
69-func z (k,n) = h(y(k, n))
81+func D (q) = i(C(q))
7082
7183
72-func A (k) = (k + "_comcnt")
84+func E (r,q) = (((q + "_") + r) + "_cnt")
7385
7486
75-func B (k) = c(A(k))
87+func F (r,q) = i(E(r, q))
7688
7789
78-func C (k,n) = (((k + "_") + n) + "_reveal")
90+func G (H,I) = ("item_" + toBase58String(sha256(toBytes((H + I)))))
7991
8092
81-func D (k,n) = h(C(k, n))
93+func J (q) = (q + "_data")
8294
8395
84-func E (k) = (k + "_status")
96+func K (q) = (q + "_owner")
8597
8698
87-func F (k) = h(E(k))
99+func L (q) = n(K(q))
88100
89101
90-func G (k,H) = ((k + "_res:") + H)
102+func M (N) = (N + "_balance")
91103
92104
93-@Callable(I)
94-func purchase (k) = {
95- let J = extract(I.payment)
96- if (isDefined(J.assetId))
105+func O (N) = i(M(N))
106+
107+
108+@Callable(P)
109+func purchase (q) = {
110+ let Q = extract(P.payment)
111+ if (isDefined(Q.assetId))
97112 then throw("can use WAVES only at the moment")
98113 else {
99- let K = toBase58String(I.caller.bytes)
100- let L = l(k)
101- let M = u(k)
102- if ((L > J.amount))
114+ let R = toBase58String(P.caller.bytes)
115+ let S = D(q)
116+ let T = L(q)
117+ if ((S > Q.amount))
103118 then throw("purchase amount cannot be less than item price")
104- else if ((J.amount > L))
119+ else if ((Q.amount > S))
105120 then throw("purchase amount cannot be higher than item price")
106- else if ((M == b))
121+ else if ((T == b))
107122 then throw("supplier does not exist")
108- else WriteSet([DataEntry(m(K, k), (o(K, k) + 1)), DataEntry(v(M), (x(M) + J.amount))])
123+ else WriteSet([DataEntry(E(R, q), (F(R, q) + 1)), DataEntry(M(T), (O(T) + Q.amount))])
109124 }
110125 }
111126
112127
113128
114-@Callable(I)
129+@Callable(P)
115130 func withdraw () = {
116- let M = toBase58String(I.caller.bytes)
117- let N = x(M)
118- if ((0 >= N))
131+ let T = toBase58String(P.caller.bytes)
132+ let U = O(T)
133+ if ((0 >= U))
119134 then throw("insufficient balance")
120- else ScriptResult(WriteSet([DataEntry(v(M), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(M), N, unit)]))
135+ else ScriptResult(WriteSet([DataEntry(M(T), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(T), U, unit)]))
121136 }
122137
123138
124139
125-@Callable(I)
126-func addItem (r,L,O) = {
127- let M = toBase58String(I.caller.bytes)
128- let k = p(M, r)
129- if ((0 >= L))
140+@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))
130145 then throw("purchase amount cannot be less than item price")
131- else if ((u(k) != b))
146+ else if ((L(q) != b))
132147 then throw("an item is already exist")
133- else WriteSet([DataEntry(t(k), M), DataEntry(j(k), L), DataEntry(s(k), O)])
148+ else WriteSet([DataEntry(K(q), T), DataEntry(C(q), S), DataEntry(J(q), V)])
134149 }
135150
136151
137-@Verifier(P)
138-func Q () = {
139- let f = P
140- if ($isInstanceOf(f, "SetScriptTransaction"))
152+@Verifier(W)
153+func X () = {
154+ let l = W
155+ if ($isInstanceOf(l, "SetScriptTransaction"))
141156 then {
142- let R = f
143- sigVerify(P.bodyBytes, P.proofs[0], a)
157+ let Y = l
158+ sigVerify(W.bodyBytes, W.proofs[0], a)
144159 }
145- else if ($isInstanceOf(f, "DataTransaction"))
160+ else if ($isInstanceOf(l, "DataTransaction"))
146161 then {
147- let R = f
162+ let Y = l
148163 true
149164 }
150- else if ($isInstanceOf(f, "TransferTransaction"))
165+ else if ($isInstanceOf(l, "TransferTransaction"))
151166 then {
152- let R = f
167+ let Y = l
153168 true
154169 }
155170 else false
156171 }
157172

github/deemru/w8io/169f3d6 
98.27 ms