tx · 4gUdK8m5AW1i7V99LMhDzajkGG64k8UExbA9waGYMBBK 3N7d3jPxKqSi3XVnAgg8oFsHLcrgctFWpVw: -0.01400000 Waves 2019.11.01 22:39 [746228] smart account 3N7d3jPxKqSi3XVnAgg8oFsHLcrgctFWpVw > SELF 0.00000000 Waves
{ "type": 13, "id": "4gUdK8m5AW1i7V99LMhDzajkGG64k8UExbA9waGYMBBK", "fee": 1400000, "feeAssetId": null, "timestamp": 1572637219642, "version": 1, "sender": "3N7d3jPxKqSi3XVnAgg8oFsHLcrgctFWpVw", "senderPublicKey": "GHnaLgezSnGCGe7LuhRy8j4JzCcySjwndqh6X9xHQNhz", "proofs": [ "4QnYEj4KKApPMKTD3PSyas8YD9PCK9GAacLLsYS5euqnzqm6N7RoqWYDQPqNXpiZK3JmMdFZH3RLKUgo3SmxtmKV" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIBARIDCgEIEgAAAAA6AQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAAGGdldFN0cmluZ0J5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAYZ2V0TnVtYmVyQn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HQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAxPcmRlckJvb2tLZXkFAAAADG5ld09yZGVyYm9vawkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAFmdldE9yZGVyRmlsbGVkVG90YWxLZXkAAAABBQAAAAdvcmRlcklkCQAAZAAAAAIFAAAAC2ZpbGxlZFRvdGFsBQAAAAV0b3RhbAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEWdldE9yZGVyU3RhdHVzS2V5AAAAAQUAAAAHb3JkZXJJZAUAAAAGc3RhdHVzCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAASZ2V0T3JkZXJIaXN0b3J5S2V5AAAAAQUAAAAGaGVpZ2h0BQAAAApvcmRlclByaWNlBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAApvcmRlck93bmVyBQAAAAxmaWxsZWRBbW91bnQFAAAAC2JvbmRBc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEG5ldXRyaW5vQ29udHJhY3QFAAAABXRvdGFsBQAAAA9uZXV0cmlub0Fzc2V0SWQFAAAAA25pbAAAAABkLao/", "chainId": 84, "height": 746228, "spentComplexity": 0 } View: original | compacted Prev: EKrJfYM3KNJPPPu5F4Lt9vZGZjbGXDcm8LzGvim2MJ69 Next: CNns7pQLLqUrW5yAop7oY5rvxAFWPA2YPRWqrUiWHdaR Diff:
Old | New | Differences | |
---|---|---|---|
59 | 59 | ||
60 | 60 | let o = 1000 | |
61 | 61 | ||
62 | - | let p = | |
62 | + | let p = 50 | |
63 | 63 | ||
64 | - | let q = " | |
64 | + | let q = "orderbook" | |
65 | 65 | ||
66 | - | let r = "order_ | |
66 | + | let r = "order_price_" | |
67 | 67 | ||
68 | - | let s = "order_ | |
68 | + | let s = "order_total_" | |
69 | 69 | ||
70 | - | let t = "order_ | |
70 | + | let t = "order_filled_total_" | |
71 | 71 | ||
72 | - | let u = "order_ | |
72 | + | let u = "order_owner_" | |
73 | 73 | ||
74 | - | let v = "order_ | |
74 | + | let v = "order_height_" | |
75 | 75 | ||
76 | - | let w = " | |
76 | + | let w = "order_status_" | |
77 | 77 | ||
78 | - | let x = " | |
78 | + | let x = "price" | |
79 | 79 | ||
80 | - | let y = " | |
80 | + | let y = "bond_asset_id" | |
81 | 81 | ||
82 | - | let z = "neutrino_ | |
82 | + | let z = "neutrino_asset_id" | |
83 | 83 | ||
84 | - | let A = " | |
84 | + | let A = "neutrino_contract" | |
85 | 85 | ||
86 | - | let B = " | |
86 | + | let B = "control_contract" | |
87 | 87 | ||
88 | - | let C = " | |
88 | + | let C = "order_history_" | |
89 | 89 | ||
90 | - | func D (E) = (q + E) | |
90 | + | let D = "swap_locked_balance" | |
91 | + | ||
92 | + | let E = "swap_neutrino_locked_balance" | |
93 | + | ||
94 | + | func F (G) = (r + G) | |
91 | 95 | ||
92 | 96 | ||
93 | - | func | |
97 | + | func H (G) = (s + G) | |
94 | 98 | ||
95 | 99 | ||
96 | - | func | |
100 | + | func I (G) = (u + G) | |
97 | 101 | ||
98 | 102 | ||
99 | - | func | |
103 | + | func J (G) = (v + G) | |
100 | 104 | ||
101 | 105 | ||
102 | - | func | |
106 | + | func K (G) = (w + G) | |
103 | 107 | ||
104 | 108 | ||
105 | - | func | |
109 | + | func L (G) = (t + G) | |
106 | 110 | ||
107 | 111 | ||
108 | - | func | |
112 | + | func M (N) = (C + toString(N)) | |
109 | 113 | ||
110 | 114 | ||
111 | - | let | |
115 | + | let O = addressFromStringValue(e(A)) | |
112 | 116 | ||
113 | - | let | |
117 | + | let P = addressFromStringValue(f(O, B)) | |
114 | 118 | ||
115 | - | let | |
119 | + | let Q = h(P, x) | |
116 | 120 | ||
117 | - | func | |
121 | + | func R (S) = ((((S * 100) / Q) * i) / k) | |
118 | 122 | ||
119 | 123 | ||
120 | - | func | |
124 | + | func T (S) = ((((S * Q) / 100) * k) / i) | |
121 | 125 | ||
122 | 126 | ||
123 | - | func | |
127 | + | func U (S) = (S / k) | |
124 | 128 | ||
125 | 129 | ||
126 | - | func | |
130 | + | func V (S) = (S * k) | |
127 | 131 | ||
128 | 132 | ||
129 | - | func | |
133 | + | func W (S) = U(T(S)) | |
130 | 134 | ||
131 | 135 | ||
132 | - | let | |
136 | + | let X = h(O, D) | |
133 | 137 | ||
134 | - | let | |
138 | + | let Y = h(O, E) | |
135 | 139 | ||
136 | - | let | |
140 | + | let Z = fromBase58String(f(O, z)) | |
137 | 141 | ||
138 | - | let | |
142 | + | let aa = fromBase58String(f(O, y)) | |
139 | 143 | ||
140 | - | let | |
144 | + | let ab = e(q) | |
141 | 145 | ||
142 | - | let aa = { | |
143 | - | let ab = extract(assetInfo(W)) | |
144 | - | (ab.quantity - assetBalance(M, W)) | |
146 | + | let ac = (wavesBalance(O) - X) | |
147 | + | ||
148 | + | let ad = { | |
149 | + | let ae = extract(assetInfo(Z)) | |
150 | + | ((ae.quantity - assetBalance(this, Z)) + Y) | |
145 | 151 | } | |
146 | 152 | ||
147 | - | let | |
153 | + | let af = (ad - T(ac)) | |
148 | 154 | ||
149 | - | func | |
155 | + | func ag (ah) = a(F(ah)) | |
150 | 156 | ||
151 | 157 | ||
152 | - | func | |
158 | + | func ai (ah) = a(H(ah)) | |
153 | 159 | ||
154 | 160 | ||
155 | - | func | |
161 | + | func aj (ah) = e(I(ah)) | |
156 | 162 | ||
157 | 163 | ||
158 | - | func | |
164 | + | func ak (ah) = e(K(ah)) | |
159 | 165 | ||
160 | 166 | ||
161 | - | func | |
167 | + | func al (ah) = a(L(ah)) | |
162 | 168 | ||
163 | 169 | ||
164 | - | func | |
170 | + | func am (ah) = (ah + j) | |
165 | 171 | ||
166 | 172 | ||
167 | - | func | |
168 | - | let | |
169 | - | let | |
170 | - | if (( | |
171 | - | then ( | |
172 | - | else if (( | |
173 | - | then ( | |
173 | + | func an (G,ao) = { | |
174 | + | let ap = split(ab, j) | |
175 | + | let aq = am(G) | |
176 | + | if ((ao == 0)) | |
177 | + | then (aq + ab) | |
178 | + | else if ((ao >= (size(ap) - 1))) | |
179 | + | then (ab + aq) | |
174 | 180 | else { | |
175 | - | let | |
176 | - | ((( | |
181 | + | let ar = split(ab, am(ap[ao])) | |
182 | + | (((ar[0] + aq) + am(ap[ao])) + ar[1]) | |
177 | 183 | } | |
178 | 184 | } | |
179 | 185 | ||
180 | 186 | ||
181 | - | func | |
182 | - | let | |
183 | - | ( | |
187 | + | func as (G) = { | |
188 | + | let ar = split(ab, am(G)) | |
189 | + | (ar[0] + ar[1]) | |
184 | 190 | } | |
185 | 191 | ||
186 | 192 | ||
187 | - | @Callable(aq) | |
188 | - | func setOrder (ar,al) = { | |
189 | - | let as = extract(aq.payment) | |
190 | - | let at = toBase58String(keccak256((((toBytes(ar) + toBytes(as.amount)) + aq.caller.bytes) + toBytes(height)))) | |
191 | - | if ((as.assetId != W)) | |
192 | - | then throw("can use neutrino only") | |
193 | - | else if ((0 >= ar)) | |
194 | - | then throw("price less zero") | |
195 | - | else if ((ag(at) != "")) | |
196 | - | then throw("order exists") | |
197 | - | else { | |
198 | - | let am = split(Y, j) | |
199 | - | let au = if ((al == 0)) | |
200 | - | then "" | |
201 | - | else am[(al - 1)] | |
202 | - | let av = ad(au) | |
203 | - | let aw = if (if ((au != "")) | |
204 | - | then (ar > av) | |
205 | - | else false) | |
206 | - | then true | |
207 | - | else false | |
208 | - | let ax = am[al] | |
209 | - | let ay = ad(ax) | |
210 | - | let az = if ((ay >= ar)) | |
211 | - | then true | |
212 | - | else false | |
213 | - | if (if (aw) | |
214 | - | then true | |
215 | - | else az) | |
216 | - | then throw(((("invalid order isPrevOrderError:" + toString(az)) + " isNextOrderError:") + toString(aw))) | |
217 | - | else WriteSet([DataEntry(p, ak(at, al)), DataEntry(D(at), ar), DataEntry(F(at), as.amount), DataEntry(G(at), toString(aq.caller)), DataEntry(H(at), height), DataEntry(I(at), m)]) | |
218 | - | } | |
193 | + | @Callable(at) | |
194 | + | func setOrder (au,ao) = { | |
195 | + | let av = extract(at.payment) | |
196 | + | let aw = toBase58String(keccak256((((toBytes(au) + toBytes(av.amount)) + at.caller.bytes) + toBytes(height)))) | |
197 | + | if ((p > au)) | |
198 | + | then throw("max discount is 50%") | |
199 | + | else if ((av.assetId != Z)) | |
200 | + | then throw("can use neutrino only") | |
201 | + | else if ((0 >= au)) | |
202 | + | then throw("price less zero") | |
203 | + | else if ((aj(aw) != "")) | |
204 | + | then throw("order exists") | |
205 | + | else { | |
206 | + | let ap = split(ab, j) | |
207 | + | let ax = if ((ao == 0)) | |
208 | + | then "" | |
209 | + | else ap[(ao - 1)] | |
210 | + | let ay = ag(ax) | |
211 | + | let az = if (if ((ax != "")) | |
212 | + | then (au > ay) | |
213 | + | else false) | |
214 | + | then true | |
215 | + | else false | |
216 | + | let aA = ap[ao] | |
217 | + | let aB = ag(aA) | |
218 | + | let aC = if ((aB >= au)) | |
219 | + | then true | |
220 | + | else false | |
221 | + | if (if (az) | |
222 | + | then true | |
223 | + | else aC) | |
224 | + | then throw(((("invalid order isPrevOrderError:" + toString(aC)) + " isNextOrderError:") + toString(az))) | |
225 | + | else WriteSet([DataEntry(q, an(aw, ao)), DataEntry(F(aw), au), DataEntry(H(aw), av.amount), DataEntry(I(aw), toString(at.caller)), DataEntry(J(aw), height), DataEntry(K(aw), m)]) | |
226 | + | } | |
219 | 227 | } | |
220 | 228 | ||
221 | 229 | ||
222 | 230 | ||
223 | - | @Callable( | |
224 | - | func cancelOrder ( | |
225 | - | let | |
226 | - | let | |
227 | - | if (( | |
231 | + | @Callable(at) | |
232 | + | func cancelOrder (G) = { | |
233 | + | let aD = aj(G) | |
234 | + | let S = (ai(G) - al(G)) | |
235 | + | if ((aD != toString(at.caller))) | |
228 | 236 | then throw("permission denied") | |
229 | - | else if (( | |
237 | + | else if ((ak(G) != m)) | |
230 | 238 | then throw("invalid order status") | |
231 | - | else ScriptResult(WriteSet([DataEntry( | |
239 | + | else ScriptResult(WriteSet([DataEntry(q, as(G)), DataEntry(K(G), l)]), TransferSet([ScriptTransfer(at.caller, S, Z)])) | |
232 | 240 | } | |
233 | 241 | ||
234 | 242 | ||
235 | 243 | ||
236 | - | @Callable( | |
244 | + | @Callable(at) | |
237 | 245 | func executeOrder () = { | |
238 | - | let | |
239 | - | let | |
246 | + | let aE = assetBalance(this, aa) | |
247 | + | let aF = if ((0 >= af)) | |
240 | 248 | then 0 | |
241 | - | else | |
242 | - | let | |
243 | - | then | |
244 | - | else | |
245 | - | let | |
249 | + | else af | |
250 | + | let aG = if ((aF >= aE)) | |
251 | + | then aE | |
252 | + | else aF | |
253 | + | let aH = if ((aF >= aE)) | |
246 | 254 | then 0 | |
247 | - | else ( | |
248 | - | if (if (( | |
249 | - | then ( | |
255 | + | else (aE - aF) | |
256 | + | if (if ((aH == 0)) | |
257 | + | then (aG == 0) | |
250 | 258 | else false) | |
251 | 259 | then throw("without deficit") | |
252 | - | else if (( | |
253 | - | then TransferSet([ScriptTransfer( | |
260 | + | else if ((aG == 0)) | |
261 | + | then TransferSet([ScriptTransfer(O, aH, aa)]) | |
254 | 262 | else { | |
255 | - | let | |
256 | - | let | |
257 | - | let | |
258 | - | let | |
259 | - | let | |
260 | - | let | |
261 | - | let | |
262 | - | then | |
263 | - | else | |
264 | - | let | |
265 | - | then | |
266 | - | else | |
267 | - | let | |
268 | - | let | |
263 | + | let G = split(ab, j)[0] | |
264 | + | let aI = al(G) | |
265 | + | let aJ = ai(G) | |
266 | + | let aK = ag(G) | |
267 | + | let aL = aj(G) | |
268 | + | let S = U((((aJ - aI) * 100) / aK)) | |
269 | + | let aM = if ((aG >= S)) | |
270 | + | then as(G) | |
271 | + | else ab | |
272 | + | let aN = if ((aG >= S)) | |
273 | + | then S | |
274 | + | else aG | |
275 | + | let aO = (((aN * aK) * k) / 100) | |
276 | + | let aP = if ((aG >= S)) | |
269 | 277 | then n | |
270 | 278 | else m | |
271 | - | if (( | |
279 | + | if ((aO == 0)) | |
272 | 280 | then throw("total equal zero") | |
273 | - | else ScriptResult(WriteSet([DataEntry( | |
281 | + | else ScriptResult(WriteSet([DataEntry(q, aM), DataEntry(L(G), (aI + aO)), DataEntry(K(G), aP), DataEntry(M(height), aK)]), TransferSet([ScriptTransfer(addressFromStringValue(aL), aN, aa), ScriptTransfer(O, aO, Z)])) | |
274 | 282 | } | |
275 | 283 | } | |
276 | 284 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b) = { | |
5 | 5 | let c = getInteger(this, b) | |
6 | 6 | if ($isInstanceOf(c, "Int")) | |
7 | 7 | then { | |
8 | 8 | let d = c | |
9 | 9 | d | |
10 | 10 | } | |
11 | 11 | else 0 | |
12 | 12 | } | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func e (b) = { | |
16 | 16 | let c = getString(this, b) | |
17 | 17 | if ($isInstanceOf(c, "String")) | |
18 | 18 | then { | |
19 | 19 | let d = c | |
20 | 20 | d | |
21 | 21 | } | |
22 | 22 | else "" | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func f (g,b) = { | |
27 | 27 | let c = getString(g, b) | |
28 | 28 | if ($isInstanceOf(c, "String")) | |
29 | 29 | then { | |
30 | 30 | let d = c | |
31 | 31 | d | |
32 | 32 | } | |
33 | 33 | else "" | |
34 | 34 | } | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func h (g,b) = { | |
38 | 38 | let c = getInteger(g, b) | |
39 | 39 | if ($isInstanceOf(c, "Int")) | |
40 | 40 | then { | |
41 | 41 | let d = c | |
42 | 42 | d | |
43 | 43 | } | |
44 | 44 | else 0 | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | let i = 100000000 | |
49 | 49 | ||
50 | 50 | let j = "_" | |
51 | 51 | ||
52 | 52 | let k = 100 | |
53 | 53 | ||
54 | 54 | let l = "canceled" | |
55 | 55 | ||
56 | 56 | let m = "new" | |
57 | 57 | ||
58 | 58 | let n = "filled" | |
59 | 59 | ||
60 | 60 | let o = 1000 | |
61 | 61 | ||
62 | - | let p = | |
62 | + | let p = 50 | |
63 | 63 | ||
64 | - | let q = " | |
64 | + | let q = "orderbook" | |
65 | 65 | ||
66 | - | let r = "order_ | |
66 | + | let r = "order_price_" | |
67 | 67 | ||
68 | - | let s = "order_ | |
68 | + | let s = "order_total_" | |
69 | 69 | ||
70 | - | let t = "order_ | |
70 | + | let t = "order_filled_total_" | |
71 | 71 | ||
72 | - | let u = "order_ | |
72 | + | let u = "order_owner_" | |
73 | 73 | ||
74 | - | let v = "order_ | |
74 | + | let v = "order_height_" | |
75 | 75 | ||
76 | - | let w = " | |
76 | + | let w = "order_status_" | |
77 | 77 | ||
78 | - | let x = " | |
78 | + | let x = "price" | |
79 | 79 | ||
80 | - | let y = " | |
80 | + | let y = "bond_asset_id" | |
81 | 81 | ||
82 | - | let z = "neutrino_ | |
82 | + | let z = "neutrino_asset_id" | |
83 | 83 | ||
84 | - | let A = " | |
84 | + | let A = "neutrino_contract" | |
85 | 85 | ||
86 | - | let B = " | |
86 | + | let B = "control_contract" | |
87 | 87 | ||
88 | - | let C = " | |
88 | + | let C = "order_history_" | |
89 | 89 | ||
90 | - | func D (E) = (q + E) | |
90 | + | let D = "swap_locked_balance" | |
91 | + | ||
92 | + | let E = "swap_neutrino_locked_balance" | |
93 | + | ||
94 | + | func F (G) = (r + G) | |
91 | 95 | ||
92 | 96 | ||
93 | - | func | |
97 | + | func H (G) = (s + G) | |
94 | 98 | ||
95 | 99 | ||
96 | - | func | |
100 | + | func I (G) = (u + G) | |
97 | 101 | ||
98 | 102 | ||
99 | - | func | |
103 | + | func J (G) = (v + G) | |
100 | 104 | ||
101 | 105 | ||
102 | - | func | |
106 | + | func K (G) = (w + G) | |
103 | 107 | ||
104 | 108 | ||
105 | - | func | |
109 | + | func L (G) = (t + G) | |
106 | 110 | ||
107 | 111 | ||
108 | - | func | |
112 | + | func M (N) = (C + toString(N)) | |
109 | 113 | ||
110 | 114 | ||
111 | - | let | |
115 | + | let O = addressFromStringValue(e(A)) | |
112 | 116 | ||
113 | - | let | |
117 | + | let P = addressFromStringValue(f(O, B)) | |
114 | 118 | ||
115 | - | let | |
119 | + | let Q = h(P, x) | |
116 | 120 | ||
117 | - | func | |
121 | + | func R (S) = ((((S * 100) / Q) * i) / k) | |
118 | 122 | ||
119 | 123 | ||
120 | - | func | |
124 | + | func T (S) = ((((S * Q) / 100) * k) / i) | |
121 | 125 | ||
122 | 126 | ||
123 | - | func | |
127 | + | func U (S) = (S / k) | |
124 | 128 | ||
125 | 129 | ||
126 | - | func | |
130 | + | func V (S) = (S * k) | |
127 | 131 | ||
128 | 132 | ||
129 | - | func | |
133 | + | func W (S) = U(T(S)) | |
130 | 134 | ||
131 | 135 | ||
132 | - | let | |
136 | + | let X = h(O, D) | |
133 | 137 | ||
134 | - | let | |
138 | + | let Y = h(O, E) | |
135 | 139 | ||
136 | - | let | |
140 | + | let Z = fromBase58String(f(O, z)) | |
137 | 141 | ||
138 | - | let | |
142 | + | let aa = fromBase58String(f(O, y)) | |
139 | 143 | ||
140 | - | let | |
144 | + | let ab = e(q) | |
141 | 145 | ||
142 | - | let aa = { | |
143 | - | let ab = extract(assetInfo(W)) | |
144 | - | (ab.quantity - assetBalance(M, W)) | |
146 | + | let ac = (wavesBalance(O) - X) | |
147 | + | ||
148 | + | let ad = { | |
149 | + | let ae = extract(assetInfo(Z)) | |
150 | + | ((ae.quantity - assetBalance(this, Z)) + Y) | |
145 | 151 | } | |
146 | 152 | ||
147 | - | let | |
153 | + | let af = (ad - T(ac)) | |
148 | 154 | ||
149 | - | func | |
155 | + | func ag (ah) = a(F(ah)) | |
150 | 156 | ||
151 | 157 | ||
152 | - | func | |
158 | + | func ai (ah) = a(H(ah)) | |
153 | 159 | ||
154 | 160 | ||
155 | - | func | |
161 | + | func aj (ah) = e(I(ah)) | |
156 | 162 | ||
157 | 163 | ||
158 | - | func | |
164 | + | func ak (ah) = e(K(ah)) | |
159 | 165 | ||
160 | 166 | ||
161 | - | func | |
167 | + | func al (ah) = a(L(ah)) | |
162 | 168 | ||
163 | 169 | ||
164 | - | func | |
170 | + | func am (ah) = (ah + j) | |
165 | 171 | ||
166 | 172 | ||
167 | - | func | |
168 | - | let | |
169 | - | let | |
170 | - | if (( | |
171 | - | then ( | |
172 | - | else if (( | |
173 | - | then ( | |
173 | + | func an (G,ao) = { | |
174 | + | let ap = split(ab, j) | |
175 | + | let aq = am(G) | |
176 | + | if ((ao == 0)) | |
177 | + | then (aq + ab) | |
178 | + | else if ((ao >= (size(ap) - 1))) | |
179 | + | then (ab + aq) | |
174 | 180 | else { | |
175 | - | let | |
176 | - | ((( | |
181 | + | let ar = split(ab, am(ap[ao])) | |
182 | + | (((ar[0] + aq) + am(ap[ao])) + ar[1]) | |
177 | 183 | } | |
178 | 184 | } | |
179 | 185 | ||
180 | 186 | ||
181 | - | func | |
182 | - | let | |
183 | - | ( | |
187 | + | func as (G) = { | |
188 | + | let ar = split(ab, am(G)) | |
189 | + | (ar[0] + ar[1]) | |
184 | 190 | } | |
185 | 191 | ||
186 | 192 | ||
187 | - | @Callable(aq) | |
188 | - | func setOrder (ar,al) = { | |
189 | - | let as = extract(aq.payment) | |
190 | - | let at = toBase58String(keccak256((((toBytes(ar) + toBytes(as.amount)) + aq.caller.bytes) + toBytes(height)))) | |
191 | - | if ((as.assetId != W)) | |
192 | - | then throw("can use neutrino only") | |
193 | - | else if ((0 >= ar)) | |
194 | - | then throw("price less zero") | |
195 | - | else if ((ag(at) != "")) | |
196 | - | then throw("order exists") | |
197 | - | else { | |
198 | - | let am = split(Y, j) | |
199 | - | let au = if ((al == 0)) | |
200 | - | then "" | |
201 | - | else am[(al - 1)] | |
202 | - | let av = ad(au) | |
203 | - | let aw = if (if ((au != "")) | |
204 | - | then (ar > av) | |
205 | - | else false) | |
206 | - | then true | |
207 | - | else false | |
208 | - | let ax = am[al] | |
209 | - | let ay = ad(ax) | |
210 | - | let az = if ((ay >= ar)) | |
211 | - | then true | |
212 | - | else false | |
213 | - | if (if (aw) | |
214 | - | then true | |
215 | - | else az) | |
216 | - | then throw(((("invalid order isPrevOrderError:" + toString(az)) + " isNextOrderError:") + toString(aw))) | |
217 | - | else WriteSet([DataEntry(p, ak(at, al)), DataEntry(D(at), ar), DataEntry(F(at), as.amount), DataEntry(G(at), toString(aq.caller)), DataEntry(H(at), height), DataEntry(I(at), m)]) | |
218 | - | } | |
193 | + | @Callable(at) | |
194 | + | func setOrder (au,ao) = { | |
195 | + | let av = extract(at.payment) | |
196 | + | let aw = toBase58String(keccak256((((toBytes(au) + toBytes(av.amount)) + at.caller.bytes) + toBytes(height)))) | |
197 | + | if ((p > au)) | |
198 | + | then throw("max discount is 50%") | |
199 | + | else if ((av.assetId != Z)) | |
200 | + | then throw("can use neutrino only") | |
201 | + | else if ((0 >= au)) | |
202 | + | then throw("price less zero") | |
203 | + | else if ((aj(aw) != "")) | |
204 | + | then throw("order exists") | |
205 | + | else { | |
206 | + | let ap = split(ab, j) | |
207 | + | let ax = if ((ao == 0)) | |
208 | + | then "" | |
209 | + | else ap[(ao - 1)] | |
210 | + | let ay = ag(ax) | |
211 | + | let az = if (if ((ax != "")) | |
212 | + | then (au > ay) | |
213 | + | else false) | |
214 | + | then true | |
215 | + | else false | |
216 | + | let aA = ap[ao] | |
217 | + | let aB = ag(aA) | |
218 | + | let aC = if ((aB >= au)) | |
219 | + | then true | |
220 | + | else false | |
221 | + | if (if (az) | |
222 | + | then true | |
223 | + | else aC) | |
224 | + | then throw(((("invalid order isPrevOrderError:" + toString(aC)) + " isNextOrderError:") + toString(az))) | |
225 | + | else WriteSet([DataEntry(q, an(aw, ao)), DataEntry(F(aw), au), DataEntry(H(aw), av.amount), DataEntry(I(aw), toString(at.caller)), DataEntry(J(aw), height), DataEntry(K(aw), m)]) | |
226 | + | } | |
219 | 227 | } | |
220 | 228 | ||
221 | 229 | ||
222 | 230 | ||
223 | - | @Callable( | |
224 | - | func cancelOrder ( | |
225 | - | let | |
226 | - | let | |
227 | - | if (( | |
231 | + | @Callable(at) | |
232 | + | func cancelOrder (G) = { | |
233 | + | let aD = aj(G) | |
234 | + | let S = (ai(G) - al(G)) | |
235 | + | if ((aD != toString(at.caller))) | |
228 | 236 | then throw("permission denied") | |
229 | - | else if (( | |
237 | + | else if ((ak(G) != m)) | |
230 | 238 | then throw("invalid order status") | |
231 | - | else ScriptResult(WriteSet([DataEntry( | |
239 | + | else ScriptResult(WriteSet([DataEntry(q, as(G)), DataEntry(K(G), l)]), TransferSet([ScriptTransfer(at.caller, S, Z)])) | |
232 | 240 | } | |
233 | 241 | ||
234 | 242 | ||
235 | 243 | ||
236 | - | @Callable( | |
244 | + | @Callable(at) | |
237 | 245 | func executeOrder () = { | |
238 | - | let | |
239 | - | let | |
246 | + | let aE = assetBalance(this, aa) | |
247 | + | let aF = if ((0 >= af)) | |
240 | 248 | then 0 | |
241 | - | else | |
242 | - | let | |
243 | - | then | |
244 | - | else | |
245 | - | let | |
249 | + | else af | |
250 | + | let aG = if ((aF >= aE)) | |
251 | + | then aE | |
252 | + | else aF | |
253 | + | let aH = if ((aF >= aE)) | |
246 | 254 | then 0 | |
247 | - | else ( | |
248 | - | if (if (( | |
249 | - | then ( | |
255 | + | else (aE - aF) | |
256 | + | if (if ((aH == 0)) | |
257 | + | then (aG == 0) | |
250 | 258 | else false) | |
251 | 259 | then throw("without deficit") | |
252 | - | else if (( | |
253 | - | then TransferSet([ScriptTransfer( | |
260 | + | else if ((aG == 0)) | |
261 | + | then TransferSet([ScriptTransfer(O, aH, aa)]) | |
254 | 262 | else { | |
255 | - | let | |
256 | - | let | |
257 | - | let | |
258 | - | let | |
259 | - | let | |
260 | - | let | |
261 | - | let | |
262 | - | then | |
263 | - | else | |
264 | - | let | |
265 | - | then | |
266 | - | else | |
267 | - | let | |
268 | - | let | |
263 | + | let G = split(ab, j)[0] | |
264 | + | let aI = al(G) | |
265 | + | let aJ = ai(G) | |
266 | + | let aK = ag(G) | |
267 | + | let aL = aj(G) | |
268 | + | let S = U((((aJ - aI) * 100) / aK)) | |
269 | + | let aM = if ((aG >= S)) | |
270 | + | then as(G) | |
271 | + | else ab | |
272 | + | let aN = if ((aG >= S)) | |
273 | + | then S | |
274 | + | else aG | |
275 | + | let aO = (((aN * aK) * k) / 100) | |
276 | + | let aP = if ((aG >= S)) | |
269 | 277 | then n | |
270 | 278 | else m | |
271 | - | if (( | |
279 | + | if ((aO == 0)) | |
272 | 280 | then throw("total equal zero") | |
273 | - | else ScriptResult(WriteSet([DataEntry( | |
281 | + | else ScriptResult(WriteSet([DataEntry(q, aM), DataEntry(L(G), (aI + aO)), DataEntry(K(G), aP), DataEntry(M(height), aK)]), TransferSet([ScriptTransfer(addressFromStringValue(aL), aN, aa), ScriptTransfer(O, aO, Z)])) | |
274 | 282 | } | |
275 | 283 | } | |
276 | 284 | ||
277 | 285 |
github/deemru/w8io/169f3d6 84.28 ms ◑