tx · 7dpQohikeytHToqGfya1WuKhCNdUMzsbazjFmmeFVDQo

3MvgxS9JmLvNSyx4dJr6Zfke3Siz5p92gao:  -0.01400000 Waves

2019.09.06 00:02 [663250] smart account 3MvgxS9JmLvNSyx4dJr6Zfke3Siz5p92gao > SELF 0.00000000 Waves

{ "type": 13, "id": "7dpQohikeytHToqGfya1WuKhCNdUMzsbazjFmmeFVDQo", "fee": 1400000, "feeAssetId": null, "timestamp": 1567717392252, "version": 1, "sender": "3MvgxS9JmLvNSyx4dJr6Zfke3Siz5p92gao", "senderPublicKey": "DtnvSHiYQnjG4si66eUE3pTReZAnukP13TFUr4QtsJBc", "proofs": [ "5AVswJ8vo7pzvL99nvWqsqeb2UajndQtCc7qAJgMiAJiaY9pehALgm6txzgmJ6K5KsVLJTANEEd4Q7tG1V4USBYg" ], "script": "base64:AAIDAAAAAAAAAAAAAAAdAAAAAAROT05FAgAAAARub25lAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAA251bQEAAAALZ2V0U3RyQnlLZXkAAAABAAAAA2tleQQAAAADc3RyBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FBQAAAANzdHIBAAAAD2dldEtleUl0ZW1QcmljZQAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdGVtAgAAAAZfcHJpY2UBAAAAEWdldFZhbHVlSXRlbVByaWNlAAAAAQAAAARpdGVtCQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABCQEAAAAPZ2V0S2V5SXRlbVByaWNlAAAAAQUA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AAOZ2V0VmFsdWVDb21taXQAAAACBQAAAARpdGVtBQAAAAR1c2VyBQAAAAROT05FCQAAAgAAAAECAAAAHXVzZXIgaGFzIGFscmVhZHkgcGFydGljaXBhdGVkAwkBAAAAAiE9AAAAAgkBAAAAEmdldEtleUl0ZW1TdXBwbGllcgAAAAEFAAAABGl0ZW0FAAAABE5PTkUJAAACAAAAAQIAAAATaXRlbSBkb2VzIG5vdCBleGlzdAMDCQEAAAACIT0AAAACBQAAAAZzdGF0dXMFAAAABE5PTkUJAQAAAAIhPQAAAAIFAAAABnN0YXR1cwUAAAAGVk9USU5HBwkAAAIAAAABAgAAABZ2b3RpbmcgaXMgbm90IHBvc3NpYmxlCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAMZ2V0S2V5Q29tbWl0AAAAAgUAAAAEaXRlbQUAAAAEdXNlcgUAAAAEaGFzaAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEmdldEtleUNvbW1pdHNDb3VudAAAAAEFAAAABGl0ZW0JAABkAAAAAgUAAAAHY29tbWl0cwAAAAAAAAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEGdldEtleUl0ZW1TdGF0dXMAAAABBQAAAARpdGVtAwkAAAAAAAACBQAAAAdjb21taXRzBQAAAAZWT1RFUlMFAAAABlJFVkVBTAUAAAAGVk9USU5HBQAAAANuaWwAAAAAXZhyCw==", "chainId": 84, "height": 663250, "spentComplexity": 0 } View: original | compacted Prev: 2YSobKaHcmoGWQESPFqZ5DjuTZgUPsuzCJSQqFHEwyCG Next: 63zUuC8xskeSjxiy9s8cawR4tHhawpcMQm7hF2pbbLvD Diff:
OldNewDifferences
6161 func w (v) = b(u(v))
6262
6363
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))
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+@Callable(O)
107+func addItem (q,P,Q) = {
108+ let R = toBase58String(O.caller.bytes)
109+ let j = o(R, q)
110+ if ((0 >= P))
69111 then throw("purchase amount cannot be less than price")
70112 else if ((t(j) != a))
71113 then throw("item already exists")
72- else WriteSet([DataEntry(s(j), A), DataEntry(i(j), y), DataEntry(r(j), z)])
114+ else WriteSet([DataEntry(s(j), R), DataEntry(i(j), P), DataEntry(r(j), Q)])
73115 }
74116
75117
76118
77-@Callable(x)
119+@Callable(O)
78120 func purchase (j) = {
79- let B = extract(x.payment)
80- if (isDefined(B.assetId))
121+ let S = extract(O.payment)
122+ if (isDefined(S.assetId))
81123 then throw("Waves token only at the moment")
82124 else {
83- let C = toBase58String(x.caller.bytes)
84- let y = k(j)
85- let A = t(j)
86- if ((y > B.amount))
125+ let T = toBase58String(O.caller.bytes)
126+ let P = k(j)
127+ let R = t(j)
128+ if ((P > S.amount))
87129 then throw("purchase cannot be less than item price")
88- else if ((B.amount > y))
130+ else if ((S.amount > P))
89131 then throw("purchase cannot be higher than item price")
90- else if ((A == a))
132+ else if ((R == a))
91133 then throw("supplier does not exists")
92- else WriteSet([DataEntry(l(C, j), (n(C, j) + 1)), DataEntry(u(A), (w(A) + B.amount))])
134+ else WriteSet([DataEntry(l(T, j), (n(T, j) + 1)), DataEntry(u(R), (w(R) + S.amount))])
93135 }
94136 }
95137
96138
97139
98-@Callable(x)
140+@Callable(O)
99141 func withdraw () = {
100- let A = toBase58String(x.caller.bytes)
101- let D = w(A)
102- if ((0 >= D))
142+ let R = toBase58String(O.caller.bytes)
143+ let U = w(R)
144+ if ((0 >= U))
103145 then throw("bad balance")
104- else ScriptResult(WriteSet([DataEntry(u(A), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(A), D, unit)]))
146+ else ScriptResult(WriteSet([DataEntry(u(R), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(R), U, unit)]))
147+ }
148+
149+
150+
151+@Callable(O)
152+func voteCommit (j,V) = {
153+ let m = toBase58String(O.caller.bytes)
154+ let W = G(j)
155+ let X = K(j)
156+ if ((W > x))
157+ then throw("reached max num of voters")
158+ else if ((E(j, m) != a))
159+ then throw("user has already participated")
160+ else if ((s(j) != a))
161+ then throw("item does not exist")
162+ else if (if ((X != a))
163+ then (X != z)
164+ else false)
165+ then throw("voting is not possible")
166+ else WriteSet([DataEntry(D(j, m), V), DataEntry(F(j), (W + 1)), DataEntry(J(j), if ((W == x))
167+ then A
168+ else z)])
105169 }
106170
107171
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
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
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))
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+@Callable(O)
107+func addItem (q,P,Q) = {
108+ let R = toBase58String(O.caller.bytes)
109+ let j = o(R, q)
110+ if ((0 >= P))
69111 then throw("purchase amount cannot be less than price")
70112 else if ((t(j) != a))
71113 then throw("item already exists")
72- else WriteSet([DataEntry(s(j), A), DataEntry(i(j), y), DataEntry(r(j), z)])
114+ else WriteSet([DataEntry(s(j), R), DataEntry(i(j), P), DataEntry(r(j), Q)])
73115 }
74116
75117
76118
77-@Callable(x)
119+@Callable(O)
78120 func purchase (j) = {
79- let B = extract(x.payment)
80- if (isDefined(B.assetId))
121+ let S = extract(O.payment)
122+ if (isDefined(S.assetId))
81123 then throw("Waves token only at the moment")
82124 else {
83- let C = toBase58String(x.caller.bytes)
84- let y = k(j)
85- let A = t(j)
86- if ((y > B.amount))
125+ let T = toBase58String(O.caller.bytes)
126+ let P = k(j)
127+ let R = t(j)
128+ if ((P > S.amount))
87129 then throw("purchase cannot be less than item price")
88- else if ((B.amount > y))
130+ else if ((S.amount > P))
89131 then throw("purchase cannot be higher than item price")
90- else if ((A == a))
132+ else if ((R == a))
91133 then throw("supplier does not exists")
92- else WriteSet([DataEntry(l(C, j), (n(C, j) + 1)), DataEntry(u(A), (w(A) + B.amount))])
134+ else WriteSet([DataEntry(l(T, j), (n(T, j) + 1)), DataEntry(u(R), (w(R) + S.amount))])
93135 }
94136 }
95137
96138
97139
98-@Callable(x)
140+@Callable(O)
99141 func withdraw () = {
100- let A = toBase58String(x.caller.bytes)
101- let D = w(A)
102- if ((0 >= D))
142+ let R = toBase58String(O.caller.bytes)
143+ let U = w(R)
144+ if ((0 >= U))
103145 then throw("bad balance")
104- else ScriptResult(WriteSet([DataEntry(u(A), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(A), D, unit)]))
146+ else ScriptResult(WriteSet([DataEntry(u(R), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(R), U, unit)]))
147+ }
148+
149+
150+
151+@Callable(O)
152+func voteCommit (j,V) = {
153+ let m = toBase58String(O.caller.bytes)
154+ let W = G(j)
155+ let X = K(j)
156+ if ((W > x))
157+ then throw("reached max num of voters")
158+ else if ((E(j, m) != a))
159+ then throw("user has already participated")
160+ else if ((s(j) != a))
161+ then throw("item does not exist")
162+ else if (if ((X != a))
163+ then (X != z)
164+ else false)
165+ then throw("voting is not possible")
166+ else WriteSet([DataEntry(D(j, m), V), DataEntry(F(j), (W + 1)), DataEntry(J(j), if ((W == x))
167+ then A
168+ else z)])
105169 }
106170
107171

github/deemru/w8io/169f3d6 
42.53 ms