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:AAIDAAAAAAAAAAAAAAAhAAAAAAROT05FAgAAAAABAAAAGGdldE51bWJlckJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAdhZGRyZXNzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG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mVsZXQEAAAABnN0YXR1cwMJAABnAAAAAgUAAAAKYm9uZEFtb3VudAUAAAAGYW1vdW50BQAAAAZGSUxMRUQFAAAAA05FVwkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAADE9yZGVyQm9va0tleQUAAAAMbmV3T3JkZXJib29rCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAAE09yZGVyRmlsbGVkVG90YWxLZXkFAAAAB29yZGVySWQJAABkAAAAAgUAAAALZmlsbGVkVG90YWwFAAAABXRvdGFsCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAADk9yZGVyU3RhdHVzS2V5BQAAAAdvcmRlcklkBQAAAAZzdGF0dXMFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADGZpbGxlZEFtb3VudAUAAAALQm9uZEFzc2V0SWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAABBOZXV0cmlub0NvbnRyYWN0BQAAAAV0b3RhbAUAAAAPTmV1dHJpbm9Bc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAQTmV1dHJpbm9Db250cmFjdAUAAAAMcmV0dXJuQW1vdW50BQAAAAtCb25kQXNzZXRJZAUAAAADbmlsAAAAAHBy8Lo=", "chainId": 84, "height": 680479, "spentComplexity": 0 } View: original | compacted Prev: DQxUA9jm9ei3KYFpc27xxhf914MdFvspmiSPiXYQxcA9 Next: 9p8rK9fSo8KhiUtqrKBd1YovogPPdebqgUthqcqjwjrS Diff:
Old | New | Differences | |
---|---|---|---|
58 | 58 | ||
59 | 59 | let s = "neutrino_contract" | |
60 | 60 | ||
61 | - | let t = | |
61 | + | let t = h(i) | |
62 | 62 | ||
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)) | |
68 | 64 | ||
69 | 65 | ||
70 | - | func | |
66 | + | func w (v) = g((k + v)) | |
71 | 67 | ||
72 | 68 | ||
73 | - | func | |
69 | + | func x (v) = h((m + v)) | |
74 | 70 | ||
75 | 71 | ||
76 | - | func | |
72 | + | func y (v) = h((o + v)) | |
77 | 73 | ||
78 | 74 | ||
79 | - | func | |
75 | + | func z (v) = g((l + v)) | |
80 | 76 | ||
81 | 77 | ||
82 | - | let | |
78 | + | let A = fromBase58String(h(r)) | |
83 | 79 | ||
84 | - | let | |
80 | + | let B = h(s) | |
85 | 81 | ||
86 | - | let | |
82 | + | let C = wavesBalance(addressFromStringValue(B)) | |
87 | 83 | ||
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) | |
89 | 90 | ||
90 | 91 | let G = "_" | |
91 | 92 | ||
92 | 93 | let H = fromBase58String(h(q)) | |
93 | 94 | ||
94 | - | let I = | |
95 | + | let I = 100000000 | |
95 | 96 | ||
96 | - | let J = | |
97 | + | let J = "canceled" | |
97 | 98 | ||
98 | - | let K = " | |
99 | + | let K = "new" | |
99 | 100 | ||
100 | - | let L = " | |
101 | + | let L = "filled" | |
101 | 102 | ||
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) | |
111 | 110 | else { | |
112 | - | let | |
113 | - | ((( | |
111 | + | let R = split(t, (P[O] + G)) | |
112 | + | (((R[0] + Q) + (P[O] + G)) + R[1]) | |
114 | 113 | } | |
115 | 114 | } | |
116 | 115 | ||
117 | 116 | ||
118 | - | @Callable( | |
119 | - | func setOrder (F, | |
120 | - | let | |
121 | - | let | |
122 | - | if (( | |
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)) | |
123 | 122 | then throw("can use neutrino only") | |
124 | 123 | else if ((0 >= F)) | |
125 | 124 | then throw("price less zero") | |
126 | - | else if (( | |
125 | + | else if ((x(U) != a)) | |
127 | 126 | then throw("order exists") | |
128 | 127 | else { | |
129 | - | let | |
130 | - | let | |
128 | + | let P = split(t, G) | |
129 | + | let V = if ((O == 0)) | |
131 | 130 | then "" | |
132 | - | else | |
133 | - | let | |
134 | - | let | |
135 | - | then (F > | |
131 | + | else P[(O - 1)] | |
132 | + | let W = u(V) | |
133 | + | let X = if (if ((V != "")) | |
134 | + | then (F > W) | |
136 | 135 | else false) | |
137 | 136 | then true | |
138 | 137 | else false | |
139 | - | let | |
140 | - | let | |
141 | - | let | |
138 | + | let Y = P[O] | |
139 | + | let Z = u(Y) | |
140 | + | let aa = if ((Z >= F)) | |
142 | 141 | then true | |
143 | 142 | else false | |
144 | - | if (if ( | |
143 | + | if (if (X) | |
145 | 144 | then true | |
146 | - | else | |
147 | - | then throw(((("invalid order isPrevOrderError:" + toString( | |
148 | - | else WriteSet([DataEntry(i, | |
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)]) | |
149 | 148 | } | |
150 | 149 | } | |
151 | 150 | ||
152 | 151 | ||
153 | 152 | ||
154 | - | @Callable( | |
155 | - | func cancelOrder ( | |
156 | - | let | |
157 | - | let | |
158 | - | if (( | |
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))) | |
159 | 158 | then throw("permission denied") | |
160 | 159 | else { | |
161 | - | let | |
162 | - | ScriptResult(WriteSet([DataEntry(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)])) | |
163 | 162 | } | |
164 | 163 | } | |
165 | 164 | ||
166 | 165 | ||
167 | 166 | ||
168 | - | @Callable( | |
167 | + | @Callable(S) | |
169 | 168 | func executeOrder () = { | |
170 | - | let | |
171 | - | let | |
172 | - | let | |
173 | - | then | |
174 | - | else | |
175 | - | let | |
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)) | |
176 | 175 | then 0 | |
177 | - | else ( | |
178 | - | if (( | |
179 | - | then TransferSet([ScriptTransfer(addressFromStringValue( | |
176 | + | else (ad - ae) | |
177 | + | if ((af == 0)) | |
178 | + | then TransferSet([ScriptTransfer(addressFromStringValue(B), ag, H)]) | |
180 | 179 | else { | |
181 | - | let | |
182 | - | let | |
183 | - | let | |
184 | - | let | |
185 | - | let | |
186 | - | let | |
187 | - | then split( | |
188 | - | else | |
189 | - | let | |
190 | - | then | |
191 | - | else | |
192 | - | let | |
193 | - | let | |
194 | - | then | |
195 | - | else | |
196 | - | ScriptResult(WriteSet([DataEntry(i, | |
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)])) | |
197 | 196 | } | |
198 | 197 | } | |
199 | 198 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "" | |
5 | 5 | ||
6 | 6 | func b (c,d) = { | |
7 | 7 | let e = getInteger(addressFromStringValue(c), d) | |
8 | 8 | if ($isInstanceOf(e, "Int")) | |
9 | 9 | then { | |
10 | 10 | let f = e | |
11 | 11 | f | |
12 | 12 | } | |
13 | 13 | else 0 | |
14 | 14 | } | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func g (d) = { | |
18 | 18 | let e = getInteger(this, d) | |
19 | 19 | if ($isInstanceOf(e, "Int")) | |
20 | 20 | then { | |
21 | 21 | let f = e | |
22 | 22 | f | |
23 | 23 | } | |
24 | 24 | else 0 | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func h (d) = { | |
29 | 29 | let e = getString(this, d) | |
30 | 30 | if ($isInstanceOf(e, "String")) | |
31 | 31 | then { | |
32 | 32 | let f = e | |
33 | 33 | f | |
34 | 34 | } | |
35 | 35 | else a | |
36 | 36 | } | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | let i = "orderbook" | |
40 | 40 | ||
41 | 41 | let j = "order_price_" | |
42 | 42 | ||
43 | 43 | let k = "order_total_" | |
44 | 44 | ||
45 | 45 | let l = "order_filled_total_" | |
46 | 46 | ||
47 | 47 | let m = "order_owner_" | |
48 | 48 | ||
49 | 49 | let n = "order_height_" | |
50 | 50 | ||
51 | 51 | let o = "order_status_" | |
52 | 52 | ||
53 | 53 | let p = "price" | |
54 | 54 | ||
55 | 55 | let q = "bond_asset_id" | |
56 | 56 | ||
57 | 57 | let r = "neutrino_asset_id" | |
58 | 58 | ||
59 | 59 | let s = "neutrino_contract" | |
60 | 60 | ||
61 | - | let t = | |
61 | + | let t = h(i) | |
62 | 62 | ||
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)) | |
68 | 64 | ||
69 | 65 | ||
70 | - | func | |
66 | + | func w (v) = g((k + v)) | |
71 | 67 | ||
72 | 68 | ||
73 | - | func | |
69 | + | func x (v) = h((m + v)) | |
74 | 70 | ||
75 | 71 | ||
76 | - | func | |
72 | + | func y (v) = h((o + v)) | |
77 | 73 | ||
78 | 74 | ||
79 | - | func | |
75 | + | func z (v) = g((l + v)) | |
80 | 76 | ||
81 | 77 | ||
82 | - | let | |
78 | + | let A = fromBase58String(h(r)) | |
83 | 79 | ||
84 | - | let | |
80 | + | let B = h(s) | |
85 | 81 | ||
86 | - | let | |
82 | + | let C = wavesBalance(addressFromStringValue(B)) | |
87 | 83 | ||
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) | |
89 | 90 | ||
90 | 91 | let G = "_" | |
91 | 92 | ||
92 | 93 | let H = fromBase58String(h(q)) | |
93 | 94 | ||
94 | - | let I = | |
95 | + | let I = 100000000 | |
95 | 96 | ||
96 | - | let J = | |
97 | + | let J = "canceled" | |
97 | 98 | ||
98 | - | let K = " | |
99 | + | let K = "new" | |
99 | 100 | ||
100 | - | let L = " | |
101 | + | let L = "filled" | |
101 | 102 | ||
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) | |
111 | 110 | else { | |
112 | - | let | |
113 | - | ((( | |
111 | + | let R = split(t, (P[O] + G)) | |
112 | + | (((R[0] + Q) + (P[O] + G)) + R[1]) | |
114 | 113 | } | |
115 | 114 | } | |
116 | 115 | ||
117 | 116 | ||
118 | - | @Callable( | |
119 | - | func setOrder (F, | |
120 | - | let | |
121 | - | let | |
122 | - | if (( | |
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)) | |
123 | 122 | then throw("can use neutrino only") | |
124 | 123 | else if ((0 >= F)) | |
125 | 124 | then throw("price less zero") | |
126 | - | else if (( | |
125 | + | else if ((x(U) != a)) | |
127 | 126 | then throw("order exists") | |
128 | 127 | else { | |
129 | - | let | |
130 | - | let | |
128 | + | let P = split(t, G) | |
129 | + | let V = if ((O == 0)) | |
131 | 130 | then "" | |
132 | - | else | |
133 | - | let | |
134 | - | let | |
135 | - | then (F > | |
131 | + | else P[(O - 1)] | |
132 | + | let W = u(V) | |
133 | + | let X = if (if ((V != "")) | |
134 | + | then (F > W) | |
136 | 135 | else false) | |
137 | 136 | then true | |
138 | 137 | else false | |
139 | - | let | |
140 | - | let | |
141 | - | let | |
138 | + | let Y = P[O] | |
139 | + | let Z = u(Y) | |
140 | + | let aa = if ((Z >= F)) | |
142 | 141 | then true | |
143 | 142 | else false | |
144 | - | if (if ( | |
143 | + | if (if (X) | |
145 | 144 | then true | |
146 | - | else | |
147 | - | then throw(((("invalid order isPrevOrderError:" + toString( | |
148 | - | else WriteSet([DataEntry(i, | |
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)]) | |
149 | 148 | } | |
150 | 149 | } | |
151 | 150 | ||
152 | 151 | ||
153 | 152 | ||
154 | - | @Callable( | |
155 | - | func cancelOrder ( | |
156 | - | let | |
157 | - | let | |
158 | - | if (( | |
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))) | |
159 | 158 | then throw("permission denied") | |
160 | 159 | else { | |
161 | - | let | |
162 | - | ScriptResult(WriteSet([DataEntry(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)])) | |
163 | 162 | } | |
164 | 163 | } | |
165 | 164 | ||
166 | 165 | ||
167 | 166 | ||
168 | - | @Callable( | |
167 | + | @Callable(S) | |
169 | 168 | func executeOrder () = { | |
170 | - | let | |
171 | - | let | |
172 | - | let | |
173 | - | then | |
174 | - | else | |
175 | - | let | |
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)) | |
176 | 175 | then 0 | |
177 | - | else ( | |
178 | - | if (( | |
179 | - | then TransferSet([ScriptTransfer(addressFromStringValue( | |
176 | + | else (ad - ae) | |
177 | + | if ((af == 0)) | |
178 | + | then TransferSet([ScriptTransfer(addressFromStringValue(B), ag, H)]) | |
180 | 179 | else { | |
181 | - | let | |
182 | - | let | |
183 | - | let | |
184 | - | let | |
185 | - | let | |
186 | - | let | |
187 | - | then split( | |
188 | - | else | |
189 | - | let | |
190 | - | then | |
191 | - | else | |
192 | - | let | |
193 | - | let | |
194 | - | then | |
195 | - | else | |
196 | - | ScriptResult(WriteSet([DataEntry(i, | |
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)])) | |
197 | 196 | } | |
198 | 197 | } | |
199 | 198 | ||
200 | 199 |
github/deemru/w8io/169f3d6 77.12 ms ◑