tx · 7R8cdk9K2aQwbWCpKzW9crrz2YMUFszd4risHdtKNStE 3N55kCyUFy8M2ooKRwierKnP7L6viqzScNn: -0.02200000 Waves 2022.10.27 10:05 [2290508] smart account 3N55kCyUFy8M2ooKRwierKnP7L6viqzScNn > SELF 0.00000000 Waves
{ "type": 13, "id": "7R8cdk9K2aQwbWCpKzW9crrz2YMUFszd4risHdtKNStE", "fee": 2200000, "feeAssetId": null, "timestamp": 1666854332606, "version": 1, "sender": "3N55kCyUFy8M2ooKRwierKnP7L6viqzScNn", "senderPublicKey": "HpuFV1RhaXZ5gaJNgeLjyAKy3D5q7fMKdNFYYbPDafnb", "proofs": [ "4uyFJLD6fXVQV2aH2ZddDo61h4Mby4fvVH2eTet3ZJ4KHQLNNjBojfsKrZRyhsmLFXzPysY3pTkA1Dgtgz7skfdr" ], "script": "base64:BgK1GwgCEgMKAQgSAwoBCBIAEgQKAgEEEgMKAQESABIECgIBARIDCgEBEgQKAggIEgASAwoBCBIFCgMBAQESBAoCAQESBAoCCAESBAoCCAgSCwoJCAEBAgECCAQEEgYKBAgIAQgSABIDCgEBEgMKAQESBAoCCAEiCmxQZGVjaW1hbHMiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQQXNzZXREY20iEmlkeFBvb2xBbXRBc3NldEFtdCIUaWR4UG9vbFByaWNlQXNzZXRBbXQiEWlkeFBvb2xMUEFzc2V0QW10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vHWsAn8gruRYn2YdiXD81SBgDN9LZf Diff:
Old | New | Differences | |
---|---|---|---|
11 | 11 | ||
12 | 12 | let e = toBigInt(0) | |
13 | 13 | ||
14 | - | let f = | |
14 | + | let f = "__" | |
15 | 15 | ||
16 | - | let g = | |
16 | + | let g = 1 | |
17 | 17 | ||
18 | - | let h = | |
18 | + | let h = 2 | |
19 | 19 | ||
20 | - | let i = | |
20 | + | let i = 3 | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = 4 | |
23 | 23 | ||
24 | 24 | let k = 1 | |
25 | 25 | ||
29 | 29 | ||
30 | 30 | let n = 4 | |
31 | 31 | ||
32 | - | let o = | |
32 | + | let o = 5 | |
33 | 33 | ||
34 | - | let p = | |
34 | + | let p = 6 | |
35 | 35 | ||
36 | - | let q = | |
36 | + | let q = 7 | |
37 | 37 | ||
38 | - | let r = | |
38 | + | let r = 8 | |
39 | 39 | ||
40 | - | let s = | |
40 | + | let s = 9 | |
41 | 41 | ||
42 | - | let t = | |
42 | + | let t = 10 | |
43 | 43 | ||
44 | - | let u = | |
44 | + | let u = 1 | |
45 | 45 | ||
46 | - | let v = | |
46 | + | let v = 2 | |
47 | 47 | ||
48 | - | let w = | |
48 | + | let w = 3 | |
49 | 49 | ||
50 | - | let x = | |
50 | + | let x = 1 | |
51 | 51 | ||
52 | - | let y = | |
52 | + | let y = 7 | |
53 | 53 | ||
54 | - | let z = 2 | |
55 | - | ||
56 | - | let A = 3 | |
57 | - | ||
58 | - | let B = 1 | |
59 | - | ||
60 | - | let C = 7 | |
61 | - | ||
62 | - | func D (E,F) = fraction(toBigInt(E), d, toBigInt(F)) | |
54 | + | func z (A,B) = fraction(toBigInt(A), d, toBigInt(B)) | |
63 | 55 | ||
64 | 56 | ||
65 | - | func | |
57 | + | func C (D,E) = toInt(fraction(D, toBigInt(E), d)) | |
66 | 58 | ||
67 | 59 | ||
68 | - | func | |
60 | + | func F (G,H,I) = fraction(G, H, I) | |
69 | 61 | ||
70 | 62 | ||
71 | - | func | |
72 | - | then -( | |
73 | - | else | |
63 | + | func J (D) = if ((e > D)) | |
64 | + | then -(D) | |
65 | + | else D | |
74 | 66 | ||
75 | 67 | ||
76 | - | func O (H) = if ((e > H)) | |
77 | - | then -(H) | |
78 | - | else H | |
68 | + | func K () = "%s__factoryContract" | |
79 | 69 | ||
80 | 70 | ||
81 | - | func | |
71 | + | func L () = "%s__managerPublicKey" | |
82 | 72 | ||
83 | 73 | ||
84 | - | func | |
74 | + | func M () = "%s__pendingManagerPublicKey" | |
85 | 75 | ||
86 | 76 | ||
87 | - | func | |
77 | + | func N () = "%s%s__price__last" | |
88 | 78 | ||
89 | 79 | ||
90 | - | func | |
80 | + | func O (P,Q) = makeString(["%s%s%d%d__price__history", toString(P), toString(Q)], f) | |
91 | 81 | ||
92 | 82 | ||
93 | - | func | |
83 | + | func R (S,T) = ((("%s%s%s__P__" + S) + "__") + T) | |
94 | 84 | ||
95 | 85 | ||
96 | - | func | |
86 | + | func U (S,T) = ((("%s%s%s__G__" + S) + "__") + T) | |
97 | 87 | ||
98 | 88 | ||
99 | - | func | |
89 | + | func V () = "%s__amountAsset" | |
100 | 90 | ||
101 | 91 | ||
102 | - | func | |
92 | + | func W () = "%s__priceAsset" | |
103 | 93 | ||
104 | 94 | ||
105 | - | func | |
95 | + | func X () = "%s__factoryConfig" | |
106 | 96 | ||
107 | 97 | ||
108 | - | let ac = "%s__fee" | |
109 | - | ||
110 | - | let ad = fraction(5, b, 10000) | |
111 | - | ||
112 | - | let ae = valueOrElse(getInteger(this, ac), ad) | |
113 | - | ||
114 | - | func af () = "%s__factoryConfig" | |
98 | + | func Y () = "%s%s__matcher__publicKey" | |
115 | 99 | ||
116 | 100 | ||
117 | - | func | |
101 | + | func Z (aa) = (("%s%s%s__" + aa) + "__mappings__poolContract2LpAsset") | |
118 | 102 | ||
119 | 103 | ||
120 | - | func | |
104 | + | func ab (ac,ad) = (((("%d%d%s__" + ac) + "__") + ad) + "__config") | |
121 | 105 | ||
122 | 106 | ||
123 | - | func | |
107 | + | func ae (af) = ("%s%s%s__mappings__baseAsset2internalId__" + af) | |
124 | 108 | ||
125 | 109 | ||
126 | - | func | |
110 | + | func ag () = "%s__shutdown" | |
127 | 111 | ||
128 | 112 | ||
129 | - | func | |
113 | + | func ah (ai) = ("%s%s__poolWeight__" + ai) | |
130 | 114 | ||
131 | 115 | ||
132 | - | func | |
116 | + | func aj () = "%s__allowedLpScriptHash" | |
133 | 117 | ||
134 | 118 | ||
135 | - | func | |
119 | + | func ak (al,am,an) = throw(((((("order validation failed: orderValid=" + toString(al)) + " senderValid=") + toString(am)) + " matcherValid=") + toString(an))) | |
136 | 120 | ||
137 | 121 | ||
138 | - | let as = "%s__feeCollectorAddress" | |
139 | - | ||
140 | - | func at (au,av,aw) = throw(((((("order validation failed: orderValid=" + toString(au)) + " senderValid=") + toString(av)) + " matcherValid=") + toString(aw))) | |
122 | + | func ao (ap,aq) = valueOrErrorMessage(getString(ap, aq), makeString(["mandatory ", toString(ap), ".", aq, " is not defined"], "")) | |
141 | 123 | ||
142 | 124 | ||
143 | - | func | |
125 | + | func ar (ap,aq) = valueOrErrorMessage(getInteger(ap, aq), makeString(["mandatory ", toString(ap), ".", aq, " is not defined"], "")) | |
144 | 126 | ||
145 | 127 | ||
146 | - | func aA (ay,az) = valueOrErrorMessage(getInteger(ay, az), makeString(["mandatory ", toString(ay), ".", az, " is not defined"], "")) | |
128 | + | let as = addressFromStringValue(ao(this, K())) | |
129 | + | ||
130 | + | func at () = valueOrElse(getBoolean(as, ag()), false) | |
147 | 131 | ||
148 | 132 | ||
149 | - | func | |
133 | + | func au () = fromBase58String(ao(as, Y())) | |
150 | 134 | ||
151 | 135 | ||
152 | - | let aD = addressFromStringValue(ax(this, P())) | |
153 | - | ||
154 | - | let aE = addressFromStringValue(ax(aD, as)) | |
155 | - | ||
156 | - | func aF () = valueOrElse(getBoolean(aD, ao()), false) | |
157 | - | ||
158 | - | ||
159 | - | func aG () = fromBase58String(ax(aD, ag())) | |
160 | - | ||
161 | - | ||
162 | - | func aH () = { | |
163 | - | let aI = ax(this, aa()) | |
164 | - | let aJ = ax(this, ab()) | |
165 | - | let al = aA(aD, am(aJ)) | |
166 | - | let ak = aA(aD, am(aI)) | |
167 | - | split(ax(aD, aj(toString(ak), toString(al))), j) | |
136 | + | func av () = { | |
137 | + | let aw = ao(this, V()) | |
138 | + | let ax = ao(this, W()) | |
139 | + | let ad = ar(as, ae(ax)) | |
140 | + | let ac = ar(as, ae(aw)) | |
141 | + | split(ao(as, ab(toString(ac), toString(ad))), f) | |
168 | 142 | } | |
169 | 143 | ||
170 | 144 | ||
171 | - | func aK (aL) = if ((aL == i)) | |
172 | - | then unit | |
173 | - | else fromBase58String(aL) | |
145 | + | func ay () = split(ao(as, X()), f) | |
174 | 146 | ||
175 | 147 | ||
176 | - | func aM (aL) = if ((aL == unit)) | |
177 | - | then i | |
178 | - | else toBase58String(value(aL)) | |
148 | + | func az (aA,aB,aC,aD,aE,aF,aG,aH,aI,aJ) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(aA), toString(aB), toString(aC), toString(aD), toString(aE), toString(aF), toString(aG), toString(aH), toString(aI), toString(aJ)], f) | |
179 | 149 | ||
180 | 150 | ||
181 | - | func | |
151 | + | func aK (aL,aM,aN,aD,aG,aH) = makeString(["%d%d%d%d%d%d", toString(aL), toString(aM), toString(aN), toString(aD), toString(aG), toString(aH)], f) | |
182 | 152 | ||
183 | 153 | ||
184 | - | let aP = aN(aH()) | |
185 | - | ||
186 | - | let aQ = aP | |
187 | - | ||
188 | - | let aR = aQ._1 | |
189 | - | ||
190 | - | let aS = aQ._2 | |
191 | - | ||
192 | - | let aT = aQ._3 | |
193 | - | ||
194 | - | let aU = aQ._4 | |
195 | - | ||
196 | - | let aV = aQ._5 | |
197 | - | ||
198 | - | let aW = aQ._6 | |
199 | - | ||
200 | - | let aX = aQ._7 | |
201 | - | ||
202 | - | func aY () = split(ax(aD, af()), j) | |
154 | + | func aO (aP) = if ((aP == "WAVES")) | |
155 | + | then wavesBalance(this).available | |
156 | + | else assetBalance(this, fromBase58String(aP)) | |
203 | 157 | ||
204 | 158 | ||
205 | - | let aZ = valueOrErrorMessage(addressFromString(aY()[B]), "incorrect staking address") | |
206 | - | ||
207 | - | let ba = valueOrErrorMessage(addressFromString(aY()[C]), "incorrect staking address") | |
208 | - | ||
209 | - | func bb (bc,bd,be,bf,bg,bh,bi,bj,bk,bl) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bc), toString(bd), toString(be), toString(bf), toString(bg), toString(bh), toString(bi), toString(bj), toString(bk), toString(bl)], j) | |
159 | + | func aQ (aR,aS) = fraction(aR, d, aS) | |
210 | 160 | ||
211 | 161 | ||
212 | - | func bm (bn,bo,bp,bf,bi,bj) = makeString(["%d%d%d%d%d%d", toString(bn), toString(bo), toString(bp), toString(bf), toString(bi), toString(bj)], j) | |
213 | - | ||
214 | - | ||
215 | - | func bq (br) = if ((br == "WAVES")) | |
216 | - | then wavesBalance(this).available | |
217 | - | else assetBalance(this, fromBase58String(br)) | |
218 | - | ||
219 | - | ||
220 | - | func bs (bt,bu) = fraction(bt, d, bu) | |
221 | - | ||
222 | - | ||
223 | - | func bv (bw,bx,by,bz) = { | |
224 | - | let bA = D(by, bw) | |
225 | - | let bB = D(bz, bx) | |
226 | - | bs(bB, bA) | |
162 | + | func aT (aU,aV,aW,aX) = { | |
163 | + | let aY = z(aW, aU) | |
164 | + | let aZ = z(aX, aV) | |
165 | + | aQ(aZ, aY) | |
227 | 166 | } | |
228 | 167 | ||
229 | 168 | ||
230 | - | func | |
231 | - | let | |
232 | - | let | |
233 | - | let | |
234 | - | let | |
235 | - | let | |
236 | - | let | |
237 | - | let | |
238 | - | let | |
239 | - | let | |
240 | - | [ | |
169 | + | func ba (aW,aX,bb) = { | |
170 | + | let bc = av() | |
171 | + | let bd = parseIntValue(bc[p]) | |
172 | + | let be = parseIntValue(bc[q]) | |
173 | + | let bf = aT(bd, be, aW, aX) | |
174 | + | let aS = z(aW, bd) | |
175 | + | let aR = z(aX, be) | |
176 | + | let bg = z(bb, b) | |
177 | + | let bh = aQ(aS, bg) | |
178 | + | let bi = aQ(aR, bg) | |
179 | + | [bf, bh, bi] | |
241 | 180 | } | |
242 | 181 | ||
243 | 182 | ||
244 | - | func | |
245 | - | let | |
246 | - | [ | |
183 | + | func bj (aW,aX,bb) = { | |
184 | + | let bk = ba(aW, aX, bb) | |
185 | + | [C(bk[0], b), C(bk[1], b), C(bk[2], b)] | |
247 | 186 | } | |
248 | 187 | ||
249 | 188 | ||
250 | - | func | |
251 | - | let | |
252 | - | let | |
253 | - | let | |
254 | - | let | |
255 | - | let | |
256 | - | let | |
257 | - | let | |
258 | - | let | |
259 | - | if (( | |
189 | + | func bl (bm,bn,bo,S) = { | |
190 | + | let bc = av() | |
191 | + | let bp = bc[m] | |
192 | + | let bq = bc[n] | |
193 | + | let br = bc[o] | |
194 | + | let aU = parseIntValue(bc[p]) | |
195 | + | let aV = parseIntValue(bc[q]) | |
196 | + | let bs = bc[l] | |
197 | + | let bt = valueOrErrorMessage(assetInfo(fromBase58String(bp)), (("Asset " + bp) + " doesn't exist")).quantity | |
198 | + | if ((bp != bn)) | |
260 | 199 | then throw("Invalid asset passed.") | |
261 | 200 | else { | |
262 | - | let | |
263 | - | let | |
264 | - | let | |
265 | - | let | |
266 | - | let | |
267 | - | let | |
268 | - | let | |
269 | - | let | |
270 | - | let | |
271 | - | let | |
272 | - | let | |
273 | - | let | |
274 | - | let | |
201 | + | let bu = aO(bq) | |
202 | + | let bv = z(bu, aU) | |
203 | + | let bw = aO(br) | |
204 | + | let bx = z(bw, aV) | |
205 | + | let by = aQ(bx, bv) | |
206 | + | let bz = C(by, b) | |
207 | + | let bA = z(bo, b) | |
208 | + | let bB = z(bt, b) | |
209 | + | let bC = fraction(bv, bA, bB) | |
210 | + | let bD = fraction(bx, bA, bB) | |
211 | + | let bE = C(bC, aU) | |
212 | + | let bF = C(bD, aV) | |
213 | + | let bG = if ((bm == "")) | |
275 | 214 | then nil | |
276 | - | else [ScriptTransfer( | |
215 | + | else [ScriptTransfer(S, bE, if ((bq == "WAVES")) | |
277 | 216 | then unit | |
278 | - | else fromBase58String( | |
217 | + | else fromBase58String(bq)), ScriptTransfer(S, bF, if ((br == "WAVES")) | |
279 | 218 | then unit | |
280 | - | else fromBase58String( | |
281 | - | $Tuple10( | |
219 | + | else fromBase58String(br)), StringEntry(U(toString(S), bm), aK(bE, bF, bo, bz, height, lastBlock.timestamp)), IntegerEntry(N(), bz), IntegerEntry(O(height, lastBlock.timestamp), bz)] | |
220 | + | $Tuple10(bE, bF, bq, br, bu, bw, bt, by, bs, bG) | |
282 | 221 | } | |
283 | 222 | } | |
284 | 223 | ||
285 | 224 | ||
286 | - | func | |
287 | - | let | |
288 | - | let | |
289 | - | let | |
290 | - | let | |
291 | - | let | |
292 | - | let | |
293 | - | let | |
294 | - | let | |
295 | - | let | |
296 | - | let | |
297 | - | let | |
298 | - | let | |
299 | - | if (if (( | |
225 | + | func bH (bm,bI,bJ,bK,bL,bM,S,bN,bO) = { | |
226 | + | let bc = av() | |
227 | + | let bp = fromBase58String(bc[m]) | |
228 | + | let bP = bc[n] | |
229 | + | let bQ = bc[o] | |
230 | + | let bR = bc[r] | |
231 | + | let bS = bc[s] | |
232 | + | let bd = parseIntValue(bc[p]) | |
233 | + | let be = parseIntValue(bc[q]) | |
234 | + | let bs = bc[l] | |
235 | + | let bt = valueOrErrorMessage(assetInfo(bp), (("Asset " + toBase58String(bp)) + " doesn't exist")).quantity | |
236 | + | let bT = toBase58String(valueOrElse(bK, fromBase58String("WAVES"))) | |
237 | + | let bU = toBase58String(valueOrElse(bM, fromBase58String("WAVES"))) | |
238 | + | if (if ((bP != bT)) | |
300 | 239 | then true | |
301 | - | else ( | |
240 | + | else (bQ != bU)) | |
302 | 241 | then throw("Invalid amt or price asset passed.") | |
303 | 242 | else { | |
304 | - | let | |
305 | - | then | |
306 | - | else ( | |
307 | - | let | |
308 | - | then | |
309 | - | else ( | |
310 | - | let | |
311 | - | let | |
312 | - | let | |
313 | - | let | |
314 | - | let | |
315 | - | let | |
243 | + | let bu = if (bN) | |
244 | + | then aO(bP) | |
245 | + | else (aO(bP) - bJ) | |
246 | + | let bw = if (bN) | |
247 | + | then aO(bQ) | |
248 | + | else (aO(bQ) - bL) | |
249 | + | let bV = z(bJ, bd) | |
250 | + | let bW = z(bL, be) | |
251 | + | let bX = aQ(bW, bV) | |
252 | + | let bv = z(bu, bd) | |
253 | + | let bx = z(bw, be) | |
254 | + | let bY = if ((bt == 0)) | |
316 | 255 | then { | |
317 | - | let | |
318 | - | let | |
319 | - | let | |
320 | - | $Tuple5( | |
256 | + | let by = e | |
257 | + | let bZ = e | |
258 | + | let bg = pow((bV * bW), 0, toBigInt(5), 1, 0, DOWN) | |
259 | + | $Tuple5(C(bg, b), C(bV, bd), C(bW, be), aQ((bx + bW), (bv + bV)), bZ) | |
321 | 260 | } | |
322 | 261 | else { | |
323 | - | let | |
324 | - | let | |
325 | - | let | |
326 | - | if (if (( | |
327 | - | then ( | |
262 | + | let by = aQ(bx, bv) | |
263 | + | let bZ = fraction(J((by - bX)), d, by) | |
264 | + | let ca = z(bI, b) | |
265 | + | if (if ((by != e)) | |
266 | + | then (bZ > ca) | |
328 | 267 | else false) | |
329 | - | then throw(((("Price slippage " + toString( | |
268 | + | then throw(((("Price slippage " + toString(bZ)) + " exceeded the passed limit of ") + toString(ca))) | |
330 | 269 | else { | |
331 | - | let | |
332 | - | let | |
333 | - | let | |
334 | - | let | |
335 | - | then $Tuple2( | |
336 | - | else $Tuple2( | |
337 | - | let | |
338 | - | let | |
339 | - | let | |
340 | - | $Tuple5( | |
270 | + | let bB = z(bt, b) | |
271 | + | let cb = fraction(bV, by, d) | |
272 | + | let cc = fraction(bW, d, by) | |
273 | + | let cd = if ((cb > bW)) | |
274 | + | then $Tuple2(cc, bW) | |
275 | + | else $Tuple2(bV, cb) | |
276 | + | let ce = cd._1 | |
277 | + | let cf = cd._2 | |
278 | + | let bg = fraction(bB, cf, bx) | |
279 | + | $Tuple5(C(bg, b), C(ce, bd), C(cf, be), by, bZ) | |
341 | 280 | } | |
342 | 281 | } | |
343 | - | let | |
344 | - | let | |
345 | - | let | |
346 | - | let | |
347 | - | let | |
348 | - | if ((0 >= | |
282 | + | let cg = bY._1 | |
283 | + | let ch = bY._2 | |
284 | + | let ci = bY._3 | |
285 | + | let bz = C(bY._4, b) | |
286 | + | let cj = C(bY._5, b) | |
287 | + | if ((0 >= cg)) | |
349 | 288 | then throw("Invalid calculations. LP calculated is less than zero.") | |
350 | 289 | else { | |
351 | - | let | |
290 | + | let ck = if (!(bO)) | |
352 | 291 | then 0 | |
353 | - | else | |
354 | - | let | |
355 | - | let | |
356 | - | let | |
357 | - | $Tuple13( | |
292 | + | else cg | |
293 | + | let cl = (bJ - ch) | |
294 | + | let cm = (bL - ci) | |
295 | + | let cn = [IntegerEntry(N(), bz), IntegerEntry(O(height, lastBlock.timestamp), bz), StringEntry(R(S, bm), az(ch, ci, ck, bz, bI, cj, height, lastBlock.timestamp, cl, cm))] | |
296 | + | $Tuple13(cg, ck, bz, bu, bw, bt, bp, bs, cn, cl, cm, bK, bM) | |
358 | 297 | } | |
359 | 298 | } | |
360 | 299 | } | |
361 | 300 | ||
362 | 301 | ||
363 | - | func | |
364 | - | let | |
365 | - | let | |
366 | - | let | |
367 | - | let | |
368 | - | let | |
369 | - | let | |
370 | - | let | |
371 | - | let | |
372 | - | let | |
373 | - | then | |
374 | - | else | |
375 | - | let | |
376 | - | if (if (if ( | |
302 | + | func co (cp) = { | |
303 | + | let bc = av() | |
304 | + | let cq = bc[n] | |
305 | + | let cr = bc[o] | |
306 | + | let bs = parseIntValue(bc[l]) | |
307 | + | let bd = parseIntValue(bc[p]) | |
308 | + | let be = parseIntValue(bc[q]) | |
309 | + | let cs = aO(cq) | |
310 | + | let ct = aO(cr) | |
311 | + | let by = if ((cp.orderType == Buy)) | |
312 | + | then aT(bd, be, (cs + cp.amount), ct) | |
313 | + | else aT(bd, be, (cs - cp.amount), ct) | |
314 | + | let bz = C(by, b) | |
315 | + | if (if (if (at()) | |
377 | 316 | then true | |
378 | - | else ( | |
317 | + | else (bs == i)) | |
379 | 318 | then true | |
380 | - | else ( | |
319 | + | else (bs == j)) | |
381 | 320 | then throw("Exchange operations disabled") | |
382 | 321 | else { | |
383 | - | let | |
384 | - | let | |
322 | + | let cu = cp.assetPair.amountAsset | |
323 | + | let cv = if ((cu == unit)) | |
385 | 324 | then "WAVES" | |
386 | - | else toBase58String(value( | |
387 | - | let | |
388 | - | let | |
325 | + | else toBase58String(value(cu)) | |
326 | + | let cw = cp.assetPair.priceAsset | |
327 | + | let cx = if ((cw == unit)) | |
389 | 328 | then "WAVES" | |
390 | - | else toBase58String(value( | |
391 | - | if (if (( | |
329 | + | else toBase58String(value(cw)) | |
330 | + | if (if ((cv != cq)) | |
392 | 331 | then true | |
393 | - | else ( | |
332 | + | else (cx != cr)) | |
394 | 333 | then throw("Wrong order assets.") | |
395 | 334 | else { | |
396 | - | let | |
397 | - | let | |
398 | - | let | |
399 | - | let | |
400 | - | then ( | |
401 | - | else ( | |
335 | + | let cy = cp.price | |
336 | + | let cz = fraction(b, be, bd) | |
337 | + | let cA = F(cy, b, cz) | |
338 | + | let cB = if ((cp.orderType == Buy)) | |
339 | + | then (bz >= cA) | |
340 | + | else (cA >= bz) | |
402 | 341 | true | |
403 | 342 | } | |
404 | 343 | } | |
405 | 344 | } | |
406 | 345 | ||
407 | 346 | ||
408 | - | func | |
347 | + | func cC (cD) = if ((size(cD.payments) != 1)) | |
409 | 348 | then throw("exactly 1 payment is expected") | |
410 | 349 | else { | |
411 | - | let | |
412 | - | let | |
413 | - | let | |
414 | - | let | |
415 | - | let | |
416 | - | let | |
417 | - | let | |
418 | - | let | |
419 | - | if (if ( | |
350 | + | let cE = value(cD.payments[0]) | |
351 | + | let bn = value(cE.assetId) | |
352 | + | let cF = cE.amount | |
353 | + | let bY = bl(toBase58String(cD.transactionId), toBase58String(bn), cF, cD.caller) | |
354 | + | let bE = bY._1 | |
355 | + | let bF = bY._2 | |
356 | + | let bs = parseIntValue(bY._9) | |
357 | + | let bG = bY._10 | |
358 | + | if (if (at()) | |
420 | 359 | then true | |
421 | - | else ( | |
422 | - | then throw(("Get operation is blocked by admin. Status = " + toString( | |
423 | - | else $Tuple5( | |
360 | + | else (bs == j)) | |
361 | + | then throw(("Get operation is blocked by admin. Status = " + toString(bs))) | |
362 | + | else $Tuple5(bE, bF, cF, bn, bG) | |
424 | 363 | } | |
425 | 364 | ||
426 | 365 | ||
427 | - | func | |
366 | + | func cG (cD,bI,bO) = if ((size(cD.payments) != 2)) | |
428 | 367 | then throw("exactly 2 payments are expected") | |
429 | 368 | else { | |
430 | - | let | |
431 | - | let | |
432 | - | let | |
433 | - | let | |
434 | - | if (if (if ( | |
369 | + | let cH = value(cD.payments[0]) | |
370 | + | let cI = value(cD.payments[1]) | |
371 | + | let cJ = bH(toBase58String(cD.transactionId), bI, cH.amount, cH.assetId, cI.amount, cI.assetId, toString(cD.caller), false, bO) | |
372 | + | let bs = parseIntValue(cJ._8) | |
373 | + | if (if (if (at()) | |
435 | 374 | then true | |
436 | - | else ( | |
375 | + | else (bs == h)) | |
437 | 376 | then true | |
438 | - | else ( | |
439 | - | then throw(("Put operation is blocked by admin. Status = " + toString( | |
440 | - | else | |
377 | + | else (bs == j)) | |
378 | + | then throw(("Put operation is blocked by admin. Status = " + toString(bs))) | |
379 | + | else cJ | |
441 | 380 | } | |
442 | 381 | ||
443 | 382 | ||
444 | - | func | |
445 | - | let | |
446 | - | if (( | |
383 | + | func cK () = { | |
384 | + | let cL = getString(L()) | |
385 | + | if ($isInstanceOf(cL, "String")) | |
447 | 386 | then { | |
448 | - | let dp = { | |
449 | - | let dq = do | |
450 | - | if ($isInstanceOf(dq, "Address")) | |
451 | - | then { | |
452 | - | let dr = dq | |
453 | - | invoke(dr, "emit", [dn], nil) | |
454 | - | } | |
455 | - | else unit | |
456 | - | } | |
457 | - | if ((dp == dp)) | |
458 | - | then dn | |
459 | - | else throw("Strict value is not equal to itself.") | |
387 | + | let cM = cL | |
388 | + | fromBase58String(cM) | |
460 | 389 | } | |
461 | - | else throw("Strict value is not equal to itself.") | |
462 | - | } | |
463 | - | ||
464 | - | ||
465 | - | func ds (dn) = { | |
466 | - | let dt = fraction(dn, ae, b) | |
467 | - | $Tuple2((dn - dt), dt) | |
468 | - | } | |
469 | - | ||
470 | - | ||
471 | - | func du (dv,dw,X,Y) = { | |
472 | - | let dx = (Y == unit) | |
473 | - | let dy = bq(aM(aU)) | |
474 | - | let dz = bq(aM(aV)) | |
475 | - | let dA = if ((dw == aU)) | |
476 | - | then true | |
477 | - | else if ((dw == aV)) | |
478 | - | then false | |
479 | - | else aB("invalid asset") | |
480 | - | let dB = if (dx) | |
481 | - | then $Tuple2(dy, dz) | |
482 | - | else if (dA) | |
483 | - | then $Tuple2((dy - dv), dz) | |
484 | - | else $Tuple2(dy, (dz - dv)) | |
485 | - | let dC = dB._1 | |
486 | - | let dD = dB._2 | |
487 | - | let dE = if (dA) | |
488 | - | then $Tuple2(dv, 0) | |
489 | - | else $Tuple2(0, dv) | |
490 | - | let dF = dE._1 | |
491 | - | let dG = dE._2 | |
492 | - | let dH = ds(dF)._1 | |
493 | - | let dI = ds(dG)._1 | |
494 | - | let dJ = ds(dv) | |
495 | - | let dK = dJ._1 | |
496 | - | let dt = dJ._2 | |
497 | - | let dL = (dC + dH) | |
498 | - | let dM = (dD + dI) | |
499 | - | let dN = bs(D(dM, aX), D(dL, aW)) | |
500 | - | let dO = G(dN, b) | |
501 | - | let dP = if (dA) | |
502 | - | then dC | |
503 | - | else dD | |
504 | - | let dQ = toBigInt(dP) | |
505 | - | let dR = toBigInt(valueOrErrorMessage(assetInfo(aT), (("asset " + toBase58String(aT)) + " doesn't exist")).quantity) | |
506 | - | let dS = if ((dR > f)) | |
507 | - | then true | |
508 | - | else aB("initial deposit requires all coins") | |
509 | - | if ((dS == dS)) | |
510 | - | then { | |
511 | - | let dT = toBigInt(dK) | |
512 | - | let dU = max([0, toInt(((dR * (sqrtBigInt((d + ((dT * d) / dQ)), 18, 18, DOWN) - d)) / d))]) | |
513 | - | let cP = if (dx) | |
514 | - | then nil | |
515 | - | else [IntegerEntry(S(), dO), IntegerEntry(T(height, lastBlock.timestamp), dO), StringEntry(W(toString(value(X)), toBase58String(value(Y))), bb(dF, dG, dU, dO, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
516 | - | let dV = bs(D(dD, aX), D(dC, aW)) | |
517 | - | let dW = G(dV, b) | |
518 | - | let dX = N((((dO - dW) * b) / dW)) | |
519 | - | $Tuple4(dU, cP, dt, dX) | |
520 | - | } | |
521 | - | else throw("Strict value is not equal to itself.") | |
522 | - | } | |
523 | - | ||
524 | - | ||
525 | - | func dY (dZ,dK,dw,X,Y) = { | |
526 | - | let dx = (Y == unit) | |
527 | - | let ea = [if ((dw == aT)) | |
528 | - | then true | |
529 | - | else aB("invalid lp asset")] | |
530 | - | if ((ea == ea)) | |
531 | - | then { | |
532 | - | let eb = if ((dZ == aU)) | |
533 | - | then true | |
534 | - | else if ((dZ == aV)) | |
535 | - | then false | |
536 | - | else aB("invalid asset") | |
537 | - | let ec = if (eb) | |
538 | - | then toBigInt(bq(aM(aU))) | |
539 | - | else toBigInt(bq(aM(aV))) | |
540 | - | let ed = bq(aM(aU)) | |
541 | - | let ee = bq(aM(aV)) | |
542 | - | let ef = if (eb) | |
543 | - | then ed | |
544 | - | else ee | |
545 | - | let eg = toBigInt(ef) | |
546 | - | let dR = toBigInt(valueOrErrorMessage(assetInfo(aT), (("asset " + toBase58String(aT)) + " doesn't exist")).quantity) | |
547 | - | let eh = toBigInt(dK) | |
548 | - | let ei = max([0, toInt(((ec * (d - pow((d - ((eh * d) / dR)), 18, h, 0, 18, DOWN))) / d))]) | |
549 | - | let ej = ds(ei) | |
550 | - | let ek = ej._1 | |
551 | - | let dt = ej._2 | |
552 | - | let el = if (eb) | |
553 | - | then $Tuple4(ek, 0, (ed - ei), ee) | |
554 | - | else $Tuple4(0, ek, ed, (ee - ei)) | |
555 | - | let em = el._1 | |
556 | - | let en = el._2 | |
557 | - | let eo = el._3 | |
558 | - | let ep = el._4 | |
559 | - | let dN = bs(D(ep, aX), D(eo, aW)) | |
560 | - | let dO = G(dN, b) | |
561 | - | let cP = if (dx) | |
562 | - | then nil | |
563 | - | else [StringEntry(Z(toString(value(X)), toBase58String(value(Y))), bm(em, en, dK, dO, height, lastBlock.timestamp)), IntegerEntry(S(), dO), IntegerEntry(T(height, lastBlock.timestamp), dO)] | |
564 | - | let dV = bs(D(ee, aX), D(ed, aW)) | |
565 | - | let dW = G(dV, b) | |
566 | - | let dX = N((((dO - dW) * b) / dW)) | |
567 | - | $Tuple4(ek, cP, dt, dX) | |
568 | - | } | |
569 | - | else throw("Strict value is not equal to itself.") | |
570 | - | } | |
571 | - | ||
572 | - | ||
573 | - | func eq () = { | |
574 | - | let dq = getString(Q()) | |
575 | - | if ($isInstanceOf(dq, "String")) | |
576 | - | then { | |
577 | - | let er = dq | |
578 | - | fromBase58String(er) | |
579 | - | } | |
580 | - | else if ($isInstanceOf(dq, "Unit")) | |
390 | + | else if ($isInstanceOf(cL, "Unit")) | |
581 | 391 | then unit | |
582 | 392 | else throw("Match error") | |
583 | 393 | } | |
584 | 394 | ||
585 | 395 | ||
586 | - | func | |
587 | - | let | |
588 | - | if ($isInstanceOf( | |
396 | + | func cN () = { | |
397 | + | let cL = getString(M()) | |
398 | + | if ($isInstanceOf(cL, "String")) | |
589 | 399 | then { | |
590 | - | let | |
591 | - | fromBase58String( | |
400 | + | let cM = cL | |
401 | + | fromBase58String(cM) | |
592 | 402 | } | |
593 | - | else if ($isInstanceOf( | |
403 | + | else if ($isInstanceOf(cL, "Unit")) | |
594 | 404 | then unit | |
595 | 405 | else throw("Match error") | |
596 | 406 | } | |
597 | 407 | ||
598 | 408 | ||
599 | - | func | |
600 | - | let | |
601 | - | let | |
602 | - | if ($isInstanceOf( | |
409 | + | func cO (cD) = { | |
410 | + | let cP = throw("Permission denied") | |
411 | + | let cL = cK() | |
412 | + | if ($isInstanceOf(cL, "ByteVector")) | |
603 | 413 | then { | |
604 | - | let | |
605 | - | if (( | |
414 | + | let cQ = cL | |
415 | + | if ((cD.callerPublicKey == cQ)) | |
606 | 416 | then true | |
607 | - | else | |
417 | + | else cP | |
608 | 418 | } | |
609 | - | else if ($isInstanceOf( | |
610 | - | then if (( | |
419 | + | else if ($isInstanceOf(cL, "Unit")) | |
420 | + | then if ((cD.caller == this)) | |
611 | 421 | then true | |
612 | - | else | |
422 | + | else cP | |
613 | 423 | else throw("Match error") | |
614 | 424 | } | |
615 | 425 | ||
616 | 426 | ||
617 | - | @Callable(df) | |
618 | - | func setManager (ew) = { | |
619 | - | let ex = et(df) | |
620 | - | if ((ex == ex)) | |
427 | + | @Callable(cD) | |
428 | + | func constructor (as) = { | |
429 | + | let cR = cO(cD) | |
430 | + | if ((cR == cR)) | |
431 | + | then [StringEntry(K(), as)] | |
432 | + | else throw("Strict value is not equal to itself.") | |
433 | + | } | |
434 | + | ||
435 | + | ||
436 | + | ||
437 | + | @Callable(cD) | |
438 | + | func setManager (cS) = { | |
439 | + | let cR = cO(cD) | |
440 | + | if ((cR == cR)) | |
621 | 441 | then { | |
622 | - | let | |
623 | - | if (( | |
624 | - | then [StringEntry( | |
442 | + | let cT = fromBase58String(cS) | |
443 | + | if ((cT == cT)) | |
444 | + | then [StringEntry(M(), cS)] | |
625 | 445 | else throw("Strict value is not equal to itself.") | |
626 | 446 | } | |
627 | 447 | else throw("Strict value is not equal to itself.") | |
629 | 449 | ||
630 | 450 | ||
631 | 451 | ||
632 | - | @Callable( | |
452 | + | @Callable(cD) | |
633 | 453 | func confirmManager () = { | |
634 | - | let | |
635 | - | let | |
454 | + | let cU = cN() | |
455 | + | let cV = if (isDefined(cU)) | |
636 | 456 | then true | |
637 | 457 | else throw("No pending manager") | |
638 | - | if (( | |
458 | + | if ((cV == cV)) | |
639 | 459 | then { | |
640 | - | let | |
460 | + | let cW = if ((cD.callerPublicKey == value(cU))) | |
641 | 461 | then true | |
642 | 462 | else throw("You are not pending manager") | |
643 | - | if (( | |
644 | - | then [StringEntry( | |
463 | + | if ((cW == cW)) | |
464 | + | then [StringEntry(L(), toBase58String(value(cU))), DeleteEntry(M())] | |
645 | 465 | else throw("Strict value is not equal to itself.") | |
646 | 466 | } | |
647 | 467 | else throw("Strict value is not equal to itself.") | |
649 | 469 | ||
650 | 470 | ||
651 | 471 | ||
652 | - | @Callable(df) | |
653 | - | func put (ck,eC) = if ((0 > ck)) | |
654 | - | then throw("Invalid slippageTolerance passed") | |
472 | + | @Callable(cD) | |
473 | + | func put (bI,cX) = { | |
474 | + | let cY = ay() | |
475 | + | let cZ = valueOrErrorMessage(addressFromString(cY[x]), "Error. Incorrect staking address.") | |
476 | + | let da = valueOrErrorMessage(addressFromString(cY[y]), "Error. Incorrect slippage contract address.") | |
477 | + | if ((0 > bI)) | |
478 | + | then throw("Invalid slippageTolerance passed") | |
479 | + | else { | |
480 | + | let cJ = cG(cD, bI, true) | |
481 | + | let ck = cJ._2 | |
482 | + | let bp = cJ._7 | |
483 | + | let bG = cJ._9 | |
484 | + | let cl = cJ._10 | |
485 | + | let cm = cJ._11 | |
486 | + | let db = cJ._12 | |
487 | + | let dc = cJ._13 | |
488 | + | let dd = invoke(as, "emit", [ck], nil) | |
489 | + | if ((dd == dd)) | |
490 | + | then { | |
491 | + | let de = { | |
492 | + | let cL = dd | |
493 | + | if ($isInstanceOf(cL, "Address")) | |
494 | + | then { | |
495 | + | let df = cL | |
496 | + | invoke(df, "emit", [ck], nil) | |
497 | + | } | |
498 | + | else unit | |
499 | + | } | |
500 | + | if ((de == de)) | |
501 | + | then { | |
502 | + | let dg = if ((cl > 0)) | |
503 | + | then invoke(da, "put", nil, [AttachedPayment(db, cl)]) | |
504 | + | else nil | |
505 | + | if ((dg == dg)) | |
506 | + | then { | |
507 | + | let dh = if ((cm > 0)) | |
508 | + | then invoke(da, "put", nil, [AttachedPayment(dc, cm)]) | |
509 | + | else nil | |
510 | + | if ((dh == dh)) | |
511 | + | then { | |
512 | + | let di = if (cX) | |
513 | + | then { | |
514 | + | let dj = invoke(cZ, "stake", nil, [AttachedPayment(bp, ck)]) | |
515 | + | if ((dj == dj)) | |
516 | + | then nil | |
517 | + | else throw("Strict value is not equal to itself.") | |
518 | + | } | |
519 | + | else [ScriptTransfer(cD.caller, ck, bp)] | |
520 | + | (bG ++ di) | |
521 | + | } | |
522 | + | else throw("Strict value is not equal to itself.") | |
523 | + | } | |
524 | + | else throw("Strict value is not equal to itself.") | |
525 | + | } | |
526 | + | else throw("Strict value is not equal to itself.") | |
527 | + | } | |
528 | + | else throw("Strict value is not equal to itself.") | |
529 | + | } | |
530 | + | } | |
531 | + | ||
532 | + | ||
533 | + | ||
534 | + | @Callable(cD) | |
535 | + | func putForFree (dk) = if ((0 > dk)) | |
536 | + | then throw("Invalid value passed") | |
655 | 537 | else { | |
656 | - | let dl = di(df, ck, true) | |
657 | - | let cM = dl._2 | |
658 | - | let bR = dl._7 | |
659 | - | let ci = dl._9 | |
660 | - | let cN = dl._10 | |
661 | - | let cO = dl._11 | |
662 | - | let eD = dl._12 | |
663 | - | let eE = dl._13 | |
664 | - | let do = invoke(aD, "emit", [cM], nil) | |
665 | - | if ((do == do)) | |
666 | - | then { | |
667 | - | let dp = { | |
668 | - | let dq = do | |
669 | - | if ($isInstanceOf(dq, "Address")) | |
670 | - | then { | |
671 | - | let dr = dq | |
672 | - | invoke(dr, "emit", [cM], nil) | |
673 | - | } | |
674 | - | else unit | |
675 | - | } | |
676 | - | if ((dp == dp)) | |
677 | - | then { | |
678 | - | let eF = if ((cN > 0)) | |
679 | - | then invoke(ba, "put", nil, [AttachedPayment(eD, cN)]) | |
680 | - | else nil | |
681 | - | if ((eF == eF)) | |
682 | - | then { | |
683 | - | let eG = if ((cO > 0)) | |
684 | - | then invoke(ba, "put", nil, [AttachedPayment(eE, cO)]) | |
685 | - | else nil | |
686 | - | if ((eG == eG)) | |
687 | - | then { | |
688 | - | let eH = if (eC) | |
689 | - | then { | |
690 | - | let eI = invoke(aZ, "stake", nil, [AttachedPayment(bR, cM)]) | |
691 | - | if ((eI == eI)) | |
692 | - | then nil | |
693 | - | else throw("Strict value is not equal to itself.") | |
694 | - | } | |
695 | - | else [ScriptTransfer(df.caller, cM, bR)] | |
696 | - | (ci ++ eH) | |
697 | - | } | |
698 | - | else throw("Strict value is not equal to itself.") | |
699 | - | } | |
700 | - | else throw("Strict value is not equal to itself.") | |
701 | - | } | |
702 | - | else throw("Strict value is not equal to itself.") | |
703 | - | } | |
704 | - | else throw("Strict value is not equal to itself.") | |
538 | + | let cJ = cG(cD, dk, false) | |
539 | + | cJ._9 | |
705 | 540 | } | |
706 | 541 | ||
707 | 542 | ||
708 | 543 | ||
709 | - | @Callable(df) | |
710 | - | func putForFree (eJ) = if ((0 > eJ)) | |
711 | - | then throw("Invalid value passed") | |
712 | - | else { | |
713 | - | let dl = di(df, eJ, false) | |
714 | - | dl._9 | |
715 | - | } | |
716 | - | ||
717 | - | ||
718 | - | ||
719 | - | @Callable(df) | |
720 | - | func putOneTkn (eK,eL) = { | |
721 | - | let eM = { | |
722 | - | let eN = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
723 | - | if ($isInstanceOf(eN, "Boolean")) | |
724 | - | then eN | |
725 | - | else throw(($getType(eN) + " couldn't be cast to Boolean")) | |
726 | - | } | |
727 | - | let eO = if (if (if (aF()) | |
728 | - | then true | |
729 | - | else (aS == l)) | |
730 | - | then true | |
731 | - | else (aS == n)) | |
732 | - | then true | |
733 | - | else eM | |
734 | - | let ea = [if (!(eO)) | |
735 | - | then true | |
736 | - | else aB("put operation is blocked by admin"), if ((size(df.payments) == 1)) | |
737 | - | then true | |
738 | - | else aB("exactly 1 payment are expected")] | |
739 | - | if ((ea == ea)) | |
740 | - | then { | |
741 | - | let eP = df.payments[0] | |
742 | - | let dw = eP.assetId | |
743 | - | let dv = eP.amount | |
744 | - | let X = df.caller | |
745 | - | let Y = df.transactionId | |
746 | - | let eQ = du(dv, dw, X, Y) | |
747 | - | let eR = eQ._1 | |
748 | - | let cP = eQ._2 | |
749 | - | let dt = eQ._3 | |
750 | - | let eS = eQ._4 | |
751 | - | let eT = if (if ((eK > 0)) | |
752 | - | then (eK > eR) | |
753 | - | else false) | |
754 | - | then aB(makeString(["amount to receive is less than ", toString(eK)], "")) | |
755 | - | else eR | |
756 | - | let do = dm(eT) | |
757 | - | if ((do == do)) | |
758 | - | then { | |
759 | - | let eH = if (eL) | |
760 | - | then { | |
761 | - | let eU = invoke(aZ, "stake", nil, [AttachedPayment(aT, eT)]) | |
762 | - | if ((eU == eU)) | |
763 | - | then nil | |
764 | - | else throw("Strict value is not equal to itself.") | |
765 | - | } | |
766 | - | else [ScriptTransfer(df.caller, eT, aT)] | |
767 | - | let eV = if ((dt > 0)) | |
768 | - | then [ScriptTransfer(aE, dt, dw)] | |
769 | - | else nil | |
770 | - | $Tuple2(((cP ++ eH) ++ eV), eT) | |
771 | - | } | |
772 | - | else throw("Strict value is not equal to itself.") | |
773 | - | } | |
544 | + | @Callable(cD) | |
545 | + | func get () = { | |
546 | + | let bY = cC(cD) | |
547 | + | let dl = bY._1 | |
548 | + | let bF = bY._2 | |
549 | + | let cF = bY._3 | |
550 | + | let bn = bY._4 | |
551 | + | let bG = bY._5 | |
552 | + | let dm = invoke(as, "burn", [cF], [AttachedPayment(bn, cF)]) | |
553 | + | if ((dm == dm)) | |
554 | + | then bG | |
774 | 555 | else throw("Strict value is not equal to itself.") | |
775 | 556 | } | |
776 | 557 | ||
777 | 558 | ||
778 | 559 | ||
779 | - | @Callable(df) | |
780 | - | func putOneTknREADONLY (dw,dv) = { | |
781 | - | let eW = du(dv, aK(dw), unit, unit) | |
782 | - | let eR = eW._1 | |
783 | - | let cP = eW._2 | |
784 | - | let dt = eW._3 | |
785 | - | let eS = eW._4 | |
786 | - | $Tuple2(nil, $Tuple3(eR, dt, eS)) | |
787 | - | } | |
788 | - | ||
789 | - | ||
790 | - | ||
791 | - | @Callable(df) | |
792 | - | func getOneTkn (eX,eK) = { | |
793 | - | let eM = { | |
794 | - | let eN = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
795 | - | if ($isInstanceOf(eN, "Boolean")) | |
796 | - | then eN | |
797 | - | else throw(($getType(eN) + " couldn't be cast to Boolean")) | |
798 | - | } | |
799 | - | let eY = if (if (aF()) | |
800 | - | then true | |
801 | - | else (aS == n)) | |
802 | - | then true | |
803 | - | else eM | |
804 | - | let ea = [if (!(eY)) | |
805 | - | then true | |
806 | - | else aB("get operation is blocked by admin"), if ((size(df.payments) == 1)) | |
807 | - | then true | |
808 | - | else aB("exactly 1 payment are expected")] | |
809 | - | if ((ea == ea)) | |
810 | - | then { | |
811 | - | let dZ = aK(eX) | |
812 | - | let eP = df.payments[0] | |
813 | - | let dw = eP.assetId | |
814 | - | let dK = eP.amount | |
815 | - | let X = df.caller | |
816 | - | let Y = df.transactionId | |
817 | - | let eZ = dY(dZ, dK, dw, X, Y) | |
818 | - | let fa = eZ._1 | |
819 | - | let cP = eZ._2 | |
820 | - | let dt = eZ._3 | |
821 | - | let eS = eZ._4 | |
822 | - | let dn = if (if ((eK > 0)) | |
823 | - | then (eK > fa) | |
824 | - | else false) | |
825 | - | then aB(makeString(["amount to receive is less than ", toString(eK)], "")) | |
826 | - | else fa | |
827 | - | let fb = invoke(aD, "burn", [dK], [AttachedPayment(dw, dK)]) | |
828 | - | if ((fb == fb)) | |
829 | - | then { | |
830 | - | let fc = [ScriptTransfer(X, dn, dZ)] | |
831 | - | let eV = if ((dt > 0)) | |
832 | - | then [ScriptTransfer(aE, dt, dZ)] | |
833 | - | else nil | |
834 | - | $Tuple2(((cP ++ fc) ++ eV), dn) | |
835 | - | } | |
836 | - | else throw("Strict value is not equal to itself.") | |
837 | - | } | |
838 | - | else throw("Strict value is not equal to itself.") | |
839 | - | } | |
840 | - | ||
841 | - | ||
842 | - | ||
843 | - | @Callable(df) | |
844 | - | func getOneTknREADONLY (dZ,dK) = { | |
845 | - | let fd = dY(aK(dZ), dK, aT, unit, unit) | |
846 | - | let fa = fd._1 | |
847 | - | let cP = fd._2 | |
848 | - | let dt = fd._3 | |
849 | - | let eS = fd._4 | |
850 | - | $Tuple2(nil, $Tuple3(fa, dt, eS)) | |
851 | - | } | |
852 | - | ||
853 | - | ||
854 | - | ||
855 | - | @Callable(df) | |
856 | - | func unstakeAndGetOneTkn (fe,eX,eK) = { | |
857 | - | let eM = { | |
858 | - | let eN = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
859 | - | if ($isInstanceOf(eN, "Boolean")) | |
860 | - | then eN | |
861 | - | else throw(($getType(eN) + " couldn't be cast to Boolean")) | |
862 | - | } | |
863 | - | let eY = if (if (aF()) | |
864 | - | then true | |
865 | - | else (aS == n)) | |
866 | - | then true | |
867 | - | else eM | |
868 | - | let ea = [if (!(eY)) | |
869 | - | then true | |
870 | - | else aB("get operation is blocked by admin"), if ((size(df.payments) == 0)) | |
871 | - | then true | |
872 | - | else aB("no payments are expected")] | |
873 | - | if ((ea == ea)) | |
874 | - | then { | |
875 | - | let dZ = aK(eX) | |
876 | - | let X = df.caller | |
877 | - | let Y = df.transactionId | |
878 | - | let ff = invoke(aZ, "unstake", [toBase58String(aT), fe], nil) | |
879 | - | if ((ff == ff)) | |
880 | - | then { | |
881 | - | let fg = dY(dZ, fe, aT, X, Y) | |
882 | - | let fa = fg._1 | |
883 | - | let cP = fg._2 | |
884 | - | let dt = fg._3 | |
885 | - | let eS = fg._4 | |
886 | - | let dn = if (if ((eK > 0)) | |
887 | - | then (eK > fa) | |
888 | - | else false) | |
889 | - | then aB(makeString(["amount to receive is less than ", toString(eK)], "")) | |
890 | - | else fa | |
891 | - | let fb = invoke(aD, "burn", [fe], [AttachedPayment(aT, fe)]) | |
892 | - | if ((fb == fb)) | |
893 | - | then { | |
894 | - | let fc = [ScriptTransfer(df.caller, dn, dZ)] | |
895 | - | let eV = if ((dt > 0)) | |
896 | - | then [ScriptTransfer(aE, dt, dZ)] | |
897 | - | else nil | |
898 | - | $Tuple2(((cP ++ fc) ++ eV), dn) | |
899 | - | } | |
900 | - | else throw("Strict value is not equal to itself.") | |
901 | - | } | |
902 | - | else throw("Strict value is not equal to itself.") | |
903 | - | } | |
904 | - | else throw("Strict value is not equal to itself.") | |
905 | - | } | |
906 | - | ||
907 | - | ||
908 | - | ||
909 | - | @Callable(df) | |
910 | - | func get () = { | |
911 | - | let cA = de(df) | |
912 | - | let fh = cA._1 | |
913 | - | let ch = cA._2 | |
914 | - | let dh = cA._3 | |
915 | - | let bP = cA._4 | |
916 | - | let ci = cA._5 | |
917 | - | let fi = invoke(aD, "burn", [dh], [AttachedPayment(bP, dh)]) | |
918 | - | if ((fi == fi)) | |
919 | - | then ci | |
920 | - | else throw("Strict value is not equal to itself.") | |
921 | - | } | |
922 | - | ||
923 | - | ||
924 | - | ||
925 | - | @Callable(df) | |
926 | - | func getNoLess (fj,fk) = { | |
927 | - | let cA = de(df) | |
928 | - | let cg = cA._1 | |
929 | - | let ch = cA._2 | |
930 | - | let dh = cA._3 | |
931 | - | let bP = cA._4 | |
932 | - | let ci = cA._5 | |
933 | - | if ((fj > cg)) | |
934 | - | then throw(((("noLessThenAmtAsset failed: " + toString(cg)) + " < ") + toString(fj))) | |
935 | - | else if ((fk > ch)) | |
936 | - | then throw(((("noLessThenPriceAsset failed: " + toString(ch)) + " < ") + toString(fk))) | |
560 | + | @Callable(cD) | |
561 | + | func getNoLess (dn,do) = { | |
562 | + | let bY = cC(cD) | |
563 | + | let bE = bY._1 | |
564 | + | let bF = bY._2 | |
565 | + | let cF = bY._3 | |
566 | + | let bn = bY._4 | |
567 | + | let bG = bY._5 | |
568 | + | if ((dn > bE)) | |
569 | + | then throw(((("noLessThenAmtAsset failed: " + toString(bE)) + " < ") + toString(dn))) | |
570 | + | else if ((do > bF)) | |
571 | + | then throw(((("noLessThenPriceAsset failed: " + toString(bF)) + " < ") + toString(do))) | |
937 | 572 | else { | |
938 | - | let | |
939 | - | if (( | |
940 | - | then | |
573 | + | let dm = invoke(as, "burn", [cF], [AttachedPayment(bn, cF)]) | |
574 | + | if ((dm == dm)) | |
575 | + | then bG | |
941 | 576 | else throw("Strict value is not equal to itself.") | |
942 | 577 | } | |
943 | 578 | } | |
944 | 579 | ||
945 | 580 | ||
946 | 581 | ||
947 | - | @Callable( | |
948 | - | func unstakeAndGet ( | |
949 | - | let | |
582 | + | @Callable(cD) | |
583 | + | func unstakeAndGet (dp) = { | |
584 | + | let dq = if ((size(cD.payments) != 0)) | |
950 | 585 | then throw("No payments are expected") | |
951 | 586 | else true | |
952 | - | if (( | |
587 | + | if ((dq == dq)) | |
953 | 588 | then { | |
954 | - | let bE = aH() | |
955 | - | let bR = fromBase58String(bE[q]) | |
956 | - | let ff = invoke(aZ, "unstake", [toBase58String(bR), dn], nil) | |
957 | - | if ((ff == ff)) | |
589 | + | let bc = av() | |
590 | + | let cY = ay() | |
591 | + | let bp = fromBase58String(bc[m]) | |
592 | + | let cZ = valueOrErrorMessage(addressFromString(cY[x]), "Error. Incorrect staking address.") | |
593 | + | let dr = invoke(cZ, "unstake", [toBase58String(bp), dp], nil) | |
594 | + | if ((dr == dr)) | |
958 | 595 | then { | |
959 | - | let | |
960 | - | let | |
961 | - | let | |
962 | - | let | |
596 | + | let bY = bl(toBase58String(cD.transactionId), toBase58String(bp), dp, cD.caller) | |
597 | + | let bs = parseIntValue(bY._9) | |
598 | + | let bG = bY._10 | |
599 | + | let ds = if (if (at()) | |
963 | 600 | then true | |
964 | - | else ( | |
965 | - | then throw(("Get operation is blocked by admin. Status = " + toString( | |
601 | + | else (bs == j)) | |
602 | + | then throw(("Get operation is blocked by admin. Status = " + toString(bs))) | |
966 | 603 | else true | |
967 | - | if (( | |
604 | + | if ((ds == ds)) | |
968 | 605 | then { | |
969 | - | let | |
970 | - | if (( | |
971 | - | then | |
606 | + | let dm = invoke(as, "burn", [dp], [AttachedPayment(bp, dp)]) | |
607 | + | if ((dm == dm)) | |
608 | + | then bG | |
972 | 609 | else throw("Strict value is not equal to itself.") | |
973 | 610 | } | |
974 | 611 | else throw("Strict value is not equal to itself.") | |
980 | 617 | ||
981 | 618 | ||
982 | 619 | ||
983 | - | @Callable( | |
984 | - | func activate ( | |
620 | + | @Callable(cD) | |
621 | + | func activate (dt,du) = if ((toString(cD.caller) != toString(as))) | |
985 | 622 | then throw("permissions denied") | |
986 | - | else $Tuple2([StringEntry( | |
623 | + | else $Tuple2([StringEntry(V(), dt), StringEntry(W(), du)], "success") | |
987 | 624 | ||
988 | 625 | ||
989 | 626 | ||
990 | - | @Callable( | |
991 | - | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, | |
627 | + | @Callable(cD) | |
628 | + | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, av()) | |
992 | 629 | ||
993 | 630 | ||
994 | 631 | ||
995 | - | @Callable( | |
996 | - | func getAccBalanceWrapperREADONLY ( | |
632 | + | @Callable(cD) | |
633 | + | func getAccBalanceWrapperREADONLY (aP) = $Tuple2(nil, aO(aP)) | |
997 | 634 | ||
998 | 635 | ||
999 | 636 | ||
1000 | - | @Callable( | |
1001 | - | func calcPricesWrapperREADONLY ( | |
1002 | - | let | |
1003 | - | $Tuple2(nil, [toString( | |
637 | + | @Callable(cD) | |
638 | + | func calcPricesWrapperREADONLY (aW,aX,bb) = { | |
639 | + | let bk = ba(aW, aX, bb) | |
640 | + | $Tuple2(nil, [toString(bk[0]), toString(bk[1]), toString(bk[2])]) | |
1004 | 641 | } | |
1005 | 642 | ||
1006 | 643 | ||
1007 | 644 | ||
1008 | - | @Callable( | |
1009 | - | func toX18WrapperREADONLY ( | |
645 | + | @Callable(cD) | |
646 | + | func toX18WrapperREADONLY (A,B) = $Tuple2(nil, toString(z(A, B))) | |
1010 | 647 | ||
1011 | 648 | ||
1012 | 649 | ||
1013 | - | @Callable( | |
1014 | - | func fromX18WrapperREADONLY ( | |
650 | + | @Callable(cD) | |
651 | + | func fromX18WrapperREADONLY (D,E) = $Tuple2(nil, C(parseBigIntValue(D), E)) | |
1015 | 652 | ||
1016 | 653 | ||
1017 | 654 | ||
1018 | - | @Callable( | |
1019 | - | func calcPriceBigIntWrapperREADONLY ( | |
655 | + | @Callable(cD) | |
656 | + | func calcPriceBigIntWrapperREADONLY (aR,aS) = $Tuple2(nil, toString(aQ(parseBigIntValue(aR), parseBigIntValue(aS)))) | |
1020 | 657 | ||
1021 | 658 | ||
1022 | 659 | ||
1023 | - | @Callable( | |
1024 | - | func estimatePutOperationWrapperREADONLY (bO | |
660 | + | @Callable(cD) | |
661 | + | func estimatePutOperationWrapperREADONLY (bm,bI,bJ,bK,bL,bM,S,bN,bO) = $Tuple2(nil, bH(bm, bI, bJ, bK, bL, bM, S, bN, bO)) | |
1025 | 662 | ||
1026 | 663 | ||
1027 | 664 | ||
1028 | - | @Callable( | |
1029 | - | func estimateGetOperationWrapperREADONLY ( | |
1030 | - | let | |
1031 | - | $Tuple2(nil, $Tuple10( | |
665 | + | @Callable(cD) | |
666 | + | func estimateGetOperationWrapperREADONLY (bm,bn,bo,S) = { | |
667 | + | let bY = bl(bm, bn, bo, addressFromStringValue(S)) | |
668 | + | $Tuple2(nil, $Tuple10(bY._1, bY._2, bY._3, bY._4, bY._5, bY._6, bY._7, toString(bY._8), bY._9, bY._10)) | |
1032 | 669 | } | |
1033 | 670 | ||
1034 | 671 | ||
1035 | 672 | ||
1036 | - | @Callable( | |
673 | + | @Callable(cD) | |
1037 | 674 | func statsREADONLY () = { | |
1038 | - | let | |
1039 | - | let | |
1040 | - | let | |
1041 | - | let | |
1042 | - | let | |
1043 | - | let | |
1044 | - | let | |
1045 | - | let | |
1046 | - | let | |
1047 | - | let | |
1048 | - | let | |
1049 | - | let | |
675 | + | let bc = av() | |
676 | + | let bp = fromBase58String(bc[m]) | |
677 | + | let cq = bc[n] | |
678 | + | let cr = bc[o] | |
679 | + | let bR = bc[r] | |
680 | + | let bS = bc[s] | |
681 | + | let bd = parseIntValue(bc[p]) | |
682 | + | let be = parseIntValue(bc[q]) | |
683 | + | let dv = valueOrErrorMessage(assetInfo(bp), (("Asset " + toBase58String(bp)) + " doesn't exist")).quantity | |
684 | + | let cs = aO(cq) | |
685 | + | let ct = aO(cr) | |
686 | + | let dw = if ((dv == 0)) | |
1050 | 687 | then [e, e, e] | |
1051 | - | else | |
1052 | - | let | |
1053 | - | let | |
1054 | - | let | |
1055 | - | let | |
1056 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString( | |
688 | + | else ba(cs, ct, dv) | |
689 | + | let bz = 0 | |
690 | + | let dx = C(dw[1], b) | |
691 | + | let dy = C(dw[2], b) | |
692 | + | let dz = value(getInteger(as, ah(toString(this)))) | |
693 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(cs), toString(ct), toString(dv), toString(bz), toString(dx), toString(dy), toString(dz)], f)) | |
1057 | 694 | } | |
1058 | 695 | ||
1059 | 696 | ||
1060 | 697 | ||
1061 | - | @Callable( | |
1062 | - | func evaluatePutByAmountAssetREADONLY ( | |
1063 | - | let | |
1064 | - | let | |
1065 | - | let | |
1066 | - | let | |
1067 | - | let | |
1068 | - | let | |
1069 | - | let | |
1070 | - | let | |
1071 | - | let | |
1072 | - | let | |
1073 | - | let | |
1074 | - | let | |
1075 | - | let | |
1076 | - | let | |
1077 | - | let | |
698 | + | @Callable(cD) | |
699 | + | func evaluatePutByAmountAssetREADONLY (bJ) = { | |
700 | + | let bc = av() | |
701 | + | let bp = fromBase58String(bc[m]) | |
702 | + | let bP = bc[n] | |
703 | + | let bq = fromBase58String(bP) | |
704 | + | let bQ = bc[o] | |
705 | + | let br = fromBase58String(bQ) | |
706 | + | let bd = parseIntValue(bc[p]) | |
707 | + | let be = parseIntValue(bc[q]) | |
708 | + | let bs = bc[l] | |
709 | + | let dv = valueOrErrorMessage(assetInfo(bp), (("Asset " + toBase58String(bp)) + " doesn't exist")).quantity | |
710 | + | let cs = aO(bP) | |
711 | + | let ct = aO(bQ) | |
712 | + | let aY = z(cs, bd) | |
713 | + | let aZ = z(ct, be) | |
714 | + | let by = if ((dv == 0)) | |
1078 | 715 | then e | |
1079 | - | else | |
1080 | - | let | |
1081 | - | let | |
1082 | - | let | |
1083 | - | let | |
1084 | - | let | |
1085 | - | let | |
1086 | - | let | |
1087 | - | let | |
1088 | - | let | |
1089 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString( | |
716 | + | else aQ(aZ, aY) | |
717 | + | let bV = z(bJ, bd) | |
718 | + | let bW = fraction(bV, by, d) | |
719 | + | let bL = C(bW, be) | |
720 | + | let cJ = bH("", 500000, bJ, bq, bL, br, "", true, false) | |
721 | + | let cg = cJ._1 | |
722 | + | let dA = cJ._3 | |
723 | + | let bu = cJ._4 | |
724 | + | let bw = cJ._5 | |
725 | + | let bt = cJ._6 | |
726 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(cg), toString(C(by, b)), toString(bu), toString(bw), toString(bt), bs, toString(bJ), toString(bL)], f)) | |
1090 | 727 | } | |
1091 | 728 | ||
1092 | 729 | ||
1093 | 730 | ||
1094 | - | @Callable( | |
1095 | - | func evaluatePutByPriceAssetREADONLY ( | |
1096 | - | let | |
1097 | - | let | |
1098 | - | let | |
1099 | - | let | |
1100 | - | let | |
1101 | - | let | |
1102 | - | let | |
1103 | - | let | |
1104 | - | let | |
1105 | - | let | |
1106 | - | let | |
1107 | - | let | |
1108 | - | let | |
1109 | - | let | |
1110 | - | let | |
731 | + | @Callable(cD) | |
732 | + | func evaluatePutByPriceAssetREADONLY (bL) = { | |
733 | + | let bc = av() | |
734 | + | let bp = fromBase58String(bc[m]) | |
735 | + | let bP = bc[n] | |
736 | + | let bq = fromBase58String(bP) | |
737 | + | let bQ = bc[o] | |
738 | + | let br = fromBase58String(bQ) | |
739 | + | let bd = parseIntValue(bc[p]) | |
740 | + | let be = parseIntValue(bc[q]) | |
741 | + | let bs = bc[l] | |
742 | + | let dv = valueOrErrorMessage(assetInfo(bp), (("Asset " + toBase58String(bp)) + " doesn't exist")).quantity | |
743 | + | let dB = aO(bP) | |
744 | + | let dC = aO(bQ) | |
745 | + | let dD = z(dB, bd) | |
746 | + | let dE = z(dC, be) | |
747 | + | let by = if ((dv == 0)) | |
1111 | 748 | then e | |
1112 | - | else | |
1113 | - | let | |
1114 | - | let | |
1115 | - | let | |
1116 | - | let | |
1117 | - | let | |
1118 | - | let | |
1119 | - | let | |
1120 | - | let | |
1121 | - | let | |
1122 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString( | |
749 | + | else aQ(dE, dD) | |
750 | + | let bW = z(bL, be) | |
751 | + | let bV = fraction(bW, d, by) | |
752 | + | let bJ = C(bV, bd) | |
753 | + | let cJ = bH("", 500000, bJ, bq, bL, br, "", true, false) | |
754 | + | let cg = cJ._1 | |
755 | + | let dA = cJ._3 | |
756 | + | let bu = cJ._4 | |
757 | + | let bw = cJ._5 | |
758 | + | let bt = cJ._6 | |
759 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(cg), toString(C(by, b)), toString(bu), toString(bw), toString(bt), bs, toString(bJ), toString(bL)], f)) | |
1123 | 760 | } | |
1124 | 761 | ||
1125 | 762 | ||
1126 | 763 | ||
1127 | - | @Callable( | |
1128 | - | func evaluateGetREADONLY ( | |
1129 | - | let | |
1130 | - | let | |
1131 | - | let | |
1132 | - | let | |
1133 | - | let | |
1134 | - | let | |
1135 | - | let | |
1136 | - | let | |
1137 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString( | |
764 | + | @Callable(cD) | |
765 | + | func evaluateGetREADONLY (dF,dG) = { | |
766 | + | let bY = bl("", dF, dG, this) | |
767 | + | let bE = bY._1 | |
768 | + | let bF = bY._2 | |
769 | + | let bu = bY._5 | |
770 | + | let bw = bY._6 | |
771 | + | let bt = bY._7 | |
772 | + | let bz = bY._8 | |
773 | + | let bs = parseIntValue(bY._9) | |
774 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(bE), toString(bF), toString(bu), toString(bw), toString(bt), toString(bz), toString(bs)], f)) | |
1138 | 775 | } | |
1139 | 776 | ||
1140 | 777 | ||
1141 | - | @Verifier( | |
1142 | - | func | |
1143 | - | let | |
1144 | - | let | |
1145 | - | if ($isInstanceOf( | |
778 | + | @Verifier(dH) | |
779 | + | func dI () = { | |
780 | + | let dJ = { | |
781 | + | let cL = cK() | |
782 | + | if ($isInstanceOf(cL, "ByteVector")) | |
1146 | 783 | then { | |
1147 | - | let | |
1148 | - | | |
784 | + | let cQ = cL | |
785 | + | cQ | |
1149 | 786 | } | |
1150 | - | else if ($isInstanceOf( | |
1151 | - | then | |
787 | + | else if ($isInstanceOf(cL, "Unit")) | |
788 | + | then dH.senderPublicKey | |
1152 | 789 | else throw("Match error") | |
1153 | 790 | } | |
1154 | - | let | |
1155 | - | if ($isInstanceOf( | |
791 | + | let cL = dH | |
792 | + | if ($isInstanceOf(cL, "Order")) | |
1156 | 793 | then { | |
1157 | - | let | |
1158 | - | let | |
1159 | - | let | |
1160 | - | let | |
1161 | - | let | |
1162 | - | if (if (if ( | |
1163 | - | then | |
794 | + | let cp = cL | |
795 | + | let dK = au() | |
796 | + | let al = co(cp) | |
797 | + | let am = sigVerify(cp.bodyBytes, cp.proofs[0], cp.senderPublicKey) | |
798 | + | let an = sigVerify(cp.bodyBytes, cp.proofs[1], dK) | |
799 | + | if (if (if (al) | |
800 | + | then am | |
1164 | 801 | else false) | |
1165 | - | then | |
802 | + | then an | |
1166 | 803 | else false) | |
1167 | 804 | then true | |
1168 | - | else | |
805 | + | else ak(al, am, an) | |
1169 | 806 | } | |
1170 | - | else if ($isInstanceOf( | |
807 | + | else if ($isInstanceOf(cL, "SetScriptTransaction")) | |
1171 | 808 | then { | |
1172 | - | let | |
1173 | - | let | |
1174 | - | let | |
1175 | - | let | |
1176 | - | if (if (( | |
1177 | - | then ( | |
809 | + | let cM = cL | |
810 | + | let dL = blake2b256(value(cM.script)) | |
811 | + | let dM = fromBase64String(value(getString(as, aj()))) | |
812 | + | let dN = scriptHash(this) | |
813 | + | if (if ((dM == dL)) | |
814 | + | then (dN != dL) | |
1178 | 815 | else false) | |
1179 | 816 | then true | |
1180 | - | else sigVerify( | |
817 | + | else sigVerify(dH.bodyBytes, dH.proofs[0], dJ) | |
1181 | 818 | } | |
1182 | - | else sigVerify( | |
819 | + | else sigVerify(dH.bodyBytes, dH.proofs[0], dJ) | |
1183 | 820 | } | |
1184 | 821 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 8 | |
5 | 5 | ||
6 | 6 | let b = 100000000 | |
7 | 7 | ||
8 | 8 | let c = toBigInt(100000000) | |
9 | 9 | ||
10 | 10 | let d = toBigInt(1000000000000000000) | |
11 | 11 | ||
12 | 12 | let e = toBigInt(0) | |
13 | 13 | ||
14 | - | let f = | |
14 | + | let f = "__" | |
15 | 15 | ||
16 | - | let g = | |
16 | + | let g = 1 | |
17 | 17 | ||
18 | - | let h = | |
18 | + | let h = 2 | |
19 | 19 | ||
20 | - | let i = | |
20 | + | let i = 3 | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = 4 | |
23 | 23 | ||
24 | 24 | let k = 1 | |
25 | 25 | ||
26 | 26 | let l = 2 | |
27 | 27 | ||
28 | 28 | let m = 3 | |
29 | 29 | ||
30 | 30 | let n = 4 | |
31 | 31 | ||
32 | - | let o = | |
32 | + | let o = 5 | |
33 | 33 | ||
34 | - | let p = | |
34 | + | let p = 6 | |
35 | 35 | ||
36 | - | let q = | |
36 | + | let q = 7 | |
37 | 37 | ||
38 | - | let r = | |
38 | + | let r = 8 | |
39 | 39 | ||
40 | - | let s = | |
40 | + | let s = 9 | |
41 | 41 | ||
42 | - | let t = | |
42 | + | let t = 10 | |
43 | 43 | ||
44 | - | let u = | |
44 | + | let u = 1 | |
45 | 45 | ||
46 | - | let v = | |
46 | + | let v = 2 | |
47 | 47 | ||
48 | - | let w = | |
48 | + | let w = 3 | |
49 | 49 | ||
50 | - | let x = | |
50 | + | let x = 1 | |
51 | 51 | ||
52 | - | let y = | |
52 | + | let y = 7 | |
53 | 53 | ||
54 | - | let z = 2 | |
55 | - | ||
56 | - | let A = 3 | |
57 | - | ||
58 | - | let B = 1 | |
59 | - | ||
60 | - | let C = 7 | |
61 | - | ||
62 | - | func D (E,F) = fraction(toBigInt(E), d, toBigInt(F)) | |
54 | + | func z (A,B) = fraction(toBigInt(A), d, toBigInt(B)) | |
63 | 55 | ||
64 | 56 | ||
65 | - | func | |
57 | + | func C (D,E) = toInt(fraction(D, toBigInt(E), d)) | |
66 | 58 | ||
67 | 59 | ||
68 | - | func | |
60 | + | func F (G,H,I) = fraction(G, H, I) | |
69 | 61 | ||
70 | 62 | ||
71 | - | func | |
72 | - | then -( | |
73 | - | else | |
63 | + | func J (D) = if ((e > D)) | |
64 | + | then -(D) | |
65 | + | else D | |
74 | 66 | ||
75 | 67 | ||
76 | - | func O (H) = if ((e > H)) | |
77 | - | then -(H) | |
78 | - | else H | |
68 | + | func K () = "%s__factoryContract" | |
79 | 69 | ||
80 | 70 | ||
81 | - | func | |
71 | + | func L () = "%s__managerPublicKey" | |
82 | 72 | ||
83 | 73 | ||
84 | - | func | |
74 | + | func M () = "%s__pendingManagerPublicKey" | |
85 | 75 | ||
86 | 76 | ||
87 | - | func | |
77 | + | func N () = "%s%s__price__last" | |
88 | 78 | ||
89 | 79 | ||
90 | - | func | |
80 | + | func O (P,Q) = makeString(["%s%s%d%d__price__history", toString(P), toString(Q)], f) | |
91 | 81 | ||
92 | 82 | ||
93 | - | func | |
83 | + | func R (S,T) = ((("%s%s%s__P__" + S) + "__") + T) | |
94 | 84 | ||
95 | 85 | ||
96 | - | func | |
86 | + | func U (S,T) = ((("%s%s%s__G__" + S) + "__") + T) | |
97 | 87 | ||
98 | 88 | ||
99 | - | func | |
89 | + | func V () = "%s__amountAsset" | |
100 | 90 | ||
101 | 91 | ||
102 | - | func | |
92 | + | func W () = "%s__priceAsset" | |
103 | 93 | ||
104 | 94 | ||
105 | - | func | |
95 | + | func X () = "%s__factoryConfig" | |
106 | 96 | ||
107 | 97 | ||
108 | - | let ac = "%s__fee" | |
109 | - | ||
110 | - | let ad = fraction(5, b, 10000) | |
111 | - | ||
112 | - | let ae = valueOrElse(getInteger(this, ac), ad) | |
113 | - | ||
114 | - | func af () = "%s__factoryConfig" | |
98 | + | func Y () = "%s%s__matcher__publicKey" | |
115 | 99 | ||
116 | 100 | ||
117 | - | func | |
101 | + | func Z (aa) = (("%s%s%s__" + aa) + "__mappings__poolContract2LpAsset") | |
118 | 102 | ||
119 | 103 | ||
120 | - | func | |
104 | + | func ab (ac,ad) = (((("%d%d%s__" + ac) + "__") + ad) + "__config") | |
121 | 105 | ||
122 | 106 | ||
123 | - | func | |
107 | + | func ae (af) = ("%s%s%s__mappings__baseAsset2internalId__" + af) | |
124 | 108 | ||
125 | 109 | ||
126 | - | func | |
110 | + | func ag () = "%s__shutdown" | |
127 | 111 | ||
128 | 112 | ||
129 | - | func | |
113 | + | func ah (ai) = ("%s%s__poolWeight__" + ai) | |
130 | 114 | ||
131 | 115 | ||
132 | - | func | |
116 | + | func aj () = "%s__allowedLpScriptHash" | |
133 | 117 | ||
134 | 118 | ||
135 | - | func | |
119 | + | func ak (al,am,an) = throw(((((("order validation failed: orderValid=" + toString(al)) + " senderValid=") + toString(am)) + " matcherValid=") + toString(an))) | |
136 | 120 | ||
137 | 121 | ||
138 | - | let as = "%s__feeCollectorAddress" | |
139 | - | ||
140 | - | func at (au,av,aw) = throw(((((("order validation failed: orderValid=" + toString(au)) + " senderValid=") + toString(av)) + " matcherValid=") + toString(aw))) | |
122 | + | func ao (ap,aq) = valueOrErrorMessage(getString(ap, aq), makeString(["mandatory ", toString(ap), ".", aq, " is not defined"], "")) | |
141 | 123 | ||
142 | 124 | ||
143 | - | func | |
125 | + | func ar (ap,aq) = valueOrErrorMessage(getInteger(ap, aq), makeString(["mandatory ", toString(ap), ".", aq, " is not defined"], "")) | |
144 | 126 | ||
145 | 127 | ||
146 | - | func aA (ay,az) = valueOrErrorMessage(getInteger(ay, az), makeString(["mandatory ", toString(ay), ".", az, " is not defined"], "")) | |
128 | + | let as = addressFromStringValue(ao(this, K())) | |
129 | + | ||
130 | + | func at () = valueOrElse(getBoolean(as, ag()), false) | |
147 | 131 | ||
148 | 132 | ||
149 | - | func | |
133 | + | func au () = fromBase58String(ao(as, Y())) | |
150 | 134 | ||
151 | 135 | ||
152 | - | let aD = addressFromStringValue(ax(this, P())) | |
153 | - | ||
154 | - | let aE = addressFromStringValue(ax(aD, as)) | |
155 | - | ||
156 | - | func aF () = valueOrElse(getBoolean(aD, ao()), false) | |
157 | - | ||
158 | - | ||
159 | - | func aG () = fromBase58String(ax(aD, ag())) | |
160 | - | ||
161 | - | ||
162 | - | func aH () = { | |
163 | - | let aI = ax(this, aa()) | |
164 | - | let aJ = ax(this, ab()) | |
165 | - | let al = aA(aD, am(aJ)) | |
166 | - | let ak = aA(aD, am(aI)) | |
167 | - | split(ax(aD, aj(toString(ak), toString(al))), j) | |
136 | + | func av () = { | |
137 | + | let aw = ao(this, V()) | |
138 | + | let ax = ao(this, W()) | |
139 | + | let ad = ar(as, ae(ax)) | |
140 | + | let ac = ar(as, ae(aw)) | |
141 | + | split(ao(as, ab(toString(ac), toString(ad))), f) | |
168 | 142 | } | |
169 | 143 | ||
170 | 144 | ||
171 | - | func aK (aL) = if ((aL == i)) | |
172 | - | then unit | |
173 | - | else fromBase58String(aL) | |
145 | + | func ay () = split(ao(as, X()), f) | |
174 | 146 | ||
175 | 147 | ||
176 | - | func aM (aL) = if ((aL == unit)) | |
177 | - | then i | |
178 | - | else toBase58String(value(aL)) | |
148 | + | func az (aA,aB,aC,aD,aE,aF,aG,aH,aI,aJ) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(aA), toString(aB), toString(aC), toString(aD), toString(aE), toString(aF), toString(aG), toString(aH), toString(aI), toString(aJ)], f) | |
179 | 149 | ||
180 | 150 | ||
181 | - | func | |
151 | + | func aK (aL,aM,aN,aD,aG,aH) = makeString(["%d%d%d%d%d%d", toString(aL), toString(aM), toString(aN), toString(aD), toString(aG), toString(aH)], f) | |
182 | 152 | ||
183 | 153 | ||
184 | - | let aP = aN(aH()) | |
185 | - | ||
186 | - | let aQ = aP | |
187 | - | ||
188 | - | let aR = aQ._1 | |
189 | - | ||
190 | - | let aS = aQ._2 | |
191 | - | ||
192 | - | let aT = aQ._3 | |
193 | - | ||
194 | - | let aU = aQ._4 | |
195 | - | ||
196 | - | let aV = aQ._5 | |
197 | - | ||
198 | - | let aW = aQ._6 | |
199 | - | ||
200 | - | let aX = aQ._7 | |
201 | - | ||
202 | - | func aY () = split(ax(aD, af()), j) | |
154 | + | func aO (aP) = if ((aP == "WAVES")) | |
155 | + | then wavesBalance(this).available | |
156 | + | else assetBalance(this, fromBase58String(aP)) | |
203 | 157 | ||
204 | 158 | ||
205 | - | let aZ = valueOrErrorMessage(addressFromString(aY()[B]), "incorrect staking address") | |
206 | - | ||
207 | - | let ba = valueOrErrorMessage(addressFromString(aY()[C]), "incorrect staking address") | |
208 | - | ||
209 | - | func bb (bc,bd,be,bf,bg,bh,bi,bj,bk,bl) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bc), toString(bd), toString(be), toString(bf), toString(bg), toString(bh), toString(bi), toString(bj), toString(bk), toString(bl)], j) | |
159 | + | func aQ (aR,aS) = fraction(aR, d, aS) | |
210 | 160 | ||
211 | 161 | ||
212 | - | func bm (bn,bo,bp,bf,bi,bj) = makeString(["%d%d%d%d%d%d", toString(bn), toString(bo), toString(bp), toString(bf), toString(bi), toString(bj)], j) | |
213 | - | ||
214 | - | ||
215 | - | func bq (br) = if ((br == "WAVES")) | |
216 | - | then wavesBalance(this).available | |
217 | - | else assetBalance(this, fromBase58String(br)) | |
218 | - | ||
219 | - | ||
220 | - | func bs (bt,bu) = fraction(bt, d, bu) | |
221 | - | ||
222 | - | ||
223 | - | func bv (bw,bx,by,bz) = { | |
224 | - | let bA = D(by, bw) | |
225 | - | let bB = D(bz, bx) | |
226 | - | bs(bB, bA) | |
162 | + | func aT (aU,aV,aW,aX) = { | |
163 | + | let aY = z(aW, aU) | |
164 | + | let aZ = z(aX, aV) | |
165 | + | aQ(aZ, aY) | |
227 | 166 | } | |
228 | 167 | ||
229 | 168 | ||
230 | - | func | |
231 | - | let | |
232 | - | let | |
233 | - | let | |
234 | - | let | |
235 | - | let | |
236 | - | let | |
237 | - | let | |
238 | - | let | |
239 | - | let | |
240 | - | [ | |
169 | + | func ba (aW,aX,bb) = { | |
170 | + | let bc = av() | |
171 | + | let bd = parseIntValue(bc[p]) | |
172 | + | let be = parseIntValue(bc[q]) | |
173 | + | let bf = aT(bd, be, aW, aX) | |
174 | + | let aS = z(aW, bd) | |
175 | + | let aR = z(aX, be) | |
176 | + | let bg = z(bb, b) | |
177 | + | let bh = aQ(aS, bg) | |
178 | + | let bi = aQ(aR, bg) | |
179 | + | [bf, bh, bi] | |
241 | 180 | } | |
242 | 181 | ||
243 | 182 | ||
244 | - | func | |
245 | - | let | |
246 | - | [ | |
183 | + | func bj (aW,aX,bb) = { | |
184 | + | let bk = ba(aW, aX, bb) | |
185 | + | [C(bk[0], b), C(bk[1], b), C(bk[2], b)] | |
247 | 186 | } | |
248 | 187 | ||
249 | 188 | ||
250 | - | func | |
251 | - | let | |
252 | - | let | |
253 | - | let | |
254 | - | let | |
255 | - | let | |
256 | - | let | |
257 | - | let | |
258 | - | let | |
259 | - | if (( | |
189 | + | func bl (bm,bn,bo,S) = { | |
190 | + | let bc = av() | |
191 | + | let bp = bc[m] | |
192 | + | let bq = bc[n] | |
193 | + | let br = bc[o] | |
194 | + | let aU = parseIntValue(bc[p]) | |
195 | + | let aV = parseIntValue(bc[q]) | |
196 | + | let bs = bc[l] | |
197 | + | let bt = valueOrErrorMessage(assetInfo(fromBase58String(bp)), (("Asset " + bp) + " doesn't exist")).quantity | |
198 | + | if ((bp != bn)) | |
260 | 199 | then throw("Invalid asset passed.") | |
261 | 200 | else { | |
262 | - | let | |
263 | - | let | |
264 | - | let | |
265 | - | let | |
266 | - | let | |
267 | - | let | |
268 | - | let | |
269 | - | let | |
270 | - | let | |
271 | - | let | |
272 | - | let | |
273 | - | let | |
274 | - | let | |
201 | + | let bu = aO(bq) | |
202 | + | let bv = z(bu, aU) | |
203 | + | let bw = aO(br) | |
204 | + | let bx = z(bw, aV) | |
205 | + | let by = aQ(bx, bv) | |
206 | + | let bz = C(by, b) | |
207 | + | let bA = z(bo, b) | |
208 | + | let bB = z(bt, b) | |
209 | + | let bC = fraction(bv, bA, bB) | |
210 | + | let bD = fraction(bx, bA, bB) | |
211 | + | let bE = C(bC, aU) | |
212 | + | let bF = C(bD, aV) | |
213 | + | let bG = if ((bm == "")) | |
275 | 214 | then nil | |
276 | - | else [ScriptTransfer( | |
215 | + | else [ScriptTransfer(S, bE, if ((bq == "WAVES")) | |
277 | 216 | then unit | |
278 | - | else fromBase58String( | |
217 | + | else fromBase58String(bq)), ScriptTransfer(S, bF, if ((br == "WAVES")) | |
279 | 218 | then unit | |
280 | - | else fromBase58String( | |
281 | - | $Tuple10( | |
219 | + | else fromBase58String(br)), StringEntry(U(toString(S), bm), aK(bE, bF, bo, bz, height, lastBlock.timestamp)), IntegerEntry(N(), bz), IntegerEntry(O(height, lastBlock.timestamp), bz)] | |
220 | + | $Tuple10(bE, bF, bq, br, bu, bw, bt, by, bs, bG) | |
282 | 221 | } | |
283 | 222 | } | |
284 | 223 | ||
285 | 224 | ||
286 | - | func | |
287 | - | let | |
288 | - | let | |
289 | - | let | |
290 | - | let | |
291 | - | let | |
292 | - | let | |
293 | - | let | |
294 | - | let | |
295 | - | let | |
296 | - | let | |
297 | - | let | |
298 | - | let | |
299 | - | if (if (( | |
225 | + | func bH (bm,bI,bJ,bK,bL,bM,S,bN,bO) = { | |
226 | + | let bc = av() | |
227 | + | let bp = fromBase58String(bc[m]) | |
228 | + | let bP = bc[n] | |
229 | + | let bQ = bc[o] | |
230 | + | let bR = bc[r] | |
231 | + | let bS = bc[s] | |
232 | + | let bd = parseIntValue(bc[p]) | |
233 | + | let be = parseIntValue(bc[q]) | |
234 | + | let bs = bc[l] | |
235 | + | let bt = valueOrErrorMessage(assetInfo(bp), (("Asset " + toBase58String(bp)) + " doesn't exist")).quantity | |
236 | + | let bT = toBase58String(valueOrElse(bK, fromBase58String("WAVES"))) | |
237 | + | let bU = toBase58String(valueOrElse(bM, fromBase58String("WAVES"))) | |
238 | + | if (if ((bP != bT)) | |
300 | 239 | then true | |
301 | - | else ( | |
240 | + | else (bQ != bU)) | |
302 | 241 | then throw("Invalid amt or price asset passed.") | |
303 | 242 | else { | |
304 | - | let | |
305 | - | then | |
306 | - | else ( | |
307 | - | let | |
308 | - | then | |
309 | - | else ( | |
310 | - | let | |
311 | - | let | |
312 | - | let | |
313 | - | let | |
314 | - | let | |
315 | - | let | |
243 | + | let bu = if (bN) | |
244 | + | then aO(bP) | |
245 | + | else (aO(bP) - bJ) | |
246 | + | let bw = if (bN) | |
247 | + | then aO(bQ) | |
248 | + | else (aO(bQ) - bL) | |
249 | + | let bV = z(bJ, bd) | |
250 | + | let bW = z(bL, be) | |
251 | + | let bX = aQ(bW, bV) | |
252 | + | let bv = z(bu, bd) | |
253 | + | let bx = z(bw, be) | |
254 | + | let bY = if ((bt == 0)) | |
316 | 255 | then { | |
317 | - | let | |
318 | - | let | |
319 | - | let | |
320 | - | $Tuple5( | |
256 | + | let by = e | |
257 | + | let bZ = e | |
258 | + | let bg = pow((bV * bW), 0, toBigInt(5), 1, 0, DOWN) | |
259 | + | $Tuple5(C(bg, b), C(bV, bd), C(bW, be), aQ((bx + bW), (bv + bV)), bZ) | |
321 | 260 | } | |
322 | 261 | else { | |
323 | - | let | |
324 | - | let | |
325 | - | let | |
326 | - | if (if (( | |
327 | - | then ( | |
262 | + | let by = aQ(bx, bv) | |
263 | + | let bZ = fraction(J((by - bX)), d, by) | |
264 | + | let ca = z(bI, b) | |
265 | + | if (if ((by != e)) | |
266 | + | then (bZ > ca) | |
328 | 267 | else false) | |
329 | - | then throw(((("Price slippage " + toString( | |
268 | + | then throw(((("Price slippage " + toString(bZ)) + " exceeded the passed limit of ") + toString(ca))) | |
330 | 269 | else { | |
331 | - | let | |
332 | - | let | |
333 | - | let | |
334 | - | let | |
335 | - | then $Tuple2( | |
336 | - | else $Tuple2( | |
337 | - | let | |
338 | - | let | |
339 | - | let | |
340 | - | $Tuple5( | |
270 | + | let bB = z(bt, b) | |
271 | + | let cb = fraction(bV, by, d) | |
272 | + | let cc = fraction(bW, d, by) | |
273 | + | let cd = if ((cb > bW)) | |
274 | + | then $Tuple2(cc, bW) | |
275 | + | else $Tuple2(bV, cb) | |
276 | + | let ce = cd._1 | |
277 | + | let cf = cd._2 | |
278 | + | let bg = fraction(bB, cf, bx) | |
279 | + | $Tuple5(C(bg, b), C(ce, bd), C(cf, be), by, bZ) | |
341 | 280 | } | |
342 | 281 | } | |
343 | - | let | |
344 | - | let | |
345 | - | let | |
346 | - | let | |
347 | - | let | |
348 | - | if ((0 >= | |
282 | + | let cg = bY._1 | |
283 | + | let ch = bY._2 | |
284 | + | let ci = bY._3 | |
285 | + | let bz = C(bY._4, b) | |
286 | + | let cj = C(bY._5, b) | |
287 | + | if ((0 >= cg)) | |
349 | 288 | then throw("Invalid calculations. LP calculated is less than zero.") | |
350 | 289 | else { | |
351 | - | let | |
290 | + | let ck = if (!(bO)) | |
352 | 291 | then 0 | |
353 | - | else | |
354 | - | let | |
355 | - | let | |
356 | - | let | |
357 | - | $Tuple13( | |
292 | + | else cg | |
293 | + | let cl = (bJ - ch) | |
294 | + | let cm = (bL - ci) | |
295 | + | let cn = [IntegerEntry(N(), bz), IntegerEntry(O(height, lastBlock.timestamp), bz), StringEntry(R(S, bm), az(ch, ci, ck, bz, bI, cj, height, lastBlock.timestamp, cl, cm))] | |
296 | + | $Tuple13(cg, ck, bz, bu, bw, bt, bp, bs, cn, cl, cm, bK, bM) | |
358 | 297 | } | |
359 | 298 | } | |
360 | 299 | } | |
361 | 300 | ||
362 | 301 | ||
363 | - | func | |
364 | - | let | |
365 | - | let | |
366 | - | let | |
367 | - | let | |
368 | - | let | |
369 | - | let | |
370 | - | let | |
371 | - | let | |
372 | - | let | |
373 | - | then | |
374 | - | else | |
375 | - | let | |
376 | - | if (if (if ( | |
302 | + | func co (cp) = { | |
303 | + | let bc = av() | |
304 | + | let cq = bc[n] | |
305 | + | let cr = bc[o] | |
306 | + | let bs = parseIntValue(bc[l]) | |
307 | + | let bd = parseIntValue(bc[p]) | |
308 | + | let be = parseIntValue(bc[q]) | |
309 | + | let cs = aO(cq) | |
310 | + | let ct = aO(cr) | |
311 | + | let by = if ((cp.orderType == Buy)) | |
312 | + | then aT(bd, be, (cs + cp.amount), ct) | |
313 | + | else aT(bd, be, (cs - cp.amount), ct) | |
314 | + | let bz = C(by, b) | |
315 | + | if (if (if (at()) | |
377 | 316 | then true | |
378 | - | else ( | |
317 | + | else (bs == i)) | |
379 | 318 | then true | |
380 | - | else ( | |
319 | + | else (bs == j)) | |
381 | 320 | then throw("Exchange operations disabled") | |
382 | 321 | else { | |
383 | - | let | |
384 | - | let | |
322 | + | let cu = cp.assetPair.amountAsset | |
323 | + | let cv = if ((cu == unit)) | |
385 | 324 | then "WAVES" | |
386 | - | else toBase58String(value( | |
387 | - | let | |
388 | - | let | |
325 | + | else toBase58String(value(cu)) | |
326 | + | let cw = cp.assetPair.priceAsset | |
327 | + | let cx = if ((cw == unit)) | |
389 | 328 | then "WAVES" | |
390 | - | else toBase58String(value( | |
391 | - | if (if (( | |
329 | + | else toBase58String(value(cw)) | |
330 | + | if (if ((cv != cq)) | |
392 | 331 | then true | |
393 | - | else ( | |
332 | + | else (cx != cr)) | |
394 | 333 | then throw("Wrong order assets.") | |
395 | 334 | else { | |
396 | - | let | |
397 | - | let | |
398 | - | let | |
399 | - | let | |
400 | - | then ( | |
401 | - | else ( | |
335 | + | let cy = cp.price | |
336 | + | let cz = fraction(b, be, bd) | |
337 | + | let cA = F(cy, b, cz) | |
338 | + | let cB = if ((cp.orderType == Buy)) | |
339 | + | then (bz >= cA) | |
340 | + | else (cA >= bz) | |
402 | 341 | true | |
403 | 342 | } | |
404 | 343 | } | |
405 | 344 | } | |
406 | 345 | ||
407 | 346 | ||
408 | - | func | |
347 | + | func cC (cD) = if ((size(cD.payments) != 1)) | |
409 | 348 | then throw("exactly 1 payment is expected") | |
410 | 349 | else { | |
411 | - | let | |
412 | - | let | |
413 | - | let | |
414 | - | let | |
415 | - | let | |
416 | - | let | |
417 | - | let | |
418 | - | let | |
419 | - | if (if ( | |
350 | + | let cE = value(cD.payments[0]) | |
351 | + | let bn = value(cE.assetId) | |
352 | + | let cF = cE.amount | |
353 | + | let bY = bl(toBase58String(cD.transactionId), toBase58String(bn), cF, cD.caller) | |
354 | + | let bE = bY._1 | |
355 | + | let bF = bY._2 | |
356 | + | let bs = parseIntValue(bY._9) | |
357 | + | let bG = bY._10 | |
358 | + | if (if (at()) | |
420 | 359 | then true | |
421 | - | else ( | |
422 | - | then throw(("Get operation is blocked by admin. Status = " + toString( | |
423 | - | else $Tuple5( | |
360 | + | else (bs == j)) | |
361 | + | then throw(("Get operation is blocked by admin. Status = " + toString(bs))) | |
362 | + | else $Tuple5(bE, bF, cF, bn, bG) | |
424 | 363 | } | |
425 | 364 | ||
426 | 365 | ||
427 | - | func | |
366 | + | func cG (cD,bI,bO) = if ((size(cD.payments) != 2)) | |
428 | 367 | then throw("exactly 2 payments are expected") | |
429 | 368 | else { | |
430 | - | let | |
431 | - | let | |
432 | - | let | |
433 | - | let | |
434 | - | if (if (if ( | |
369 | + | let cH = value(cD.payments[0]) | |
370 | + | let cI = value(cD.payments[1]) | |
371 | + | let cJ = bH(toBase58String(cD.transactionId), bI, cH.amount, cH.assetId, cI.amount, cI.assetId, toString(cD.caller), false, bO) | |
372 | + | let bs = parseIntValue(cJ._8) | |
373 | + | if (if (if (at()) | |
435 | 374 | then true | |
436 | - | else ( | |
375 | + | else (bs == h)) | |
437 | 376 | then true | |
438 | - | else ( | |
439 | - | then throw(("Put operation is blocked by admin. Status = " + toString( | |
440 | - | else | |
377 | + | else (bs == j)) | |
378 | + | then throw(("Put operation is blocked by admin. Status = " + toString(bs))) | |
379 | + | else cJ | |
441 | 380 | } | |
442 | 381 | ||
443 | 382 | ||
444 | - | func | |
445 | - | let | |
446 | - | if (( | |
383 | + | func cK () = { | |
384 | + | let cL = getString(L()) | |
385 | + | if ($isInstanceOf(cL, "String")) | |
447 | 386 | then { | |
448 | - | let dp = { | |
449 | - | let dq = do | |
450 | - | if ($isInstanceOf(dq, "Address")) | |
451 | - | then { | |
452 | - | let dr = dq | |
453 | - | invoke(dr, "emit", [dn], nil) | |
454 | - | } | |
455 | - | else unit | |
456 | - | } | |
457 | - | if ((dp == dp)) | |
458 | - | then dn | |
459 | - | else throw("Strict value is not equal to itself.") | |
387 | + | let cM = cL | |
388 | + | fromBase58String(cM) | |
460 | 389 | } | |
461 | - | else throw("Strict value is not equal to itself.") | |
462 | - | } | |
463 | - | ||
464 | - | ||
465 | - | func ds (dn) = { | |
466 | - | let dt = fraction(dn, ae, b) | |
467 | - | $Tuple2((dn - dt), dt) | |
468 | - | } | |
469 | - | ||
470 | - | ||
471 | - | func du (dv,dw,X,Y) = { | |
472 | - | let dx = (Y == unit) | |
473 | - | let dy = bq(aM(aU)) | |
474 | - | let dz = bq(aM(aV)) | |
475 | - | let dA = if ((dw == aU)) | |
476 | - | then true | |
477 | - | else if ((dw == aV)) | |
478 | - | then false | |
479 | - | else aB("invalid asset") | |
480 | - | let dB = if (dx) | |
481 | - | then $Tuple2(dy, dz) | |
482 | - | else if (dA) | |
483 | - | then $Tuple2((dy - dv), dz) | |
484 | - | else $Tuple2(dy, (dz - dv)) | |
485 | - | let dC = dB._1 | |
486 | - | let dD = dB._2 | |
487 | - | let dE = if (dA) | |
488 | - | then $Tuple2(dv, 0) | |
489 | - | else $Tuple2(0, dv) | |
490 | - | let dF = dE._1 | |
491 | - | let dG = dE._2 | |
492 | - | let dH = ds(dF)._1 | |
493 | - | let dI = ds(dG)._1 | |
494 | - | let dJ = ds(dv) | |
495 | - | let dK = dJ._1 | |
496 | - | let dt = dJ._2 | |
497 | - | let dL = (dC + dH) | |
498 | - | let dM = (dD + dI) | |
499 | - | let dN = bs(D(dM, aX), D(dL, aW)) | |
500 | - | let dO = G(dN, b) | |
501 | - | let dP = if (dA) | |
502 | - | then dC | |
503 | - | else dD | |
504 | - | let dQ = toBigInt(dP) | |
505 | - | let dR = toBigInt(valueOrErrorMessage(assetInfo(aT), (("asset " + toBase58String(aT)) + " doesn't exist")).quantity) | |
506 | - | let dS = if ((dR > f)) | |
507 | - | then true | |
508 | - | else aB("initial deposit requires all coins") | |
509 | - | if ((dS == dS)) | |
510 | - | then { | |
511 | - | let dT = toBigInt(dK) | |
512 | - | let dU = max([0, toInt(((dR * (sqrtBigInt((d + ((dT * d) / dQ)), 18, 18, DOWN) - d)) / d))]) | |
513 | - | let cP = if (dx) | |
514 | - | then nil | |
515 | - | else [IntegerEntry(S(), dO), IntegerEntry(T(height, lastBlock.timestamp), dO), StringEntry(W(toString(value(X)), toBase58String(value(Y))), bb(dF, dG, dU, dO, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
516 | - | let dV = bs(D(dD, aX), D(dC, aW)) | |
517 | - | let dW = G(dV, b) | |
518 | - | let dX = N((((dO - dW) * b) / dW)) | |
519 | - | $Tuple4(dU, cP, dt, dX) | |
520 | - | } | |
521 | - | else throw("Strict value is not equal to itself.") | |
522 | - | } | |
523 | - | ||
524 | - | ||
525 | - | func dY (dZ,dK,dw,X,Y) = { | |
526 | - | let dx = (Y == unit) | |
527 | - | let ea = [if ((dw == aT)) | |
528 | - | then true | |
529 | - | else aB("invalid lp asset")] | |
530 | - | if ((ea == ea)) | |
531 | - | then { | |
532 | - | let eb = if ((dZ == aU)) | |
533 | - | then true | |
534 | - | else if ((dZ == aV)) | |
535 | - | then false | |
536 | - | else aB("invalid asset") | |
537 | - | let ec = if (eb) | |
538 | - | then toBigInt(bq(aM(aU))) | |
539 | - | else toBigInt(bq(aM(aV))) | |
540 | - | let ed = bq(aM(aU)) | |
541 | - | let ee = bq(aM(aV)) | |
542 | - | let ef = if (eb) | |
543 | - | then ed | |
544 | - | else ee | |
545 | - | let eg = toBigInt(ef) | |
546 | - | let dR = toBigInt(valueOrErrorMessage(assetInfo(aT), (("asset " + toBase58String(aT)) + " doesn't exist")).quantity) | |
547 | - | let eh = toBigInt(dK) | |
548 | - | let ei = max([0, toInt(((ec * (d - pow((d - ((eh * d) / dR)), 18, h, 0, 18, DOWN))) / d))]) | |
549 | - | let ej = ds(ei) | |
550 | - | let ek = ej._1 | |
551 | - | let dt = ej._2 | |
552 | - | let el = if (eb) | |
553 | - | then $Tuple4(ek, 0, (ed - ei), ee) | |
554 | - | else $Tuple4(0, ek, ed, (ee - ei)) | |
555 | - | let em = el._1 | |
556 | - | let en = el._2 | |
557 | - | let eo = el._3 | |
558 | - | let ep = el._4 | |
559 | - | let dN = bs(D(ep, aX), D(eo, aW)) | |
560 | - | let dO = G(dN, b) | |
561 | - | let cP = if (dx) | |
562 | - | then nil | |
563 | - | else [StringEntry(Z(toString(value(X)), toBase58String(value(Y))), bm(em, en, dK, dO, height, lastBlock.timestamp)), IntegerEntry(S(), dO), IntegerEntry(T(height, lastBlock.timestamp), dO)] | |
564 | - | let dV = bs(D(ee, aX), D(ed, aW)) | |
565 | - | let dW = G(dV, b) | |
566 | - | let dX = N((((dO - dW) * b) / dW)) | |
567 | - | $Tuple4(ek, cP, dt, dX) | |
568 | - | } | |
569 | - | else throw("Strict value is not equal to itself.") | |
570 | - | } | |
571 | - | ||
572 | - | ||
573 | - | func eq () = { | |
574 | - | let dq = getString(Q()) | |
575 | - | if ($isInstanceOf(dq, "String")) | |
576 | - | then { | |
577 | - | let er = dq | |
578 | - | fromBase58String(er) | |
579 | - | } | |
580 | - | else if ($isInstanceOf(dq, "Unit")) | |
390 | + | else if ($isInstanceOf(cL, "Unit")) | |
581 | 391 | then unit | |
582 | 392 | else throw("Match error") | |
583 | 393 | } | |
584 | 394 | ||
585 | 395 | ||
586 | - | func | |
587 | - | let | |
588 | - | if ($isInstanceOf( | |
396 | + | func cN () = { | |
397 | + | let cL = getString(M()) | |
398 | + | if ($isInstanceOf(cL, "String")) | |
589 | 399 | then { | |
590 | - | let | |
591 | - | fromBase58String( | |
400 | + | let cM = cL | |
401 | + | fromBase58String(cM) | |
592 | 402 | } | |
593 | - | else if ($isInstanceOf( | |
403 | + | else if ($isInstanceOf(cL, "Unit")) | |
594 | 404 | then unit | |
595 | 405 | else throw("Match error") | |
596 | 406 | } | |
597 | 407 | ||
598 | 408 | ||
599 | - | func | |
600 | - | let | |
601 | - | let | |
602 | - | if ($isInstanceOf( | |
409 | + | func cO (cD) = { | |
410 | + | let cP = throw("Permission denied") | |
411 | + | let cL = cK() | |
412 | + | if ($isInstanceOf(cL, "ByteVector")) | |
603 | 413 | then { | |
604 | - | let | |
605 | - | if (( | |
414 | + | let cQ = cL | |
415 | + | if ((cD.callerPublicKey == cQ)) | |
606 | 416 | then true | |
607 | - | else | |
417 | + | else cP | |
608 | 418 | } | |
609 | - | else if ($isInstanceOf( | |
610 | - | then if (( | |
419 | + | else if ($isInstanceOf(cL, "Unit")) | |
420 | + | then if ((cD.caller == this)) | |
611 | 421 | then true | |
612 | - | else | |
422 | + | else cP | |
613 | 423 | else throw("Match error") | |
614 | 424 | } | |
615 | 425 | ||
616 | 426 | ||
617 | - | @Callable(df) | |
618 | - | func setManager (ew) = { | |
619 | - | let ex = et(df) | |
620 | - | if ((ex == ex)) | |
427 | + | @Callable(cD) | |
428 | + | func constructor (as) = { | |
429 | + | let cR = cO(cD) | |
430 | + | if ((cR == cR)) | |
431 | + | then [StringEntry(K(), as)] | |
432 | + | else throw("Strict value is not equal to itself.") | |
433 | + | } | |
434 | + | ||
435 | + | ||
436 | + | ||
437 | + | @Callable(cD) | |
438 | + | func setManager (cS) = { | |
439 | + | let cR = cO(cD) | |
440 | + | if ((cR == cR)) | |
621 | 441 | then { | |
622 | - | let | |
623 | - | if (( | |
624 | - | then [StringEntry( | |
442 | + | let cT = fromBase58String(cS) | |
443 | + | if ((cT == cT)) | |
444 | + | then [StringEntry(M(), cS)] | |
625 | 445 | else throw("Strict value is not equal to itself.") | |
626 | 446 | } | |
627 | 447 | else throw("Strict value is not equal to itself.") | |
628 | 448 | } | |
629 | 449 | ||
630 | 450 | ||
631 | 451 | ||
632 | - | @Callable( | |
452 | + | @Callable(cD) | |
633 | 453 | func confirmManager () = { | |
634 | - | let | |
635 | - | let | |
454 | + | let cU = cN() | |
455 | + | let cV = if (isDefined(cU)) | |
636 | 456 | then true | |
637 | 457 | else throw("No pending manager") | |
638 | - | if (( | |
458 | + | if ((cV == cV)) | |
639 | 459 | then { | |
640 | - | let | |
460 | + | let cW = if ((cD.callerPublicKey == value(cU))) | |
641 | 461 | then true | |
642 | 462 | else throw("You are not pending manager") | |
643 | - | if (( | |
644 | - | then [StringEntry( | |
463 | + | if ((cW == cW)) | |
464 | + | then [StringEntry(L(), toBase58String(value(cU))), DeleteEntry(M())] | |
645 | 465 | else throw("Strict value is not equal to itself.") | |
646 | 466 | } | |
647 | 467 | else throw("Strict value is not equal to itself.") | |
648 | 468 | } | |
649 | 469 | ||
650 | 470 | ||
651 | 471 | ||
652 | - | @Callable(df) | |
653 | - | func put (ck,eC) = if ((0 > ck)) | |
654 | - | then throw("Invalid slippageTolerance passed") | |
472 | + | @Callable(cD) | |
473 | + | func put (bI,cX) = { | |
474 | + | let cY = ay() | |
475 | + | let cZ = valueOrErrorMessage(addressFromString(cY[x]), "Error. Incorrect staking address.") | |
476 | + | let da = valueOrErrorMessage(addressFromString(cY[y]), "Error. Incorrect slippage contract address.") | |
477 | + | if ((0 > bI)) | |
478 | + | then throw("Invalid slippageTolerance passed") | |
479 | + | else { | |
480 | + | let cJ = cG(cD, bI, true) | |
481 | + | let ck = cJ._2 | |
482 | + | let bp = cJ._7 | |
483 | + | let bG = cJ._9 | |
484 | + | let cl = cJ._10 | |
485 | + | let cm = cJ._11 | |
486 | + | let db = cJ._12 | |
487 | + | let dc = cJ._13 | |
488 | + | let dd = invoke(as, "emit", [ck], nil) | |
489 | + | if ((dd == dd)) | |
490 | + | then { | |
491 | + | let de = { | |
492 | + | let cL = dd | |
493 | + | if ($isInstanceOf(cL, "Address")) | |
494 | + | then { | |
495 | + | let df = cL | |
496 | + | invoke(df, "emit", [ck], nil) | |
497 | + | } | |
498 | + | else unit | |
499 | + | } | |
500 | + | if ((de == de)) | |
501 | + | then { | |
502 | + | let dg = if ((cl > 0)) | |
503 | + | then invoke(da, "put", nil, [AttachedPayment(db, cl)]) | |
504 | + | else nil | |
505 | + | if ((dg == dg)) | |
506 | + | then { | |
507 | + | let dh = if ((cm > 0)) | |
508 | + | then invoke(da, "put", nil, [AttachedPayment(dc, cm)]) | |
509 | + | else nil | |
510 | + | if ((dh == dh)) | |
511 | + | then { | |
512 | + | let di = if (cX) | |
513 | + | then { | |
514 | + | let dj = invoke(cZ, "stake", nil, [AttachedPayment(bp, ck)]) | |
515 | + | if ((dj == dj)) | |
516 | + | then nil | |
517 | + | else throw("Strict value is not equal to itself.") | |
518 | + | } | |
519 | + | else [ScriptTransfer(cD.caller, ck, bp)] | |
520 | + | (bG ++ di) | |
521 | + | } | |
522 | + | else throw("Strict value is not equal to itself.") | |
523 | + | } | |
524 | + | else throw("Strict value is not equal to itself.") | |
525 | + | } | |
526 | + | else throw("Strict value is not equal to itself.") | |
527 | + | } | |
528 | + | else throw("Strict value is not equal to itself.") | |
529 | + | } | |
530 | + | } | |
531 | + | ||
532 | + | ||
533 | + | ||
534 | + | @Callable(cD) | |
535 | + | func putForFree (dk) = if ((0 > dk)) | |
536 | + | then throw("Invalid value passed") | |
655 | 537 | else { | |
656 | - | let dl = di(df, ck, true) | |
657 | - | let cM = dl._2 | |
658 | - | let bR = dl._7 | |
659 | - | let ci = dl._9 | |
660 | - | let cN = dl._10 | |
661 | - | let cO = dl._11 | |
662 | - | let eD = dl._12 | |
663 | - | let eE = dl._13 | |
664 | - | let do = invoke(aD, "emit", [cM], nil) | |
665 | - | if ((do == do)) | |
666 | - | then { | |
667 | - | let dp = { | |
668 | - | let dq = do | |
669 | - | if ($isInstanceOf(dq, "Address")) | |
670 | - | then { | |
671 | - | let dr = dq | |
672 | - | invoke(dr, "emit", [cM], nil) | |
673 | - | } | |
674 | - | else unit | |
675 | - | } | |
676 | - | if ((dp == dp)) | |
677 | - | then { | |
678 | - | let eF = if ((cN > 0)) | |
679 | - | then invoke(ba, "put", nil, [AttachedPayment(eD, cN)]) | |
680 | - | else nil | |
681 | - | if ((eF == eF)) | |
682 | - | then { | |
683 | - | let eG = if ((cO > 0)) | |
684 | - | then invoke(ba, "put", nil, [AttachedPayment(eE, cO)]) | |
685 | - | else nil | |
686 | - | if ((eG == eG)) | |
687 | - | then { | |
688 | - | let eH = if (eC) | |
689 | - | then { | |
690 | - | let eI = invoke(aZ, "stake", nil, [AttachedPayment(bR, cM)]) | |
691 | - | if ((eI == eI)) | |
692 | - | then nil | |
693 | - | else throw("Strict value is not equal to itself.") | |
694 | - | } | |
695 | - | else [ScriptTransfer(df.caller, cM, bR)] | |
696 | - | (ci ++ eH) | |
697 | - | } | |
698 | - | else throw("Strict value is not equal to itself.") | |
699 | - | } | |
700 | - | else throw("Strict value is not equal to itself.") | |
701 | - | } | |
702 | - | else throw("Strict value is not equal to itself.") | |
703 | - | } | |
704 | - | else throw("Strict value is not equal to itself.") | |
538 | + | let cJ = cG(cD, dk, false) | |
539 | + | cJ._9 | |
705 | 540 | } | |
706 | 541 | ||
707 | 542 | ||
708 | 543 | ||
709 | - | @Callable(df) | |
710 | - | func putForFree (eJ) = if ((0 > eJ)) | |
711 | - | then throw("Invalid value passed") | |
712 | - | else { | |
713 | - | let dl = di(df, eJ, false) | |
714 | - | dl._9 | |
715 | - | } | |
716 | - | ||
717 | - | ||
718 | - | ||
719 | - | @Callable(df) | |
720 | - | func putOneTkn (eK,eL) = { | |
721 | - | let eM = { | |
722 | - | let eN = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
723 | - | if ($isInstanceOf(eN, "Boolean")) | |
724 | - | then eN | |
725 | - | else throw(($getType(eN) + " couldn't be cast to Boolean")) | |
726 | - | } | |
727 | - | let eO = if (if (if (aF()) | |
728 | - | then true | |
729 | - | else (aS == l)) | |
730 | - | then true | |
731 | - | else (aS == n)) | |
732 | - | then true | |
733 | - | else eM | |
734 | - | let ea = [if (!(eO)) | |
735 | - | then true | |
736 | - | else aB("put operation is blocked by admin"), if ((size(df.payments) == 1)) | |
737 | - | then true | |
738 | - | else aB("exactly 1 payment are expected")] | |
739 | - | if ((ea == ea)) | |
740 | - | then { | |
741 | - | let eP = df.payments[0] | |
742 | - | let dw = eP.assetId | |
743 | - | let dv = eP.amount | |
744 | - | let X = df.caller | |
745 | - | let Y = df.transactionId | |
746 | - | let eQ = du(dv, dw, X, Y) | |
747 | - | let eR = eQ._1 | |
748 | - | let cP = eQ._2 | |
749 | - | let dt = eQ._3 | |
750 | - | let eS = eQ._4 | |
751 | - | let eT = if (if ((eK > 0)) | |
752 | - | then (eK > eR) | |
753 | - | else false) | |
754 | - | then aB(makeString(["amount to receive is less than ", toString(eK)], "")) | |
755 | - | else eR | |
756 | - | let do = dm(eT) | |
757 | - | if ((do == do)) | |
758 | - | then { | |
759 | - | let eH = if (eL) | |
760 | - | then { | |
761 | - | let eU = invoke(aZ, "stake", nil, [AttachedPayment(aT, eT)]) | |
762 | - | if ((eU == eU)) | |
763 | - | then nil | |
764 | - | else throw("Strict value is not equal to itself.") | |
765 | - | } | |
766 | - | else [ScriptTransfer(df.caller, eT, aT)] | |
767 | - | let eV = if ((dt > 0)) | |
768 | - | then [ScriptTransfer(aE, dt, dw)] | |
769 | - | else nil | |
770 | - | $Tuple2(((cP ++ eH) ++ eV), eT) | |
771 | - | } | |
772 | - | else throw("Strict value is not equal to itself.") | |
773 | - | } | |
544 | + | @Callable(cD) | |
545 | + | func get () = { | |
546 | + | let bY = cC(cD) | |
547 | + | let dl = bY._1 | |
548 | + | let bF = bY._2 | |
549 | + | let cF = bY._3 | |
550 | + | let bn = bY._4 | |
551 | + | let bG = bY._5 | |
552 | + | let dm = invoke(as, "burn", [cF], [AttachedPayment(bn, cF)]) | |
553 | + | if ((dm == dm)) | |
554 | + | then bG | |
774 | 555 | else throw("Strict value is not equal to itself.") | |
775 | 556 | } | |
776 | 557 | ||
777 | 558 | ||
778 | 559 | ||
779 | - | @Callable(df) | |
780 | - | func putOneTknREADONLY (dw,dv) = { | |
781 | - | let eW = du(dv, aK(dw), unit, unit) | |
782 | - | let eR = eW._1 | |
783 | - | let cP = eW._2 | |
784 | - | let dt = eW._3 | |
785 | - | let eS = eW._4 | |
786 | - | $Tuple2(nil, $Tuple3(eR, dt, eS)) | |
787 | - | } | |
788 | - | ||
789 | - | ||
790 | - | ||
791 | - | @Callable(df) | |
792 | - | func getOneTkn (eX,eK) = { | |
793 | - | let eM = { | |
794 | - | let eN = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
795 | - | if ($isInstanceOf(eN, "Boolean")) | |
796 | - | then eN | |
797 | - | else throw(($getType(eN) + " couldn't be cast to Boolean")) | |
798 | - | } | |
799 | - | let eY = if (if (aF()) | |
800 | - | then true | |
801 | - | else (aS == n)) | |
802 | - | then true | |
803 | - | else eM | |
804 | - | let ea = [if (!(eY)) | |
805 | - | then true | |
806 | - | else aB("get operation is blocked by admin"), if ((size(df.payments) == 1)) | |
807 | - | then true | |
808 | - | else aB("exactly 1 payment are expected")] | |
809 | - | if ((ea == ea)) | |
810 | - | then { | |
811 | - | let dZ = aK(eX) | |
812 | - | let eP = df.payments[0] | |
813 | - | let dw = eP.assetId | |
814 | - | let dK = eP.amount | |
815 | - | let X = df.caller | |
816 | - | let Y = df.transactionId | |
817 | - | let eZ = dY(dZ, dK, dw, X, Y) | |
818 | - | let fa = eZ._1 | |
819 | - | let cP = eZ._2 | |
820 | - | let dt = eZ._3 | |
821 | - | let eS = eZ._4 | |
822 | - | let dn = if (if ((eK > 0)) | |
823 | - | then (eK > fa) | |
824 | - | else false) | |
825 | - | then aB(makeString(["amount to receive is less than ", toString(eK)], "")) | |
826 | - | else fa | |
827 | - | let fb = invoke(aD, "burn", [dK], [AttachedPayment(dw, dK)]) | |
828 | - | if ((fb == fb)) | |
829 | - | then { | |
830 | - | let fc = [ScriptTransfer(X, dn, dZ)] | |
831 | - | let eV = if ((dt > 0)) | |
832 | - | then [ScriptTransfer(aE, dt, dZ)] | |
833 | - | else nil | |
834 | - | $Tuple2(((cP ++ fc) ++ eV), dn) | |
835 | - | } | |
836 | - | else throw("Strict value is not equal to itself.") | |
837 | - | } | |
838 | - | else throw("Strict value is not equal to itself.") | |
839 | - | } | |
840 | - | ||
841 | - | ||
842 | - | ||
843 | - | @Callable(df) | |
844 | - | func getOneTknREADONLY (dZ,dK) = { | |
845 | - | let fd = dY(aK(dZ), dK, aT, unit, unit) | |
846 | - | let fa = fd._1 | |
847 | - | let cP = fd._2 | |
848 | - | let dt = fd._3 | |
849 | - | let eS = fd._4 | |
850 | - | $Tuple2(nil, $Tuple3(fa, dt, eS)) | |
851 | - | } | |
852 | - | ||
853 | - | ||
854 | - | ||
855 | - | @Callable(df) | |
856 | - | func unstakeAndGetOneTkn (fe,eX,eK) = { | |
857 | - | let eM = { | |
858 | - | let eN = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
859 | - | if ($isInstanceOf(eN, "Boolean")) | |
860 | - | then eN | |
861 | - | else throw(($getType(eN) + " couldn't be cast to Boolean")) | |
862 | - | } | |
863 | - | let eY = if (if (aF()) | |
864 | - | then true | |
865 | - | else (aS == n)) | |
866 | - | then true | |
867 | - | else eM | |
868 | - | let ea = [if (!(eY)) | |
869 | - | then true | |
870 | - | else aB("get operation is blocked by admin"), if ((size(df.payments) == 0)) | |
871 | - | then true | |
872 | - | else aB("no payments are expected")] | |
873 | - | if ((ea == ea)) | |
874 | - | then { | |
875 | - | let dZ = aK(eX) | |
876 | - | let X = df.caller | |
877 | - | let Y = df.transactionId | |
878 | - | let ff = invoke(aZ, "unstake", [toBase58String(aT), fe], nil) | |
879 | - | if ((ff == ff)) | |
880 | - | then { | |
881 | - | let fg = dY(dZ, fe, aT, X, Y) | |
882 | - | let fa = fg._1 | |
883 | - | let cP = fg._2 | |
884 | - | let dt = fg._3 | |
885 | - | let eS = fg._4 | |
886 | - | let dn = if (if ((eK > 0)) | |
887 | - | then (eK > fa) | |
888 | - | else false) | |
889 | - | then aB(makeString(["amount to receive is less than ", toString(eK)], "")) | |
890 | - | else fa | |
891 | - | let fb = invoke(aD, "burn", [fe], [AttachedPayment(aT, fe)]) | |
892 | - | if ((fb == fb)) | |
893 | - | then { | |
894 | - | let fc = [ScriptTransfer(df.caller, dn, dZ)] | |
895 | - | let eV = if ((dt > 0)) | |
896 | - | then [ScriptTransfer(aE, dt, dZ)] | |
897 | - | else nil | |
898 | - | $Tuple2(((cP ++ fc) ++ eV), dn) | |
899 | - | } | |
900 | - | else throw("Strict value is not equal to itself.") | |
901 | - | } | |
902 | - | else throw("Strict value is not equal to itself.") | |
903 | - | } | |
904 | - | else throw("Strict value is not equal to itself.") | |
905 | - | } | |
906 | - | ||
907 | - | ||
908 | - | ||
909 | - | @Callable(df) | |
910 | - | func get () = { | |
911 | - | let cA = de(df) | |
912 | - | let fh = cA._1 | |
913 | - | let ch = cA._2 | |
914 | - | let dh = cA._3 | |
915 | - | let bP = cA._4 | |
916 | - | let ci = cA._5 | |
917 | - | let fi = invoke(aD, "burn", [dh], [AttachedPayment(bP, dh)]) | |
918 | - | if ((fi == fi)) | |
919 | - | then ci | |
920 | - | else throw("Strict value is not equal to itself.") | |
921 | - | } | |
922 | - | ||
923 | - | ||
924 | - | ||
925 | - | @Callable(df) | |
926 | - | func getNoLess (fj,fk) = { | |
927 | - | let cA = de(df) | |
928 | - | let cg = cA._1 | |
929 | - | let ch = cA._2 | |
930 | - | let dh = cA._3 | |
931 | - | let bP = cA._4 | |
932 | - | let ci = cA._5 | |
933 | - | if ((fj > cg)) | |
934 | - | then throw(((("noLessThenAmtAsset failed: " + toString(cg)) + " < ") + toString(fj))) | |
935 | - | else if ((fk > ch)) | |
936 | - | then throw(((("noLessThenPriceAsset failed: " + toString(ch)) + " < ") + toString(fk))) | |
560 | + | @Callable(cD) | |
561 | + | func getNoLess (dn,do) = { | |
562 | + | let bY = cC(cD) | |
563 | + | let bE = bY._1 | |
564 | + | let bF = bY._2 | |
565 | + | let cF = bY._3 | |
566 | + | let bn = bY._4 | |
567 | + | let bG = bY._5 | |
568 | + | if ((dn > bE)) | |
569 | + | then throw(((("noLessThenAmtAsset failed: " + toString(bE)) + " < ") + toString(dn))) | |
570 | + | else if ((do > bF)) | |
571 | + | then throw(((("noLessThenPriceAsset failed: " + toString(bF)) + " < ") + toString(do))) | |
937 | 572 | else { | |
938 | - | let | |
939 | - | if (( | |
940 | - | then | |
573 | + | let dm = invoke(as, "burn", [cF], [AttachedPayment(bn, cF)]) | |
574 | + | if ((dm == dm)) | |
575 | + | then bG | |
941 | 576 | else throw("Strict value is not equal to itself.") | |
942 | 577 | } | |
943 | 578 | } | |
944 | 579 | ||
945 | 580 | ||
946 | 581 | ||
947 | - | @Callable( | |
948 | - | func unstakeAndGet ( | |
949 | - | let | |
582 | + | @Callable(cD) | |
583 | + | func unstakeAndGet (dp) = { | |
584 | + | let dq = if ((size(cD.payments) != 0)) | |
950 | 585 | then throw("No payments are expected") | |
951 | 586 | else true | |
952 | - | if (( | |
587 | + | if ((dq == dq)) | |
953 | 588 | then { | |
954 | - | let bE = aH() | |
955 | - | let bR = fromBase58String(bE[q]) | |
956 | - | let ff = invoke(aZ, "unstake", [toBase58String(bR), dn], nil) | |
957 | - | if ((ff == ff)) | |
589 | + | let bc = av() | |
590 | + | let cY = ay() | |
591 | + | let bp = fromBase58String(bc[m]) | |
592 | + | let cZ = valueOrErrorMessage(addressFromString(cY[x]), "Error. Incorrect staking address.") | |
593 | + | let dr = invoke(cZ, "unstake", [toBase58String(bp), dp], nil) | |
594 | + | if ((dr == dr)) | |
958 | 595 | then { | |
959 | - | let | |
960 | - | let | |
961 | - | let | |
962 | - | let | |
596 | + | let bY = bl(toBase58String(cD.transactionId), toBase58String(bp), dp, cD.caller) | |
597 | + | let bs = parseIntValue(bY._9) | |
598 | + | let bG = bY._10 | |
599 | + | let ds = if (if (at()) | |
963 | 600 | then true | |
964 | - | else ( | |
965 | - | then throw(("Get operation is blocked by admin. Status = " + toString( | |
601 | + | else (bs == j)) | |
602 | + | then throw(("Get operation is blocked by admin. Status = " + toString(bs))) | |
966 | 603 | else true | |
967 | - | if (( | |
604 | + | if ((ds == ds)) | |
968 | 605 | then { | |
969 | - | let | |
970 | - | if (( | |
971 | - | then | |
606 | + | let dm = invoke(as, "burn", [dp], [AttachedPayment(bp, dp)]) | |
607 | + | if ((dm == dm)) | |
608 | + | then bG | |
972 | 609 | else throw("Strict value is not equal to itself.") | |
973 | 610 | } | |
974 | 611 | else throw("Strict value is not equal to itself.") | |
975 | 612 | } | |
976 | 613 | else throw("Strict value is not equal to itself.") | |
977 | 614 | } | |
978 | 615 | else throw("Strict value is not equal to itself.") | |
979 | 616 | } | |
980 | 617 | ||
981 | 618 | ||
982 | 619 | ||
983 | - | @Callable( | |
984 | - | func activate ( | |
620 | + | @Callable(cD) | |
621 | + | func activate (dt,du) = if ((toString(cD.caller) != toString(as))) | |
985 | 622 | then throw("permissions denied") | |
986 | - | else $Tuple2([StringEntry( | |
623 | + | else $Tuple2([StringEntry(V(), dt), StringEntry(W(), du)], "success") | |
987 | 624 | ||
988 | 625 | ||
989 | 626 | ||
990 | - | @Callable( | |
991 | - | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, | |
627 | + | @Callable(cD) | |
628 | + | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, av()) | |
992 | 629 | ||
993 | 630 | ||
994 | 631 | ||
995 | - | @Callable( | |
996 | - | func getAccBalanceWrapperREADONLY ( | |
632 | + | @Callable(cD) | |
633 | + | func getAccBalanceWrapperREADONLY (aP) = $Tuple2(nil, aO(aP)) | |
997 | 634 | ||
998 | 635 | ||
999 | 636 | ||
1000 | - | @Callable( | |
1001 | - | func calcPricesWrapperREADONLY ( | |
1002 | - | let | |
1003 | - | $Tuple2(nil, [toString( | |
637 | + | @Callable(cD) | |
638 | + | func calcPricesWrapperREADONLY (aW,aX,bb) = { | |
639 | + | let bk = ba(aW, aX, bb) | |
640 | + | $Tuple2(nil, [toString(bk[0]), toString(bk[1]), toString(bk[2])]) | |
1004 | 641 | } | |
1005 | 642 | ||
1006 | 643 | ||
1007 | 644 | ||
1008 | - | @Callable( | |
1009 | - | func toX18WrapperREADONLY ( | |
645 | + | @Callable(cD) | |
646 | + | func toX18WrapperREADONLY (A,B) = $Tuple2(nil, toString(z(A, B))) | |
1010 | 647 | ||
1011 | 648 | ||
1012 | 649 | ||
1013 | - | @Callable( | |
1014 | - | func fromX18WrapperREADONLY ( | |
650 | + | @Callable(cD) | |
651 | + | func fromX18WrapperREADONLY (D,E) = $Tuple2(nil, C(parseBigIntValue(D), E)) | |
1015 | 652 | ||
1016 | 653 | ||
1017 | 654 | ||
1018 | - | @Callable( | |
1019 | - | func calcPriceBigIntWrapperREADONLY ( | |
655 | + | @Callable(cD) | |
656 | + | func calcPriceBigIntWrapperREADONLY (aR,aS) = $Tuple2(nil, toString(aQ(parseBigIntValue(aR), parseBigIntValue(aS)))) | |
1020 | 657 | ||
1021 | 658 | ||
1022 | 659 | ||
1023 | - | @Callable( | |
1024 | - | func estimatePutOperationWrapperREADONLY (bO | |
660 | + | @Callable(cD) | |
661 | + | func estimatePutOperationWrapperREADONLY (bm,bI,bJ,bK,bL,bM,S,bN,bO) = $Tuple2(nil, bH(bm, bI, bJ, bK, bL, bM, S, bN, bO)) | |
1025 | 662 | ||
1026 | 663 | ||
1027 | 664 | ||
1028 | - | @Callable( | |
1029 | - | func estimateGetOperationWrapperREADONLY ( | |
1030 | - | let | |
1031 | - | $Tuple2(nil, $Tuple10( | |
665 | + | @Callable(cD) | |
666 | + | func estimateGetOperationWrapperREADONLY (bm,bn,bo,S) = { | |
667 | + | let bY = bl(bm, bn, bo, addressFromStringValue(S)) | |
668 | + | $Tuple2(nil, $Tuple10(bY._1, bY._2, bY._3, bY._4, bY._5, bY._6, bY._7, toString(bY._8), bY._9, bY._10)) | |
1032 | 669 | } | |
1033 | 670 | ||
1034 | 671 | ||
1035 | 672 | ||
1036 | - | @Callable( | |
673 | + | @Callable(cD) | |
1037 | 674 | func statsREADONLY () = { | |
1038 | - | let | |
1039 | - | let | |
1040 | - | let | |
1041 | - | let | |
1042 | - | let | |
1043 | - | let | |
1044 | - | let | |
1045 | - | let | |
1046 | - | let | |
1047 | - | let | |
1048 | - | let | |
1049 | - | let | |
675 | + | let bc = av() | |
676 | + | let bp = fromBase58String(bc[m]) | |
677 | + | let cq = bc[n] | |
678 | + | let cr = bc[o] | |
679 | + | let bR = bc[r] | |
680 | + | let bS = bc[s] | |
681 | + | let bd = parseIntValue(bc[p]) | |
682 | + | let be = parseIntValue(bc[q]) | |
683 | + | let dv = valueOrErrorMessage(assetInfo(bp), (("Asset " + toBase58String(bp)) + " doesn't exist")).quantity | |
684 | + | let cs = aO(cq) | |
685 | + | let ct = aO(cr) | |
686 | + | let dw = if ((dv == 0)) | |
1050 | 687 | then [e, e, e] | |
1051 | - | else | |
1052 | - | let | |
1053 | - | let | |
1054 | - | let | |
1055 | - | let | |
1056 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString( | |
688 | + | else ba(cs, ct, dv) | |
689 | + | let bz = 0 | |
690 | + | let dx = C(dw[1], b) | |
691 | + | let dy = C(dw[2], b) | |
692 | + | let dz = value(getInteger(as, ah(toString(this)))) | |
693 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(cs), toString(ct), toString(dv), toString(bz), toString(dx), toString(dy), toString(dz)], f)) | |
1057 | 694 | } | |
1058 | 695 | ||
1059 | 696 | ||
1060 | 697 | ||
1061 | - | @Callable( | |
1062 | - | func evaluatePutByAmountAssetREADONLY ( | |
1063 | - | let | |
1064 | - | let | |
1065 | - | let | |
1066 | - | let | |
1067 | - | let | |
1068 | - | let | |
1069 | - | let | |
1070 | - | let | |
1071 | - | let | |
1072 | - | let | |
1073 | - | let | |
1074 | - | let | |
1075 | - | let | |
1076 | - | let | |
1077 | - | let | |
698 | + | @Callable(cD) | |
699 | + | func evaluatePutByAmountAssetREADONLY (bJ) = { | |
700 | + | let bc = av() | |
701 | + | let bp = fromBase58String(bc[m]) | |
702 | + | let bP = bc[n] | |
703 | + | let bq = fromBase58String(bP) | |
704 | + | let bQ = bc[o] | |
705 | + | let br = fromBase58String(bQ) | |
706 | + | let bd = parseIntValue(bc[p]) | |
707 | + | let be = parseIntValue(bc[q]) | |
708 | + | let bs = bc[l] | |
709 | + | let dv = valueOrErrorMessage(assetInfo(bp), (("Asset " + toBase58String(bp)) + " doesn't exist")).quantity | |
710 | + | let cs = aO(bP) | |
711 | + | let ct = aO(bQ) | |
712 | + | let aY = z(cs, bd) | |
713 | + | let aZ = z(ct, be) | |
714 | + | let by = if ((dv == 0)) | |
1078 | 715 | then e | |
1079 | - | else | |
1080 | - | let | |
1081 | - | let | |
1082 | - | let | |
1083 | - | let | |
1084 | - | let | |
1085 | - | let | |
1086 | - | let | |
1087 | - | let | |
1088 | - | let | |
1089 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString( | |
716 | + | else aQ(aZ, aY) | |
717 | + | let bV = z(bJ, bd) | |
718 | + | let bW = fraction(bV, by, d) | |
719 | + | let bL = C(bW, be) | |
720 | + | let cJ = bH("", 500000, bJ, bq, bL, br, "", true, false) | |
721 | + | let cg = cJ._1 | |
722 | + | let dA = cJ._3 | |
723 | + | let bu = cJ._4 | |
724 | + | let bw = cJ._5 | |
725 | + | let bt = cJ._6 | |
726 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(cg), toString(C(by, b)), toString(bu), toString(bw), toString(bt), bs, toString(bJ), toString(bL)], f)) | |
1090 | 727 | } | |
1091 | 728 | ||
1092 | 729 | ||
1093 | 730 | ||
1094 | - | @Callable( | |
1095 | - | func evaluatePutByPriceAssetREADONLY ( | |
1096 | - | let | |
1097 | - | let | |
1098 | - | let | |
1099 | - | let | |
1100 | - | let | |
1101 | - | let | |
1102 | - | let | |
1103 | - | let | |
1104 | - | let | |
1105 | - | let | |
1106 | - | let | |
1107 | - | let | |
1108 | - | let | |
1109 | - | let | |
1110 | - | let | |
731 | + | @Callable(cD) | |
732 | + | func evaluatePutByPriceAssetREADONLY (bL) = { | |
733 | + | let bc = av() | |
734 | + | let bp = fromBase58String(bc[m]) | |
735 | + | let bP = bc[n] | |
736 | + | let bq = fromBase58String(bP) | |
737 | + | let bQ = bc[o] | |
738 | + | let br = fromBase58String(bQ) | |
739 | + | let bd = parseIntValue(bc[p]) | |
740 | + | let be = parseIntValue(bc[q]) | |
741 | + | let bs = bc[l] | |
742 | + | let dv = valueOrErrorMessage(assetInfo(bp), (("Asset " + toBase58String(bp)) + " doesn't exist")).quantity | |
743 | + | let dB = aO(bP) | |
744 | + | let dC = aO(bQ) | |
745 | + | let dD = z(dB, bd) | |
746 | + | let dE = z(dC, be) | |
747 | + | let by = if ((dv == 0)) | |
1111 | 748 | then e | |
1112 | - | else | |
1113 | - | let | |
1114 | - | let | |
1115 | - | let | |
1116 | - | let | |
1117 | - | let | |
1118 | - | let | |
1119 | - | let | |
1120 | - | let | |
1121 | - | let | |
1122 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString( | |
749 | + | else aQ(dE, dD) | |
750 | + | let bW = z(bL, be) | |
751 | + | let bV = fraction(bW, d, by) | |
752 | + | let bJ = C(bV, bd) | |
753 | + | let cJ = bH("", 500000, bJ, bq, bL, br, "", true, false) | |
754 | + | let cg = cJ._1 | |
755 | + | let dA = cJ._3 | |
756 | + | let bu = cJ._4 | |
757 | + | let bw = cJ._5 | |
758 | + | let bt = cJ._6 | |
759 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(cg), toString(C(by, b)), toString(bu), toString(bw), toString(bt), bs, toString(bJ), toString(bL)], f)) | |
1123 | 760 | } | |
1124 | 761 | ||
1125 | 762 | ||
1126 | 763 | ||
1127 | - | @Callable( | |
1128 | - | func evaluateGetREADONLY ( | |
1129 | - | let | |
1130 | - | let | |
1131 | - | let | |
1132 | - | let | |
1133 | - | let | |
1134 | - | let | |
1135 | - | let | |
1136 | - | let | |
1137 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString( | |
764 | + | @Callable(cD) | |
765 | + | func evaluateGetREADONLY (dF,dG) = { | |
766 | + | let bY = bl("", dF, dG, this) | |
767 | + | let bE = bY._1 | |
768 | + | let bF = bY._2 | |
769 | + | let bu = bY._5 | |
770 | + | let bw = bY._6 | |
771 | + | let bt = bY._7 | |
772 | + | let bz = bY._8 | |
773 | + | let bs = parseIntValue(bY._9) | |
774 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(bE), toString(bF), toString(bu), toString(bw), toString(bt), toString(bz), toString(bs)], f)) | |
1138 | 775 | } | |
1139 | 776 | ||
1140 | 777 | ||
1141 | - | @Verifier( | |
1142 | - | func | |
1143 | - | let | |
1144 | - | let | |
1145 | - | if ($isInstanceOf( | |
778 | + | @Verifier(dH) | |
779 | + | func dI () = { | |
780 | + | let dJ = { | |
781 | + | let cL = cK() | |
782 | + | if ($isInstanceOf(cL, "ByteVector")) | |
1146 | 783 | then { | |
1147 | - | let | |
1148 | - | | |
784 | + | let cQ = cL | |
785 | + | cQ | |
1149 | 786 | } | |
1150 | - | else if ($isInstanceOf( | |
1151 | - | then | |
787 | + | else if ($isInstanceOf(cL, "Unit")) | |
788 | + | then dH.senderPublicKey | |
1152 | 789 | else throw("Match error") | |
1153 | 790 | } | |
1154 | - | let | |
1155 | - | if ($isInstanceOf( | |
791 | + | let cL = dH | |
792 | + | if ($isInstanceOf(cL, "Order")) | |
1156 | 793 | then { | |
1157 | - | let | |
1158 | - | let | |
1159 | - | let | |
1160 | - | let | |
1161 | - | let | |
1162 | - | if (if (if ( | |
1163 | - | then | |
794 | + | let cp = cL | |
795 | + | let dK = au() | |
796 | + | let al = co(cp) | |
797 | + | let am = sigVerify(cp.bodyBytes, cp.proofs[0], cp.senderPublicKey) | |
798 | + | let an = sigVerify(cp.bodyBytes, cp.proofs[1], dK) | |
799 | + | if (if (if (al) | |
800 | + | then am | |
1164 | 801 | else false) | |
1165 | - | then | |
802 | + | then an | |
1166 | 803 | else false) | |
1167 | 804 | then true | |
1168 | - | else | |
805 | + | else ak(al, am, an) | |
1169 | 806 | } | |
1170 | - | else if ($isInstanceOf( | |
807 | + | else if ($isInstanceOf(cL, "SetScriptTransaction")) | |
1171 | 808 | then { | |
1172 | - | let | |
1173 | - | let | |
1174 | - | let | |
1175 | - | let | |
1176 | - | if (if (( | |
1177 | - | then ( | |
809 | + | let cM = cL | |
810 | + | let dL = blake2b256(value(cM.script)) | |
811 | + | let dM = fromBase64String(value(getString(as, aj()))) | |
812 | + | let dN = scriptHash(this) | |
813 | + | if (if ((dM == dL)) | |
814 | + | then (dN != dL) | |
1178 | 815 | else false) | |
1179 | 816 | then true | |
1180 | - | else sigVerify( | |
817 | + | else sigVerify(dH.bodyBytes, dH.proofs[0], dJ) | |
1181 | 818 | } | |
1182 | - | else sigVerify( | |
819 | + | else sigVerify(dH.bodyBytes, dH.proofs[0], dJ) | |
1183 | 820 | } | |
1184 | 821 |
github/deemru/w8io/026f985 294.55 ms ◑