tx · Nb3WLdAAc8RKfQbSMgv9L4PvonrX6DqZRYWqfuoa4Za

3NC8pQxcnDTtDkhzv5Eje8qqW4qoFawLnAb:  -0.01400000 Waves

2019.09.17 19:22 [680479] smart account 3NC8pQxcnDTtDkhzv5Eje8qqW4qoFawLnAb > SELF 0.00000000 Waves

{ "type": 13, "id": "Nb3WLdAAc8RKfQbSMgv9L4PvonrX6DqZRYWqfuoa4Za", "fee": 1400000, "feeAssetId": null, "timestamp": 1568737409438, "version": 1, "sender": "3NC8pQxcnDTtDkhzv5Eje8qqW4qoFawLnAb", "senderPublicKey": "5vyi92HdgdTabKCQzDHGrgQ4ASjtoT3XrCUXr459sWuc", "proofs": [ "2PWRTZJzpoavWbW78YewpuNpPmS2znidKDLS7Q28Fu1sFmx56pvF6KnRr2T3CeToZmVdTEhiZpW4xJkoCPSmPQZy" ], "script": "base64:AAIDAAAAAAAAAAAAAAAhAAAAAAROT05FAgAAAAABAAAAGGdldE51bWJlckJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAdhZGRyZXNzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJ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dmVsZXQEAAAABnN0YXR1cwMJAABnAAAAAgUAAAAKYm9uZEFtb3VudAUAAAAGYW1vdW50BQAAAAZGSUxMRUQFAAAAA05FVwkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAADE9yZGVyQm9va0tleQUAAAAMbmV3T3JkZXJib29rCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAAE09yZGVyRmlsbGVkVG90YWxLZXkFAAAAB29yZGVySWQJAABkAAAAAgUAAAALZmlsbGVkVG90YWwFAAAABXRvdGFsCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAADk9yZGVyU3RhdHVzS2V5BQAAAAdvcmRlcklkBQAAAAZzdGF0dXMFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADGZpbGxlZEFtb3VudAUAAAALQm9uZEFzc2V0SWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAABBOZXV0cmlub0NvbnRyYWN0BQAAAAV0b3RhbAUAAAAPTmV1dHJpbm9Bc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAQTmV1dHJpbm9Db250cmFjdAUAAAAMcmV0dXJuQW1vdW50BQAAAAtCb25kQXNzZXRJZAUAAAADbmlsAAAAAHBy8Lo=", "chainId": 84, "height": 680479, "spentComplexity": 0 } View: original | compacted Prev: DQxUA9jm9ei3KYFpc27xxhf914MdFvspmiSPiXYQxcA9 Next: 9p8rK9fSo8KhiUtqrKBd1YovogPPdebqgUthqcqjwjrS Diff:
OldNewDifferences
5858
5959 let s = "neutrino_contract"
6060
61-let t = "neutrino_supply"
61+let t = h(i)
6262
63-let u = "waves_reserve"
64-
65-let v = h(i)
66-
67-func w (x) = g((j + x))
63+func u (v) = g((j + v))
6864
6965
70-func y (x) = g((k + x))
66+func w (v) = g((k + v))
7167
7268
73-func z (x) = h((m + x))
69+func x (v) = h((m + v))
7470
7571
76-func A (x) = h((o + x))
72+func y (v) = h((o + v))
7773
7874
79-func B (x) = g((l + x))
75+func z (v) = g((l + v))
8076
8177
82-let C = h(s)
78+let A = fromBase58String(h(r))
8379
84-let D = b(C, u)
80+let B = h(s)
8581
86-let E = b(C, t)
82+let C = wavesBalance(addressFromStringValue(B))
8783
88-let F = b(C, p)
84+let D = {
85+ let E = extract(assetInfo(A))
86+ (E.quantity - assetBalance(addressFromStringValue(B), A))
87+ }
88+
89+let F = b(B, p)
8990
9091 let G = "_"
9192
9293 let H = fromBase58String(h(q))
9394
94-let I = fromBase58String(h(r))
95+let I = 100000000
9596
96-let J = 100000000
97+let J = "canceled"
9798
98-let K = "canceled"
99+let K = "new"
99100
100-let L = "new"
101+let L = "filled"
101102
102-let M = "filled"
103-
104-func N (O,P) = {
105- let Q = split(v, G)
106- let R = (O + G)
107- if ((P == 0))
108- then (R + v)
109- else if ((P >= (size(Q) - 1)))
110- then (v + R)
103+func M (N,O) = {
104+ let P = split(t, G)
105+ let Q = (N + G)
106+ if ((O == 0))
107+ then (Q + t)
108+ else if ((O >= (size(P) - 1)))
109+ then (t + Q)
111110 else {
112- let S = split(v, (Q[P] + G))
113- (((S[0] + R) + (Q[P] + G)) + S[1])
111+ let R = split(t, (P[O] + G))
112+ (((R[0] + Q) + (P[O] + G)) + R[1])
114113 }
115114 }
116115
117116
118-@Callable(T)
119-func setOrder (F,P) = {
120- let U = extract(T.payment)
121- let V = toBase58String(keccak256((((toBytes(F) + toBytes(U.amount)) + T.caller.bytes) + toBytes(height))))
122- if ((U.assetId != I))
117+@Callable(S)
118+func setOrder (F,O) = {
119+ let T = extract(S.payment)
120+ let U = toBase58String(keccak256((((toBytes(F) + toBytes(T.amount)) + S.caller.bytes) + toBytes(height))))
121+ if ((T.assetId != A))
123122 then throw("can use neutrino only")
124123 else if ((0 >= F))
125124 then throw("price less zero")
126- else if ((z(V) != a))
125+ else if ((x(U) != a))
127126 then throw("order exists")
128127 else {
129- let Q = split(v, G)
130- let W = if ((P == 0))
128+ let P = split(t, G)
129+ let V = if ((O == 0))
131130 then ""
132- else Q[(P - 1)]
133- let X = w(W)
134- let Y = if (if ((W != ""))
135- then (F > X)
131+ else P[(O - 1)]
132+ let W = u(V)
133+ let X = if (if ((V != ""))
134+ then (F > W)
136135 else false)
137136 then true
138137 else false
139- let Z = Q[P]
140- let aa = w(Z)
141- let ab = if ((aa >= F))
138+ let Y = P[O]
139+ let Z = u(Y)
140+ let aa = if ((Z >= F))
142141 then true
143142 else false
144- if (if (Y)
143+ if (if (X)
145144 then true
146- else ab)
147- then throw(((("invalid order isPrevOrderError:" + toString(ab)) + " isNextOrderError:") + toString(Y)))
148- else WriteSet([DataEntry(i, N(V, P)), DataEntry((j + V), F), DataEntry((k + V), U.amount), DataEntry((m + V), toString(T.caller)), DataEntry((n + V), height), DataEntry((o + V), L)])
145+ else aa)
146+ then throw(((("invalid order isPrevOrderError:" + toString(aa)) + " isNextOrderError:") + toString(X)))
147+ else WriteSet([DataEntry(i, M(U, O)), DataEntry((j + U), F), DataEntry((k + U), T.amount), DataEntry((m + U), toString(S.caller)), DataEntry((n + U), height), DataEntry((o + U), K)])
149148 }
150149 }
151150
152151
153152
154-@Callable(T)
155-func cancelOrder (O) = {
156- let ac = z(O)
157- let ad = (y(O) - B(O))
158- if ((ac != toString(T.caller)))
153+@Callable(S)
154+func cancelOrder (N) = {
155+ let ab = x(N)
156+ let ac = (w(N) - z(N))
157+ if ((ab != toString(S.caller)))
159158 then throw("permission denied")
160159 else {
161- let S = split(v, (O + G))
162- ScriptResult(WriteSet([DataEntry(i, (S[0] + S[1])), DataEntry((o + O), K)]), TransferSet([ScriptTransfer(T.caller, ad, I)]))
160+ let R = split(t, (N + G))
161+ ScriptResult(WriteSet([DataEntry(i, (R[0] + R[1])), DataEntry((o + N), J)]), TransferSet([ScriptTransfer(S.caller, ac, A)]))
163162 }
164163 }
165164
166165
167166
168-@Callable(T)
167+@Callable(S)
169168 func executeOrder () = {
170- let ae = assetBalance(this, H)
171- let af = ((E - ((D * F) / 100)) / J)
172- let ag = if ((af >= ae))
173- then ae
174- else af
175- let ah = if ((af >= ae))
169+ let ad = assetBalance(this, H)
170+ let ae = ((D - ((C * F) / 100)) / I)
171+ let af = if ((ae >= ad))
172+ then ad
173+ else ae
174+ let ag = if ((ae >= ad))
176175 then 0
177- else (ae - af)
178- if ((ag == 0))
179- then TransferSet([ScriptTransfer(addressFromStringValue(C), ah, H)])
176+ else (ad - ae)
177+ if ((af == 0))
178+ then TransferSet([ScriptTransfer(addressFromStringValue(B), ag, H)])
180179 else {
181- let O = split(v, G)[0]
182- let ai = B(O)
183- let aj = y(O)
184- let ak = w(O)
185- let ad = ((((aj - ai) * 100) / ak) / J)
186- let al = if ((ag >= ad))
187- then split(v, (O + G))[1]
188- else v
189- let am = if ((ag >= ad))
190- then ad
191- else ag
192- let an = (((am * ak) / 100) * J)
193- let ao = if ((ag >= ad))
194- then M
195- else L
196- ScriptResult(WriteSet([DataEntry(i, al), DataEntry((l + O), (ai + an)), DataEntry((o + O), ao)]), TransferSet([ScriptTransfer(T.caller, am, H), ScriptTransfer(addressFromStringValue(C), an, I), ScriptTransfer(addressFromStringValue(C), ah, H)]))
180+ let N = split(t, G)[0]
181+ let ah = z(N)
182+ let ai = w(N)
183+ let aj = u(N)
184+ let ac = ((((ai - ah) * 100) / aj) / I)
185+ let ak = if ((af >= ac))
186+ then split(t, (N + G))[1]
187+ else t
188+ let al = if ((af >= ac))
189+ then ac
190+ else af
191+ let am = (((al * aj) / 100) * I)
192+ let an = if ((af >= ac))
193+ then L
194+ else K
195+ ScriptResult(WriteSet([DataEntry(i, ak), DataEntry((l + N), (ah + am)), DataEntry((o + N), an)]), TransferSet([ScriptTransfer(S.caller, al, H), ScriptTransfer(addressFromStringValue(B), am, A), ScriptTransfer(addressFromStringValue(B), ag, H)]))
197196 }
198197 }
199198
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = ""
55
66 func b (c,d) = {
77 let e = getInteger(addressFromStringValue(c), d)
88 if ($isInstanceOf(e, "Int"))
99 then {
1010 let f = e
1111 f
1212 }
1313 else 0
1414 }
1515
1616
1717 func g (d) = {
1818 let e = getInteger(this, d)
1919 if ($isInstanceOf(e, "Int"))
2020 then {
2121 let f = e
2222 f
2323 }
2424 else 0
2525 }
2626
2727
2828 func h (d) = {
2929 let e = getString(this, d)
3030 if ($isInstanceOf(e, "String"))
3131 then {
3232 let f = e
3333 f
3434 }
3535 else a
3636 }
3737
3838
3939 let i = "orderbook"
4040
4141 let j = "order_price_"
4242
4343 let k = "order_total_"
4444
4545 let l = "order_filled_total_"
4646
4747 let m = "order_owner_"
4848
4949 let n = "order_height_"
5050
5151 let o = "order_status_"
5252
5353 let p = "price"
5454
5555 let q = "bond_asset_id"
5656
5757 let r = "neutrino_asset_id"
5858
5959 let s = "neutrino_contract"
6060
61-let t = "neutrino_supply"
61+let t = h(i)
6262
63-let u = "waves_reserve"
64-
65-let v = h(i)
66-
67-func w (x) = g((j + x))
63+func u (v) = g((j + v))
6864
6965
70-func y (x) = g((k + x))
66+func w (v) = g((k + v))
7167
7268
73-func z (x) = h((m + x))
69+func x (v) = h((m + v))
7470
7571
76-func A (x) = h((o + x))
72+func y (v) = h((o + v))
7773
7874
79-func B (x) = g((l + x))
75+func z (v) = g((l + v))
8076
8177
82-let C = h(s)
78+let A = fromBase58String(h(r))
8379
84-let D = b(C, u)
80+let B = h(s)
8581
86-let E = b(C, t)
82+let C = wavesBalance(addressFromStringValue(B))
8783
88-let F = b(C, p)
84+let D = {
85+ let E = extract(assetInfo(A))
86+ (E.quantity - assetBalance(addressFromStringValue(B), A))
87+ }
88+
89+let F = b(B, p)
8990
9091 let G = "_"
9192
9293 let H = fromBase58String(h(q))
9394
94-let I = fromBase58String(h(r))
95+let I = 100000000
9596
96-let J = 100000000
97+let J = "canceled"
9798
98-let K = "canceled"
99+let K = "new"
99100
100-let L = "new"
101+let L = "filled"
101102
102-let M = "filled"
103-
104-func N (O,P) = {
105- let Q = split(v, G)
106- let R = (O + G)
107- if ((P == 0))
108- then (R + v)
109- else if ((P >= (size(Q) - 1)))
110- then (v + R)
103+func M (N,O) = {
104+ let P = split(t, G)
105+ let Q = (N + G)
106+ if ((O == 0))
107+ then (Q + t)
108+ else if ((O >= (size(P) - 1)))
109+ then (t + Q)
111110 else {
112- let S = split(v, (Q[P] + G))
113- (((S[0] + R) + (Q[P] + G)) + S[1])
111+ let R = split(t, (P[O] + G))
112+ (((R[0] + Q) + (P[O] + G)) + R[1])
114113 }
115114 }
116115
117116
118-@Callable(T)
119-func setOrder (F,P) = {
120- let U = extract(T.payment)
121- let V = toBase58String(keccak256((((toBytes(F) + toBytes(U.amount)) + T.caller.bytes) + toBytes(height))))
122- if ((U.assetId != I))
117+@Callable(S)
118+func setOrder (F,O) = {
119+ let T = extract(S.payment)
120+ let U = toBase58String(keccak256((((toBytes(F) + toBytes(T.amount)) + S.caller.bytes) + toBytes(height))))
121+ if ((T.assetId != A))
123122 then throw("can use neutrino only")
124123 else if ((0 >= F))
125124 then throw("price less zero")
126- else if ((z(V) != a))
125+ else if ((x(U) != a))
127126 then throw("order exists")
128127 else {
129- let Q = split(v, G)
130- let W = if ((P == 0))
128+ let P = split(t, G)
129+ let V = if ((O == 0))
131130 then ""
132- else Q[(P - 1)]
133- let X = w(W)
134- let Y = if (if ((W != ""))
135- then (F > X)
131+ else P[(O - 1)]
132+ let W = u(V)
133+ let X = if (if ((V != ""))
134+ then (F > W)
136135 else false)
137136 then true
138137 else false
139- let Z = Q[P]
140- let aa = w(Z)
141- let ab = if ((aa >= F))
138+ let Y = P[O]
139+ let Z = u(Y)
140+ let aa = if ((Z >= F))
142141 then true
143142 else false
144- if (if (Y)
143+ if (if (X)
145144 then true
146- else ab)
147- then throw(((("invalid order isPrevOrderError:" + toString(ab)) + " isNextOrderError:") + toString(Y)))
148- else WriteSet([DataEntry(i, N(V, P)), DataEntry((j + V), F), DataEntry((k + V), U.amount), DataEntry((m + V), toString(T.caller)), DataEntry((n + V), height), DataEntry((o + V), L)])
145+ else aa)
146+ then throw(((("invalid order isPrevOrderError:" + toString(aa)) + " isNextOrderError:") + toString(X)))
147+ else WriteSet([DataEntry(i, M(U, O)), DataEntry((j + U), F), DataEntry((k + U), T.amount), DataEntry((m + U), toString(S.caller)), DataEntry((n + U), height), DataEntry((o + U), K)])
149148 }
150149 }
151150
152151
153152
154-@Callable(T)
155-func cancelOrder (O) = {
156- let ac = z(O)
157- let ad = (y(O) - B(O))
158- if ((ac != toString(T.caller)))
153+@Callable(S)
154+func cancelOrder (N) = {
155+ let ab = x(N)
156+ let ac = (w(N) - z(N))
157+ if ((ab != toString(S.caller)))
159158 then throw("permission denied")
160159 else {
161- let S = split(v, (O + G))
162- ScriptResult(WriteSet([DataEntry(i, (S[0] + S[1])), DataEntry((o + O), K)]), TransferSet([ScriptTransfer(T.caller, ad, I)]))
160+ let R = split(t, (N + G))
161+ ScriptResult(WriteSet([DataEntry(i, (R[0] + R[1])), DataEntry((o + N), J)]), TransferSet([ScriptTransfer(S.caller, ac, A)]))
163162 }
164163 }
165164
166165
167166
168-@Callable(T)
167+@Callable(S)
169168 func executeOrder () = {
170- let ae = assetBalance(this, H)
171- let af = ((E - ((D * F) / 100)) / J)
172- let ag = if ((af >= ae))
173- then ae
174- else af
175- let ah = if ((af >= ae))
169+ let ad = assetBalance(this, H)
170+ let ae = ((D - ((C * F) / 100)) / I)
171+ let af = if ((ae >= ad))
172+ then ad
173+ else ae
174+ let ag = if ((ae >= ad))
176175 then 0
177- else (ae - af)
178- if ((ag == 0))
179- then TransferSet([ScriptTransfer(addressFromStringValue(C), ah, H)])
176+ else (ad - ae)
177+ if ((af == 0))
178+ then TransferSet([ScriptTransfer(addressFromStringValue(B), ag, H)])
180179 else {
181- let O = split(v, G)[0]
182- let ai = B(O)
183- let aj = y(O)
184- let ak = w(O)
185- let ad = ((((aj - ai) * 100) / ak) / J)
186- let al = if ((ag >= ad))
187- then split(v, (O + G))[1]
188- else v
189- let am = if ((ag >= ad))
190- then ad
191- else ag
192- let an = (((am * ak) / 100) * J)
193- let ao = if ((ag >= ad))
194- then M
195- else L
196- ScriptResult(WriteSet([DataEntry(i, al), DataEntry((l + O), (ai + an)), DataEntry((o + O), ao)]), TransferSet([ScriptTransfer(T.caller, am, H), ScriptTransfer(addressFromStringValue(C), an, I), ScriptTransfer(addressFromStringValue(C), ah, H)]))
180+ let N = split(t, G)[0]
181+ let ah = z(N)
182+ let ai = w(N)
183+ let aj = u(N)
184+ let ac = ((((ai - ah) * 100) / aj) / I)
185+ let ak = if ((af >= ac))
186+ then split(t, (N + G))[1]
187+ else t
188+ let al = if ((af >= ac))
189+ then ac
190+ else af
191+ let am = (((al * aj) / 100) * I)
192+ let an = if ((af >= ac))
193+ then L
194+ else K
195+ ScriptResult(WriteSet([DataEntry(i, ak), DataEntry((l + N), (ah + am)), DataEntry((o + N), an)]), TransferSet([ScriptTransfer(S.caller, al, H), ScriptTransfer(addressFromStringValue(B), am, A), ScriptTransfer(addressFromStringValue(B), ag, H)]))
197196 }
198197 }
199198
200199

github/deemru/w8io/169f3d6 
77.12 ms