tx · 8XpSmtN2sYwNg3obsuasdpyb5KZUMGLWmMxxzcXq8Sgs 3NAYgaLaVNNh5qw3Zx5PydFoE7mSoqYvP2H: -0.04200000 Waves 2023.04.06 17:37 [2522832] smart account 3NAYgaLaVNNh5qw3Zx5PydFoE7mSoqYvP2H > SELF 0.00000000 Waves
{ "type": 13, "id": "8XpSmtN2sYwNg3obsuasdpyb5KZUMGLWmMxxzcXq8Sgs", "fee": 4200000, "feeAssetId": null, "timestamp": 1680791878717, "version": 2, "chainId": 84, "sender": "3NAYgaLaVNNh5qw3Zx5PydFoE7mSoqYvP2H", "senderPublicKey": "BNZJaZQpQutteRwUttAsDbWkozgmUAAjBrkxaaYMuV8", "proofs": [ "r32LMTAJcjiLBFU4r5pmmcR9Nt4JebWbAewi2QwhZ4xhBU7CiDQSaeQmMm6L9pV6exx3YKKNCZs1KHdiazJJHHK" ], "script": "base64:BgK9NwgCEgASBQoDAQQBEgcKBQEEAQgBEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V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FAmluBQJpbAcJAPQDAwgFAmlnCWJvZHlCeXRlcwkAkQMCCAUCaWcGcHJvb2ZzAAAFAmlpzVFmaQ==", "height": 2522832, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J6WFXeska4TViibs5SwMM8puGw5QwKkQZGiuiH626trR Next: HWeTF7JkdQiStZAsmVV35U22eh4Z11CN2CLN8Q8kh9cp Diff:
Old | New | Differences | |
---|---|---|---|
130 | 130 | ||
131 | 131 | let an = valueOrElse(getInteger(this, al), am) | |
132 | 132 | ||
133 | - | func ao () = "%s | |
133 | + | func ao (ap) = makeString(["%s%s", "stakedBalance", ap], j) | |
134 | 134 | ||
135 | 135 | ||
136 | - | func | |
136 | + | func aq (ap) = makeString(["%s%s", "shareAssetBalance", ap], j) | |
137 | 137 | ||
138 | 138 | ||
139 | - | func | |
139 | + | func ar (ap) = valueOrElse(getInteger(this, ao(ap)), 0) | |
140 | 140 | ||
141 | 141 | ||
142 | - | func as ( | |
142 | + | func as (ap) = valueOrElse(getInteger(this, aq(ap)), 0) | |
143 | 143 | ||
144 | 144 | ||
145 | - | func | |
145 | + | func at () = "%s__factoryConfig" | |
146 | 146 | ||
147 | 147 | ||
148 | - | func | |
148 | + | func au () = "%s%s__matcher__publicKey" | |
149 | 149 | ||
150 | 150 | ||
151 | - | func | |
151 | + | func av (aw) = (("%s%s%s__" + aw) + "__mappings__poolContract2LpAsset") | |
152 | 152 | ||
153 | 153 | ||
154 | - | func | |
154 | + | func ax (ay,az) = (((("%d%d%s__" + ay) + "__") + az) + "__config") | |
155 | 155 | ||
156 | 156 | ||
157 | - | let aB = "%s__feeCollectorAddress" | |
158 | - | ||
159 | - | func aC (aD,aE,aF,aG) = throw((((((((("order validation failed: orderValid=" + toString(aD)) + " (") + aE) + ")") + " senderValid=") + toString(aF)) + " matcherValid=") + toString(aG))) | |
157 | + | func aA (aB) = ("%s%s%s__mappings__baseAsset2internalId__" + aB) | |
160 | 158 | ||
161 | 159 | ||
162 | - | func | |
160 | + | func aC () = "%s__shutdown" | |
163 | 161 | ||
164 | 162 | ||
165 | - | func | |
163 | + | func aD (aE) = ("%s%s__poolWeight__" + aE) | |
166 | 164 | ||
167 | 165 | ||
168 | - | func | |
166 | + | func aF () = "%s__allowedLpScriptHash" | |
169 | 167 | ||
170 | 168 | ||
171 | - | func aN (aM) = makeString(["lp.ride:", aM], " ") | |
169 | + | let aG = "%s__feeCollectorAddress" | |
170 | + | ||
171 | + | func aH (aI,aJ,aK,aL) = throw((((((((("order validation failed: orderValid=" + toString(aI)) + " (") + aJ) + ")") + " senderValid=") + toString(aK)) + " matcherValid=") + toString(aL))) | |
172 | 172 | ||
173 | 173 | ||
174 | - | ||
174 | + | func aM (aN,aO) = valueOrErrorMessage(getString(aN, aO), makeString(["mandatory ", toString(aN), ".", aO, " is not defined"], "")) | |
175 | 175 | ||
176 | - | let aP = addressFromStringValue(aH(aO, aB)) | |
177 | 176 | ||
178 | - | let aQ = { | |
179 | - | let aR = invoke(aO, "getInFeeREADONLY", [toString(this)], nil) | |
180 | - | if ($isInstanceOf(aR, "Int")) | |
181 | - | then aR | |
182 | - | else throw(($getType(aR) + " couldn't be cast to Int")) | |
177 | + | func aP (aN,aO) = valueOrErrorMessage(getInteger(aN, aO), makeString(["mandatory ", toString(aN), ".", aO, " is not defined"], "")) | |
178 | + | ||
179 | + | ||
180 | + | func aQ (aR) = throw(makeString(["lp.ride:", aR], " ")) | |
181 | + | ||
182 | + | ||
183 | + | func aS (aR) = makeString(["lp.ride:", aR], " ") | |
184 | + | ||
185 | + | ||
186 | + | let aT = addressFromStringValue(aM(this, T())) | |
187 | + | ||
188 | + | let aU = addressFromStringValue(aM(aT, aG)) | |
189 | + | ||
190 | + | let aV = { | |
191 | + | let aW = invoke(aT, "getInFeeREADONLY", [toString(this)], nil) | |
192 | + | if ($isInstanceOf(aW, "Int")) | |
193 | + | then aW | |
194 | + | else throw(($getType(aW) + " couldn't be cast to Int")) | |
183 | 195 | } | |
184 | 196 | ||
185 | - | let | |
186 | - | let | |
187 | - | if ($isInstanceOf( | |
188 | - | then | |
189 | - | else throw(($getType( | |
197 | + | let aX = { | |
198 | + | let aW = invoke(aT, "getOutFeeREADONLY", [toString(this)], nil) | |
199 | + | if ($isInstanceOf(aW, "Int")) | |
200 | + | then aW | |
201 | + | else throw(($getType(aW) + " couldn't be cast to Int")) | |
190 | 202 | } | |
191 | 203 | ||
192 | - | func | |
204 | + | func aY () = valueOrElse(getBoolean(aT, aC()), false) | |
193 | 205 | ||
194 | 206 | ||
195 | - | func | |
207 | + | func aZ () = fromBase58String(aM(aT, au())) | |
196 | 208 | ||
197 | 209 | ||
198 | - | func | |
199 | - | let | |
200 | - | let | |
201 | - | let | |
202 | - | let | |
203 | - | split( | |
210 | + | func ba () = { | |
211 | + | let bb = aM(this, ae()) | |
212 | + | let bc = aM(this, af()) | |
213 | + | let az = aP(aT, aA(bc)) | |
214 | + | let ay = aP(aT, aA(bb)) | |
215 | + | split(aM(aT, ax(toString(ay), toString(az))), j) | |
204 | 216 | } | |
205 | 217 | ||
206 | 218 | ||
207 | - | func | |
219 | + | func bd (be) = if ((be == i)) | |
208 | 220 | then unit | |
209 | - | else fromBase58String( | |
221 | + | else fromBase58String(be) | |
210 | 222 | ||
211 | 223 | ||
212 | - | func | |
224 | + | func bf (be) = if ((be == unit)) | |
213 | 225 | then i | |
214 | - | else toBase58String(value( | |
226 | + | else toBase58String(value(be)) | |
215 | 227 | ||
216 | 228 | ||
217 | - | func | |
229 | + | func bg (bh) = $Tuple7(addressFromStringValue(bh[o]), parseIntValue(bh[p]), fromBase58String(bh[q]), bd(bh[r]), bd(bh[s]), parseIntValue(bh[t]), parseIntValue(bh[u])) | |
218 | 230 | ||
219 | 231 | ||
220 | - | let | |
232 | + | let bi = bg(ba()) | |
221 | 233 | ||
222 | - | let | |
234 | + | let bj = bi | |
223 | 235 | ||
224 | - | let | |
236 | + | let bk = bj._1 | |
225 | 237 | ||
226 | - | let | |
238 | + | let bl = bj._2 | |
227 | 239 | ||
228 | - | let | |
240 | + | let bm = bj._3 | |
229 | 241 | ||
230 | - | let | |
242 | + | let bn = bj._4 | |
231 | 243 | ||
232 | - | let | |
244 | + | let bo = bj._5 | |
233 | 245 | ||
234 | - | let | |
246 | + | let bp = bj._6 | |
235 | 247 | ||
236 | - | let | |
248 | + | let bq = bj._7 | |
237 | 249 | ||
238 | - | func | |
250 | + | func br () = split(aM(aT, at()), j) | |
239 | 251 | ||
240 | 252 | ||
241 | - | let | |
253 | + | let bs = valueOrErrorMessage(addressFromString(br()[B]), "incorrect staking address") | |
242 | 254 | ||
243 | - | let | |
255 | + | let bt = valueOrErrorMessage(addressFromString(br()[C]), "incorrect staking address") | |
244 | 256 | ||
245 | - | func | |
257 | + | func bu (bv,bw,bx,by,bz,bA,bB,bC,bD,bE) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bv), toString(bw), toString(bx), toString(by), toString(bz), toString(bA), toString(bB), toString(bC), toString(bD), toString(bE)], j) | |
246 | 258 | ||
247 | 259 | ||
248 | - | func | |
260 | + | func bF (bG,bH,bI,by,bB,bC) = makeString(["%d%d%d%d%d%d", toString(bG), toString(bH), toString(bI), toString(by), toString(bB), toString(bC)], j) | |
249 | 261 | ||
250 | 262 | ||
251 | - | func bE (bF) = if ((bF == "WAVES")) | |
252 | - | then wavesBalance(this).available | |
253 | - | else assetBalance(this, fromBase58String(bF)) | |
254 | - | ||
255 | - | ||
256 | - | func bG (bH,bI) = fraction(bH, d, bI) | |
257 | - | ||
258 | - | ||
259 | - | func bJ (bH,bI,L) = fraction(bH, d, bI, L) | |
260 | - | ||
261 | - | ||
262 | - | func bK (bL,bM,bN,bO) = { | |
263 | - | let bP = D(bN, bL) | |
264 | - | let bQ = D(bO, bM) | |
265 | - | bG(bQ, bP) | |
263 | + | func bJ (ap) = { | |
264 | + | let bK = if ((ap == "WAVES")) | |
265 | + | then wavesBalance(this).available | |
266 | + | else assetBalance(this, fromBase58String(ap)) | |
267 | + | let bL = ((bK + ar(ap)) - as(ap)) | |
268 | + | max([0, bL]) | |
266 | 269 | } | |
267 | 270 | ||
268 | 271 | ||
269 | - | func bR (bN,bO,bS) = { | |
270 | - | let bT = aV() | |
271 | - | let bU = parseIntValue(bT[t]) | |
272 | - | let bV = parseIntValue(bT[u]) | |
273 | - | let bW = bK(bU, bV, bN, bO) | |
274 | - | let bI = D(bN, bU) | |
275 | - | let bH = D(bO, bV) | |
276 | - | let bX = D(bS, b) | |
277 | - | let bY = bG(bI, bX) | |
278 | - | let bZ = bG(bH, bX) | |
279 | - | [bW, bY, bZ] | |
272 | + | func bM (bN,bO) = fraction(bN, d, bO) | |
273 | + | ||
274 | + | ||
275 | + | func bP (bN,bO,L) = fraction(bN, d, bO, L) | |
276 | + | ||
277 | + | ||
278 | + | func bQ (bR) = { | |
279 | + | let bS = invoke(bR, "getRate", nil, nil) | |
280 | + | if ((bS == bS)) | |
281 | + | then { | |
282 | + | let bT = bS | |
283 | + | if ($isInstanceOf(bT, "Int")) | |
284 | + | then { | |
285 | + | let bU = bT | |
286 | + | bU | |
287 | + | } | |
288 | + | else aQ("proxy.getRate() unexpected value") | |
289 | + | } | |
290 | + | else throw("Strict value is not equal to itself.") | |
280 | 291 | } | |
281 | 292 | ||
282 | 293 | ||
283 | - | func ca (bN,bO,bS) = { | |
284 | - | let cb = bR(bN, bO, bS) | |
285 | - | [H(cb[0], b), H(cb[1], b), H(cb[2], b)] | |
286 | - | } | |
287 | - | ||
288 | - | ||
289 | - | func cc (cd,ce,cf,ab) = { | |
290 | - | let bT = aV() | |
291 | - | let cg = bT[q] | |
292 | - | let ch = bT[r] | |
293 | - | let ci = bT[s] | |
294 | - | let bL = parseIntValue(bT[t]) | |
295 | - | let bM = parseIntValue(bT[u]) | |
296 | - | let cj = bT[p] | |
297 | - | let ck = valueOrErrorMessage(assetInfo(fromBase58String(cg)), (("Asset " + cg) + " doesn't exist")).quantity | |
298 | - | if ((cg != ce)) | |
299 | - | then throw("Invalid asset passed.") | |
300 | - | else { | |
301 | - | let cl = bE(ch) | |
302 | - | let cm = D(cl, bL) | |
303 | - | let cn = bE(ci) | |
304 | - | let co = D(cn, bM) | |
305 | - | let cp = bG(co, cm) | |
306 | - | let cq = H(cp, b) | |
307 | - | let cr = D(cf, b) | |
308 | - | let cs = D(ck, b) | |
309 | - | let ct = fraction(cm, cr, cs) | |
310 | - | let cu = fraction(co, cr, cs) | |
311 | - | let cv = K(ct, bL, FLOOR) | |
312 | - | let cw = K(cu, bM, FLOOR) | |
313 | - | let cx = if ((cd == "")) | |
314 | - | then nil | |
315 | - | else [ScriptTransfer(ab, cv, if ((ch == "WAVES")) | |
316 | - | then unit | |
317 | - | else fromBase58String(ch)), ScriptTransfer(ab, cw, if ((ci == "WAVES")) | |
318 | - | then unit | |
319 | - | else fromBase58String(ci)), StringEntry(ad(toString(ab), cd), bA(cv, cw, cf, cq, height, lastBlock.timestamp)), IntegerEntry(W(), cq), IntegerEntry(X(height, lastBlock.timestamp), cq)] | |
320 | - | $Tuple10(cv, cw, ch, ci, cl, cn, ck, cp, cj, cx) | |
321 | - | } | |
322 | - | } | |
323 | - | ||
324 | - | ||
325 | - | func cy (cd,cz,cA,cB,cC,cD,ab,cE,cF) = { | |
326 | - | let bT = aV() | |
327 | - | let cg = fromBase58String(bT[q]) | |
328 | - | let cG = bT[r] | |
329 | - | let cH = bT[s] | |
330 | - | let cI = bT[v] | |
331 | - | let cJ = bT[w] | |
332 | - | let bU = parseIntValue(bT[t]) | |
333 | - | let bV = parseIntValue(bT[u]) | |
334 | - | let cj = bT[p] | |
335 | - | let ck = valueOrErrorMessage(assetInfo(cg), (("Asset " + toBase58String(cg)) + " doesn't exist")).quantity | |
336 | - | let cK = toBase58String(valueOrElse(cB, fromBase58String("WAVES"))) | |
337 | - | let cL = toBase58String(valueOrElse(cD, fromBase58String("WAVES"))) | |
338 | - | if (if ((cG != cK)) | |
339 | - | then true | |
340 | - | else (cH != cL)) | |
341 | - | then throw("Invalid amt or price asset passed.") | |
342 | - | else { | |
343 | - | let cl = if (cE) | |
344 | - | then bE(cG) | |
345 | - | else (bE(cG) - cA) | |
346 | - | let cn = if (cE) | |
347 | - | then bE(cH) | |
348 | - | else (bE(cH) - cC) | |
349 | - | let cM = D(cA, bU) | |
350 | - | let cN = D(cC, bV) | |
351 | - | let cO = bG(cN, cM) | |
352 | - | let cm = D(cl, bU) | |
353 | - | let co = D(cn, bV) | |
354 | - | let cP = if ((ck == 0)) | |
294 | + | func bV (ap,bW,bX,bR) = { | |
295 | + | let bY = ar(ap) | |
296 | + | if ((bY == bY)) | |
297 | + | then { | |
298 | + | let bZ = as(bX) | |
299 | + | if ((bZ == bZ)) | |
355 | 300 | then { | |
356 | - | let cp = e | |
357 | - | let cQ = e | |
358 | - | let bX = pow((cM * cN), 0, toBigInt(5), 1, 0, DOWN) | |
359 | - | $Tuple5(H(bX, b), H(cM, bU), H(cN, bV), bG((co + cN), (cm + cM)), cQ) | |
301 | + | let ca = bd(ap) | |
302 | + | if ((bW > 0)) | |
303 | + | then { | |
304 | + | let cb = invoke(bR, "deposit", nil, [AttachedPayment(ca, bW)]) | |
305 | + | if ((cb == cb)) | |
306 | + | then { | |
307 | + | let bT = cb | |
308 | + | if ($isInstanceOf(bT, "Int")) | |
309 | + | then { | |
310 | + | let cc = bT | |
311 | + | let cd = (bY + bW) | |
312 | + | let ce = (bZ + cc) | |
313 | + | [IntegerEntry(ao(ap), cd), IntegerEntry(aq(bX), ce)] | |
314 | + | } | |
315 | + | else nil | |
316 | + | } | |
317 | + | else throw("Strict value is not equal to itself.") | |
318 | + | } | |
319 | + | else nil | |
360 | 320 | } | |
361 | - | else { | |
362 | - | let cp = bG(co, cm) | |
363 | - | let cQ = fraction(R((cp - cO)), d, cp) | |
364 | - | let cR = D(cz, b) | |
365 | - | if (if ((cp != e)) | |
366 | - | then (cQ > cR) | |
367 | - | else false) | |
368 | - | then throw(((("Price slippage " + toString(cQ)) + " exceeded the passed limit of ") + toString(cR))) | |
369 | - | else { | |
370 | - | let cs = D(ck, b) | |
371 | - | let cS = fraction(cM, bJ(co, cm, CEILING), d, CEILING) | |
372 | - | let cT = fraction(cN, d, bJ(co, cm, FLOOR), CEILING) | |
373 | - | let cU = if ((cS > cN)) | |
374 | - | then $Tuple2(cT, cN) | |
375 | - | else $Tuple2(cM, cS) | |
376 | - | let cV = cU._1 | |
377 | - | let cW = cU._2 | |
378 | - | let bX = fraction(cs, cW, co, FLOOR) | |
379 | - | $Tuple5(K(bX, b, FLOOR), K(cV, bU, CEILING), K(cW, bV, CEILING), cp, cQ) | |
380 | - | } | |
381 | - | } | |
382 | - | let cX = cP._1 | |
383 | - | let cY = cP._2 | |
384 | - | let cZ = cP._3 | |
385 | - | let cq = H(cP._4, b) | |
386 | - | let da = H(cP._5, b) | |
387 | - | if ((0 >= cX)) | |
388 | - | then throw("Invalid calculations. LP calculated is less than zero.") | |
389 | - | else { | |
390 | - | let db = if (!(cF)) | |
391 | - | then 0 | |
392 | - | else cX | |
393 | - | let dc = (cA - cY) | |
394 | - | let dd = (cC - cZ) | |
395 | - | let de = [IntegerEntry(W(), cq), IntegerEntry(X(height, lastBlock.timestamp), cq), StringEntry(aa(ab, cd), bp(cY, cZ, db, cq, cz, da, height, lastBlock.timestamp, dc, dd))] | |
396 | - | $Tuple13(cX, db, cq, cl, cn, ck, cg, cj, de, dc, dd, cB, cD) | |
397 | - | } | |
398 | - | } | |
399 | - | } | |
400 | - | ||
401 | - | ||
402 | - | func df (dg,dh,ck) = { | |
403 | - | let di = G(dg, toBigInt(bk)) | |
404 | - | let dj = G(dh, toBigInt(bl)) | |
405 | - | let dk = fraction(pow((di * dj), 0, toBigInt(5), 1, 18, DOWN), g, ck) | |
406 | - | if ((ck == f)) | |
407 | - | then f | |
408 | - | else dk | |
409 | - | } | |
410 | - | ||
411 | - | ||
412 | - | func dl (dm,dn,do) = { | |
413 | - | let dp = (toBigInt(bE(ba(bi))) - dm) | |
414 | - | let dq = (toBigInt(bE(ba(bj))) - dn) | |
415 | - | let dr = (toBigInt(value(assetInfo(bh)).quantity) - do) | |
416 | - | let ds = df(dp, dq, dr) | |
417 | - | ds | |
418 | - | } | |
419 | - | ||
420 | - | ||
421 | - | func dt (du,dv,do) = { | |
422 | - | let dp = (bE(ba(bi)) + du) | |
423 | - | let dq = (bE(ba(bj)) + dv) | |
424 | - | let dr = (value(assetInfo(bh)).quantity + do) | |
425 | - | let dk = df(toBigInt(dp), toBigInt(dq), toBigInt(dr)) | |
426 | - | let dw = [IntegerEntry(ak, height), StringEntry(aj, toString(dk))] | |
427 | - | $Tuple2(dw, dk) | |
428 | - | } | |
429 | - | ||
430 | - | ||
431 | - | func dx (dy,dk) = if ((dk >= dy)) | |
432 | - | then true | |
433 | - | else aL(makeString(["updated KLp lower than current KLp", toString(dy), toString(dk)], " ")) | |
434 | - | ||
435 | - | ||
436 | - | func dz (dA) = { | |
437 | - | let dp = bE(ba(bi)) | |
438 | - | let dq = bE(ba(bj)) | |
439 | - | let dB = dA.amount | |
440 | - | let dC = fraction(dA.amount, dA.price, b, FLOOR) | |
441 | - | let dD = if ((dA.orderType == Buy)) | |
442 | - | then $Tuple2(dB, -(dC)) | |
443 | - | else $Tuple2(-(dB), dC) | |
444 | - | let du = dD._1 | |
445 | - | let dv = dD._2 | |
446 | - | if (if (if (aT()) | |
447 | - | then true | |
448 | - | else (bg == m)) | |
449 | - | then true | |
450 | - | else (bg == n)) | |
451 | - | then throw("Exchange operations disabled") | |
452 | - | else if (if ((dA.assetPair.amountAsset != bi)) | |
453 | - | then true | |
454 | - | else (dA.assetPair.priceAsset != bj)) | |
455 | - | then throw("Wrong order assets.") | |
456 | - | else { | |
457 | - | let dE = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, aj), "0")), aN("invalid kLp")) | |
458 | - | let dF = dt(du, dv, 0) | |
459 | - | let dG = dF._1 | |
460 | - | let dH = dF._2 | |
461 | - | let dI = (dH >= dE) | |
462 | - | let dJ = makeString(["kLp=", toString(dE), " kLpNew=", toString(dH), " amountAssetBalance=", toString(dp), " priceAssetBalance=", toString(dq), " amountAssetBalanceDelta=", toString(du), " priceAssetBalanceDelta=", toString(dv), " height=", toString(height)], "") | |
463 | - | $Tuple2(dI, dJ) | |
464 | - | } | |
465 | - | } | |
466 | - | ||
467 | - | ||
468 | - | func dK (dL) = if ((size(dL.payments) != 1)) | |
469 | - | then throw("exactly 1 payment is expected") | |
470 | - | else { | |
471 | - | let dM = value(dL.payments[0]) | |
472 | - | let ce = value(dM.assetId) | |
473 | - | let dN = dM.amount | |
474 | - | let cP = cc(toBase58String(dL.transactionId), toBase58String(ce), dN, dL.caller) | |
475 | - | let cv = cP._1 | |
476 | - | let cw = cP._2 | |
477 | - | let cj = parseIntValue(cP._9) | |
478 | - | let cx = cP._10 | |
479 | - | if (if (aT()) | |
480 | - | then true | |
481 | - | else (cj == n)) | |
482 | - | then throw(("Get operation is blocked by admin. Status = " + toString(cj))) | |
483 | - | else $Tuple5(cv, cw, dN, ce, cx) | |
484 | - | } | |
485 | - | ||
486 | - | ||
487 | - | func dO (dL,cz,cF) = if ((size(dL.payments) != 2)) | |
488 | - | then throw("exactly 2 payments are expected") | |
489 | - | else { | |
490 | - | let dP = value(dL.payments[0]) | |
491 | - | let dQ = value(dL.payments[1]) | |
492 | - | let dR = cy(toBase58String(dL.transactionId), cz, dP.amount, dP.assetId, dQ.amount, dQ.assetId, toString(dL.caller), false, cF) | |
493 | - | let cj = parseIntValue(dR._8) | |
494 | - | if (if (if (aT()) | |
495 | - | then true | |
496 | - | else (cj == l)) | |
497 | - | then true | |
498 | - | else (cj == n)) | |
499 | - | then throw(("Put operation is blocked by admin. Status = " + toString(cj))) | |
500 | - | else dR | |
501 | - | } | |
502 | - | ||
503 | - | ||
504 | - | func dS (dT) = { | |
505 | - | let dU = invoke(aO, "emit", [dT], nil) | |
506 | - | if ((dU == dU)) | |
507 | - | then { | |
508 | - | let dV = { | |
509 | - | let dW = dU | |
510 | - | if ($isInstanceOf(dW, "Address")) | |
511 | - | then { | |
512 | - | let dX = dW | |
513 | - | invoke(dX, "emit", [dT], nil) | |
514 | - | } | |
515 | - | else unit | |
516 | - | } | |
517 | - | if ((dV == dV)) | |
518 | - | then dT | |
519 | 321 | else throw("Strict value is not equal to itself.") | |
520 | 322 | } | |
521 | 323 | else throw("Strict value is not equal to itself.") | |
522 | 324 | } | |
523 | 325 | ||
524 | 326 | ||
525 | - | func dY (dT,ai) = { | |
526 | - | let dZ = if ((ai == 0)) | |
527 | - | then 0 | |
528 | - | else fraction(dT, ai, b) | |
529 | - | $Tuple2((dT - dZ), dZ) | |
530 | - | } | |
531 | - | ||
532 | - | ||
533 | - | func ea (eb,ec,ab,ac) = { | |
534 | - | let ed = (ac == unit) | |
535 | - | let ee = bE(ba(bi)) | |
536 | - | let ef = bE(ba(bj)) | |
537 | - | let eg = if ((ec == bi)) | |
538 | - | then true | |
539 | - | else if ((ec == bj)) | |
540 | - | then false | |
541 | - | else aL("invalid asset") | |
542 | - | let eh = if (ed) | |
543 | - | then $Tuple2(ee, ef) | |
544 | - | else if (eg) | |
545 | - | then $Tuple2((ee - eb), ef) | |
546 | - | else $Tuple2(ee, (ef - eb)) | |
547 | - | let ei = eh._1 | |
548 | - | let ej = eh._2 | |
549 | - | let ek = if (eg) | |
550 | - | then $Tuple2(eb, 0) | |
551 | - | else $Tuple2(0, eb) | |
552 | - | let el = ek._1 | |
553 | - | let em = ek._2 | |
554 | - | let dB = dY(el, aQ)._1 | |
555 | - | let dC = dY(em, aQ)._1 | |
556 | - | let en = dY(eb, aQ) | |
557 | - | let eo = en._1 | |
558 | - | let dZ = en._2 | |
559 | - | let ep = (ei + dB) | |
560 | - | let eq = (ej + dC) | |
561 | - | let er = bG(D(eq, bl), D(ep, bk)) | |
562 | - | let es = H(er, b) | |
563 | - | let et = if (eg) | |
564 | - | then ei | |
565 | - | else ej | |
566 | - | let eu = toBigInt(et) | |
567 | - | let ev = toBigInt(valueOrErrorMessage(assetInfo(bh), (("asset " + toBase58String(bh)) + " doesn't exist")).quantity) | |
568 | - | let ew = if ((ev > f)) | |
569 | - | then true | |
570 | - | else aL("initial deposit requires all coins") | |
571 | - | if ((ew == ew)) | |
327 | + | func cf (ap,bW,bX,bR,cg,ch) = { | |
328 | + | let bY = ar(ap) | |
329 | + | if ((bY == bY)) | |
572 | 330 | then { | |
573 | - | let ex = toBigInt(eo) | |
574 | - | let ey = max([0, toInt(((ev * (sqrtBigInt((d + ((ex * d) / eu)), 18, 18, DOWN) - d)) / d))]) | |
575 | - | let de = if (ed) | |
576 | - | then nil | |
577 | - | else [IntegerEntry(W(), es), IntegerEntry(X(height, lastBlock.timestamp), es), StringEntry(aa(toString(value(ab)), toBase58String(value(ac))), bp(el, em, ey, es, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
578 | - | let ez = bG(D(ej, bl), D(ei, bk)) | |
579 | - | let eA = H(ez, b) | |
580 | - | let eB = { | |
581 | - | let eC = if (eg) | |
582 | - | then $Tuple2(el, ei) | |
583 | - | else $Tuple2(em, ej) | |
584 | - | let dT = eC._1 | |
585 | - | let eD = eC._2 | |
586 | - | let eE = toInt(fraction(ev, toBigInt((dT / 2)), toBigInt(eD))) | |
587 | - | fraction((ey - eE), b, eE) | |
588 | - | } | |
589 | - | $Tuple5(ey, de, dZ, eB, eg) | |
331 | + | let bZ = as(bX) | |
332 | + | if ((bZ == bZ)) | |
333 | + | then { | |
334 | + | let ci = bQ(bR) | |
335 | + | if ((ci == ci)) | |
336 | + | then { | |
337 | + | let cj = fraction(cg, bY, bZ) | |
338 | + | let ck = bd(bX) | |
339 | + | let cl = fraction(cg, bW, cj) | |
340 | + | let cm = fraction(cg, bW, ci) | |
341 | + | let cn = max([0, (cl - cm)]) | |
342 | + | if ((cm > 0)) | |
343 | + | then { | |
344 | + | let co = invoke(bR, "withdraw", nil, [AttachedPayment(ck, cm)]) | |
345 | + | if ((co == co)) | |
346 | + | then { | |
347 | + | let bT = co | |
348 | + | if ($isInstanceOf(bT, "Int")) | |
349 | + | then { | |
350 | + | let cp = bT | |
351 | + | let cd = (bY - cp) | |
352 | + | let ce = ((bZ - cm) - cn) | |
353 | + | [IntegerEntry(ao(ap), cd), IntegerEntry(aq(bX), ce), ScriptTransfer(ch, cn, bd(bX))] | |
354 | + | } | |
355 | + | else nil | |
356 | + | } | |
357 | + | else throw("Strict value is not equal to itself.") | |
358 | + | } | |
359 | + | else nil | |
360 | + | } | |
361 | + | else throw("Strict value is not equal to itself.") | |
362 | + | } | |
363 | + | else throw("Strict value is not equal to itself.") | |
590 | 364 | } | |
591 | 365 | else throw("Strict value is not equal to itself.") | |
592 | 366 | } | |
593 | 367 | ||
594 | 368 | ||
595 | - | func eF (eG,eo,ec,ab,ac) = { | |
596 | - | let ed = (ac == unit) | |
597 | - | let bT = aV() | |
598 | - | let bU = parseIntValue(bT[t]) | |
599 | - | let bV = parseIntValue(bT[u]) | |
600 | - | let eH = [if ((ec == bh)) | |
601 | - | then true | |
602 | - | else aL("invalid lp asset")] | |
603 | - | if ((eH == eH)) | |
369 | + | func cq (ap) = { | |
370 | + | let bT = invoke(aT, "getPoolLeaseConfigREADONLY", [toString(this), ap], nil) | |
371 | + | if ($isInstanceOf(bT, "(Boolean, Int, Int, String, String, Int, String)")) | |
604 | 372 | then { | |
605 | - | let eI = if ((eG == bi)) | |
606 | - | then true | |
607 | - | else if ((eG == bj)) | |
608 | - | then false | |
609 | - | else aL("invalid asset") | |
610 | - | let eJ = if (eI) | |
611 | - | then toBigInt(bE(ba(bi))) | |
612 | - | else toBigInt(bE(ba(bj))) | |
613 | - | let eK = if (eI) | |
614 | - | then bU | |
615 | - | else bV | |
616 | - | let eL = bE(ba(bi)) | |
617 | - | let eM = bE(ba(bj)) | |
618 | - | let eN = if (eI) | |
619 | - | then eL | |
620 | - | else eM | |
621 | - | let eO = toBigInt(eN) | |
622 | - | let ev = toBigInt(valueOrErrorMessage(assetInfo(bh), (("asset " + toBase58String(bh)) + " doesn't exist")).quantity) | |
623 | - | let eP = toBigInt(eo) | |
624 | - | let eQ = max([0, toInt(((eJ * (d - pow((d - ((eP * d) / ev)), 18, h, 0, 18, DOWN))) / d))]) | |
625 | - | let eR = dY(eQ, aS) | |
626 | - | let eS = eR._1 | |
627 | - | let dZ = eR._2 | |
628 | - | let eT = if (eI) | |
629 | - | then $Tuple4(eS, 0, (eL - eQ), eM) | |
630 | - | else $Tuple4(0, eS, eL, (eM - eQ)) | |
631 | - | let eU = eT._1 | |
632 | - | let eV = eT._2 | |
633 | - | let eW = eT._3 | |
634 | - | let eX = eT._4 | |
635 | - | let er = bG(D(eX, bl), D(eW, bk)) | |
636 | - | let es = H(er, b) | |
637 | - | let de = if (ed) | |
638 | - | then nil | |
639 | - | else [StringEntry(ad(toString(value(ab)), toBase58String(value(ac))), bA(eU, eV, eo, es, height, lastBlock.timestamp)), IntegerEntry(W(), es), IntegerEntry(X(height, lastBlock.timestamp), es)] | |
640 | - | let ez = bG(D(eM, bl), D(eL, bk)) | |
641 | - | let eA = H(ez, b) | |
642 | - | let eB = { | |
643 | - | let eY = (toInt(fraction(eJ, eP, ev)) * 2) | |
644 | - | fraction((eS - eY), b, eY) | |
645 | - | } | |
646 | - | $Tuple5(eS, de, dZ, eB, eI) | |
373 | + | let cr = bT | |
374 | + | cr | |
375 | + | } | |
376 | + | else aQ((("[" + ap) + "] getLeaseProxyConfig() error")) | |
377 | + | } | |
378 | + | ||
379 | + | ||
380 | + | func cs (ct,ap,bX,cu,bR,cg,ch) = { | |
381 | + | let bY = ar(ap) | |
382 | + | if ((bY == bY)) | |
383 | + | then { | |
384 | + | let bZ = as(bX) | |
385 | + | if ((bZ == bZ)) | |
386 | + | then { | |
387 | + | let cv = max([0, (bJ(ap) - cu)]) | |
388 | + | let cw = fraction(ct, cv, 100) | |
389 | + | let cx = (bY - cw) | |
390 | + | if ((cx == 0)) | |
391 | + | then nil | |
392 | + | else if ((0 > cx)) | |
393 | + | then { | |
394 | + | let cy = -(cx) | |
395 | + | bV(ap, cy, bX, bR) | |
396 | + | } | |
397 | + | else { | |
398 | + | let cz = cx | |
399 | + | cf(ap, cz, bX, bR, cg, ch) | |
400 | + | } | |
401 | + | } | |
402 | + | else throw("Strict value is not equal to itself.") | |
647 | 403 | } | |
648 | 404 | else throw("Strict value is not equal to itself.") | |
649 | 405 | } | |
650 | 406 | ||
651 | 407 | ||
652 | - | func eZ () = { | |
653 | - | let dW = getString(U()) | |
654 | - | if ($isInstanceOf(dW, "String")) | |
408 | + | func cA (ap) = { | |
409 | + | let cB = cq(ap) | |
410 | + | let cC = cB._1 | |
411 | + | let cD = cB._2 | |
412 | + | let cu = cB._3 | |
413 | + | let cE = cB._4 | |
414 | + | let cF = cB._5 | |
415 | + | let cg = cB._6 | |
416 | + | let cG = cB._7 | |
417 | + | if (cC) | |
418 | + | then cs(cD, ap, cF, cu, addressFromStringValue(cE), cg, addressFromStringValue(cG)) | |
419 | + | else nil | |
420 | + | } | |
421 | + | ||
422 | + | ||
423 | + | func cH (ap,cI) = { | |
424 | + | let cJ = cq(ap) | |
425 | + | let cC = cJ._1 | |
426 | + | let cD = cJ._2 | |
427 | + | let cu = cJ._3 | |
428 | + | let cE = cJ._4 | |
429 | + | let cF = cJ._5 | |
430 | + | let cg = cJ._6 | |
431 | + | let cG = cJ._7 | |
432 | + | if (cC) | |
655 | 433 | then { | |
656 | - | let fa = dW | |
657 | - | fromBase58String(fa) | |
434 | + | let cK = max([0, ((bJ(ap) - cI) - cu)]) | |
435 | + | if ((cK == cK)) | |
436 | + | then { | |
437 | + | let cd = fraction(cD, cK, 100) | |
438 | + | if ((cd == cd)) | |
439 | + | then { | |
440 | + | let cL = max([0, (ar(ap) - cd)]) | |
441 | + | if ((cL == cL)) | |
442 | + | then cf(ap, cL, cF, addressFromStringValue(cE), cg, addressFromStringValue(cG)) | |
443 | + | else throw("Strict value is not equal to itself.") | |
444 | + | } | |
445 | + | else throw("Strict value is not equal to itself.") | |
446 | + | } | |
447 | + | else throw("Strict value is not equal to itself.") | |
658 | 448 | } | |
659 | - | else if ($isInstanceOf(dW, "Unit")) | |
449 | + | else nil | |
450 | + | } | |
451 | + | ||
452 | + | ||
453 | + | func cM (cN,cO) = { | |
454 | + | let cP = cH(aM(this, ae()), cN) | |
455 | + | let cQ = cH(aM(this, af()), cO) | |
456 | + | (cP ++ cQ) | |
457 | + | } | |
458 | + | ||
459 | + | ||
460 | + | func cR (cS,cT,cU,cV) = { | |
461 | + | let cW = D(cU, cS) | |
462 | + | let cX = D(cV, cT) | |
463 | + | bM(cX, cW) | |
464 | + | } | |
465 | + | ||
466 | + | ||
467 | + | func cY (cU,cV,cZ) = { | |
468 | + | let da = ba() | |
469 | + | let db = parseIntValue(da[t]) | |
470 | + | let dc = parseIntValue(da[u]) | |
471 | + | let dd = cR(db, dc, cU, cV) | |
472 | + | let bO = D(cU, db) | |
473 | + | let bN = D(cV, dc) | |
474 | + | let de = D(cZ, b) | |
475 | + | let df = bM(bO, de) | |
476 | + | let dg = bM(bN, de) | |
477 | + | [dd, df, dg] | |
478 | + | } | |
479 | + | ||
480 | + | ||
481 | + | func dh (cU,cV,cZ) = { | |
482 | + | let di = cY(cU, cV, cZ) | |
483 | + | [H(di[0], b), H(di[1], b), H(di[2], b)] | |
484 | + | } | |
485 | + | ||
486 | + | ||
487 | + | func dj (dk,dl,dm,ab) = { | |
488 | + | let da = ba() | |
489 | + | let dn = da[q] | |
490 | + | let do = da[r] | |
491 | + | let dp = da[s] | |
492 | + | let cS = parseIntValue(da[t]) | |
493 | + | let cT = parseIntValue(da[u]) | |
494 | + | let dq = da[p] | |
495 | + | let dr = valueOrErrorMessage(assetInfo(fromBase58String(dn)), (("Asset " + dn) + " doesn't exist")).quantity | |
496 | + | if ((dn != dl)) | |
497 | + | then throw("Invalid asset passed.") | |
498 | + | else { | |
499 | + | let ds = bJ(do) | |
500 | + | let dt = D(ds, cS) | |
501 | + | let du = bJ(dp) | |
502 | + | let dv = D(du, cT) | |
503 | + | let dw = bM(dv, dt) | |
504 | + | let dx = H(dw, b) | |
505 | + | let dy = D(dm, b) | |
506 | + | let dz = D(dr, b) | |
507 | + | let dA = fraction(dt, dy, dz) | |
508 | + | let dB = fraction(dv, dy, dz) | |
509 | + | let dC = K(dA, cS, FLOOR) | |
510 | + | let dD = K(dB, cT, FLOOR) | |
511 | + | let dE = if ((dk == "")) | |
512 | + | then nil | |
513 | + | else [ScriptTransfer(ab, dC, if ((do == "WAVES")) | |
514 | + | then unit | |
515 | + | else fromBase58String(do)), ScriptTransfer(ab, dD, if ((dp == "WAVES")) | |
516 | + | then unit | |
517 | + | else fromBase58String(dp)), StringEntry(ad(toString(ab), dk), bF(dC, dD, dm, dx, height, lastBlock.timestamp)), IntegerEntry(W(), dx), IntegerEntry(X(height, lastBlock.timestamp), dx)] | |
518 | + | $Tuple10(dC, dD, do, dp, ds, du, dr, dw, dq, dE) | |
519 | + | } | |
520 | + | } | |
521 | + | ||
522 | + | ||
523 | + | func dF (dk,dG,dH,dI,dJ,dK,ab,dL,dM) = { | |
524 | + | let da = ba() | |
525 | + | let dn = fromBase58String(da[q]) | |
526 | + | let dN = da[r] | |
527 | + | let dO = da[s] | |
528 | + | let dP = da[v] | |
529 | + | let dQ = da[w] | |
530 | + | let db = parseIntValue(da[t]) | |
531 | + | let dc = parseIntValue(da[u]) | |
532 | + | let dq = da[p] | |
533 | + | let dr = valueOrErrorMessage(assetInfo(dn), (("Asset " + toBase58String(dn)) + " doesn't exist")).quantity | |
534 | + | let dR = toBase58String(valueOrElse(dI, fromBase58String("WAVES"))) | |
535 | + | let dS = toBase58String(valueOrElse(dK, fromBase58String("WAVES"))) | |
536 | + | if (if ((dN != dR)) | |
537 | + | then true | |
538 | + | else (dO != dS)) | |
539 | + | then throw("Invalid amt or price asset passed.") | |
540 | + | else { | |
541 | + | let ds = if (dL) | |
542 | + | then bJ(dN) | |
543 | + | else (bJ(dN) - dH) | |
544 | + | let du = if (dL) | |
545 | + | then bJ(dO) | |
546 | + | else (bJ(dO) - dJ) | |
547 | + | let dT = D(dH, db) | |
548 | + | let dU = D(dJ, dc) | |
549 | + | let dV = bM(dU, dT) | |
550 | + | let dt = D(ds, db) | |
551 | + | let dv = D(du, dc) | |
552 | + | let dW = if ((dr == 0)) | |
553 | + | then { | |
554 | + | let dw = e | |
555 | + | let dX = e | |
556 | + | let de = pow((dT * dU), 0, toBigInt(5), 1, 0, DOWN) | |
557 | + | $Tuple5(H(de, b), H(dT, db), H(dU, dc), bM((dv + dU), (dt + dT)), dX) | |
558 | + | } | |
559 | + | else { | |
560 | + | let dw = bM(dv, dt) | |
561 | + | let dX = fraction(R((dw - dV)), d, dw) | |
562 | + | let dY = D(dG, b) | |
563 | + | if (if ((dw != e)) | |
564 | + | then (dX > dY) | |
565 | + | else false) | |
566 | + | then throw(((("Price slippage " + toString(dX)) + " exceeded the passed limit of ") + toString(dY))) | |
567 | + | else { | |
568 | + | let dz = D(dr, b) | |
569 | + | let dZ = fraction(dT, bP(dv, dt, CEILING), d, CEILING) | |
570 | + | let ea = fraction(dU, d, bP(dv, dt, FLOOR), CEILING) | |
571 | + | let eb = if ((dZ > dU)) | |
572 | + | then $Tuple2(ea, dU) | |
573 | + | else $Tuple2(dT, dZ) | |
574 | + | let ec = eb._1 | |
575 | + | let ed = eb._2 | |
576 | + | let de = fraction(dz, ed, dv, FLOOR) | |
577 | + | $Tuple5(K(de, b, FLOOR), K(ec, db, CEILING), K(ed, dc, CEILING), dw, dX) | |
578 | + | } | |
579 | + | } | |
580 | + | let ee = dW._1 | |
581 | + | let ef = dW._2 | |
582 | + | let eg = dW._3 | |
583 | + | let dx = H(dW._4, b) | |
584 | + | let eh = H(dW._5, b) | |
585 | + | if ((0 >= ee)) | |
586 | + | then throw("Invalid calculations. LP calculated is less than zero.") | |
587 | + | else { | |
588 | + | let ei = if (!(dM)) | |
589 | + | then 0 | |
590 | + | else ee | |
591 | + | let ej = (dH - ef) | |
592 | + | let ek = (dJ - eg) | |
593 | + | let el = [IntegerEntry(W(), dx), IntegerEntry(X(height, lastBlock.timestamp), dx), StringEntry(aa(ab, dk), bu(ef, eg, ei, dx, dG, eh, height, lastBlock.timestamp, ej, ek))] | |
594 | + | $Tuple13(ee, ei, dx, ds, du, dr, dn, dq, el, ej, ek, dI, dK) | |
595 | + | } | |
596 | + | } | |
597 | + | } | |
598 | + | ||
599 | + | ||
600 | + | func em (en,eo,dr) = { | |
601 | + | let ep = G(en, toBigInt(bp)) | |
602 | + | let eq = G(eo, toBigInt(bq)) | |
603 | + | let er = fraction(pow((ep * eq), 0, toBigInt(5), 1, 18, DOWN), g, dr) | |
604 | + | if ((dr == f)) | |
605 | + | then f | |
606 | + | else er | |
607 | + | } | |
608 | + | ||
609 | + | ||
610 | + | func es (et,eu,ev) = { | |
611 | + | let ew = (toBigInt(bJ(bf(bn))) - et) | |
612 | + | let ex = (toBigInt(bJ(bf(bo))) - eu) | |
613 | + | let ey = (toBigInt(value(assetInfo(bm)).quantity) - ev) | |
614 | + | let ez = em(ew, ex, ey) | |
615 | + | ez | |
616 | + | } | |
617 | + | ||
618 | + | ||
619 | + | func eA (eB,eC,ev) = { | |
620 | + | let ew = (bJ(bf(bn)) + eB) | |
621 | + | let ex = (bJ(bf(bo)) + eC) | |
622 | + | let ey = (value(assetInfo(bm)).quantity + ev) | |
623 | + | let er = em(toBigInt(ew), toBigInt(ex), toBigInt(ey)) | |
624 | + | let eD = [IntegerEntry(ak, height), StringEntry(aj, toString(er))] | |
625 | + | $Tuple2(eD, er) | |
626 | + | } | |
627 | + | ||
628 | + | ||
629 | + | func eE (eF,er) = if ((er >= eF)) | |
630 | + | then true | |
631 | + | else aQ(makeString(["updated KLp lower than current KLp", toString(eF), toString(er)], " ")) | |
632 | + | ||
633 | + | ||
634 | + | func eG (eH) = { | |
635 | + | let ew = bJ(bf(bn)) | |
636 | + | let ex = bJ(bf(bo)) | |
637 | + | let eI = eH.amount | |
638 | + | let eJ = fraction(eH.amount, eH.price, b, FLOOR) | |
639 | + | let eK = if ((eH.orderType == Buy)) | |
640 | + | then $Tuple2(eI, -(eJ)) | |
641 | + | else $Tuple2(-(eI), eJ) | |
642 | + | let eB = eK._1 | |
643 | + | let eC = eK._2 | |
644 | + | if (if (if (aY()) | |
645 | + | then true | |
646 | + | else (bl == m)) | |
647 | + | then true | |
648 | + | else (bl == n)) | |
649 | + | then throw("Exchange operations disabled") | |
650 | + | else if (if ((eH.assetPair.amountAsset != bn)) | |
651 | + | then true | |
652 | + | else (eH.assetPair.priceAsset != bo)) | |
653 | + | then throw("Wrong order assets.") | |
654 | + | else { | |
655 | + | let eL = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, aj), "0")), aS("invalid kLp")) | |
656 | + | let eM = eA(eB, eC, 0) | |
657 | + | let eN = eM._1 | |
658 | + | let eO = eM._2 | |
659 | + | let eP = (eO >= eL) | |
660 | + | let eQ = makeString(["kLp=", toString(eL), " kLpNew=", toString(eO), " amountAssetBalance=", toString(ew), " priceAssetBalance=", toString(ex), " amountAssetBalanceDelta=", toString(eB), " priceAssetBalanceDelta=", toString(eC), " height=", toString(height)], "") | |
661 | + | $Tuple2(eP, eQ) | |
662 | + | } | |
663 | + | } | |
664 | + | ||
665 | + | ||
666 | + | func eR (eS) = if ((size(eS.payments) != 1)) | |
667 | + | then throw("exactly 1 payment is expected") | |
668 | + | else { | |
669 | + | let eT = value(eS.payments[0]) | |
670 | + | let dl = value(eT.assetId) | |
671 | + | let eU = eT.amount | |
672 | + | let dW = dj(toBase58String(eS.transactionId), toBase58String(dl), eU, eS.caller) | |
673 | + | let dC = dW._1 | |
674 | + | let dD = dW._2 | |
675 | + | let dq = parseIntValue(dW._9) | |
676 | + | let dE = dW._10 | |
677 | + | if (if (aY()) | |
678 | + | then true | |
679 | + | else (dq == n)) | |
680 | + | then throw(("Get operation is blocked by admin. Status = " + toString(dq))) | |
681 | + | else $Tuple5(dC, dD, eU, dl, dE) | |
682 | + | } | |
683 | + | ||
684 | + | ||
685 | + | func eV (eS,dG,dM) = if ((size(eS.payments) != 2)) | |
686 | + | then throw("exactly 2 payments are expected") | |
687 | + | else { | |
688 | + | let eW = value(eS.payments[0]) | |
689 | + | let eX = value(eS.payments[1]) | |
690 | + | let eY = dF(toBase58String(eS.transactionId), dG, eW.amount, eW.assetId, eX.amount, eX.assetId, toString(eS.caller), false, dM) | |
691 | + | let dq = parseIntValue(eY._8) | |
692 | + | if (if (if (aY()) | |
693 | + | then true | |
694 | + | else (dq == l)) | |
695 | + | then true | |
696 | + | else (dq == n)) | |
697 | + | then throw(("Put operation is blocked by admin. Status = " + toString(dq))) | |
698 | + | else eY | |
699 | + | } | |
700 | + | ||
701 | + | ||
702 | + | func eZ (bW) = { | |
703 | + | let fa = invoke(aT, "emit", [bW], nil) | |
704 | + | if ((fa == fa)) | |
705 | + | then { | |
706 | + | let fb = { | |
707 | + | let bT = fa | |
708 | + | if ($isInstanceOf(bT, "Address")) | |
709 | + | then { | |
710 | + | let fc = bT | |
711 | + | invoke(fc, "emit", [bW], nil) | |
712 | + | } | |
713 | + | else unit | |
714 | + | } | |
715 | + | if ((fb == fb)) | |
716 | + | then bW | |
717 | + | else throw("Strict value is not equal to itself.") | |
718 | + | } | |
719 | + | else throw("Strict value is not equal to itself.") | |
720 | + | } | |
721 | + | ||
722 | + | ||
723 | + | func fd (bW,ai) = { | |
724 | + | let fe = if ((ai == 0)) | |
725 | + | then 0 | |
726 | + | else fraction(bW, ai, b) | |
727 | + | $Tuple2((bW - fe), fe) | |
728 | + | } | |
729 | + | ||
730 | + | ||
731 | + | func ff (fg,fh,ab,ac) = { | |
732 | + | let fi = (ac == unit) | |
733 | + | let fj = bJ(bf(bn)) | |
734 | + | let fk = bJ(bf(bo)) | |
735 | + | let fl = if ((fh == bn)) | |
736 | + | then true | |
737 | + | else if ((fh == bo)) | |
738 | + | then false | |
739 | + | else aQ("invalid asset") | |
740 | + | let fm = if (fi) | |
741 | + | then $Tuple2(fj, fk) | |
742 | + | else if (fl) | |
743 | + | then $Tuple2((fj - fg), fk) | |
744 | + | else $Tuple2(fj, (fk - fg)) | |
745 | + | let fn = fm._1 | |
746 | + | let fo = fm._2 | |
747 | + | let fp = if (fl) | |
748 | + | then $Tuple2(fg, 0) | |
749 | + | else $Tuple2(0, fg) | |
750 | + | let fq = fp._1 | |
751 | + | let fr = fp._2 | |
752 | + | let eI = fd(fq, aV)._1 | |
753 | + | let eJ = fd(fr, aV)._1 | |
754 | + | let fs = fd(fg, aV) | |
755 | + | let ft = fs._1 | |
756 | + | let fe = fs._2 | |
757 | + | let fu = (fn + eI) | |
758 | + | let fv = (fo + eJ) | |
759 | + | let fw = bM(D(fv, bq), D(fu, bp)) | |
760 | + | let fx = H(fw, b) | |
761 | + | let fy = if (fl) | |
762 | + | then fn | |
763 | + | else fo | |
764 | + | let fz = toBigInt(fy) | |
765 | + | let fA = toBigInt(valueOrErrorMessage(assetInfo(bm), (("asset " + toBase58String(bm)) + " doesn't exist")).quantity) | |
766 | + | let fB = if ((fA > f)) | |
767 | + | then true | |
768 | + | else aQ("initial deposit requires all coins") | |
769 | + | if ((fB == fB)) | |
770 | + | then { | |
771 | + | let fC = toBigInt(ft) | |
772 | + | let fD = max([0, toInt(((fA * (sqrtBigInt((d + ((fC * d) / fz)), 18, 18, DOWN) - d)) / d))]) | |
773 | + | let el = if (fi) | |
774 | + | then nil | |
775 | + | else [IntegerEntry(W(), fx), IntegerEntry(X(height, lastBlock.timestamp), fx), StringEntry(aa(toString(value(ab)), toBase58String(value(ac))), bu(fq, fr, fD, fx, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
776 | + | let fE = bM(D(fo, bq), D(fn, bp)) | |
777 | + | let fF = H(fE, b) | |
778 | + | let fG = { | |
779 | + | let fH = if (fl) | |
780 | + | then $Tuple2(fq, fn) | |
781 | + | else $Tuple2(fr, fo) | |
782 | + | let bW = fH._1 | |
783 | + | let fI = fH._2 | |
784 | + | let fJ = toInt(fraction(fA, toBigInt((bW / 2)), toBigInt(fI))) | |
785 | + | fraction((fD - fJ), b, fJ) | |
786 | + | } | |
787 | + | $Tuple5(fD, el, fe, fG, fl) | |
788 | + | } | |
789 | + | else throw("Strict value is not equal to itself.") | |
790 | + | } | |
791 | + | ||
792 | + | ||
793 | + | func fK (fL,ft,fh,ab,ac) = { | |
794 | + | let fi = (ac == unit) | |
795 | + | let da = ba() | |
796 | + | let db = parseIntValue(da[t]) | |
797 | + | let dc = parseIntValue(da[u]) | |
798 | + | let fM = [if ((fh == bm)) | |
799 | + | then true | |
800 | + | else aQ("invalid lp asset")] | |
801 | + | if ((fM == fM)) | |
802 | + | then { | |
803 | + | let fN = if ((fL == bn)) | |
804 | + | then true | |
805 | + | else if ((fL == bo)) | |
806 | + | then false | |
807 | + | else aQ("invalid asset") | |
808 | + | let fO = if (fN) | |
809 | + | then toBigInt(bJ(bf(bn))) | |
810 | + | else toBigInt(bJ(bf(bo))) | |
811 | + | let fP = if (fN) | |
812 | + | then db | |
813 | + | else dc | |
814 | + | let fQ = bJ(bf(bn)) | |
815 | + | let fR = bJ(bf(bo)) | |
816 | + | let fS = if (fN) | |
817 | + | then fQ | |
818 | + | else fR | |
819 | + | let fT = toBigInt(fS) | |
820 | + | let fA = toBigInt(valueOrErrorMessage(assetInfo(bm), (("asset " + toBase58String(bm)) + " doesn't exist")).quantity) | |
821 | + | let fU = toBigInt(ft) | |
822 | + | let fV = max([0, toInt(((fO * (d - pow((d - ((fU * d) / fA)), 18, h, 0, 18, DOWN))) / d))]) | |
823 | + | let fW = fd(fV, aX) | |
824 | + | let fX = fW._1 | |
825 | + | let fe = fW._2 | |
826 | + | let fY = if (fN) | |
827 | + | then $Tuple4(fX, 0, (fQ - fV), fR) | |
828 | + | else $Tuple4(0, fX, fQ, (fR - fV)) | |
829 | + | let fZ = fY._1 | |
830 | + | let ga = fY._2 | |
831 | + | let gb = fY._3 | |
832 | + | let gc = fY._4 | |
833 | + | let fw = bM(D(gc, bq), D(gb, bp)) | |
834 | + | let fx = H(fw, b) | |
835 | + | let el = if (fi) | |
836 | + | then nil | |
837 | + | else [StringEntry(ad(toString(value(ab)), toBase58String(value(ac))), bF(fZ, ga, ft, fx, height, lastBlock.timestamp)), IntegerEntry(W(), fx), IntegerEntry(X(height, lastBlock.timestamp), fx)] | |
838 | + | let fE = bM(D(fR, bq), D(fQ, bp)) | |
839 | + | let fF = H(fE, b) | |
840 | + | let fG = { | |
841 | + | let gd = (toInt(fraction(fO, fU, fA)) * 2) | |
842 | + | fraction((fX - gd), b, gd) | |
843 | + | } | |
844 | + | $Tuple5(fX, el, fe, fG, fN) | |
845 | + | } | |
846 | + | else throw("Strict value is not equal to itself.") | |
847 | + | } | |
848 | + | ||
849 | + | ||
850 | + | func ge () = { | |
851 | + | let bT = getString(U()) | |
852 | + | if ($isInstanceOf(bT, "String")) | |
853 | + | then { | |
854 | + | let gf = bT | |
855 | + | fromBase58String(gf) | |
856 | + | } | |
857 | + | else if ($isInstanceOf(bT, "Unit")) | |
660 | 858 | then unit | |
661 | 859 | else throw("Match error") | |
662 | 860 | } | |
663 | 861 | ||
664 | 862 | ||
665 | - | func | |
666 | - | let | |
667 | - | if ($isInstanceOf( | |
863 | + | func gg () = { | |
864 | + | let bT = getString(V()) | |
865 | + | if ($isInstanceOf(bT, "String")) | |
668 | 866 | then { | |
669 | - | let | |
670 | - | fromBase58String( | |
867 | + | let gf = bT | |
868 | + | fromBase58String(gf) | |
671 | 869 | } | |
672 | - | else if ($isInstanceOf( | |
870 | + | else if ($isInstanceOf(bT, "Unit")) | |
673 | 871 | then unit | |
674 | 872 | else throw("Match error") | |
675 | 873 | } | |
676 | 874 | ||
677 | 875 | ||
678 | - | func | |
679 | - | let | |
680 | - | if ($isInstanceOf( | |
876 | + | func gh (eS) = { | |
877 | + | let bT = ge() | |
878 | + | if ($isInstanceOf(bT, "ByteVector")) | |
681 | 879 | then { | |
682 | - | let | |
683 | - | ( | |
880 | + | let gi = bT | |
881 | + | (eS.callerPublicKey == gi) | |
684 | 882 | } | |
685 | - | else if ($isInstanceOf( | |
686 | - | then ( | |
883 | + | else if ($isInstanceOf(bT, "Unit")) | |
884 | + | then (eS.caller == this) | |
687 | 885 | else throw("Match error") | |
688 | 886 | } | |
689 | 887 | ||
690 | 888 | ||
691 | - | func | |
692 | - | let | |
693 | - | let | |
694 | - | if ($isInstanceOf( | |
889 | + | func gj (eS) = { | |
890 | + | let gk = throw("Permission denied") | |
891 | + | let bT = ge() | |
892 | + | if ($isInstanceOf(bT, "ByteVector")) | |
695 | 893 | then { | |
696 | - | let | |
697 | - | if (( | |
894 | + | let gi = bT | |
895 | + | if ((eS.callerPublicKey == gi)) | |
698 | 896 | then true | |
699 | - | else | |
897 | + | else gk | |
700 | 898 | } | |
701 | - | else if ($isInstanceOf( | |
702 | - | then if (( | |
899 | + | else if ($isInstanceOf(bT, "Unit")) | |
900 | + | then if ((eS.caller == this)) | |
703 | 901 | then true | |
704 | - | else | |
902 | + | else gk | |
705 | 903 | else throw("Match error") | |
706 | 904 | } | |
707 | 905 | ||
708 | 906 | ||
709 | - | @Callable(dL) | |
710 | - | func calculateAmountOutForSwapREADONLY (fg,fh,fi) = { | |
711 | - | let fj = if ((fh == false)) | |
907 | + | @Callable(eS) | |
908 | + | func rebalance () = (cA(aM(this, ae())) ++ cA(aM(this, af()))) | |
909 | + | ||
910 | + | ||
911 | + | ||
912 | + | @Callable(eS) | |
913 | + | func calculateAmountOutForSwapREADONLY (gl,gm,gn) = { | |
914 | + | let go = if ((gm == false)) | |
712 | 915 | then { | |
713 | - | let | |
714 | - | let | |
715 | - | $Tuple2( | |
916 | + | let gp = aM(this, af()) | |
917 | + | let gq = aM(this, ae()) | |
918 | + | $Tuple2(gp, gq) | |
716 | 919 | } | |
717 | 920 | else { | |
718 | - | let | |
719 | - | let | |
720 | - | $Tuple2( | |
921 | + | let gp = aM(this, ae()) | |
922 | + | let gq = aM(this, af()) | |
923 | + | $Tuple2(gp, gq) | |
721 | 924 | } | |
722 | - | let | |
723 | - | let | |
724 | - | let | |
725 | - | let | |
726 | - | let | |
727 | - | let | |
728 | - | let | |
729 | - | let | |
925 | + | let gp = go._1 | |
926 | + | let gq = go._2 | |
927 | + | let gr = bJ(gq) | |
928 | + | let gs = bJ(gp) | |
929 | + | let gt = fraction(gs, gl, (gr + gl)) | |
930 | + | let gu = (toBigInt(gr) * toBigInt(gs)) | |
931 | + | let gv = (((toBigInt(bJ(gq)) + toBigInt(gl)) + toBigInt(gn)) * (toBigInt(bJ(gp)) - toBigInt(gt))) | |
932 | + | let gw = if ((gv >= gu)) | |
730 | 933 | then true | |
731 | 934 | else throw("new K is fewer error") | |
732 | - | if (( | |
733 | - | then $Tuple2(nil, | |
935 | + | if ((gw == gw)) | |
936 | + | then $Tuple2(nil, gt) | |
734 | 937 | else throw("Strict value is not equal to itself.") | |
735 | 938 | } | |
736 | 939 | ||
737 | 940 | ||
738 | 941 | ||
739 | - | @Callable( | |
740 | - | func calculateAmountOutForSwapAndSendTokens ( | |
741 | - | let | |
742 | - | let | |
743 | - | if ($isInstanceOf( | |
744 | - | then | |
745 | - | else throw(($getType( | |
942 | + | @Callable(eS) | |
943 | + | func calculateAmountOutForSwapAndSendTokens (gl,gm,gx,gy,gn) = { | |
944 | + | let gz = { | |
945 | + | let aW = invoke(aT, "getSwapContractREADONLY", nil, nil) | |
946 | + | if ($isInstanceOf(aW, "String")) | |
947 | + | then aW | |
948 | + | else throw(($getType(aW) + " couldn't be cast to String")) | |
746 | 949 | } | |
747 | - | let | |
950 | + | let fM = [if ((value(eS.payments[0]).amount >= gl)) | |
748 | 951 | then true | |
749 | - | else | |
952 | + | else aQ("Wrong amount"), if ((eS.caller == addressFromStringValue(gz))) | |
750 | 953 | then true | |
751 | - | else | |
752 | - | if (( | |
954 | + | else aQ("Permission denied")] | |
955 | + | if ((fM == fM)) | |
753 | 956 | then { | |
754 | - | let | |
755 | - | let | |
756 | - | let | |
757 | - | then | |
758 | - | else | |
759 | - | let | |
760 | - | let | |
761 | - | let | |
762 | - | let | |
763 | - | let | |
764 | - | let | |
957 | + | let eT = value(eS.payments[0]) | |
958 | + | let gq = bf(eT.assetId) | |
959 | + | let gp = if ((gm == false)) | |
960 | + | then aM(this, af()) | |
961 | + | else aM(this, ae()) | |
962 | + | let gr = (bJ(gq) - value(eS.payments[0]).amount) | |
963 | + | let gs = bJ(gp) | |
964 | + | let gt = fraction(gs, gl, (gr + gl)) | |
965 | + | let gu = (toBigInt(gr) * toBigInt(gs)) | |
966 | + | let gv = ((toBigInt(bJ(gq)) + toBigInt(gn)) * (toBigInt(bJ(gp)) - toBigInt(gt))) | |
967 | + | let gw = if ((gv >= gu)) | |
765 | 968 | then true | |
766 | 969 | else throw("new K is fewer error") | |
767 | - | if (( | |
970 | + | if ((gw == gw)) | |
768 | 971 | then { | |
769 | - | let | |
972 | + | let gA = if ((gt >= gx)) | |
770 | 973 | then true | |
771 | 974 | else throw("Exchange result is fewer coins than expected") | |
772 | - | if ((fv == fv)) | |
773 | - | then $Tuple2([ScriptTransfer(addressFromStringValue(ft), fo, aY(fk))], fo) | |
975 | + | if ((gA == gA)) | |
976 | + | then { | |
977 | + | let gB = cA(gq) | |
978 | + | if ((gB == gB)) | |
979 | + | then { | |
980 | + | let gC = cH(gp, gt) | |
981 | + | if ((gC == gC)) | |
982 | + | then $Tuple2(((gC ++ gB) ++ [ScriptTransfer(addressFromStringValue(gy), gt, bd(gp))]), gt) | |
983 | + | else throw("Strict value is not equal to itself.") | |
984 | + | } | |
985 | + | else throw("Strict value is not equal to itself.") | |
986 | + | } | |
774 | 987 | else throw("Strict value is not equal to itself.") | |
775 | 988 | } | |
776 | 989 | else throw("Strict value is not equal to itself.") | |
780 | 993 | ||
781 | 994 | ||
782 | 995 | ||
783 | - | @Callable( | |
784 | - | func setManager ( | |
785 | - | let | |
786 | - | if (( | |
996 | + | @Callable(eS) | |
997 | + | func setManager (gD) = { | |
998 | + | let gE = gj(eS) | |
999 | + | if ((gE == gE)) | |
787 | 1000 | then { | |
788 | - | let | |
789 | - | if (( | |
790 | - | then [StringEntry(V(), | |
1001 | + | let gF = fromBase58String(gD) | |
1002 | + | if ((gF == gF)) | |
1003 | + | then [StringEntry(V(), gD)] | |
791 | 1004 | else throw("Strict value is not equal to itself.") | |
792 | 1005 | } | |
793 | 1006 | else throw("Strict value is not equal to itself.") | |
795 | 1008 | ||
796 | 1009 | ||
797 | 1010 | ||
798 | - | @Callable( | |
1011 | + | @Callable(eS) | |
799 | 1012 | func confirmManager () = { | |
800 | - | let | |
801 | - | let | |
1013 | + | let gG = gg() | |
1014 | + | let gH = if (isDefined(gG)) | |
802 | 1015 | then true | |
803 | 1016 | else throw("No pending manager") | |
804 | - | if (( | |
1017 | + | if ((gH == gH)) | |
805 | 1018 | then { | |
806 | - | let | |
1019 | + | let gI = if ((eS.callerPublicKey == value(gG))) | |
807 | 1020 | then true | |
808 | 1021 | else throw("You are not pending manager") | |
809 | - | if (( | |
810 | - | then [StringEntry(U(), toBase58String(value( | |
1022 | + | if ((gI == gI)) | |
1023 | + | then [StringEntry(U(), toBase58String(value(gG))), DeleteEntry(V())] | |
811 | 1024 | else throw("Strict value is not equal to itself.") | |
812 | 1025 | } | |
813 | 1026 | else throw("Strict value is not equal to itself.") | |
815 | 1028 | ||
816 | 1029 | ||
817 | 1030 | ||
818 | - | @Callable( | |
819 | - | func put ( | |
1031 | + | @Callable(eS) | |
1032 | + | func put (dG,gJ) = if ((0 > dG)) | |
820 | 1033 | then throw("Invalid slippageTolerance passed") | |
821 | 1034 | else { | |
822 | - | let | |
823 | - | let | |
824 | - | let | |
825 | - | let | |
826 | - | let | |
827 | - | let | |
828 | - | let | |
829 | - | let | |
830 | - | let | |
831 | - | let | |
832 | - | let | |
833 | - | if (( | |
1035 | + | let eY = eV(eS, dG, true) | |
1036 | + | let ei = eY._2 | |
1037 | + | let dn = eY._7 | |
1038 | + | let dE = eY._9 | |
1039 | + | let ej = eY._10 | |
1040 | + | let ek = eY._11 | |
1041 | + | let gK = eY._12 | |
1042 | + | let gL = eY._13 | |
1043 | + | let eW = toBigInt(value(eS.payments[0]).amount) | |
1044 | + | let eX = toBigInt(value(eS.payments[1]).amount) | |
1045 | + | let ez = es(eW, eX, toBigInt(0)) | |
1046 | + | if ((ez == ez)) | |
834 | 1047 | then { | |
835 | - | let | |
836 | - | if (( | |
1048 | + | let fa = invoke(aT, "emit", [ei], nil) | |
1049 | + | if ((fa == fa)) | |
837 | 1050 | then { | |
838 | - | let | |
839 | - | let | |
840 | - | if ($isInstanceOf( | |
1051 | + | let fb = { | |
1052 | + | let bT = fa | |
1053 | + | if ($isInstanceOf(bT, "Address")) | |
841 | 1054 | then { | |
842 | - | let | |
843 | - | invoke( | |
1055 | + | let fc = bT | |
1056 | + | invoke(fc, "emit", [ei], nil) | |
844 | 1057 | } | |
845 | 1058 | else unit | |
846 | 1059 | } | |
847 | - | if (( | |
1060 | + | if ((fb == fb)) | |
848 | 1061 | then { | |
849 | - | let | |
850 | - | then invoke( | |
1062 | + | let gM = if ((ej > 0)) | |
1063 | + | then invoke(bt, "put", nil, [AttachedPayment(gK, ej)]) | |
851 | 1064 | else nil | |
852 | - | if (( | |
1065 | + | if ((gM == gM)) | |
853 | 1066 | then { | |
854 | - | let | |
855 | - | then invoke( | |
1067 | + | let gN = if ((ek > 0)) | |
1068 | + | then invoke(bt, "put", nil, [AttachedPayment(gL, ek)]) | |
856 | 1069 | else nil | |
857 | - | if (( | |
1070 | + | if ((gN == gN)) | |
858 | 1071 | then { | |
859 | - | let | |
1072 | + | let gO = if (gJ) | |
860 | 1073 | then { | |
861 | - | let | |
862 | - | if (( | |
1074 | + | let gP = invoke(bs, "stake", nil, [AttachedPayment(dn, ei)]) | |
1075 | + | if ((gP == gP)) | |
863 | 1076 | then nil | |
864 | 1077 | else throw("Strict value is not equal to itself.") | |
865 | 1078 | } | |
866 | - | else [ScriptTransfer( | |
867 | - | let | |
868 | - | if (( | |
1079 | + | else [ScriptTransfer(eS.caller, ei, dn)] | |
1080 | + | let gQ = eA(0, 0, 0) | |
1081 | + | if ((gQ == gQ)) | |
869 | 1082 | then { | |
870 | - | let dk = fJ._2 | |
871 | - | let fK = fJ._1 | |
872 | - | let fL = dx(ds, dk) | |
873 | - | if ((fL == fL)) | |
874 | - | then ((cx ++ fH) ++ fK) | |
1083 | + | let er = gQ._2 | |
1084 | + | let gR = gQ._1 | |
1085 | + | let gS = eE(ez, er) | |
1086 | + | if ((gS == gS)) | |
1087 | + | then { | |
1088 | + | let gT = invoke(this, "rebalance", nil, nil) | |
1089 | + | if ((gT == gT)) | |
1090 | + | then ((dE ++ gO) ++ gR) | |
1091 | + | else throw("Strict value is not equal to itself.") | |
1092 | + | } | |
875 | 1093 | else throw("Strict value is not equal to itself.") | |
876 | 1094 | } | |
877 | 1095 | else throw("Strict value is not equal to itself.") | |
889 | 1107 | ||
890 | 1108 | ||
891 | 1109 | ||
892 | - | @Callable( | |
893 | - | func putForFree ( | |
1110 | + | @Callable(eS) | |
1111 | + | func putForFree (gU) = if ((0 > gU)) | |
894 | 1112 | then throw("Invalid value passed") | |
895 | 1113 | else { | |
896 | - | let | |
897 | - | let | |
898 | - | let | |
899 | - | let | |
900 | - | let | |
901 | - | if (( | |
1114 | + | let eY = eV(eS, gU, false) | |
1115 | + | let dE = eY._9 | |
1116 | + | let eW = toBigInt(value(eS.payments[0]).amount) | |
1117 | + | let eX = toBigInt(value(eS.payments[1]).amount) | |
1118 | + | let ez = es(eW, eX, toBigInt(0)) | |
1119 | + | if ((ez == ez)) | |
902 | 1120 | then { | |
903 | - | let | |
904 | - | let | |
905 | - | let | |
906 | - | let | |
907 | - | if (( | |
908 | - | then ( | |
1121 | + | let gV = eA(0, 0, 0) | |
1122 | + | let gR = gV._1 | |
1123 | + | let er = gV._2 | |
1124 | + | let gS = eE(ez, er) | |
1125 | + | if ((gS == gS)) | |
1126 | + | then (dE ++ gR) | |
909 | 1127 | else throw("Strict value is not equal to itself.") | |
910 | 1128 | } | |
911 | 1129 | else throw("Strict value is not equal to itself.") | |
913 | 1131 | ||
914 | 1132 | ||
915 | 1133 | ||
916 | - | @Callable( | |
917 | - | func putOneTkn ( | |
918 | - | let | |
919 | - | let | |
920 | - | if ($isInstanceOf( | |
921 | - | then | |
922 | - | else throw(($getType( | |
1134 | + | @Callable(eS) | |
1135 | + | func putOneTkn (gW,gX) = { | |
1136 | + | let gY = { | |
1137 | + | let aW = invoke(aT, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1138 | + | if ($isInstanceOf(aW, "Boolean")) | |
1139 | + | then aW | |
1140 | + | else throw(($getType(aW) + " couldn't be cast to Boolean")) | |
923 | 1141 | } | |
924 | - | let | |
1142 | + | let gZ = if (if (if (aY()) | |
925 | 1143 | then true | |
926 | - | else ( | |
1144 | + | else (bl == l)) | |
927 | 1145 | then true | |
928 | - | else ( | |
1146 | + | else (bl == n)) | |
929 | 1147 | then true | |
930 | - | else | |
931 | - | let | |
1148 | + | else gY | |
1149 | + | let fM = [if (if (!(gZ)) | |
932 | 1150 | then true | |
933 | - | else | |
1151 | + | else gh(eS)) | |
934 | 1152 | then true | |
935 | - | else | |
1153 | + | else aQ("put operation is blocked by admin"), if ((size(eS.payments) == 1)) | |
936 | 1154 | then true | |
937 | - | else | |
938 | - | if (( | |
1155 | + | else aQ("exactly 1 payment are expected")] | |
1156 | + | if ((fM == fM)) | |
939 | 1157 | then { | |
940 | - | let | |
941 | - | let | |
942 | - | let | |
943 | - | let | |
944 | - | then | |
945 | - | else if (( | |
946 | - | then | |
947 | - | else | |
948 | - | if (( | |
1158 | + | let ha = eS.payments[0] | |
1159 | + | let fh = ha.assetId | |
1160 | + | let fg = ha.amount | |
1161 | + | let ez = if ((fh == bn)) | |
1162 | + | then es(toBigInt(fg), toBigInt(0), toBigInt(0)) | |
1163 | + | else if ((fh == bo)) | |
1164 | + | then es(toBigInt(0), toBigInt(fg), toBigInt(0)) | |
1165 | + | else aQ("payment asset is not supported") | |
1166 | + | if ((ez == ez)) | |
949 | 1167 | then { | |
950 | - | let ab = | |
951 | - | let ac = | |
952 | - | let | |
953 | - | if (( | |
1168 | + | let ab = eS.caller | |
1169 | + | let ac = eS.transactionId | |
1170 | + | let hb = ff(fg, fh, ab, ac) | |
1171 | + | if ((hb == hb)) | |
954 | 1172 | then { | |
955 | - | let | |
956 | - | let | |
957 | - | let | |
958 | - | let | |
959 | - | let | |
960 | - | let | |
961 | - | then ( | |
1173 | + | let fl = hb._5 | |
1174 | + | let hc = hb._4 | |
1175 | + | let fe = hb._3 | |
1176 | + | let el = hb._2 | |
1177 | + | let hd = hb._1 | |
1178 | + | let he = if (if ((gW > 0)) | |
1179 | + | then (gW > hd) | |
962 | 1180 | else false) | |
963 | - | then | |
964 | - | else | |
965 | - | let | |
966 | - | if (( | |
1181 | + | then aQ(makeString(["amount to receive is less than ", toString(gW)], "")) | |
1182 | + | else hd | |
1183 | + | let fa = eZ(he) | |
1184 | + | if ((fa == fa)) | |
967 | 1185 | then { | |
968 | - | let | |
1186 | + | let gO = if (gX) | |
969 | 1187 | then { | |
970 | - | let | |
971 | - | if (( | |
1188 | + | let hf = invoke(bs, "stake", nil, [AttachedPayment(bm, he)]) | |
1189 | + | if ((hf == hf)) | |
972 | 1190 | then nil | |
973 | 1191 | else throw("Strict value is not equal to itself.") | |
974 | 1192 | } | |
975 | - | else [ScriptTransfer( | |
976 | - | let | |
977 | - | then [ScriptTransfer( | |
1193 | + | else [ScriptTransfer(eS.caller, he, bm)] | |
1194 | + | let hg = if ((fe > 0)) | |
1195 | + | then [ScriptTransfer(aU, fe, fh)] | |
978 | 1196 | else nil | |
979 | - | let | |
1197 | + | let hh = if ((this == aU)) | |
980 | 1198 | then $Tuple2(0, 0) | |
981 | - | else if (eg) | |
982 | - | then $Tuple2(-(dZ), 0) | |
983 | - | else $Tuple2(0, -(dZ)) | |
984 | - | let du = fZ._1 | |
985 | - | let dv = fZ._2 | |
986 | - | let ga = dt(du, dv, 0) | |
987 | - | let fK = ga._1 | |
988 | - | let dk = ga._2 | |
989 | - | let dE = value(getString(aj)) | |
990 | - | let fL = dx(ds, dk) | |
991 | - | if ((fL == fL)) | |
992 | - | then $Tuple2((((de ++ fH) ++ fY) ++ fK), fW) | |
993 | - | else throw("Strict value is not equal to itself.") | |
994 | - | } | |
995 | - | else throw("Strict value is not equal to itself.") | |
996 | - | } | |
997 | - | else throw("Strict value is not equal to itself.") | |
998 | - | } | |
999 | - | else throw("Strict value is not equal to itself.") | |
1000 | - | } | |
1001 | - | else throw("Strict value is not equal to itself.") | |
1002 | - | } | |
1003 | - | ||
1004 | - | ||
1005 | - | ||
1006 | - | @Callable(dL) | |
1007 | - | func putOneTknREADONLY (ec,eb) = { | |
1008 | - | let gb = ea(eb, aY(ec), unit, unit) | |
1009 | - | let fV = gb._1 | |
1010 | - | let de = gb._2 | |
1011 | - | let dZ = gb._3 | |
1012 | - | let fU = gb._4 | |
1013 | - | let eg = gb._5 | |
1014 | - | $Tuple2(nil, $Tuple3(fV, dZ, fU)) | |
1015 | - | } | |
1016 | - | ||
1017 | - | ||
1018 | - | ||
1019 | - | @Callable(dL) | |
1020 | - | func getOneTkn (gc,fO) = { | |
1021 | - | let fQ = { | |
1022 | - | let aR = invoke(aO, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1023 | - | if ($isInstanceOf(aR, "Boolean")) | |
1024 | - | then aR | |
1025 | - | else throw(($getType(aR) + " couldn't be cast to Boolean")) | |
1026 | - | } | |
1027 | - | let gd = if (if (aT()) | |
1028 | - | then true | |
1029 | - | else (bg == n)) | |
1030 | - | then true | |
1031 | - | else fQ | |
1032 | - | let eH = [if (if (!(gd)) | |
1033 | - | then true | |
1034 | - | else fc(dL)) | |
1035 | - | then true | |
1036 | - | else aL("get operation is blocked by admin"), if ((size(dL.payments) == 1)) | |
1037 | - | then true | |
1038 | - | else aL("exactly 1 payment are expected")] | |
1039 | - | if ((eH == eH)) | |
1040 | - | then { | |
1041 | - | let eG = aY(gc) | |
1042 | - | let fS = dL.payments[0] | |
1043 | - | let ec = fS.assetId | |
1044 | - | let eo = fS.amount | |
1045 | - | let ds = dl(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1046 | - | if ((ds == ds)) | |
1047 | - | then { | |
1048 | - | let ab = dL.caller | |
1049 | - | let ac = dL.transactionId | |
1050 | - | let ge = eF(eG, eo, ec, ab, ac) | |
1051 | - | if ((ge == ge)) | |
1052 | - | then { | |
1053 | - | let eI = ge._5 | |
1054 | - | let fU = ge._4 | |
1055 | - | let dZ = ge._3 | |
1056 | - | let de = ge._2 | |
1057 | - | let gf = ge._1 | |
1058 | - | let dT = if (if ((fO > 0)) | |
1059 | - | then (fO > gf) | |
1060 | - | else false) | |
1061 | - | then aL(makeString(["amount to receive is less than ", toString(fO)], "")) | |
1062 | - | else gf | |
1063 | - | let gg = invoke(aO, "burn", [eo], [AttachedPayment(ec, eo)]) | |
1064 | - | if ((gg == gg)) | |
1065 | - | then { | |
1066 | - | let gh = [ScriptTransfer(ab, dT, eG)] | |
1067 | - | let fY = if ((dZ > 0)) | |
1068 | - | then [ScriptTransfer(aP, dZ, eG)] | |
1069 | - | else nil | |
1070 | - | let gi = { | |
1071 | - | let gj = if ((this == aP)) | |
1072 | - | then 0 | |
1073 | - | else dZ | |
1074 | - | if (eI) | |
1075 | - | then $Tuple2(-((dT + gj)), 0) | |
1076 | - | else $Tuple2(0, -((dT + gj))) | |
1077 | - | } | |
1078 | - | let du = gi._1 | |
1079 | - | let dv = gi._2 | |
1080 | - | let gk = dt(du, dv, 0) | |
1081 | - | let fK = gk._1 | |
1082 | - | let dk = gk._2 | |
1083 | - | let fL = dx(ds, dk) | |
1084 | - | if ((fL == fL)) | |
1085 | - | then $Tuple2((((de ++ gh) ++ fY) ++ fK), dT) | |
1086 | - | else throw("Strict value is not equal to itself.") | |
1087 | - | } | |
1088 | - | else throw("Strict value is not equal to itself.") | |
1089 | - | } | |
1090 | - | else throw("Strict value is not equal to itself.") | |
1091 | - | } | |
1092 | - | else throw("Strict value is not equal to itself.") | |
1093 | - | } | |
1094 | - | else throw("Strict value is not equal to itself.") | |
1095 | - | } | |
1096 | - | ||
1097 | - | ||
1098 | - | ||
1099 | - | @Callable(dL) | |
1100 | - | func getOneTknREADONLY (eG,eo) = { | |
1101 | - | let gl = eF(aY(eG), eo, bh, unit, unit) | |
1102 | - | let gf = gl._1 | |
1103 | - | let de = gl._2 | |
1104 | - | let dZ = gl._3 | |
1105 | - | let fU = gl._4 | |
1106 | - | let eI = gl._5 | |
1107 | - | $Tuple2(nil, $Tuple3(gf, dZ, fU)) | |
1108 | - | } | |
1109 | - | ||
1110 | - | ||
1111 | - | ||
1112 | - | @Callable(dL) | |
1113 | - | func unstakeAndGetOneTkn (gm,gc,fO) = { | |
1114 | - | let fQ = { | |
1115 | - | let aR = invoke(aO, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1116 | - | if ($isInstanceOf(aR, "Boolean")) | |
1117 | - | then aR | |
1118 | - | else throw(($getType(aR) + " couldn't be cast to Boolean")) | |
1119 | - | } | |
1120 | - | let gd = if (if (aT()) | |
1121 | - | then true | |
1122 | - | else (bg == n)) | |
1123 | - | then true | |
1124 | - | else fQ | |
1125 | - | let eH = [if (if (!(gd)) | |
1126 | - | then true | |
1127 | - | else fc(dL)) | |
1128 | - | then true | |
1129 | - | else aL("get operation is blocked by admin"), if ((size(dL.payments) == 0)) | |
1130 | - | then true | |
1131 | - | else aL("no payments are expected")] | |
1132 | - | if ((eH == eH)) | |
1133 | - | then { | |
1134 | - | let eG = aY(gc) | |
1135 | - | let ab = dL.caller | |
1136 | - | let ac = dL.transactionId | |
1137 | - | let ds = dl(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1138 | - | if ((ds == ds)) | |
1139 | - | then { | |
1140 | - | let gn = invoke(bn, "unstake", [toBase58String(bh), gm], nil) | |
1141 | - | if ((gn == gn)) | |
1142 | - | then { | |
1143 | - | let go = eF(eG, gm, bh, ab, ac) | |
1144 | - | if ((go == go)) | |
1145 | - | then { | |
1146 | - | let eI = go._5 | |
1147 | - | let fU = go._4 | |
1148 | - | let dZ = go._3 | |
1149 | - | let de = go._2 | |
1150 | - | let gf = go._1 | |
1151 | - | let dT = if (if ((fO > 0)) | |
1152 | - | then (fO > gf) | |
1153 | - | else false) | |
1154 | - | then aL(makeString(["amount to receive is less than ", toString(fO)], "")) | |
1155 | - | else gf | |
1156 | - | let gg = invoke(aO, "burn", [gm], [AttachedPayment(bh, gm)]) | |
1157 | - | if ((gg == gg)) | |
1199 | + | else if (fl) | |
1200 | + | then $Tuple2(-(fe), 0) | |
1201 | + | else $Tuple2(0, -(fe)) | |
1202 | + | let eB = hh._1 | |
1203 | + | let eC = hh._2 | |
1204 | + | let hi = eA(eB, eC, 0) | |
1205 | + | let gR = hi._1 | |
1206 | + | let er = hi._2 | |
1207 | + | let eL = value(getString(aj)) | |
1208 | + | let gS = eE(ez, er) | |
1209 | + | if ((gS == gS)) | |
1158 | 1210 | then { | |
1159 | - | let gh = [ScriptTransfer(dL.caller, dT, eG)] | |
1160 | - | let fY = if ((dZ > 0)) | |
1161 | - | then [ScriptTransfer(aP, dZ, eG)] | |
1162 | - | else nil | |
1163 | - | let gp = { | |
1164 | - | let gj = if ((this == aP)) | |
1165 | - | then 0 | |
1166 | - | else dZ | |
1167 | - | if (eI) | |
1168 | - | then $Tuple2(-((dT + gj)), 0) | |
1169 | - | else $Tuple2(0, -((dT + gj))) | |
1170 | - | } | |
1171 | - | let du = gp._1 | |
1172 | - | let dv = gp._2 | |
1173 | - | let gq = dt(du, dv, 0) | |
1174 | - | let fK = gq._1 | |
1175 | - | let dk = gq._2 | |
1176 | - | let fL = dx(ds, dk) | |
1177 | - | if ((fL == fL)) | |
1178 | - | then $Tuple2((((de ++ gh) ++ fY) ++ fK), dT) | |
1211 | + | let gT = invoke(this, "rebalance", nil, nil) | |
1212 | + | if ((gT == gT)) | |
1213 | + | then $Tuple2((((el ++ gO) ++ hg) ++ gR), he) | |
1179 | 1214 | else throw("Strict value is not equal to itself.") | |
1180 | 1215 | } | |
1181 | 1216 | else throw("Strict value is not equal to itself.") | |
1191 | 1226 | ||
1192 | 1227 | ||
1193 | 1228 | ||
1194 | - | @Callable(dL) | |
1195 | - | func get () = { | |
1196 | - | let cP = dK(dL) | |
1197 | - | let gr = cP._1 | |
1198 | - | let cw = cP._2 | |
1199 | - | let dN = cP._3 | |
1200 | - | let ce = cP._4 | |
1201 | - | let cx = cP._5 | |
1202 | - | let ds = dl(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1203 | - | if ((ds == ds)) | |
1229 | + | @Callable(eS) | |
1230 | + | func putOneTknREADONLY (fh,fg) = { | |
1231 | + | let hj = ff(fg, bd(fh), unit, unit) | |
1232 | + | let hd = hj._1 | |
1233 | + | let el = hj._2 | |
1234 | + | let fe = hj._3 | |
1235 | + | let hc = hj._4 | |
1236 | + | let fl = hj._5 | |
1237 | + | $Tuple2(nil, $Tuple3(hd, fe, hc)) | |
1238 | + | } | |
1239 | + | ||
1240 | + | ||
1241 | + | ||
1242 | + | @Callable(eS) | |
1243 | + | func getOneTkn (hk,gW) = { | |
1244 | + | let gY = { | |
1245 | + | let aW = invoke(aT, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1246 | + | if ($isInstanceOf(aW, "Boolean")) | |
1247 | + | then aW | |
1248 | + | else throw(($getType(aW) + " couldn't be cast to Boolean")) | |
1249 | + | } | |
1250 | + | let hl = if (if (aY()) | |
1251 | + | then true | |
1252 | + | else (bl == n)) | |
1253 | + | then true | |
1254 | + | else gY | |
1255 | + | let fM = [if (if (!(hl)) | |
1256 | + | then true | |
1257 | + | else gh(eS)) | |
1258 | + | then true | |
1259 | + | else aQ("get operation is blocked by admin"), if ((size(eS.payments) == 1)) | |
1260 | + | then true | |
1261 | + | else aQ("exactly 1 payment are expected")] | |
1262 | + | if ((fM == fM)) | |
1204 | 1263 | then { | |
1205 | - | let gs = invoke(aO, "burn", [dN], [AttachedPayment(ce, dN)]) | |
1206 | - | if ((gs == gs)) | |
1264 | + | let fL = bd(hk) | |
1265 | + | let ha = eS.payments[0] | |
1266 | + | let fh = ha.assetId | |
1267 | + | let ft = ha.amount | |
1268 | + | let ez = es(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1269 | + | if ((ez == ez)) | |
1207 | 1270 | then { | |
1208 | - | let gt = dt(-(gr), -(cw), 0) | |
1209 | - | let fK = gt._1 | |
1210 | - | let dk = gt._2 | |
1211 | - | let fL = dx(ds, dk) | |
1212 | - | if ((fL == fL)) | |
1213 | - | then (cx ++ fK) | |
1271 | + | let ab = eS.caller | |
1272 | + | let ac = eS.transactionId | |
1273 | + | let hm = fK(fL, ft, fh, ab, ac) | |
1274 | + | if ((hm == hm)) | |
1275 | + | then { | |
1276 | + | let fN = hm._5 | |
1277 | + | let hc = hm._4 | |
1278 | + | let fe = hm._3 | |
1279 | + | let el = hm._2 | |
1280 | + | let hn = hm._1 | |
1281 | + | let bW = if (if ((gW > 0)) | |
1282 | + | then (gW > hn) | |
1283 | + | else false) | |
1284 | + | then aQ(makeString(["amount to receive is less than ", toString(gW)], "")) | |
1285 | + | else hn | |
1286 | + | let ho = invoke(aT, "burn", [ft], [AttachedPayment(fh, ft)]) | |
1287 | + | if ((ho == ho)) | |
1288 | + | then { | |
1289 | + | let gC = cH(hk, bW) | |
1290 | + | let hp = [ScriptTransfer(ab, bW, fL)] | |
1291 | + | let hg = if ((fe > 0)) | |
1292 | + | then [ScriptTransfer(aU, fe, fL)] | |
1293 | + | else nil | |
1294 | + | let hq = { | |
1295 | + | let hr = if ((this == aU)) | |
1296 | + | then 0 | |
1297 | + | else fe | |
1298 | + | if (fN) | |
1299 | + | then $Tuple2(-((bW + hr)), 0) | |
1300 | + | else $Tuple2(0, -((bW + hr))) | |
1301 | + | } | |
1302 | + | let eB = hq._1 | |
1303 | + | let eC = hq._2 | |
1304 | + | let hs = eA(eB, eC, 0) | |
1305 | + | let gR = hs._1 | |
1306 | + | let er = hs._2 | |
1307 | + | let gS = eE(ez, er) | |
1308 | + | if ((gS == gS)) | |
1309 | + | then $Tuple2(((((el ++ gC) ++ hp) ++ hg) ++ gR), bW) | |
1310 | + | else throw("Strict value is not equal to itself.") | |
1311 | + | } | |
1312 | + | else throw("Strict value is not equal to itself.") | |
1313 | + | } | |
1214 | 1314 | else throw("Strict value is not equal to itself.") | |
1215 | 1315 | } | |
1216 | 1316 | else throw("Strict value is not equal to itself.") | |
1220 | 1320 | ||
1221 | 1321 | ||
1222 | 1322 | ||
1223 | - | @Callable(dL) | |
1224 | - | func getNoLess (gu,gv) = { | |
1225 | - | let cP = dK(dL) | |
1226 | - | let cv = cP._1 | |
1227 | - | let cw = cP._2 | |
1228 | - | let dN = cP._3 | |
1229 | - | let ce = cP._4 | |
1230 | - | let cx = cP._5 | |
1231 | - | if ((gu > cv)) | |
1232 | - | then throw(((("noLessThenAmtAsset failed: " + toString(cv)) + " < ") + toString(gu))) | |
1233 | - | else if ((gv > cw)) | |
1234 | - | then throw(((("noLessThenPriceAsset failed: " + toString(cw)) + " < ") + toString(gv))) | |
1235 | - | else { | |
1236 | - | let ds = dl(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1237 | - | if ((ds == ds)) | |
1238 | - | then { | |
1239 | - | let gs = invoke(aO, "burn", [dN], [AttachedPayment(ce, dN)]) | |
1240 | - | if ((gs == gs)) | |
1241 | - | then { | |
1242 | - | let gw = dt(-(cv), -(cw), 0) | |
1243 | - | let fK = gw._1 | |
1244 | - | let dk = gw._2 | |
1245 | - | let fL = dx(ds, dk) | |
1246 | - | if ((fL == fL)) | |
1247 | - | then (cx ++ fK) | |
1248 | - | else throw("Strict value is not equal to itself.") | |
1249 | - | } | |
1250 | - | else throw("Strict value is not equal to itself.") | |
1251 | - | } | |
1252 | - | else throw("Strict value is not equal to itself.") | |
1253 | - | } | |
1323 | + | @Callable(eS) | |
1324 | + | func getOneTknREADONLY (fL,ft) = { | |
1325 | + | let ht = fK(bd(fL), ft, bm, unit, unit) | |
1326 | + | let hn = ht._1 | |
1327 | + | let el = ht._2 | |
1328 | + | let fe = ht._3 | |
1329 | + | let hc = ht._4 | |
1330 | + | let fN = ht._5 | |
1331 | + | $Tuple2(nil, $Tuple3(hn, fe, hc)) | |
1254 | 1332 | } | |
1255 | 1333 | ||
1256 | 1334 | ||
1257 | 1335 | ||
1258 | - | @Callable(dL) | |
1259 | - | func unstakeAndGet (dT) = { | |
1260 | - | let gx = if ((size(dL.payments) != 0)) | |
1261 | - | then throw("No payments are expected") | |
1262 | - | else true | |
1263 | - | if ((gx == gx)) | |
1336 | + | @Callable(eS) | |
1337 | + | func unstakeAndGetOneTkn (hu,hk,gW) = { | |
1338 | + | let gY = { | |
1339 | + | let aW = invoke(aT, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1340 | + | if ($isInstanceOf(aW, "Boolean")) | |
1341 | + | then aW | |
1342 | + | else throw(($getType(aW) + " couldn't be cast to Boolean")) | |
1343 | + | } | |
1344 | + | let hl = if (if (aY()) | |
1345 | + | then true | |
1346 | + | else (bl == n)) | |
1347 | + | then true | |
1348 | + | else gY | |
1349 | + | let fM = [if (if (!(hl)) | |
1350 | + | then true | |
1351 | + | else gh(eS)) | |
1352 | + | then true | |
1353 | + | else aQ("get operation is blocked by admin"), if ((size(eS.payments) == 0)) | |
1354 | + | then true | |
1355 | + | else aQ("no payments are expected")] | |
1356 | + | if ((fM == fM)) | |
1264 | 1357 | then { | |
1265 | - | let bT = aV() | |
1266 | - | let cg = fromBase58String(bT[q]) | |
1267 | - | let ds = dl(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1268 | - | if ((ds == ds)) | |
1358 | + | let fL = bd(hk) | |
1359 | + | let ab = eS.caller | |
1360 | + | let ac = eS.transactionId | |
1361 | + | let ez = es(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1362 | + | if ((ez == ez)) | |
1269 | 1363 | then { | |
1270 | - | let | |
1271 | - | if (( | |
1364 | + | let hv = invoke(bs, "unstake", [toBase58String(bm), hu], nil) | |
1365 | + | if ((hv == hv)) | |
1272 | 1366 | then { | |
1273 | - | let cP = cc(toBase58String(dL.transactionId), toBase58String(cg), dT, dL.caller) | |
1274 | - | let cv = cP._1 | |
1275 | - | let cw = cP._2 | |
1276 | - | let cj = parseIntValue(cP._9) | |
1277 | - | let cx = cP._10 | |
1278 | - | let gy = if (if (aT()) | |
1279 | - | then true | |
1280 | - | else (cj == n)) | |
1281 | - | then throw(("Get operation is blocked by admin. Status = " + toString(cj))) | |
1282 | - | else true | |
1283 | - | if ((gy == gy)) | |
1367 | + | let hw = fK(fL, hu, bm, ab, ac) | |
1368 | + | if ((hw == hw)) | |
1284 | 1369 | then { | |
1285 | - | let gs = invoke(aO, "burn", [dT], [AttachedPayment(cg, dT)]) | |
1286 | - | if ((gs == gs)) | |
1370 | + | let fN = hw._5 | |
1371 | + | let hc = hw._4 | |
1372 | + | let fe = hw._3 | |
1373 | + | let el = hw._2 | |
1374 | + | let hn = hw._1 | |
1375 | + | let bW = if (if ((gW > 0)) | |
1376 | + | then (gW > hn) | |
1377 | + | else false) | |
1378 | + | then aQ(makeString(["amount to receive is less than ", toString(gW)], "")) | |
1379 | + | else hn | |
1380 | + | let ho = invoke(aT, "burn", [hu], [AttachedPayment(bm, hu)]) | |
1381 | + | if ((ho == ho)) | |
1287 | 1382 | then { | |
1288 | - | let gz = dt(-(cv), -(cw), 0) | |
1289 | - | let fK = gz._1 | |
1290 | - | let dk = gz._2 | |
1291 | - | let fL = dx(ds, dk) | |
1292 | - | if ((fL == fL)) | |
1293 | - | then (cx ++ fK) | |
1383 | + | let gC = cH(hk, bW) | |
1384 | + | let hp = [ScriptTransfer(eS.caller, bW, fL)] | |
1385 | + | let hg = if ((fe > 0)) | |
1386 | + | then [ScriptTransfer(aU, fe, fL)] | |
1387 | + | else nil | |
1388 | + | let hx = { | |
1389 | + | let hr = if ((this == aU)) | |
1390 | + | then 0 | |
1391 | + | else fe | |
1392 | + | if (fN) | |
1393 | + | then $Tuple2(-((bW + hr)), 0) | |
1394 | + | else $Tuple2(0, -((bW + hr))) | |
1395 | + | } | |
1396 | + | let eB = hx._1 | |
1397 | + | let eC = hx._2 | |
1398 | + | let hy = eA(eB, eC, 0) | |
1399 | + | let gR = hy._1 | |
1400 | + | let er = hy._2 | |
1401 | + | let gS = eE(ez, er) | |
1402 | + | if ((gS == gS)) | |
1403 | + | then $Tuple2(((((el ++ gC) ++ hp) ++ hg) ++ gR), bW) | |
1294 | 1404 | else throw("Strict value is not equal to itself.") | |
1295 | 1405 | } | |
1296 | 1406 | else throw("Strict value is not equal to itself.") | |
1306 | 1416 | ||
1307 | 1417 | ||
1308 | 1418 | ||
1309 | - | @Callable( | |
1310 | - | func | |
1311 | - | let | |
1312 | - | | |
1313 | - | | |
1314 | - | let | |
1315 | - | | |
1316 | - | | |
1317 | - | | |
1318 | - | | |
1319 | - | if (( | |
1419 | + | @Callable(eS) | |
1420 | + | func get () = { | |
1421 | + | let dW = eR(eS) | |
1422 | + | let dC = dW._1 | |
1423 | + | let dD = dW._2 | |
1424 | + | let eU = dW._3 | |
1425 | + | let dl = dW._4 | |
1426 | + | let dE = dW._5 | |
1427 | + | let gC = cM(dC, dD) | |
1428 | + | let ez = es(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1429 | + | if ((ez == ez)) | |
1320 | 1430 | then { | |
1321 | - | let | |
1322 | - | if (( | |
1431 | + | let hz = invoke(aT, "burn", [eU], [AttachedPayment(dl, eU)]) | |
1432 | + | if ((hz == hz)) | |
1323 | 1433 | then { | |
1324 | - | let gn = invoke(bn, "unstake", [toBase58String(bh), gm], nil) | |
1325 | - | if ((gn == gn)) | |
1434 | + | let hA = eA(-(dC), -(dD), 0) | |
1435 | + | let gR = hA._1 | |
1436 | + | let er = hA._2 | |
1437 | + | let gS = eE(ez, er) | |
1438 | + | if ((gS == gS)) | |
1439 | + | then ((gC ++ dE) ++ gR) | |
1440 | + | else throw("Strict value is not equal to itself.") | |
1441 | + | } | |
1442 | + | else throw("Strict value is not equal to itself.") | |
1443 | + | } | |
1444 | + | else throw("Strict value is not equal to itself.") | |
1445 | + | } | |
1446 | + | ||
1447 | + | ||
1448 | + | ||
1449 | + | @Callable(eS) | |
1450 | + | func getNoLess (hB,hC) = { | |
1451 | + | let dW = eR(eS) | |
1452 | + | let dC = dW._1 | |
1453 | + | let dD = dW._2 | |
1454 | + | let eU = dW._3 | |
1455 | + | let dl = dW._4 | |
1456 | + | let dE = dW._5 | |
1457 | + | if ((hB > dC)) | |
1458 | + | then throw(((("noLessThenAmtAsset failed: " + toString(dC)) + " < ") + toString(hB))) | |
1459 | + | else if ((hC > dD)) | |
1460 | + | then throw(((("noLessThenPriceAsset failed: " + toString(dD)) + " < ") + toString(hC))) | |
1461 | + | else { | |
1462 | + | let gC = cM(dC, dD) | |
1463 | + | let ez = es(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1464 | + | if ((ez == ez)) | |
1465 | + | then { | |
1466 | + | let hz = invoke(aT, "burn", [eU], [AttachedPayment(dl, eU)]) | |
1467 | + | if ((hz == hz)) | |
1468 | + | then { | |
1469 | + | let hD = eA(-(dC), -(dD), 0) | |
1470 | + | let gR = hD._1 | |
1471 | + | let er = hD._2 | |
1472 | + | let gS = eE(ez, er) | |
1473 | + | if ((gS == gS)) | |
1474 | + | then ((gC ++ dE) ++ gR) | |
1475 | + | else throw("Strict value is not equal to itself.") | |
1476 | + | } | |
1477 | + | else throw("Strict value is not equal to itself.") | |
1478 | + | } | |
1479 | + | else throw("Strict value is not equal to itself.") | |
1480 | + | } | |
1481 | + | } | |
1482 | + | ||
1483 | + | ||
1484 | + | ||
1485 | + | @Callable(eS) | |
1486 | + | func unstakeAndGet (bW) = { | |
1487 | + | let hE = if ((size(eS.payments) != 0)) | |
1488 | + | then throw("No payments are expected") | |
1489 | + | else true | |
1490 | + | if ((hE == hE)) | |
1491 | + | then { | |
1492 | + | let da = ba() | |
1493 | + | let dn = fromBase58String(da[q]) | |
1494 | + | let ez = es(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1495 | + | if ((ez == ez)) | |
1496 | + | then { | |
1497 | + | let hv = invoke(bs, "unstake", [toBase58String(dn), bW], nil) | |
1498 | + | if ((hv == hv)) | |
1326 | 1499 | then { | |
1327 | - | let cP = cc(toBase58String(dL.transactionId), toBase58String(bh), gm, dL.caller) | |
1328 | - | let cv = cP._1 | |
1329 | - | let cw = cP._2 | |
1330 | - | let cx = cP._10 | |
1331 | - | let gB = [if ((cv >= gA)) | |
1500 | + | let dW = dj(toBase58String(eS.transactionId), toBase58String(dn), bW, eS.caller) | |
1501 | + | let dC = dW._1 | |
1502 | + | let dD = dW._2 | |
1503 | + | let dq = parseIntValue(dW._9) | |
1504 | + | let dE = dW._10 | |
1505 | + | let gC = cM(dC, dD) | |
1506 | + | let hF = if (if (aY()) | |
1332 | 1507 | then true | |
1333 | - | else | |
1334 | - | then | |
1335 | - | else | |
1336 | - | if (( | |
1508 | + | else (dq == n)) | |
1509 | + | then throw(("Get operation is blocked by admin. Status = " + toString(dq))) | |
1510 | + | else true | |
1511 | + | if ((hF == hF)) | |
1337 | 1512 | then { | |
1338 | - | let | |
1339 | - | if (( | |
1513 | + | let hz = invoke(aT, "burn", [bW], [AttachedPayment(dn, bW)]) | |
1514 | + | if ((hz == hz)) | |
1340 | 1515 | then { | |
1341 | - | let | |
1342 | - | let | |
1343 | - | let | |
1344 | - | let | |
1345 | - | if (( | |
1346 | - | then ( | |
1516 | + | let hG = eA(-(dC), -(dD), 0) | |
1517 | + | let gR = hG._1 | |
1518 | + | let er = hG._2 | |
1519 | + | let gS = eE(ez, er) | |
1520 | + | if ((gS == gS)) | |
1521 | + | then ((gC ++ dE) ++ gR) | |
1347 | 1522 | else throw("Strict value is not equal to itself.") | |
1348 | 1523 | } | |
1349 | 1524 | else throw("Strict value is not equal to itself.") | |
1359 | 1534 | ||
1360 | 1535 | ||
1361 | 1536 | ||
1362 | - | @Callable(dL) | |
1363 | - | func activate (gD,gE) = if ((toString(dL.caller) != toString(aO))) | |
1364 | - | then throw("permissions denied") | |
1365 | - | else $Tuple2([StringEntry(ae(), gD), StringEntry(af(), gE)], "success") | |
1366 | - | ||
1367 | - | ||
1368 | - | ||
1369 | - | @Callable(dL) | |
1370 | - | func refreshKLp () = { | |
1371 | - | let gF = valueOrElse(getInteger(ak), 0) | |
1372 | - | let gG = if (((height - gF) >= an)) | |
1373 | - | then unit | |
1374 | - | else aL(makeString([toString(an), " blocks have not passed since the previous call"], "")) | |
1375 | - | if ((gG == gG)) | |
1537 | + | @Callable(eS) | |
1538 | + | func unstakeAndGetNoLess (hu,hH,hC) = { | |
1539 | + | let hl = if (aY()) | |
1540 | + | then true | |
1541 | + | else (bl == n) | |
1542 | + | let fM = [if (!(hl)) | |
1543 | + | then true | |
1544 | + | else throw("get operation is blocked by admin"), if ((size(eS.payments) == 0)) | |
1545 | + | then true | |
1546 | + | else throw("no payments are expected")] | |
1547 | + | if ((fM == fM)) | |
1376 | 1548 | then { | |
1377 | - | let dE = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, aj), "0")), aN("invalid kLp")) | |
1378 | - | let gH = dt(0, 0, 0) | |
1379 | - | let gI = gH._1 | |
1380 | - | let dk = gH._2 | |
1381 | - | let dw = if ((dE != dk)) | |
1382 | - | then gI | |
1383 | - | else aL("nothing to refresh") | |
1384 | - | $Tuple2(dw, toString(dk)) | |
1549 | + | let ez = es(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1550 | + | if ((ez == ez)) | |
1551 | + | then { | |
1552 | + | let hv = invoke(bs, "unstake", [toBase58String(bm), hu], nil) | |
1553 | + | if ((hv == hv)) | |
1554 | + | then { | |
1555 | + | let dW = dj(toBase58String(eS.transactionId), toBase58String(bm), hu, eS.caller) | |
1556 | + | let dC = dW._1 | |
1557 | + | let dD = dW._2 | |
1558 | + | let dE = dW._10 | |
1559 | + | let gC = cM(dC, dD) | |
1560 | + | let hI = [if ((dC >= hH)) | |
1561 | + | then true | |
1562 | + | else throw(makeString(["amount asset amount to receive is less than ", toString(hH)], "")), if ((dD >= hC)) | |
1563 | + | then true | |
1564 | + | else throw(makeString(["price asset amount to receive is less than ", toString(hC)], ""))] | |
1565 | + | if ((hI == hI)) | |
1566 | + | then { | |
1567 | + | let hz = invoke(aT, "burn", [hu], [AttachedPayment(bm, hu)]) | |
1568 | + | if ((hz == hz)) | |
1569 | + | then { | |
1570 | + | let hJ = eA(-(dC), -(dD), 0) | |
1571 | + | let gR = hJ._1 | |
1572 | + | let er = hJ._2 | |
1573 | + | let gS = eE(ez, er) | |
1574 | + | if ((gS == gS)) | |
1575 | + | then ((gC ++ dE) ++ gR) | |
1576 | + | else throw("Strict value is not equal to itself.") | |
1577 | + | } | |
1578 | + | else throw("Strict value is not equal to itself.") | |
1579 | + | } | |
1580 | + | else throw("Strict value is not equal to itself.") | |
1581 | + | } | |
1582 | + | else throw("Strict value is not equal to itself.") | |
1583 | + | } | |
1584 | + | else throw("Strict value is not equal to itself.") | |
1385 | 1585 | } | |
1386 | 1586 | else throw("Strict value is not equal to itself.") | |
1387 | 1587 | } | |
1388 | 1588 | ||
1389 | 1589 | ||
1390 | 1590 | ||
1391 | - | @Callable(dL) | |
1392 | - | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aV()) | |
1591 | + | @Callable(eS) | |
1592 | + | func activate (hK,hL) = if ((toString(eS.caller) != toString(aT))) | |
1593 | + | then throw("permissions denied") | |
1594 | + | else $Tuple2([StringEntry(ae(), hK), StringEntry(af(), hL)], "success") | |
1393 | 1595 | ||
1394 | 1596 | ||
1395 | 1597 | ||
1396 | - | @Callable(dL) | |
1397 | - | func getAccBalanceWrapperREADONLY (bF) = $Tuple2(nil, bE(bF)) | |
1398 | - | ||
1399 | - | ||
1400 | - | ||
1401 | - | @Callable(dL) | |
1402 | - | func calcPricesWrapperREADONLY (bN,bO,bS) = { | |
1403 | - | let cb = bR(bN, bO, bS) | |
1404 | - | $Tuple2(nil, [toString(cb[0]), toString(cb[1]), toString(cb[2])]) | |
1598 | + | @Callable(eS) | |
1599 | + | func refreshKLp () = { | |
1600 | + | let hM = valueOrElse(getInteger(ak), 0) | |
1601 | + | let hN = if (((height - hM) >= an)) | |
1602 | + | then unit | |
1603 | + | else aQ(makeString([toString(an), " blocks have not passed since the previous call"], "")) | |
1604 | + | if ((hN == hN)) | |
1605 | + | then { | |
1606 | + | let eL = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, aj), "0")), aS("invalid kLp")) | |
1607 | + | let hO = eA(0, 0, 0) | |
1608 | + | let hP = hO._1 | |
1609 | + | let er = hO._2 | |
1610 | + | let eD = if ((eL != er)) | |
1611 | + | then hP | |
1612 | + | else aQ("nothing to refresh") | |
1613 | + | $Tuple2(eD, toString(er)) | |
1614 | + | } | |
1615 | + | else throw("Strict value is not equal to itself.") | |
1405 | 1616 | } | |
1406 | 1617 | ||
1407 | 1618 | ||
1408 | 1619 | ||
1409 | - | @Callable(dL) | |
1620 | + | @Callable(eS) | |
1621 | + | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, ba()) | |
1622 | + | ||
1623 | + | ||
1624 | + | ||
1625 | + | @Callable(eS) | |
1626 | + | func getAccBalanceWrapperREADONLY (ap) = $Tuple2(nil, bJ(ap)) | |
1627 | + | ||
1628 | + | ||
1629 | + | ||
1630 | + | @Callable(eS) | |
1631 | + | func calcPricesWrapperREADONLY (cU,cV,cZ) = { | |
1632 | + | let di = cY(cU, cV, cZ) | |
1633 | + | $Tuple2(nil, [toString(di[0]), toString(di[1]), toString(di[2])]) | |
1634 | + | } | |
1635 | + | ||
1636 | + | ||
1637 | + | ||
1638 | + | @Callable(eS) | |
1410 | 1639 | func toX18WrapperREADONLY (E,F) = $Tuple2(nil, toString(D(E, F))) | |
1411 | 1640 | ||
1412 | 1641 | ||
1413 | 1642 | ||
1414 | - | @Callable( | |
1643 | + | @Callable(eS) | |
1415 | 1644 | func fromX18WrapperREADONLY (I,J) = $Tuple2(nil, H(parseBigIntValue(I), J)) | |
1416 | 1645 | ||
1417 | 1646 | ||
1418 | 1647 | ||
1419 | - | @Callable( | |
1420 | - | func calcPriceBigIntWrapperREADONLY ( | |
1648 | + | @Callable(eS) | |
1649 | + | func calcPriceBigIntWrapperREADONLY (bN,bO) = $Tuple2(nil, toString(bM(parseBigIntValue(bN), parseBigIntValue(bO)))) | |
1421 | 1650 | ||
1422 | 1651 | ||
1423 | 1652 | ||
1424 | - | @Callable( | |
1425 | - | func estimatePutOperationWrapperREADONLY ( | |
1653 | + | @Callable(eS) | |
1654 | + | func estimatePutOperationWrapperREADONLY (dk,dG,dH,dI,dJ,dK,ab,dL,dM) = $Tuple2(nil, dF(dk, dG, dH, dI, dJ, dK, ab, dL, dM)) | |
1426 | 1655 | ||
1427 | 1656 | ||
1428 | 1657 | ||
1429 | - | @Callable( | |
1430 | - | func estimateGetOperationWrapperREADONLY ( | |
1431 | - | let | |
1432 | - | $Tuple2(nil, $Tuple10( | |
1658 | + | @Callable(eS) | |
1659 | + | func estimateGetOperationWrapperREADONLY (dk,dl,dm,ab) = { | |
1660 | + | let dW = dj(dk, dl, dm, addressFromStringValue(ab)) | |
1661 | + | $Tuple2(nil, $Tuple10(dW._1, dW._2, dW._3, dW._4, dW._5, dW._6, dW._7, toString(dW._8), dW._9, dW._10)) | |
1433 | 1662 | } | |
1434 | 1663 | ||
1435 | 1664 | ||
1436 | 1665 | ||
1437 | - | @Callable( | |
1666 | + | @Callable(eS) | |
1438 | 1667 | func statsREADONLY () = { | |
1439 | - | let | |
1440 | - | let | |
1441 | - | let | |
1442 | - | let | |
1443 | - | let | |
1444 | - | let | |
1445 | - | let | |
1446 | - | let | |
1447 | - | let | |
1448 | - | let | |
1449 | - | let | |
1450 | - | let | |
1668 | + | let da = ba() | |
1669 | + | let dn = fromBase58String(da[q]) | |
1670 | + | let hQ = da[r] | |
1671 | + | let hR = da[s] | |
1672 | + | let dP = da[v] | |
1673 | + | let dQ = da[w] | |
1674 | + | let db = parseIntValue(da[t]) | |
1675 | + | let dc = parseIntValue(da[u]) | |
1676 | + | let hS = valueOrErrorMessage(assetInfo(dn), (("Asset " + toBase58String(dn)) + " doesn't exist")).quantity | |
1677 | + | let hT = bJ(hQ) | |
1678 | + | let hU = bJ(hR) | |
1679 | + | let hV = if ((hS == 0)) | |
1451 | 1680 | then [e, e, e] | |
1452 | - | else | |
1453 | - | let | |
1454 | - | let | |
1455 | - | let | |
1456 | - | let | |
1457 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString( | |
1681 | + | else cY(hT, hU, hS) | |
1682 | + | let dx = 0 | |
1683 | + | let hW = H(hV[1], b) | |
1684 | + | let hX = H(hV[2], b) | |
1685 | + | let hY = value(getInteger(aT, aD(toString(this)))) | |
1686 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(hT), toString(hU), toString(hS), toString(dx), toString(hW), toString(hX), toString(hY)], j)) | |
1458 | 1687 | } | |
1459 | 1688 | ||
1460 | 1689 | ||
1461 | 1690 | ||
1462 | - | @Callable( | |
1463 | - | func evaluatePutByAmountAssetREADONLY ( | |
1464 | - | let | |
1465 | - | let | |
1466 | - | let | |
1467 | - | let | |
1468 | - | let | |
1469 | - | let | |
1470 | - | let | |
1471 | - | let | |
1472 | - | let | |
1473 | - | let | |
1474 | - | let | |
1475 | - | let | |
1476 | - | let | |
1477 | - | let | |
1478 | - | let | |
1691 | + | @Callable(eS) | |
1692 | + | func evaluatePutByAmountAssetREADONLY (dH) = { | |
1693 | + | let da = ba() | |
1694 | + | let dn = fromBase58String(da[q]) | |
1695 | + | let dN = da[r] | |
1696 | + | let do = fromBase58String(dN) | |
1697 | + | let dO = da[s] | |
1698 | + | let dp = fromBase58String(dO) | |
1699 | + | let db = parseIntValue(da[t]) | |
1700 | + | let dc = parseIntValue(da[u]) | |
1701 | + | let dq = da[p] | |
1702 | + | let hS = valueOrErrorMessage(assetInfo(dn), (("Asset " + toBase58String(dn)) + " doesn't exist")).quantity | |
1703 | + | let hT = bJ(dN) | |
1704 | + | let hU = bJ(dO) | |
1705 | + | let cW = D(hT, db) | |
1706 | + | let cX = D(hU, dc) | |
1707 | + | let dw = if ((hS == 0)) | |
1479 | 1708 | then e | |
1480 | - | else | |
1481 | - | let | |
1482 | - | let | |
1483 | - | let | |
1484 | - | let | |
1485 | - | let | |
1486 | - | let | |
1487 | - | let | |
1488 | - | let | |
1489 | - | let | |
1490 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString( | |
1709 | + | else bM(cX, cW) | |
1710 | + | let dT = D(dH, db) | |
1711 | + | let dU = fraction(dT, dw, d) | |
1712 | + | let dJ = H(dU, dc) | |
1713 | + | let eY = dF("", 500000, dH, do, dJ, dp, "", true, false) | |
1714 | + | let ee = eY._1 | |
1715 | + | let hZ = eY._3 | |
1716 | + | let ds = eY._4 | |
1717 | + | let du = eY._5 | |
1718 | + | let dr = eY._6 | |
1719 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(ee), toString(H(dw, b)), toString(ds), toString(du), toString(dr), dq, toString(dH), toString(dJ)], j)) | |
1491 | 1720 | } | |
1492 | 1721 | ||
1493 | 1722 | ||
1494 | 1723 | ||
1495 | - | @Callable( | |
1496 | - | func evaluatePutByPriceAssetREADONLY ( | |
1497 | - | let | |
1498 | - | let | |
1499 | - | let | |
1500 | - | let | |
1501 | - | let | |
1502 | - | let | |
1503 | - | let | |
1504 | - | let | |
1505 | - | let | |
1506 | - | let | |
1507 | - | let | |
1508 | - | let | |
1509 | - | let | |
1510 | - | let | |
1511 | - | let | |
1724 | + | @Callable(eS) | |
1725 | + | func evaluatePutByPriceAssetREADONLY (dJ) = { | |
1726 | + | let da = ba() | |
1727 | + | let dn = fromBase58String(da[q]) | |
1728 | + | let dN = da[r] | |
1729 | + | let do = fromBase58String(dN) | |
1730 | + | let dO = da[s] | |
1731 | + | let dp = fromBase58String(dO) | |
1732 | + | let db = parseIntValue(da[t]) | |
1733 | + | let dc = parseIntValue(da[u]) | |
1734 | + | let dq = da[p] | |
1735 | + | let hS = valueOrErrorMessage(assetInfo(dn), (("Asset " + toBase58String(dn)) + " doesn't exist")).quantity | |
1736 | + | let ia = bJ(dN) | |
1737 | + | let ib = bJ(dO) | |
1738 | + | let ic = D(ia, db) | |
1739 | + | let id = D(ib, dc) | |
1740 | + | let dw = if ((hS == 0)) | |
1512 | 1741 | then e | |
1513 | - | else | |
1514 | - | let | |
1515 | - | let | |
1516 | - | let | |
1517 | - | let | |
1518 | - | let | |
1519 | - | let | |
1520 | - | let | |
1521 | - | let | |
1522 | - | let | |
1523 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString( | |
1742 | + | else bM(id, ic) | |
1743 | + | let dU = D(dJ, dc) | |
1744 | + | let dT = fraction(dU, d, dw) | |
1745 | + | let dH = H(dT, db) | |
1746 | + | let eY = dF("", 500000, dH, do, dJ, dp, "", true, false) | |
1747 | + | let ee = eY._1 | |
1748 | + | let hZ = eY._3 | |
1749 | + | let ds = eY._4 | |
1750 | + | let du = eY._5 | |
1751 | + | let dr = eY._6 | |
1752 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(ee), toString(H(dw, b)), toString(ds), toString(du), toString(dr), dq, toString(dH), toString(dJ)], j)) | |
1524 | 1753 | } | |
1525 | 1754 | ||
1526 | 1755 | ||
1527 | 1756 | ||
1528 | - | @Callable( | |
1529 | - | func evaluateGetREADONLY ( | |
1530 | - | let | |
1531 | - | let | |
1532 | - | let | |
1533 | - | let | |
1534 | - | let | |
1535 | - | let | |
1536 | - | let | |
1537 | - | let | |
1538 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString( | |
1757 | + | @Callable(eS) | |
1758 | + | func evaluateGetREADONLY (ie,if) = { | |
1759 | + | let dW = dj("", ie, if, this) | |
1760 | + | let dC = dW._1 | |
1761 | + | let dD = dW._2 | |
1762 | + | let ds = dW._5 | |
1763 | + | let du = dW._6 | |
1764 | + | let dr = dW._7 | |
1765 | + | let dx = dW._8 | |
1766 | + | let dq = parseIntValue(dW._9) | |
1767 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(dC), toString(dD), toString(ds), toString(du), toString(dr), toString(dx), toString(dq)], j)) | |
1539 | 1768 | } | |
1540 | 1769 | ||
1541 | 1770 | ||
1542 | - | @Verifier( | |
1543 | - | func | |
1544 | - | let | |
1545 | - | let | |
1546 | - | if ($isInstanceOf( | |
1771 | + | @Verifier(ig) | |
1772 | + | func ih () = { | |
1773 | + | let ii = { | |
1774 | + | let bT = ge() | |
1775 | + | if ($isInstanceOf(bT, "ByteVector")) | |
1547 | 1776 | then { | |
1548 | - | let | |
1549 | - | | |
1777 | + | let gi = bT | |
1778 | + | gi | |
1550 | 1779 | } | |
1551 | - | else if ($isInstanceOf( | |
1552 | - | then | |
1780 | + | else if ($isInstanceOf(bT, "Unit")) | |
1781 | + | then ig.senderPublicKey | |
1553 | 1782 | else throw("Match error") | |
1554 | 1783 | } | |
1555 | - | let | |
1556 | - | if ($isInstanceOf( | |
1784 | + | let bT = ig | |
1785 | + | if ($isInstanceOf(bT, "Order")) | |
1557 | 1786 | then { | |
1558 | - | let | |
1559 | - | let | |
1560 | - | let | |
1561 | - | let | |
1562 | - | let | |
1563 | - | let | |
1564 | - | let | |
1565 | - | if (if (if ( | |
1566 | - | then | |
1787 | + | let eH = bT | |
1788 | + | let ij = aZ() | |
1789 | + | let ik = eG(eH) | |
1790 | + | let aI = ik._1 | |
1791 | + | let aJ = ik._2 | |
1792 | + | let aK = sigVerify(eH.bodyBytes, eH.proofs[0], eH.senderPublicKey) | |
1793 | + | let aL = sigVerify(eH.bodyBytes, eH.proofs[1], ij) | |
1794 | + | if (if (if (aI) | |
1795 | + | then aK | |
1567 | 1796 | else false) | |
1568 | - | then | |
1797 | + | then aL | |
1569 | 1798 | else false) | |
1570 | 1799 | then true | |
1571 | - | else | |
1800 | + | else aH(aI, aJ, aK, aL) | |
1572 | 1801 | } | |
1573 | - | else if ($isInstanceOf( | |
1802 | + | else if ($isInstanceOf(bT, "SetScriptTransaction")) | |
1574 | 1803 | then { | |
1575 | - | let | |
1576 | - | if (sigVerify( | |
1804 | + | let gf = bT | |
1805 | + | if (sigVerify(ig.bodyBytes, ig.proofs[0], ii)) | |
1577 | 1806 | then true | |
1578 | 1807 | else { | |
1579 | - | let | |
1580 | - | let | |
1581 | - | let | |
1582 | - | if (( | |
1583 | - | then ( | |
1808 | + | let il = blake2b256(value(gf.script)) | |
1809 | + | let im = fromBase64String(value(getString(aT, aF()))) | |
1810 | + | let in = scriptHash(this) | |
1811 | + | if ((im == il)) | |
1812 | + | then (in != il) | |
1584 | 1813 | else false | |
1585 | 1814 | } | |
1586 | 1815 | } | |
1587 | - | else sigVerify( | |
1816 | + | else sigVerify(ig.bodyBytes, ig.proofs[0], ii) | |
1588 | 1817 | } | |
1589 | 1818 |
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 | 14 | let f = toBigInt(0) | |
15 | 15 | ||
16 | 16 | let g = toBigInt(1) | |
17 | 17 | ||
18 | 18 | let h = toBigInt(2) | |
19 | 19 | ||
20 | 20 | let i = "WAVES" | |
21 | 21 | ||
22 | 22 | let j = "__" | |
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 | 32 | let o = 1 | |
33 | 33 | ||
34 | 34 | let p = 2 | |
35 | 35 | ||
36 | 36 | let q = 3 | |
37 | 37 | ||
38 | 38 | let r = 4 | |
39 | 39 | ||
40 | 40 | let s = 5 | |
41 | 41 | ||
42 | 42 | let t = 6 | |
43 | 43 | ||
44 | 44 | let u = 7 | |
45 | 45 | ||
46 | 46 | let v = 8 | |
47 | 47 | ||
48 | 48 | let w = 9 | |
49 | 49 | ||
50 | 50 | let x = 10 | |
51 | 51 | ||
52 | 52 | let y = 1 | |
53 | 53 | ||
54 | 54 | let z = 2 | |
55 | 55 | ||
56 | 56 | let A = 3 | |
57 | 57 | ||
58 | 58 | let B = 1 | |
59 | 59 | ||
60 | 60 | let C = 7 | |
61 | 61 | ||
62 | 62 | func D (E,F) = fraction(toBigInt(E), d, toBigInt(F)) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func G (E,F) = fraction(E, d, F) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func H (I,J) = toInt(fraction(I, toBigInt(J), d)) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func K (I,J,L) = toInt(fraction(I, toBigInt(J), d, L)) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func M (N,O,P) = fraction(N, O, P) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func Q (I) = if ((0 > I)) | |
78 | 78 | then -(I) | |
79 | 79 | else I | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func R (I) = if ((e > I)) | |
83 | 83 | then -(I) | |
84 | 84 | else I | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func S () = "%s__swapContract" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func T () = "%s__factoryContract" | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func U () = "%s__managerPublicKey" | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func V () = "%s__pendingManagerPublicKey" | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func W () = "%s%s__price__last" | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func X (Y,Z) = makeString(["%s%s%d%d__price__history", toString(Y), toString(Z)], j) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func aa (ab,ac) = ((("%s%s%s__P__" + ab) + "__") + ac) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func ad (ab,ac) = ((("%s%s%s__G__" + ab) + "__") + ac) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func ae () = "%s__amountAsset" | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func af () = "%s__priceAsset" | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | let ag = "%s__fee" | |
118 | 118 | ||
119 | 119 | let ah = fraction(10, b, 10000) | |
120 | 120 | ||
121 | 121 | let ai = valueOrElse(getInteger(this, ag), ah) | |
122 | 122 | ||
123 | 123 | let aj = makeString(["%s", "kLp"], j) | |
124 | 124 | ||
125 | 125 | let ak = makeString(["%s", "kLpRefreshedHeight"], j) | |
126 | 126 | ||
127 | 127 | let al = makeString(["%s", "refreshKLpDelay"], j) | |
128 | 128 | ||
129 | 129 | let am = 30 | |
130 | 130 | ||
131 | 131 | let an = valueOrElse(getInteger(this, al), am) | |
132 | 132 | ||
133 | - | func ao () = "%s | |
133 | + | func ao (ap) = makeString(["%s%s", "stakedBalance", ap], j) | |
134 | 134 | ||
135 | 135 | ||
136 | - | func | |
136 | + | func aq (ap) = makeString(["%s%s", "shareAssetBalance", ap], j) | |
137 | 137 | ||
138 | 138 | ||
139 | - | func | |
139 | + | func ar (ap) = valueOrElse(getInteger(this, ao(ap)), 0) | |
140 | 140 | ||
141 | 141 | ||
142 | - | func as ( | |
142 | + | func as (ap) = valueOrElse(getInteger(this, aq(ap)), 0) | |
143 | 143 | ||
144 | 144 | ||
145 | - | func | |
145 | + | func at () = "%s__factoryConfig" | |
146 | 146 | ||
147 | 147 | ||
148 | - | func | |
148 | + | func au () = "%s%s__matcher__publicKey" | |
149 | 149 | ||
150 | 150 | ||
151 | - | func | |
151 | + | func av (aw) = (("%s%s%s__" + aw) + "__mappings__poolContract2LpAsset") | |
152 | 152 | ||
153 | 153 | ||
154 | - | func | |
154 | + | func ax (ay,az) = (((("%d%d%s__" + ay) + "__") + az) + "__config") | |
155 | 155 | ||
156 | 156 | ||
157 | - | let aB = "%s__feeCollectorAddress" | |
158 | - | ||
159 | - | func aC (aD,aE,aF,aG) = throw((((((((("order validation failed: orderValid=" + toString(aD)) + " (") + aE) + ")") + " senderValid=") + toString(aF)) + " matcherValid=") + toString(aG))) | |
157 | + | func aA (aB) = ("%s%s%s__mappings__baseAsset2internalId__" + aB) | |
160 | 158 | ||
161 | 159 | ||
162 | - | func | |
160 | + | func aC () = "%s__shutdown" | |
163 | 161 | ||
164 | 162 | ||
165 | - | func | |
163 | + | func aD (aE) = ("%s%s__poolWeight__" + aE) | |
166 | 164 | ||
167 | 165 | ||
168 | - | func | |
166 | + | func aF () = "%s__allowedLpScriptHash" | |
169 | 167 | ||
170 | 168 | ||
171 | - | func aN (aM) = makeString(["lp.ride:", aM], " ") | |
169 | + | let aG = "%s__feeCollectorAddress" | |
170 | + | ||
171 | + | func aH (aI,aJ,aK,aL) = throw((((((((("order validation failed: orderValid=" + toString(aI)) + " (") + aJ) + ")") + " senderValid=") + toString(aK)) + " matcherValid=") + toString(aL))) | |
172 | 172 | ||
173 | 173 | ||
174 | - | ||
174 | + | func aM (aN,aO) = valueOrErrorMessage(getString(aN, aO), makeString(["mandatory ", toString(aN), ".", aO, " is not defined"], "")) | |
175 | 175 | ||
176 | - | let aP = addressFromStringValue(aH(aO, aB)) | |
177 | 176 | ||
178 | - | let aQ = { | |
179 | - | let aR = invoke(aO, "getInFeeREADONLY", [toString(this)], nil) | |
180 | - | if ($isInstanceOf(aR, "Int")) | |
181 | - | then aR | |
182 | - | else throw(($getType(aR) + " couldn't be cast to Int")) | |
177 | + | func aP (aN,aO) = valueOrErrorMessage(getInteger(aN, aO), makeString(["mandatory ", toString(aN), ".", aO, " is not defined"], "")) | |
178 | + | ||
179 | + | ||
180 | + | func aQ (aR) = throw(makeString(["lp.ride:", aR], " ")) | |
181 | + | ||
182 | + | ||
183 | + | func aS (aR) = makeString(["lp.ride:", aR], " ") | |
184 | + | ||
185 | + | ||
186 | + | let aT = addressFromStringValue(aM(this, T())) | |
187 | + | ||
188 | + | let aU = addressFromStringValue(aM(aT, aG)) | |
189 | + | ||
190 | + | let aV = { | |
191 | + | let aW = invoke(aT, "getInFeeREADONLY", [toString(this)], nil) | |
192 | + | if ($isInstanceOf(aW, "Int")) | |
193 | + | then aW | |
194 | + | else throw(($getType(aW) + " couldn't be cast to Int")) | |
183 | 195 | } | |
184 | 196 | ||
185 | - | let | |
186 | - | let | |
187 | - | if ($isInstanceOf( | |
188 | - | then | |
189 | - | else throw(($getType( | |
197 | + | let aX = { | |
198 | + | let aW = invoke(aT, "getOutFeeREADONLY", [toString(this)], nil) | |
199 | + | if ($isInstanceOf(aW, "Int")) | |
200 | + | then aW | |
201 | + | else throw(($getType(aW) + " couldn't be cast to Int")) | |
190 | 202 | } | |
191 | 203 | ||
192 | - | func | |
204 | + | func aY () = valueOrElse(getBoolean(aT, aC()), false) | |
193 | 205 | ||
194 | 206 | ||
195 | - | func | |
207 | + | func aZ () = fromBase58String(aM(aT, au())) | |
196 | 208 | ||
197 | 209 | ||
198 | - | func | |
199 | - | let | |
200 | - | let | |
201 | - | let | |
202 | - | let | |
203 | - | split( | |
210 | + | func ba () = { | |
211 | + | let bb = aM(this, ae()) | |
212 | + | let bc = aM(this, af()) | |
213 | + | let az = aP(aT, aA(bc)) | |
214 | + | let ay = aP(aT, aA(bb)) | |
215 | + | split(aM(aT, ax(toString(ay), toString(az))), j) | |
204 | 216 | } | |
205 | 217 | ||
206 | 218 | ||
207 | - | func | |
219 | + | func bd (be) = if ((be == i)) | |
208 | 220 | then unit | |
209 | - | else fromBase58String( | |
221 | + | else fromBase58String(be) | |
210 | 222 | ||
211 | 223 | ||
212 | - | func | |
224 | + | func bf (be) = if ((be == unit)) | |
213 | 225 | then i | |
214 | - | else toBase58String(value( | |
226 | + | else toBase58String(value(be)) | |
215 | 227 | ||
216 | 228 | ||
217 | - | func | |
229 | + | func bg (bh) = $Tuple7(addressFromStringValue(bh[o]), parseIntValue(bh[p]), fromBase58String(bh[q]), bd(bh[r]), bd(bh[s]), parseIntValue(bh[t]), parseIntValue(bh[u])) | |
218 | 230 | ||
219 | 231 | ||
220 | - | let | |
232 | + | let bi = bg(ba()) | |
221 | 233 | ||
222 | - | let | |
234 | + | let bj = bi | |
223 | 235 | ||
224 | - | let | |
236 | + | let bk = bj._1 | |
225 | 237 | ||
226 | - | let | |
238 | + | let bl = bj._2 | |
227 | 239 | ||
228 | - | let | |
240 | + | let bm = bj._3 | |
229 | 241 | ||
230 | - | let | |
242 | + | let bn = bj._4 | |
231 | 243 | ||
232 | - | let | |
244 | + | let bo = bj._5 | |
233 | 245 | ||
234 | - | let | |
246 | + | let bp = bj._6 | |
235 | 247 | ||
236 | - | let | |
248 | + | let bq = bj._7 | |
237 | 249 | ||
238 | - | func | |
250 | + | func br () = split(aM(aT, at()), j) | |
239 | 251 | ||
240 | 252 | ||
241 | - | let | |
253 | + | let bs = valueOrErrorMessage(addressFromString(br()[B]), "incorrect staking address") | |
242 | 254 | ||
243 | - | let | |
255 | + | let bt = valueOrErrorMessage(addressFromString(br()[C]), "incorrect staking address") | |
244 | 256 | ||
245 | - | func | |
257 | + | func bu (bv,bw,bx,by,bz,bA,bB,bC,bD,bE) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bv), toString(bw), toString(bx), toString(by), toString(bz), toString(bA), toString(bB), toString(bC), toString(bD), toString(bE)], j) | |
246 | 258 | ||
247 | 259 | ||
248 | - | func | |
260 | + | func bF (bG,bH,bI,by,bB,bC) = makeString(["%d%d%d%d%d%d", toString(bG), toString(bH), toString(bI), toString(by), toString(bB), toString(bC)], j) | |
249 | 261 | ||
250 | 262 | ||
251 | - | func bE (bF) = if ((bF == "WAVES")) | |
252 | - | then wavesBalance(this).available | |
253 | - | else assetBalance(this, fromBase58String(bF)) | |
254 | - | ||
255 | - | ||
256 | - | func bG (bH,bI) = fraction(bH, d, bI) | |
257 | - | ||
258 | - | ||
259 | - | func bJ (bH,bI,L) = fraction(bH, d, bI, L) | |
260 | - | ||
261 | - | ||
262 | - | func bK (bL,bM,bN,bO) = { | |
263 | - | let bP = D(bN, bL) | |
264 | - | let bQ = D(bO, bM) | |
265 | - | bG(bQ, bP) | |
263 | + | func bJ (ap) = { | |
264 | + | let bK = if ((ap == "WAVES")) | |
265 | + | then wavesBalance(this).available | |
266 | + | else assetBalance(this, fromBase58String(ap)) | |
267 | + | let bL = ((bK + ar(ap)) - as(ap)) | |
268 | + | max([0, bL]) | |
266 | 269 | } | |
267 | 270 | ||
268 | 271 | ||
269 | - | func bR (bN,bO,bS) = { | |
270 | - | let bT = aV() | |
271 | - | let bU = parseIntValue(bT[t]) | |
272 | - | let bV = parseIntValue(bT[u]) | |
273 | - | let bW = bK(bU, bV, bN, bO) | |
274 | - | let bI = D(bN, bU) | |
275 | - | let bH = D(bO, bV) | |
276 | - | let bX = D(bS, b) | |
277 | - | let bY = bG(bI, bX) | |
278 | - | let bZ = bG(bH, bX) | |
279 | - | [bW, bY, bZ] | |
272 | + | func bM (bN,bO) = fraction(bN, d, bO) | |
273 | + | ||
274 | + | ||
275 | + | func bP (bN,bO,L) = fraction(bN, d, bO, L) | |
276 | + | ||
277 | + | ||
278 | + | func bQ (bR) = { | |
279 | + | let bS = invoke(bR, "getRate", nil, nil) | |
280 | + | if ((bS == bS)) | |
281 | + | then { | |
282 | + | let bT = bS | |
283 | + | if ($isInstanceOf(bT, "Int")) | |
284 | + | then { | |
285 | + | let bU = bT | |
286 | + | bU | |
287 | + | } | |
288 | + | else aQ("proxy.getRate() unexpected value") | |
289 | + | } | |
290 | + | else throw("Strict value is not equal to itself.") | |
280 | 291 | } | |
281 | 292 | ||
282 | 293 | ||
283 | - | func ca (bN,bO,bS) = { | |
284 | - | let cb = bR(bN, bO, bS) | |
285 | - | [H(cb[0], b), H(cb[1], b), H(cb[2], b)] | |
286 | - | } | |
287 | - | ||
288 | - | ||
289 | - | func cc (cd,ce,cf,ab) = { | |
290 | - | let bT = aV() | |
291 | - | let cg = bT[q] | |
292 | - | let ch = bT[r] | |
293 | - | let ci = bT[s] | |
294 | - | let bL = parseIntValue(bT[t]) | |
295 | - | let bM = parseIntValue(bT[u]) | |
296 | - | let cj = bT[p] | |
297 | - | let ck = valueOrErrorMessage(assetInfo(fromBase58String(cg)), (("Asset " + cg) + " doesn't exist")).quantity | |
298 | - | if ((cg != ce)) | |
299 | - | then throw("Invalid asset passed.") | |
300 | - | else { | |
301 | - | let cl = bE(ch) | |
302 | - | let cm = D(cl, bL) | |
303 | - | let cn = bE(ci) | |
304 | - | let co = D(cn, bM) | |
305 | - | let cp = bG(co, cm) | |
306 | - | let cq = H(cp, b) | |
307 | - | let cr = D(cf, b) | |
308 | - | let cs = D(ck, b) | |
309 | - | let ct = fraction(cm, cr, cs) | |
310 | - | let cu = fraction(co, cr, cs) | |
311 | - | let cv = K(ct, bL, FLOOR) | |
312 | - | let cw = K(cu, bM, FLOOR) | |
313 | - | let cx = if ((cd == "")) | |
314 | - | then nil | |
315 | - | else [ScriptTransfer(ab, cv, if ((ch == "WAVES")) | |
316 | - | then unit | |
317 | - | else fromBase58String(ch)), ScriptTransfer(ab, cw, if ((ci == "WAVES")) | |
318 | - | then unit | |
319 | - | else fromBase58String(ci)), StringEntry(ad(toString(ab), cd), bA(cv, cw, cf, cq, height, lastBlock.timestamp)), IntegerEntry(W(), cq), IntegerEntry(X(height, lastBlock.timestamp), cq)] | |
320 | - | $Tuple10(cv, cw, ch, ci, cl, cn, ck, cp, cj, cx) | |
321 | - | } | |
322 | - | } | |
323 | - | ||
324 | - | ||
325 | - | func cy (cd,cz,cA,cB,cC,cD,ab,cE,cF) = { | |
326 | - | let bT = aV() | |
327 | - | let cg = fromBase58String(bT[q]) | |
328 | - | let cG = bT[r] | |
329 | - | let cH = bT[s] | |
330 | - | let cI = bT[v] | |
331 | - | let cJ = bT[w] | |
332 | - | let bU = parseIntValue(bT[t]) | |
333 | - | let bV = parseIntValue(bT[u]) | |
334 | - | let cj = bT[p] | |
335 | - | let ck = valueOrErrorMessage(assetInfo(cg), (("Asset " + toBase58String(cg)) + " doesn't exist")).quantity | |
336 | - | let cK = toBase58String(valueOrElse(cB, fromBase58String("WAVES"))) | |
337 | - | let cL = toBase58String(valueOrElse(cD, fromBase58String("WAVES"))) | |
338 | - | if (if ((cG != cK)) | |
339 | - | then true | |
340 | - | else (cH != cL)) | |
341 | - | then throw("Invalid amt or price asset passed.") | |
342 | - | else { | |
343 | - | let cl = if (cE) | |
344 | - | then bE(cG) | |
345 | - | else (bE(cG) - cA) | |
346 | - | let cn = if (cE) | |
347 | - | then bE(cH) | |
348 | - | else (bE(cH) - cC) | |
349 | - | let cM = D(cA, bU) | |
350 | - | let cN = D(cC, bV) | |
351 | - | let cO = bG(cN, cM) | |
352 | - | let cm = D(cl, bU) | |
353 | - | let co = D(cn, bV) | |
354 | - | let cP = if ((ck == 0)) | |
294 | + | func bV (ap,bW,bX,bR) = { | |
295 | + | let bY = ar(ap) | |
296 | + | if ((bY == bY)) | |
297 | + | then { | |
298 | + | let bZ = as(bX) | |
299 | + | if ((bZ == bZ)) | |
355 | 300 | then { | |
356 | - | let cp = e | |
357 | - | let cQ = e | |
358 | - | let bX = pow((cM * cN), 0, toBigInt(5), 1, 0, DOWN) | |
359 | - | $Tuple5(H(bX, b), H(cM, bU), H(cN, bV), bG((co + cN), (cm + cM)), cQ) | |
301 | + | let ca = bd(ap) | |
302 | + | if ((bW > 0)) | |
303 | + | then { | |
304 | + | let cb = invoke(bR, "deposit", nil, [AttachedPayment(ca, bW)]) | |
305 | + | if ((cb == cb)) | |
306 | + | then { | |
307 | + | let bT = cb | |
308 | + | if ($isInstanceOf(bT, "Int")) | |
309 | + | then { | |
310 | + | let cc = bT | |
311 | + | let cd = (bY + bW) | |
312 | + | let ce = (bZ + cc) | |
313 | + | [IntegerEntry(ao(ap), cd), IntegerEntry(aq(bX), ce)] | |
314 | + | } | |
315 | + | else nil | |
316 | + | } | |
317 | + | else throw("Strict value is not equal to itself.") | |
318 | + | } | |
319 | + | else nil | |
360 | 320 | } | |
361 | - | else { | |
362 | - | let cp = bG(co, cm) | |
363 | - | let cQ = fraction(R((cp - cO)), d, cp) | |
364 | - | let cR = D(cz, b) | |
365 | - | if (if ((cp != e)) | |
366 | - | then (cQ > cR) | |
367 | - | else false) | |
368 | - | then throw(((("Price slippage " + toString(cQ)) + " exceeded the passed limit of ") + toString(cR))) | |
369 | - | else { | |
370 | - | let cs = D(ck, b) | |
371 | - | let cS = fraction(cM, bJ(co, cm, CEILING), d, CEILING) | |
372 | - | let cT = fraction(cN, d, bJ(co, cm, FLOOR), CEILING) | |
373 | - | let cU = if ((cS > cN)) | |
374 | - | then $Tuple2(cT, cN) | |
375 | - | else $Tuple2(cM, cS) | |
376 | - | let cV = cU._1 | |
377 | - | let cW = cU._2 | |
378 | - | let bX = fraction(cs, cW, co, FLOOR) | |
379 | - | $Tuple5(K(bX, b, FLOOR), K(cV, bU, CEILING), K(cW, bV, CEILING), cp, cQ) | |
380 | - | } | |
381 | - | } | |
382 | - | let cX = cP._1 | |
383 | - | let cY = cP._2 | |
384 | - | let cZ = cP._3 | |
385 | - | let cq = H(cP._4, b) | |
386 | - | let da = H(cP._5, b) | |
387 | - | if ((0 >= cX)) | |
388 | - | then throw("Invalid calculations. LP calculated is less than zero.") | |
389 | - | else { | |
390 | - | let db = if (!(cF)) | |
391 | - | then 0 | |
392 | - | else cX | |
393 | - | let dc = (cA - cY) | |
394 | - | let dd = (cC - cZ) | |
395 | - | let de = [IntegerEntry(W(), cq), IntegerEntry(X(height, lastBlock.timestamp), cq), StringEntry(aa(ab, cd), bp(cY, cZ, db, cq, cz, da, height, lastBlock.timestamp, dc, dd))] | |
396 | - | $Tuple13(cX, db, cq, cl, cn, ck, cg, cj, de, dc, dd, cB, cD) | |
397 | - | } | |
398 | - | } | |
399 | - | } | |
400 | - | ||
401 | - | ||
402 | - | func df (dg,dh,ck) = { | |
403 | - | let di = G(dg, toBigInt(bk)) | |
404 | - | let dj = G(dh, toBigInt(bl)) | |
405 | - | let dk = fraction(pow((di * dj), 0, toBigInt(5), 1, 18, DOWN), g, ck) | |
406 | - | if ((ck == f)) | |
407 | - | then f | |
408 | - | else dk | |
409 | - | } | |
410 | - | ||
411 | - | ||
412 | - | func dl (dm,dn,do) = { | |
413 | - | let dp = (toBigInt(bE(ba(bi))) - dm) | |
414 | - | let dq = (toBigInt(bE(ba(bj))) - dn) | |
415 | - | let dr = (toBigInt(value(assetInfo(bh)).quantity) - do) | |
416 | - | let ds = df(dp, dq, dr) | |
417 | - | ds | |
418 | - | } | |
419 | - | ||
420 | - | ||
421 | - | func dt (du,dv,do) = { | |
422 | - | let dp = (bE(ba(bi)) + du) | |
423 | - | let dq = (bE(ba(bj)) + dv) | |
424 | - | let dr = (value(assetInfo(bh)).quantity + do) | |
425 | - | let dk = df(toBigInt(dp), toBigInt(dq), toBigInt(dr)) | |
426 | - | let dw = [IntegerEntry(ak, height), StringEntry(aj, toString(dk))] | |
427 | - | $Tuple2(dw, dk) | |
428 | - | } | |
429 | - | ||
430 | - | ||
431 | - | func dx (dy,dk) = if ((dk >= dy)) | |
432 | - | then true | |
433 | - | else aL(makeString(["updated KLp lower than current KLp", toString(dy), toString(dk)], " ")) | |
434 | - | ||
435 | - | ||
436 | - | func dz (dA) = { | |
437 | - | let dp = bE(ba(bi)) | |
438 | - | let dq = bE(ba(bj)) | |
439 | - | let dB = dA.amount | |
440 | - | let dC = fraction(dA.amount, dA.price, b, FLOOR) | |
441 | - | let dD = if ((dA.orderType == Buy)) | |
442 | - | then $Tuple2(dB, -(dC)) | |
443 | - | else $Tuple2(-(dB), dC) | |
444 | - | let du = dD._1 | |
445 | - | let dv = dD._2 | |
446 | - | if (if (if (aT()) | |
447 | - | then true | |
448 | - | else (bg == m)) | |
449 | - | then true | |
450 | - | else (bg == n)) | |
451 | - | then throw("Exchange operations disabled") | |
452 | - | else if (if ((dA.assetPair.amountAsset != bi)) | |
453 | - | then true | |
454 | - | else (dA.assetPair.priceAsset != bj)) | |
455 | - | then throw("Wrong order assets.") | |
456 | - | else { | |
457 | - | let dE = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, aj), "0")), aN("invalid kLp")) | |
458 | - | let dF = dt(du, dv, 0) | |
459 | - | let dG = dF._1 | |
460 | - | let dH = dF._2 | |
461 | - | let dI = (dH >= dE) | |
462 | - | let dJ = makeString(["kLp=", toString(dE), " kLpNew=", toString(dH), " amountAssetBalance=", toString(dp), " priceAssetBalance=", toString(dq), " amountAssetBalanceDelta=", toString(du), " priceAssetBalanceDelta=", toString(dv), " height=", toString(height)], "") | |
463 | - | $Tuple2(dI, dJ) | |
464 | - | } | |
465 | - | } | |
466 | - | ||
467 | - | ||
468 | - | func dK (dL) = if ((size(dL.payments) != 1)) | |
469 | - | then throw("exactly 1 payment is expected") | |
470 | - | else { | |
471 | - | let dM = value(dL.payments[0]) | |
472 | - | let ce = value(dM.assetId) | |
473 | - | let dN = dM.amount | |
474 | - | let cP = cc(toBase58String(dL.transactionId), toBase58String(ce), dN, dL.caller) | |
475 | - | let cv = cP._1 | |
476 | - | let cw = cP._2 | |
477 | - | let cj = parseIntValue(cP._9) | |
478 | - | let cx = cP._10 | |
479 | - | if (if (aT()) | |
480 | - | then true | |
481 | - | else (cj == n)) | |
482 | - | then throw(("Get operation is blocked by admin. Status = " + toString(cj))) | |
483 | - | else $Tuple5(cv, cw, dN, ce, cx) | |
484 | - | } | |
485 | - | ||
486 | - | ||
487 | - | func dO (dL,cz,cF) = if ((size(dL.payments) != 2)) | |
488 | - | then throw("exactly 2 payments are expected") | |
489 | - | else { | |
490 | - | let dP = value(dL.payments[0]) | |
491 | - | let dQ = value(dL.payments[1]) | |
492 | - | let dR = cy(toBase58String(dL.transactionId), cz, dP.amount, dP.assetId, dQ.amount, dQ.assetId, toString(dL.caller), false, cF) | |
493 | - | let cj = parseIntValue(dR._8) | |
494 | - | if (if (if (aT()) | |
495 | - | then true | |
496 | - | else (cj == l)) | |
497 | - | then true | |
498 | - | else (cj == n)) | |
499 | - | then throw(("Put operation is blocked by admin. Status = " + toString(cj))) | |
500 | - | else dR | |
501 | - | } | |
502 | - | ||
503 | - | ||
504 | - | func dS (dT) = { | |
505 | - | let dU = invoke(aO, "emit", [dT], nil) | |
506 | - | if ((dU == dU)) | |
507 | - | then { | |
508 | - | let dV = { | |
509 | - | let dW = dU | |
510 | - | if ($isInstanceOf(dW, "Address")) | |
511 | - | then { | |
512 | - | let dX = dW | |
513 | - | invoke(dX, "emit", [dT], nil) | |
514 | - | } | |
515 | - | else unit | |
516 | - | } | |
517 | - | if ((dV == dV)) | |
518 | - | then dT | |
519 | 321 | else throw("Strict value is not equal to itself.") | |
520 | 322 | } | |
521 | 323 | else throw("Strict value is not equal to itself.") | |
522 | 324 | } | |
523 | 325 | ||
524 | 326 | ||
525 | - | func dY (dT,ai) = { | |
526 | - | let dZ = if ((ai == 0)) | |
527 | - | then 0 | |
528 | - | else fraction(dT, ai, b) | |
529 | - | $Tuple2((dT - dZ), dZ) | |
530 | - | } | |
531 | - | ||
532 | - | ||
533 | - | func ea (eb,ec,ab,ac) = { | |
534 | - | let ed = (ac == unit) | |
535 | - | let ee = bE(ba(bi)) | |
536 | - | let ef = bE(ba(bj)) | |
537 | - | let eg = if ((ec == bi)) | |
538 | - | then true | |
539 | - | else if ((ec == bj)) | |
540 | - | then false | |
541 | - | else aL("invalid asset") | |
542 | - | let eh = if (ed) | |
543 | - | then $Tuple2(ee, ef) | |
544 | - | else if (eg) | |
545 | - | then $Tuple2((ee - eb), ef) | |
546 | - | else $Tuple2(ee, (ef - eb)) | |
547 | - | let ei = eh._1 | |
548 | - | let ej = eh._2 | |
549 | - | let ek = if (eg) | |
550 | - | then $Tuple2(eb, 0) | |
551 | - | else $Tuple2(0, eb) | |
552 | - | let el = ek._1 | |
553 | - | let em = ek._2 | |
554 | - | let dB = dY(el, aQ)._1 | |
555 | - | let dC = dY(em, aQ)._1 | |
556 | - | let en = dY(eb, aQ) | |
557 | - | let eo = en._1 | |
558 | - | let dZ = en._2 | |
559 | - | let ep = (ei + dB) | |
560 | - | let eq = (ej + dC) | |
561 | - | let er = bG(D(eq, bl), D(ep, bk)) | |
562 | - | let es = H(er, b) | |
563 | - | let et = if (eg) | |
564 | - | then ei | |
565 | - | else ej | |
566 | - | let eu = toBigInt(et) | |
567 | - | let ev = toBigInt(valueOrErrorMessage(assetInfo(bh), (("asset " + toBase58String(bh)) + " doesn't exist")).quantity) | |
568 | - | let ew = if ((ev > f)) | |
569 | - | then true | |
570 | - | else aL("initial deposit requires all coins") | |
571 | - | if ((ew == ew)) | |
327 | + | func cf (ap,bW,bX,bR,cg,ch) = { | |
328 | + | let bY = ar(ap) | |
329 | + | if ((bY == bY)) | |
572 | 330 | then { | |
573 | - | let ex = toBigInt(eo) | |
574 | - | let ey = max([0, toInt(((ev * (sqrtBigInt((d + ((ex * d) / eu)), 18, 18, DOWN) - d)) / d))]) | |
575 | - | let de = if (ed) | |
576 | - | then nil | |
577 | - | else [IntegerEntry(W(), es), IntegerEntry(X(height, lastBlock.timestamp), es), StringEntry(aa(toString(value(ab)), toBase58String(value(ac))), bp(el, em, ey, es, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
578 | - | let ez = bG(D(ej, bl), D(ei, bk)) | |
579 | - | let eA = H(ez, b) | |
580 | - | let eB = { | |
581 | - | let eC = if (eg) | |
582 | - | then $Tuple2(el, ei) | |
583 | - | else $Tuple2(em, ej) | |
584 | - | let dT = eC._1 | |
585 | - | let eD = eC._2 | |
586 | - | let eE = toInt(fraction(ev, toBigInt((dT / 2)), toBigInt(eD))) | |
587 | - | fraction((ey - eE), b, eE) | |
588 | - | } | |
589 | - | $Tuple5(ey, de, dZ, eB, eg) | |
331 | + | let bZ = as(bX) | |
332 | + | if ((bZ == bZ)) | |
333 | + | then { | |
334 | + | let ci = bQ(bR) | |
335 | + | if ((ci == ci)) | |
336 | + | then { | |
337 | + | let cj = fraction(cg, bY, bZ) | |
338 | + | let ck = bd(bX) | |
339 | + | let cl = fraction(cg, bW, cj) | |
340 | + | let cm = fraction(cg, bW, ci) | |
341 | + | let cn = max([0, (cl - cm)]) | |
342 | + | if ((cm > 0)) | |
343 | + | then { | |
344 | + | let co = invoke(bR, "withdraw", nil, [AttachedPayment(ck, cm)]) | |
345 | + | if ((co == co)) | |
346 | + | then { | |
347 | + | let bT = co | |
348 | + | if ($isInstanceOf(bT, "Int")) | |
349 | + | then { | |
350 | + | let cp = bT | |
351 | + | let cd = (bY - cp) | |
352 | + | let ce = ((bZ - cm) - cn) | |
353 | + | [IntegerEntry(ao(ap), cd), IntegerEntry(aq(bX), ce), ScriptTransfer(ch, cn, bd(bX))] | |
354 | + | } | |
355 | + | else nil | |
356 | + | } | |
357 | + | else throw("Strict value is not equal to itself.") | |
358 | + | } | |
359 | + | else nil | |
360 | + | } | |
361 | + | else throw("Strict value is not equal to itself.") | |
362 | + | } | |
363 | + | else throw("Strict value is not equal to itself.") | |
590 | 364 | } | |
591 | 365 | else throw("Strict value is not equal to itself.") | |
592 | 366 | } | |
593 | 367 | ||
594 | 368 | ||
595 | - | func eF (eG,eo,ec,ab,ac) = { | |
596 | - | let ed = (ac == unit) | |
597 | - | let bT = aV() | |
598 | - | let bU = parseIntValue(bT[t]) | |
599 | - | let bV = parseIntValue(bT[u]) | |
600 | - | let eH = [if ((ec == bh)) | |
601 | - | then true | |
602 | - | else aL("invalid lp asset")] | |
603 | - | if ((eH == eH)) | |
369 | + | func cq (ap) = { | |
370 | + | let bT = invoke(aT, "getPoolLeaseConfigREADONLY", [toString(this), ap], nil) | |
371 | + | if ($isInstanceOf(bT, "(Boolean, Int, Int, String, String, Int, String)")) | |
604 | 372 | then { | |
605 | - | let eI = if ((eG == bi)) | |
606 | - | then true | |
607 | - | else if ((eG == bj)) | |
608 | - | then false | |
609 | - | else aL("invalid asset") | |
610 | - | let eJ = if (eI) | |
611 | - | then toBigInt(bE(ba(bi))) | |
612 | - | else toBigInt(bE(ba(bj))) | |
613 | - | let eK = if (eI) | |
614 | - | then bU | |
615 | - | else bV | |
616 | - | let eL = bE(ba(bi)) | |
617 | - | let eM = bE(ba(bj)) | |
618 | - | let eN = if (eI) | |
619 | - | then eL | |
620 | - | else eM | |
621 | - | let eO = toBigInt(eN) | |
622 | - | let ev = toBigInt(valueOrErrorMessage(assetInfo(bh), (("asset " + toBase58String(bh)) + " doesn't exist")).quantity) | |
623 | - | let eP = toBigInt(eo) | |
624 | - | let eQ = max([0, toInt(((eJ * (d - pow((d - ((eP * d) / ev)), 18, h, 0, 18, DOWN))) / d))]) | |
625 | - | let eR = dY(eQ, aS) | |
626 | - | let eS = eR._1 | |
627 | - | let dZ = eR._2 | |
628 | - | let eT = if (eI) | |
629 | - | then $Tuple4(eS, 0, (eL - eQ), eM) | |
630 | - | else $Tuple4(0, eS, eL, (eM - eQ)) | |
631 | - | let eU = eT._1 | |
632 | - | let eV = eT._2 | |
633 | - | let eW = eT._3 | |
634 | - | let eX = eT._4 | |
635 | - | let er = bG(D(eX, bl), D(eW, bk)) | |
636 | - | let es = H(er, b) | |
637 | - | let de = if (ed) | |
638 | - | then nil | |
639 | - | else [StringEntry(ad(toString(value(ab)), toBase58String(value(ac))), bA(eU, eV, eo, es, height, lastBlock.timestamp)), IntegerEntry(W(), es), IntegerEntry(X(height, lastBlock.timestamp), es)] | |
640 | - | let ez = bG(D(eM, bl), D(eL, bk)) | |
641 | - | let eA = H(ez, b) | |
642 | - | let eB = { | |
643 | - | let eY = (toInt(fraction(eJ, eP, ev)) * 2) | |
644 | - | fraction((eS - eY), b, eY) | |
645 | - | } | |
646 | - | $Tuple5(eS, de, dZ, eB, eI) | |
373 | + | let cr = bT | |
374 | + | cr | |
375 | + | } | |
376 | + | else aQ((("[" + ap) + "] getLeaseProxyConfig() error")) | |
377 | + | } | |
378 | + | ||
379 | + | ||
380 | + | func cs (ct,ap,bX,cu,bR,cg,ch) = { | |
381 | + | let bY = ar(ap) | |
382 | + | if ((bY == bY)) | |
383 | + | then { | |
384 | + | let bZ = as(bX) | |
385 | + | if ((bZ == bZ)) | |
386 | + | then { | |
387 | + | let cv = max([0, (bJ(ap) - cu)]) | |
388 | + | let cw = fraction(ct, cv, 100) | |
389 | + | let cx = (bY - cw) | |
390 | + | if ((cx == 0)) | |
391 | + | then nil | |
392 | + | else if ((0 > cx)) | |
393 | + | then { | |
394 | + | let cy = -(cx) | |
395 | + | bV(ap, cy, bX, bR) | |
396 | + | } | |
397 | + | else { | |
398 | + | let cz = cx | |
399 | + | cf(ap, cz, bX, bR, cg, ch) | |
400 | + | } | |
401 | + | } | |
402 | + | else throw("Strict value is not equal to itself.") | |
647 | 403 | } | |
648 | 404 | else throw("Strict value is not equal to itself.") | |
649 | 405 | } | |
650 | 406 | ||
651 | 407 | ||
652 | - | func eZ () = { | |
653 | - | let dW = getString(U()) | |
654 | - | if ($isInstanceOf(dW, "String")) | |
408 | + | func cA (ap) = { | |
409 | + | let cB = cq(ap) | |
410 | + | let cC = cB._1 | |
411 | + | let cD = cB._2 | |
412 | + | let cu = cB._3 | |
413 | + | let cE = cB._4 | |
414 | + | let cF = cB._5 | |
415 | + | let cg = cB._6 | |
416 | + | let cG = cB._7 | |
417 | + | if (cC) | |
418 | + | then cs(cD, ap, cF, cu, addressFromStringValue(cE), cg, addressFromStringValue(cG)) | |
419 | + | else nil | |
420 | + | } | |
421 | + | ||
422 | + | ||
423 | + | func cH (ap,cI) = { | |
424 | + | let cJ = cq(ap) | |
425 | + | let cC = cJ._1 | |
426 | + | let cD = cJ._2 | |
427 | + | let cu = cJ._3 | |
428 | + | let cE = cJ._4 | |
429 | + | let cF = cJ._5 | |
430 | + | let cg = cJ._6 | |
431 | + | let cG = cJ._7 | |
432 | + | if (cC) | |
655 | 433 | then { | |
656 | - | let fa = dW | |
657 | - | fromBase58String(fa) | |
434 | + | let cK = max([0, ((bJ(ap) - cI) - cu)]) | |
435 | + | if ((cK == cK)) | |
436 | + | then { | |
437 | + | let cd = fraction(cD, cK, 100) | |
438 | + | if ((cd == cd)) | |
439 | + | then { | |
440 | + | let cL = max([0, (ar(ap) - cd)]) | |
441 | + | if ((cL == cL)) | |
442 | + | then cf(ap, cL, cF, addressFromStringValue(cE), cg, addressFromStringValue(cG)) | |
443 | + | else throw("Strict value is not equal to itself.") | |
444 | + | } | |
445 | + | else throw("Strict value is not equal to itself.") | |
446 | + | } | |
447 | + | else throw("Strict value is not equal to itself.") | |
658 | 448 | } | |
659 | - | else if ($isInstanceOf(dW, "Unit")) | |
449 | + | else nil | |
450 | + | } | |
451 | + | ||
452 | + | ||
453 | + | func cM (cN,cO) = { | |
454 | + | let cP = cH(aM(this, ae()), cN) | |
455 | + | let cQ = cH(aM(this, af()), cO) | |
456 | + | (cP ++ cQ) | |
457 | + | } | |
458 | + | ||
459 | + | ||
460 | + | func cR (cS,cT,cU,cV) = { | |
461 | + | let cW = D(cU, cS) | |
462 | + | let cX = D(cV, cT) | |
463 | + | bM(cX, cW) | |
464 | + | } | |
465 | + | ||
466 | + | ||
467 | + | func cY (cU,cV,cZ) = { | |
468 | + | let da = ba() | |
469 | + | let db = parseIntValue(da[t]) | |
470 | + | let dc = parseIntValue(da[u]) | |
471 | + | let dd = cR(db, dc, cU, cV) | |
472 | + | let bO = D(cU, db) | |
473 | + | let bN = D(cV, dc) | |
474 | + | let de = D(cZ, b) | |
475 | + | let df = bM(bO, de) | |
476 | + | let dg = bM(bN, de) | |
477 | + | [dd, df, dg] | |
478 | + | } | |
479 | + | ||
480 | + | ||
481 | + | func dh (cU,cV,cZ) = { | |
482 | + | let di = cY(cU, cV, cZ) | |
483 | + | [H(di[0], b), H(di[1], b), H(di[2], b)] | |
484 | + | } | |
485 | + | ||
486 | + | ||
487 | + | func dj (dk,dl,dm,ab) = { | |
488 | + | let da = ba() | |
489 | + | let dn = da[q] | |
490 | + | let do = da[r] | |
491 | + | let dp = da[s] | |
492 | + | let cS = parseIntValue(da[t]) | |
493 | + | let cT = parseIntValue(da[u]) | |
494 | + | let dq = da[p] | |
495 | + | let dr = valueOrErrorMessage(assetInfo(fromBase58String(dn)), (("Asset " + dn) + " doesn't exist")).quantity | |
496 | + | if ((dn != dl)) | |
497 | + | then throw("Invalid asset passed.") | |
498 | + | else { | |
499 | + | let ds = bJ(do) | |
500 | + | let dt = D(ds, cS) | |
501 | + | let du = bJ(dp) | |
502 | + | let dv = D(du, cT) | |
503 | + | let dw = bM(dv, dt) | |
504 | + | let dx = H(dw, b) | |
505 | + | let dy = D(dm, b) | |
506 | + | let dz = D(dr, b) | |
507 | + | let dA = fraction(dt, dy, dz) | |
508 | + | let dB = fraction(dv, dy, dz) | |
509 | + | let dC = K(dA, cS, FLOOR) | |
510 | + | let dD = K(dB, cT, FLOOR) | |
511 | + | let dE = if ((dk == "")) | |
512 | + | then nil | |
513 | + | else [ScriptTransfer(ab, dC, if ((do == "WAVES")) | |
514 | + | then unit | |
515 | + | else fromBase58String(do)), ScriptTransfer(ab, dD, if ((dp == "WAVES")) | |
516 | + | then unit | |
517 | + | else fromBase58String(dp)), StringEntry(ad(toString(ab), dk), bF(dC, dD, dm, dx, height, lastBlock.timestamp)), IntegerEntry(W(), dx), IntegerEntry(X(height, lastBlock.timestamp), dx)] | |
518 | + | $Tuple10(dC, dD, do, dp, ds, du, dr, dw, dq, dE) | |
519 | + | } | |
520 | + | } | |
521 | + | ||
522 | + | ||
523 | + | func dF (dk,dG,dH,dI,dJ,dK,ab,dL,dM) = { | |
524 | + | let da = ba() | |
525 | + | let dn = fromBase58String(da[q]) | |
526 | + | let dN = da[r] | |
527 | + | let dO = da[s] | |
528 | + | let dP = da[v] | |
529 | + | let dQ = da[w] | |
530 | + | let db = parseIntValue(da[t]) | |
531 | + | let dc = parseIntValue(da[u]) | |
532 | + | let dq = da[p] | |
533 | + | let dr = valueOrErrorMessage(assetInfo(dn), (("Asset " + toBase58String(dn)) + " doesn't exist")).quantity | |
534 | + | let dR = toBase58String(valueOrElse(dI, fromBase58String("WAVES"))) | |
535 | + | let dS = toBase58String(valueOrElse(dK, fromBase58String("WAVES"))) | |
536 | + | if (if ((dN != dR)) | |
537 | + | then true | |
538 | + | else (dO != dS)) | |
539 | + | then throw("Invalid amt or price asset passed.") | |
540 | + | else { | |
541 | + | let ds = if (dL) | |
542 | + | then bJ(dN) | |
543 | + | else (bJ(dN) - dH) | |
544 | + | let du = if (dL) | |
545 | + | then bJ(dO) | |
546 | + | else (bJ(dO) - dJ) | |
547 | + | let dT = D(dH, db) | |
548 | + | let dU = D(dJ, dc) | |
549 | + | let dV = bM(dU, dT) | |
550 | + | let dt = D(ds, db) | |
551 | + | let dv = D(du, dc) | |
552 | + | let dW = if ((dr == 0)) | |
553 | + | then { | |
554 | + | let dw = e | |
555 | + | let dX = e | |
556 | + | let de = pow((dT * dU), 0, toBigInt(5), 1, 0, DOWN) | |
557 | + | $Tuple5(H(de, b), H(dT, db), H(dU, dc), bM((dv + dU), (dt + dT)), dX) | |
558 | + | } | |
559 | + | else { | |
560 | + | let dw = bM(dv, dt) | |
561 | + | let dX = fraction(R((dw - dV)), d, dw) | |
562 | + | let dY = D(dG, b) | |
563 | + | if (if ((dw != e)) | |
564 | + | then (dX > dY) | |
565 | + | else false) | |
566 | + | then throw(((("Price slippage " + toString(dX)) + " exceeded the passed limit of ") + toString(dY))) | |
567 | + | else { | |
568 | + | let dz = D(dr, b) | |
569 | + | let dZ = fraction(dT, bP(dv, dt, CEILING), d, CEILING) | |
570 | + | let ea = fraction(dU, d, bP(dv, dt, FLOOR), CEILING) | |
571 | + | let eb = if ((dZ > dU)) | |
572 | + | then $Tuple2(ea, dU) | |
573 | + | else $Tuple2(dT, dZ) | |
574 | + | let ec = eb._1 | |
575 | + | let ed = eb._2 | |
576 | + | let de = fraction(dz, ed, dv, FLOOR) | |
577 | + | $Tuple5(K(de, b, FLOOR), K(ec, db, CEILING), K(ed, dc, CEILING), dw, dX) | |
578 | + | } | |
579 | + | } | |
580 | + | let ee = dW._1 | |
581 | + | let ef = dW._2 | |
582 | + | let eg = dW._3 | |
583 | + | let dx = H(dW._4, b) | |
584 | + | let eh = H(dW._5, b) | |
585 | + | if ((0 >= ee)) | |
586 | + | then throw("Invalid calculations. LP calculated is less than zero.") | |
587 | + | else { | |
588 | + | let ei = if (!(dM)) | |
589 | + | then 0 | |
590 | + | else ee | |
591 | + | let ej = (dH - ef) | |
592 | + | let ek = (dJ - eg) | |
593 | + | let el = [IntegerEntry(W(), dx), IntegerEntry(X(height, lastBlock.timestamp), dx), StringEntry(aa(ab, dk), bu(ef, eg, ei, dx, dG, eh, height, lastBlock.timestamp, ej, ek))] | |
594 | + | $Tuple13(ee, ei, dx, ds, du, dr, dn, dq, el, ej, ek, dI, dK) | |
595 | + | } | |
596 | + | } | |
597 | + | } | |
598 | + | ||
599 | + | ||
600 | + | func em (en,eo,dr) = { | |
601 | + | let ep = G(en, toBigInt(bp)) | |
602 | + | let eq = G(eo, toBigInt(bq)) | |
603 | + | let er = fraction(pow((ep * eq), 0, toBigInt(5), 1, 18, DOWN), g, dr) | |
604 | + | if ((dr == f)) | |
605 | + | then f | |
606 | + | else er | |
607 | + | } | |
608 | + | ||
609 | + | ||
610 | + | func es (et,eu,ev) = { | |
611 | + | let ew = (toBigInt(bJ(bf(bn))) - et) | |
612 | + | let ex = (toBigInt(bJ(bf(bo))) - eu) | |
613 | + | let ey = (toBigInt(value(assetInfo(bm)).quantity) - ev) | |
614 | + | let ez = em(ew, ex, ey) | |
615 | + | ez | |
616 | + | } | |
617 | + | ||
618 | + | ||
619 | + | func eA (eB,eC,ev) = { | |
620 | + | let ew = (bJ(bf(bn)) + eB) | |
621 | + | let ex = (bJ(bf(bo)) + eC) | |
622 | + | let ey = (value(assetInfo(bm)).quantity + ev) | |
623 | + | let er = em(toBigInt(ew), toBigInt(ex), toBigInt(ey)) | |
624 | + | let eD = [IntegerEntry(ak, height), StringEntry(aj, toString(er))] | |
625 | + | $Tuple2(eD, er) | |
626 | + | } | |
627 | + | ||
628 | + | ||
629 | + | func eE (eF,er) = if ((er >= eF)) | |
630 | + | then true | |
631 | + | else aQ(makeString(["updated KLp lower than current KLp", toString(eF), toString(er)], " ")) | |
632 | + | ||
633 | + | ||
634 | + | func eG (eH) = { | |
635 | + | let ew = bJ(bf(bn)) | |
636 | + | let ex = bJ(bf(bo)) | |
637 | + | let eI = eH.amount | |
638 | + | let eJ = fraction(eH.amount, eH.price, b, FLOOR) | |
639 | + | let eK = if ((eH.orderType == Buy)) | |
640 | + | then $Tuple2(eI, -(eJ)) | |
641 | + | else $Tuple2(-(eI), eJ) | |
642 | + | let eB = eK._1 | |
643 | + | let eC = eK._2 | |
644 | + | if (if (if (aY()) | |
645 | + | then true | |
646 | + | else (bl == m)) | |
647 | + | then true | |
648 | + | else (bl == n)) | |
649 | + | then throw("Exchange operations disabled") | |
650 | + | else if (if ((eH.assetPair.amountAsset != bn)) | |
651 | + | then true | |
652 | + | else (eH.assetPair.priceAsset != bo)) | |
653 | + | then throw("Wrong order assets.") | |
654 | + | else { | |
655 | + | let eL = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, aj), "0")), aS("invalid kLp")) | |
656 | + | let eM = eA(eB, eC, 0) | |
657 | + | let eN = eM._1 | |
658 | + | let eO = eM._2 | |
659 | + | let eP = (eO >= eL) | |
660 | + | let eQ = makeString(["kLp=", toString(eL), " kLpNew=", toString(eO), " amountAssetBalance=", toString(ew), " priceAssetBalance=", toString(ex), " amountAssetBalanceDelta=", toString(eB), " priceAssetBalanceDelta=", toString(eC), " height=", toString(height)], "") | |
661 | + | $Tuple2(eP, eQ) | |
662 | + | } | |
663 | + | } | |
664 | + | ||
665 | + | ||
666 | + | func eR (eS) = if ((size(eS.payments) != 1)) | |
667 | + | then throw("exactly 1 payment is expected") | |
668 | + | else { | |
669 | + | let eT = value(eS.payments[0]) | |
670 | + | let dl = value(eT.assetId) | |
671 | + | let eU = eT.amount | |
672 | + | let dW = dj(toBase58String(eS.transactionId), toBase58String(dl), eU, eS.caller) | |
673 | + | let dC = dW._1 | |
674 | + | let dD = dW._2 | |
675 | + | let dq = parseIntValue(dW._9) | |
676 | + | let dE = dW._10 | |
677 | + | if (if (aY()) | |
678 | + | then true | |
679 | + | else (dq == n)) | |
680 | + | then throw(("Get operation is blocked by admin. Status = " + toString(dq))) | |
681 | + | else $Tuple5(dC, dD, eU, dl, dE) | |
682 | + | } | |
683 | + | ||
684 | + | ||
685 | + | func eV (eS,dG,dM) = if ((size(eS.payments) != 2)) | |
686 | + | then throw("exactly 2 payments are expected") | |
687 | + | else { | |
688 | + | let eW = value(eS.payments[0]) | |
689 | + | let eX = value(eS.payments[1]) | |
690 | + | let eY = dF(toBase58String(eS.transactionId), dG, eW.amount, eW.assetId, eX.amount, eX.assetId, toString(eS.caller), false, dM) | |
691 | + | let dq = parseIntValue(eY._8) | |
692 | + | if (if (if (aY()) | |
693 | + | then true | |
694 | + | else (dq == l)) | |
695 | + | then true | |
696 | + | else (dq == n)) | |
697 | + | then throw(("Put operation is blocked by admin. Status = " + toString(dq))) | |
698 | + | else eY | |
699 | + | } | |
700 | + | ||
701 | + | ||
702 | + | func eZ (bW) = { | |
703 | + | let fa = invoke(aT, "emit", [bW], nil) | |
704 | + | if ((fa == fa)) | |
705 | + | then { | |
706 | + | let fb = { | |
707 | + | let bT = fa | |
708 | + | if ($isInstanceOf(bT, "Address")) | |
709 | + | then { | |
710 | + | let fc = bT | |
711 | + | invoke(fc, "emit", [bW], nil) | |
712 | + | } | |
713 | + | else unit | |
714 | + | } | |
715 | + | if ((fb == fb)) | |
716 | + | then bW | |
717 | + | else throw("Strict value is not equal to itself.") | |
718 | + | } | |
719 | + | else throw("Strict value is not equal to itself.") | |
720 | + | } | |
721 | + | ||
722 | + | ||
723 | + | func fd (bW,ai) = { | |
724 | + | let fe = if ((ai == 0)) | |
725 | + | then 0 | |
726 | + | else fraction(bW, ai, b) | |
727 | + | $Tuple2((bW - fe), fe) | |
728 | + | } | |
729 | + | ||
730 | + | ||
731 | + | func ff (fg,fh,ab,ac) = { | |
732 | + | let fi = (ac == unit) | |
733 | + | let fj = bJ(bf(bn)) | |
734 | + | let fk = bJ(bf(bo)) | |
735 | + | let fl = if ((fh == bn)) | |
736 | + | then true | |
737 | + | else if ((fh == bo)) | |
738 | + | then false | |
739 | + | else aQ("invalid asset") | |
740 | + | let fm = if (fi) | |
741 | + | then $Tuple2(fj, fk) | |
742 | + | else if (fl) | |
743 | + | then $Tuple2((fj - fg), fk) | |
744 | + | else $Tuple2(fj, (fk - fg)) | |
745 | + | let fn = fm._1 | |
746 | + | let fo = fm._2 | |
747 | + | let fp = if (fl) | |
748 | + | then $Tuple2(fg, 0) | |
749 | + | else $Tuple2(0, fg) | |
750 | + | let fq = fp._1 | |
751 | + | let fr = fp._2 | |
752 | + | let eI = fd(fq, aV)._1 | |
753 | + | let eJ = fd(fr, aV)._1 | |
754 | + | let fs = fd(fg, aV) | |
755 | + | let ft = fs._1 | |
756 | + | let fe = fs._2 | |
757 | + | let fu = (fn + eI) | |
758 | + | let fv = (fo + eJ) | |
759 | + | let fw = bM(D(fv, bq), D(fu, bp)) | |
760 | + | let fx = H(fw, b) | |
761 | + | let fy = if (fl) | |
762 | + | then fn | |
763 | + | else fo | |
764 | + | let fz = toBigInt(fy) | |
765 | + | let fA = toBigInt(valueOrErrorMessage(assetInfo(bm), (("asset " + toBase58String(bm)) + " doesn't exist")).quantity) | |
766 | + | let fB = if ((fA > f)) | |
767 | + | then true | |
768 | + | else aQ("initial deposit requires all coins") | |
769 | + | if ((fB == fB)) | |
770 | + | then { | |
771 | + | let fC = toBigInt(ft) | |
772 | + | let fD = max([0, toInt(((fA * (sqrtBigInt((d + ((fC * d) / fz)), 18, 18, DOWN) - d)) / d))]) | |
773 | + | let el = if (fi) | |
774 | + | then nil | |
775 | + | else [IntegerEntry(W(), fx), IntegerEntry(X(height, lastBlock.timestamp), fx), StringEntry(aa(toString(value(ab)), toBase58String(value(ac))), bu(fq, fr, fD, fx, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
776 | + | let fE = bM(D(fo, bq), D(fn, bp)) | |
777 | + | let fF = H(fE, b) | |
778 | + | let fG = { | |
779 | + | let fH = if (fl) | |
780 | + | then $Tuple2(fq, fn) | |
781 | + | else $Tuple2(fr, fo) | |
782 | + | let bW = fH._1 | |
783 | + | let fI = fH._2 | |
784 | + | let fJ = toInt(fraction(fA, toBigInt((bW / 2)), toBigInt(fI))) | |
785 | + | fraction((fD - fJ), b, fJ) | |
786 | + | } | |
787 | + | $Tuple5(fD, el, fe, fG, fl) | |
788 | + | } | |
789 | + | else throw("Strict value is not equal to itself.") | |
790 | + | } | |
791 | + | ||
792 | + | ||
793 | + | func fK (fL,ft,fh,ab,ac) = { | |
794 | + | let fi = (ac == unit) | |
795 | + | let da = ba() | |
796 | + | let db = parseIntValue(da[t]) | |
797 | + | let dc = parseIntValue(da[u]) | |
798 | + | let fM = [if ((fh == bm)) | |
799 | + | then true | |
800 | + | else aQ("invalid lp asset")] | |
801 | + | if ((fM == fM)) | |
802 | + | then { | |
803 | + | let fN = if ((fL == bn)) | |
804 | + | then true | |
805 | + | else if ((fL == bo)) | |
806 | + | then false | |
807 | + | else aQ("invalid asset") | |
808 | + | let fO = if (fN) | |
809 | + | then toBigInt(bJ(bf(bn))) | |
810 | + | else toBigInt(bJ(bf(bo))) | |
811 | + | let fP = if (fN) | |
812 | + | then db | |
813 | + | else dc | |
814 | + | let fQ = bJ(bf(bn)) | |
815 | + | let fR = bJ(bf(bo)) | |
816 | + | let fS = if (fN) | |
817 | + | then fQ | |
818 | + | else fR | |
819 | + | let fT = toBigInt(fS) | |
820 | + | let fA = toBigInt(valueOrErrorMessage(assetInfo(bm), (("asset " + toBase58String(bm)) + " doesn't exist")).quantity) | |
821 | + | let fU = toBigInt(ft) | |
822 | + | let fV = max([0, toInt(((fO * (d - pow((d - ((fU * d) / fA)), 18, h, 0, 18, DOWN))) / d))]) | |
823 | + | let fW = fd(fV, aX) | |
824 | + | let fX = fW._1 | |
825 | + | let fe = fW._2 | |
826 | + | let fY = if (fN) | |
827 | + | then $Tuple4(fX, 0, (fQ - fV), fR) | |
828 | + | else $Tuple4(0, fX, fQ, (fR - fV)) | |
829 | + | let fZ = fY._1 | |
830 | + | let ga = fY._2 | |
831 | + | let gb = fY._3 | |
832 | + | let gc = fY._4 | |
833 | + | let fw = bM(D(gc, bq), D(gb, bp)) | |
834 | + | let fx = H(fw, b) | |
835 | + | let el = if (fi) | |
836 | + | then nil | |
837 | + | else [StringEntry(ad(toString(value(ab)), toBase58String(value(ac))), bF(fZ, ga, ft, fx, height, lastBlock.timestamp)), IntegerEntry(W(), fx), IntegerEntry(X(height, lastBlock.timestamp), fx)] | |
838 | + | let fE = bM(D(fR, bq), D(fQ, bp)) | |
839 | + | let fF = H(fE, b) | |
840 | + | let fG = { | |
841 | + | let gd = (toInt(fraction(fO, fU, fA)) * 2) | |
842 | + | fraction((fX - gd), b, gd) | |
843 | + | } | |
844 | + | $Tuple5(fX, el, fe, fG, fN) | |
845 | + | } | |
846 | + | else throw("Strict value is not equal to itself.") | |
847 | + | } | |
848 | + | ||
849 | + | ||
850 | + | func ge () = { | |
851 | + | let bT = getString(U()) | |
852 | + | if ($isInstanceOf(bT, "String")) | |
853 | + | then { | |
854 | + | let gf = bT | |
855 | + | fromBase58String(gf) | |
856 | + | } | |
857 | + | else if ($isInstanceOf(bT, "Unit")) | |
660 | 858 | then unit | |
661 | 859 | else throw("Match error") | |
662 | 860 | } | |
663 | 861 | ||
664 | 862 | ||
665 | - | func | |
666 | - | let | |
667 | - | if ($isInstanceOf( | |
863 | + | func gg () = { | |
864 | + | let bT = getString(V()) | |
865 | + | if ($isInstanceOf(bT, "String")) | |
668 | 866 | then { | |
669 | - | let | |
670 | - | fromBase58String( | |
867 | + | let gf = bT | |
868 | + | fromBase58String(gf) | |
671 | 869 | } | |
672 | - | else if ($isInstanceOf( | |
870 | + | else if ($isInstanceOf(bT, "Unit")) | |
673 | 871 | then unit | |
674 | 872 | else throw("Match error") | |
675 | 873 | } | |
676 | 874 | ||
677 | 875 | ||
678 | - | func | |
679 | - | let | |
680 | - | if ($isInstanceOf( | |
876 | + | func gh (eS) = { | |
877 | + | let bT = ge() | |
878 | + | if ($isInstanceOf(bT, "ByteVector")) | |
681 | 879 | then { | |
682 | - | let | |
683 | - | ( | |
880 | + | let gi = bT | |
881 | + | (eS.callerPublicKey == gi) | |
684 | 882 | } | |
685 | - | else if ($isInstanceOf( | |
686 | - | then ( | |
883 | + | else if ($isInstanceOf(bT, "Unit")) | |
884 | + | then (eS.caller == this) | |
687 | 885 | else throw("Match error") | |
688 | 886 | } | |
689 | 887 | ||
690 | 888 | ||
691 | - | func | |
692 | - | let | |
693 | - | let | |
694 | - | if ($isInstanceOf( | |
889 | + | func gj (eS) = { | |
890 | + | let gk = throw("Permission denied") | |
891 | + | let bT = ge() | |
892 | + | if ($isInstanceOf(bT, "ByteVector")) | |
695 | 893 | then { | |
696 | - | let | |
697 | - | if (( | |
894 | + | let gi = bT | |
895 | + | if ((eS.callerPublicKey == gi)) | |
698 | 896 | then true | |
699 | - | else | |
897 | + | else gk | |
700 | 898 | } | |
701 | - | else if ($isInstanceOf( | |
702 | - | then if (( | |
899 | + | else if ($isInstanceOf(bT, "Unit")) | |
900 | + | then if ((eS.caller == this)) | |
703 | 901 | then true | |
704 | - | else | |
902 | + | else gk | |
705 | 903 | else throw("Match error") | |
706 | 904 | } | |
707 | 905 | ||
708 | 906 | ||
709 | - | @Callable(dL) | |
710 | - | func calculateAmountOutForSwapREADONLY (fg,fh,fi) = { | |
711 | - | let fj = if ((fh == false)) | |
907 | + | @Callable(eS) | |
908 | + | func rebalance () = (cA(aM(this, ae())) ++ cA(aM(this, af()))) | |
909 | + | ||
910 | + | ||
911 | + | ||
912 | + | @Callable(eS) | |
913 | + | func calculateAmountOutForSwapREADONLY (gl,gm,gn) = { | |
914 | + | let go = if ((gm == false)) | |
712 | 915 | then { | |
713 | - | let | |
714 | - | let | |
715 | - | $Tuple2( | |
916 | + | let gp = aM(this, af()) | |
917 | + | let gq = aM(this, ae()) | |
918 | + | $Tuple2(gp, gq) | |
716 | 919 | } | |
717 | 920 | else { | |
718 | - | let | |
719 | - | let | |
720 | - | $Tuple2( | |
921 | + | let gp = aM(this, ae()) | |
922 | + | let gq = aM(this, af()) | |
923 | + | $Tuple2(gp, gq) | |
721 | 924 | } | |
722 | - | let | |
723 | - | let | |
724 | - | let | |
725 | - | let | |
726 | - | let | |
727 | - | let | |
728 | - | let | |
729 | - | let | |
925 | + | let gp = go._1 | |
926 | + | let gq = go._2 | |
927 | + | let gr = bJ(gq) | |
928 | + | let gs = bJ(gp) | |
929 | + | let gt = fraction(gs, gl, (gr + gl)) | |
930 | + | let gu = (toBigInt(gr) * toBigInt(gs)) | |
931 | + | let gv = (((toBigInt(bJ(gq)) + toBigInt(gl)) + toBigInt(gn)) * (toBigInt(bJ(gp)) - toBigInt(gt))) | |
932 | + | let gw = if ((gv >= gu)) | |
730 | 933 | then true | |
731 | 934 | else throw("new K is fewer error") | |
732 | - | if (( | |
733 | - | then $Tuple2(nil, | |
935 | + | if ((gw == gw)) | |
936 | + | then $Tuple2(nil, gt) | |
734 | 937 | else throw("Strict value is not equal to itself.") | |
735 | 938 | } | |
736 | 939 | ||
737 | 940 | ||
738 | 941 | ||
739 | - | @Callable( | |
740 | - | func calculateAmountOutForSwapAndSendTokens ( | |
741 | - | let | |
742 | - | let | |
743 | - | if ($isInstanceOf( | |
744 | - | then | |
745 | - | else throw(($getType( | |
942 | + | @Callable(eS) | |
943 | + | func calculateAmountOutForSwapAndSendTokens (gl,gm,gx,gy,gn) = { | |
944 | + | let gz = { | |
945 | + | let aW = invoke(aT, "getSwapContractREADONLY", nil, nil) | |
946 | + | if ($isInstanceOf(aW, "String")) | |
947 | + | then aW | |
948 | + | else throw(($getType(aW) + " couldn't be cast to String")) | |
746 | 949 | } | |
747 | - | let | |
950 | + | let fM = [if ((value(eS.payments[0]).amount >= gl)) | |
748 | 951 | then true | |
749 | - | else | |
952 | + | else aQ("Wrong amount"), if ((eS.caller == addressFromStringValue(gz))) | |
750 | 953 | then true | |
751 | - | else | |
752 | - | if (( | |
954 | + | else aQ("Permission denied")] | |
955 | + | if ((fM == fM)) | |
753 | 956 | then { | |
754 | - | let | |
755 | - | let | |
756 | - | let | |
757 | - | then | |
758 | - | else | |
759 | - | let | |
760 | - | let | |
761 | - | let | |
762 | - | let | |
763 | - | let | |
764 | - | let | |
957 | + | let eT = value(eS.payments[0]) | |
958 | + | let gq = bf(eT.assetId) | |
959 | + | let gp = if ((gm == false)) | |
960 | + | then aM(this, af()) | |
961 | + | else aM(this, ae()) | |
962 | + | let gr = (bJ(gq) - value(eS.payments[0]).amount) | |
963 | + | let gs = bJ(gp) | |
964 | + | let gt = fraction(gs, gl, (gr + gl)) | |
965 | + | let gu = (toBigInt(gr) * toBigInt(gs)) | |
966 | + | let gv = ((toBigInt(bJ(gq)) + toBigInt(gn)) * (toBigInt(bJ(gp)) - toBigInt(gt))) | |
967 | + | let gw = if ((gv >= gu)) | |
765 | 968 | then true | |
766 | 969 | else throw("new K is fewer error") | |
767 | - | if (( | |
970 | + | if ((gw == gw)) | |
768 | 971 | then { | |
769 | - | let | |
972 | + | let gA = if ((gt >= gx)) | |
770 | 973 | then true | |
771 | 974 | else throw("Exchange result is fewer coins than expected") | |
772 | - | if ((fv == fv)) | |
773 | - | then $Tuple2([ScriptTransfer(addressFromStringValue(ft), fo, aY(fk))], fo) | |
975 | + | if ((gA == gA)) | |
976 | + | then { | |
977 | + | let gB = cA(gq) | |
978 | + | if ((gB == gB)) | |
979 | + | then { | |
980 | + | let gC = cH(gp, gt) | |
981 | + | if ((gC == gC)) | |
982 | + | then $Tuple2(((gC ++ gB) ++ [ScriptTransfer(addressFromStringValue(gy), gt, bd(gp))]), gt) | |
983 | + | else throw("Strict value is not equal to itself.") | |
984 | + | } | |
985 | + | else throw("Strict value is not equal to itself.") | |
986 | + | } | |
774 | 987 | else throw("Strict value is not equal to itself.") | |
775 | 988 | } | |
776 | 989 | else throw("Strict value is not equal to itself.") | |
777 | 990 | } | |
778 | 991 | else throw("Strict value is not equal to itself.") | |
779 | 992 | } | |
780 | 993 | ||
781 | 994 | ||
782 | 995 | ||
783 | - | @Callable( | |
784 | - | func setManager ( | |
785 | - | let | |
786 | - | if (( | |
996 | + | @Callable(eS) | |
997 | + | func setManager (gD) = { | |
998 | + | let gE = gj(eS) | |
999 | + | if ((gE == gE)) | |
787 | 1000 | then { | |
788 | - | let | |
789 | - | if (( | |
790 | - | then [StringEntry(V(), | |
1001 | + | let gF = fromBase58String(gD) | |
1002 | + | if ((gF == gF)) | |
1003 | + | then [StringEntry(V(), gD)] | |
791 | 1004 | else throw("Strict value is not equal to itself.") | |
792 | 1005 | } | |
793 | 1006 | else throw("Strict value is not equal to itself.") | |
794 | 1007 | } | |
795 | 1008 | ||
796 | 1009 | ||
797 | 1010 | ||
798 | - | @Callable( | |
1011 | + | @Callable(eS) | |
799 | 1012 | func confirmManager () = { | |
800 | - | let | |
801 | - | let | |
1013 | + | let gG = gg() | |
1014 | + | let gH = if (isDefined(gG)) | |
802 | 1015 | then true | |
803 | 1016 | else throw("No pending manager") | |
804 | - | if (( | |
1017 | + | if ((gH == gH)) | |
805 | 1018 | then { | |
806 | - | let | |
1019 | + | let gI = if ((eS.callerPublicKey == value(gG))) | |
807 | 1020 | then true | |
808 | 1021 | else throw("You are not pending manager") | |
809 | - | if (( | |
810 | - | then [StringEntry(U(), toBase58String(value( | |
1022 | + | if ((gI == gI)) | |
1023 | + | then [StringEntry(U(), toBase58String(value(gG))), DeleteEntry(V())] | |
811 | 1024 | else throw("Strict value is not equal to itself.") | |
812 | 1025 | } | |
813 | 1026 | else throw("Strict value is not equal to itself.") | |
814 | 1027 | } | |
815 | 1028 | ||
816 | 1029 | ||
817 | 1030 | ||
818 | - | @Callable( | |
819 | - | func put ( | |
1031 | + | @Callable(eS) | |
1032 | + | func put (dG,gJ) = if ((0 > dG)) | |
820 | 1033 | then throw("Invalid slippageTolerance passed") | |
821 | 1034 | else { | |
822 | - | let | |
823 | - | let | |
824 | - | let | |
825 | - | let | |
826 | - | let | |
827 | - | let | |
828 | - | let | |
829 | - | let | |
830 | - | let | |
831 | - | let | |
832 | - | let | |
833 | - | if (( | |
1035 | + | let eY = eV(eS, dG, true) | |
1036 | + | let ei = eY._2 | |
1037 | + | let dn = eY._7 | |
1038 | + | let dE = eY._9 | |
1039 | + | let ej = eY._10 | |
1040 | + | let ek = eY._11 | |
1041 | + | let gK = eY._12 | |
1042 | + | let gL = eY._13 | |
1043 | + | let eW = toBigInt(value(eS.payments[0]).amount) | |
1044 | + | let eX = toBigInt(value(eS.payments[1]).amount) | |
1045 | + | let ez = es(eW, eX, toBigInt(0)) | |
1046 | + | if ((ez == ez)) | |
834 | 1047 | then { | |
835 | - | let | |
836 | - | if (( | |
1048 | + | let fa = invoke(aT, "emit", [ei], nil) | |
1049 | + | if ((fa == fa)) | |
837 | 1050 | then { | |
838 | - | let | |
839 | - | let | |
840 | - | if ($isInstanceOf( | |
1051 | + | let fb = { | |
1052 | + | let bT = fa | |
1053 | + | if ($isInstanceOf(bT, "Address")) | |
841 | 1054 | then { | |
842 | - | let | |
843 | - | invoke( | |
1055 | + | let fc = bT | |
1056 | + | invoke(fc, "emit", [ei], nil) | |
844 | 1057 | } | |
845 | 1058 | else unit | |
846 | 1059 | } | |
847 | - | if (( | |
1060 | + | if ((fb == fb)) | |
848 | 1061 | then { | |
849 | - | let | |
850 | - | then invoke( | |
1062 | + | let gM = if ((ej > 0)) | |
1063 | + | then invoke(bt, "put", nil, [AttachedPayment(gK, ej)]) | |
851 | 1064 | else nil | |
852 | - | if (( | |
1065 | + | if ((gM == gM)) | |
853 | 1066 | then { | |
854 | - | let | |
855 | - | then invoke( | |
1067 | + | let gN = if ((ek > 0)) | |
1068 | + | then invoke(bt, "put", nil, [AttachedPayment(gL, ek)]) | |
856 | 1069 | else nil | |
857 | - | if (( | |
1070 | + | if ((gN == gN)) | |
858 | 1071 | then { | |
859 | - | let | |
1072 | + | let gO = if (gJ) | |
860 | 1073 | then { | |
861 | - | let | |
862 | - | if (( | |
1074 | + | let gP = invoke(bs, "stake", nil, [AttachedPayment(dn, ei)]) | |
1075 | + | if ((gP == gP)) | |
863 | 1076 | then nil | |
864 | 1077 | else throw("Strict value is not equal to itself.") | |
865 | 1078 | } | |
866 | - | else [ScriptTransfer( | |
867 | - | let | |
868 | - | if (( | |
1079 | + | else [ScriptTransfer(eS.caller, ei, dn)] | |
1080 | + | let gQ = eA(0, 0, 0) | |
1081 | + | if ((gQ == gQ)) | |
869 | 1082 | then { | |
870 | - | let dk = fJ._2 | |
871 | - | let fK = fJ._1 | |
872 | - | let fL = dx(ds, dk) | |
873 | - | if ((fL == fL)) | |
874 | - | then ((cx ++ fH) ++ fK) | |
1083 | + | let er = gQ._2 | |
1084 | + | let gR = gQ._1 | |
1085 | + | let gS = eE(ez, er) | |
1086 | + | if ((gS == gS)) | |
1087 | + | then { | |
1088 | + | let gT = invoke(this, "rebalance", nil, nil) | |
1089 | + | if ((gT == gT)) | |
1090 | + | then ((dE ++ gO) ++ gR) | |
1091 | + | else throw("Strict value is not equal to itself.") | |
1092 | + | } | |
875 | 1093 | else throw("Strict value is not equal to itself.") | |
876 | 1094 | } | |
877 | 1095 | else throw("Strict value is not equal to itself.") | |
878 | 1096 | } | |
879 | 1097 | else throw("Strict value is not equal to itself.") | |
880 | 1098 | } | |
881 | 1099 | else throw("Strict value is not equal to itself.") | |
882 | 1100 | } | |
883 | 1101 | else throw("Strict value is not equal to itself.") | |
884 | 1102 | } | |
885 | 1103 | else throw("Strict value is not equal to itself.") | |
886 | 1104 | } | |
887 | 1105 | else throw("Strict value is not equal to itself.") | |
888 | 1106 | } | |
889 | 1107 | ||
890 | 1108 | ||
891 | 1109 | ||
892 | - | @Callable( | |
893 | - | func putForFree ( | |
1110 | + | @Callable(eS) | |
1111 | + | func putForFree (gU) = if ((0 > gU)) | |
894 | 1112 | then throw("Invalid value passed") | |
895 | 1113 | else { | |
896 | - | let | |
897 | - | let | |
898 | - | let | |
899 | - | let | |
900 | - | let | |
901 | - | if (( | |
1114 | + | let eY = eV(eS, gU, false) | |
1115 | + | let dE = eY._9 | |
1116 | + | let eW = toBigInt(value(eS.payments[0]).amount) | |
1117 | + | let eX = toBigInt(value(eS.payments[1]).amount) | |
1118 | + | let ez = es(eW, eX, toBigInt(0)) | |
1119 | + | if ((ez == ez)) | |
902 | 1120 | then { | |
903 | - | let | |
904 | - | let | |
905 | - | let | |
906 | - | let | |
907 | - | if (( | |
908 | - | then ( | |
1121 | + | let gV = eA(0, 0, 0) | |
1122 | + | let gR = gV._1 | |
1123 | + | let er = gV._2 | |
1124 | + | let gS = eE(ez, er) | |
1125 | + | if ((gS == gS)) | |
1126 | + | then (dE ++ gR) | |
909 | 1127 | else throw("Strict value is not equal to itself.") | |
910 | 1128 | } | |
911 | 1129 | else throw("Strict value is not equal to itself.") | |
912 | 1130 | } | |
913 | 1131 | ||
914 | 1132 | ||
915 | 1133 | ||
916 | - | @Callable( | |
917 | - | func putOneTkn ( | |
918 | - | let | |
919 | - | let | |
920 | - | if ($isInstanceOf( | |
921 | - | then | |
922 | - | else throw(($getType( | |
1134 | + | @Callable(eS) | |
1135 | + | func putOneTkn (gW,gX) = { | |
1136 | + | let gY = { | |
1137 | + | let aW = invoke(aT, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1138 | + | if ($isInstanceOf(aW, "Boolean")) | |
1139 | + | then aW | |
1140 | + | else throw(($getType(aW) + " couldn't be cast to Boolean")) | |
923 | 1141 | } | |
924 | - | let | |
1142 | + | let gZ = if (if (if (aY()) | |
925 | 1143 | then true | |
926 | - | else ( | |
1144 | + | else (bl == l)) | |
927 | 1145 | then true | |
928 | - | else ( | |
1146 | + | else (bl == n)) | |
929 | 1147 | then true | |
930 | - | else | |
931 | - | let | |
1148 | + | else gY | |
1149 | + | let fM = [if (if (!(gZ)) | |
932 | 1150 | then true | |
933 | - | else | |
1151 | + | else gh(eS)) | |
934 | 1152 | then true | |
935 | - | else | |
1153 | + | else aQ("put operation is blocked by admin"), if ((size(eS.payments) == 1)) | |
936 | 1154 | then true | |
937 | - | else | |
938 | - | if (( | |
1155 | + | else aQ("exactly 1 payment are expected")] | |
1156 | + | if ((fM == fM)) | |
939 | 1157 | then { | |
940 | - | let | |
941 | - | let | |
942 | - | let | |
943 | - | let | |
944 | - | then | |
945 | - | else if (( | |
946 | - | then | |
947 | - | else | |
948 | - | if (( | |
1158 | + | let ha = eS.payments[0] | |
1159 | + | let fh = ha.assetId | |
1160 | + | let fg = ha.amount | |
1161 | + | let ez = if ((fh == bn)) | |
1162 | + | then es(toBigInt(fg), toBigInt(0), toBigInt(0)) | |
1163 | + | else if ((fh == bo)) | |
1164 | + | then es(toBigInt(0), toBigInt(fg), toBigInt(0)) | |
1165 | + | else aQ("payment asset is not supported") | |
1166 | + | if ((ez == ez)) | |
949 | 1167 | then { | |
950 | - | let ab = | |
951 | - | let ac = | |
952 | - | let | |
953 | - | if (( | |
1168 | + | let ab = eS.caller | |
1169 | + | let ac = eS.transactionId | |
1170 | + | let hb = ff(fg, fh, ab, ac) | |
1171 | + | if ((hb == hb)) | |
954 | 1172 | then { | |
955 | - | let | |
956 | - | let | |
957 | - | let | |
958 | - | let | |
959 | - | let | |
960 | - | let | |
961 | - | then ( | |
1173 | + | let fl = hb._5 | |
1174 | + | let hc = hb._4 | |
1175 | + | let fe = hb._3 | |
1176 | + | let el = hb._2 | |
1177 | + | let hd = hb._1 | |
1178 | + | let he = if (if ((gW > 0)) | |
1179 | + | then (gW > hd) | |
962 | 1180 | else false) | |
963 | - | then | |
964 | - | else | |
965 | - | let | |
966 | - | if (( | |
1181 | + | then aQ(makeString(["amount to receive is less than ", toString(gW)], "")) | |
1182 | + | else hd | |
1183 | + | let fa = eZ(he) | |
1184 | + | if ((fa == fa)) | |
967 | 1185 | then { | |
968 | - | let | |
1186 | + | let gO = if (gX) | |
969 | 1187 | then { | |
970 | - | let | |
971 | - | if (( | |
1188 | + | let hf = invoke(bs, "stake", nil, [AttachedPayment(bm, he)]) | |
1189 | + | if ((hf == hf)) | |
972 | 1190 | then nil | |
973 | 1191 | else throw("Strict value is not equal to itself.") | |
974 | 1192 | } | |
975 | - | else [ScriptTransfer( | |
976 | - | let | |
977 | - | then [ScriptTransfer( | |
1193 | + | else [ScriptTransfer(eS.caller, he, bm)] | |
1194 | + | let hg = if ((fe > 0)) | |
1195 | + | then [ScriptTransfer(aU, fe, fh)] | |
978 | 1196 | else nil | |
979 | - | let | |
1197 | + | let hh = if ((this == aU)) | |
980 | 1198 | then $Tuple2(0, 0) | |
981 | - | else if (eg) | |
982 | - | then $Tuple2(-(dZ), 0) | |
983 | - | else $Tuple2(0, -(dZ)) | |
984 | - | let du = fZ._1 | |
985 | - | let dv = fZ._2 | |
986 | - | let ga = dt(du, dv, 0) | |
987 | - | let fK = ga._1 | |
988 | - | let dk = ga._2 | |
989 | - | let dE = value(getString(aj)) | |
990 | - | let fL = dx(ds, dk) | |
991 | - | if ((fL == fL)) | |
992 | - | then $Tuple2((((de ++ fH) ++ fY) ++ fK), fW) | |
993 | - | else throw("Strict value is not equal to itself.") | |
994 | - | } | |
995 | - | else throw("Strict value is not equal to itself.") | |
996 | - | } | |
997 | - | else throw("Strict value is not equal to itself.") | |
998 | - | } | |
999 | - | else throw("Strict value is not equal to itself.") | |
1000 | - | } | |
1001 | - | else throw("Strict value is not equal to itself.") | |
1002 | - | } | |
1003 | - | ||
1004 | - | ||
1005 | - | ||
1006 | - | @Callable(dL) | |
1007 | - | func putOneTknREADONLY (ec,eb) = { | |
1008 | - | let gb = ea(eb, aY(ec), unit, unit) | |
1009 | - | let fV = gb._1 | |
1010 | - | let de = gb._2 | |
1011 | - | let dZ = gb._3 | |
1012 | - | let fU = gb._4 | |
1013 | - | let eg = gb._5 | |
1014 | - | $Tuple2(nil, $Tuple3(fV, dZ, fU)) | |
1015 | - | } | |
1016 | - | ||
1017 | - | ||
1018 | - | ||
1019 | - | @Callable(dL) | |
1020 | - | func getOneTkn (gc,fO) = { | |
1021 | - | let fQ = { | |
1022 | - | let aR = invoke(aO, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1023 | - | if ($isInstanceOf(aR, "Boolean")) | |
1024 | - | then aR | |
1025 | - | else throw(($getType(aR) + " couldn't be cast to Boolean")) | |
1026 | - | } | |
1027 | - | let gd = if (if (aT()) | |
1028 | - | then true | |
1029 | - | else (bg == n)) | |
1030 | - | then true | |
1031 | - | else fQ | |
1032 | - | let eH = [if (if (!(gd)) | |
1033 | - | then true | |
1034 | - | else fc(dL)) | |
1035 | - | then true | |
1036 | - | else aL("get operation is blocked by admin"), if ((size(dL.payments) == 1)) | |
1037 | - | then true | |
1038 | - | else aL("exactly 1 payment are expected")] | |
1039 | - | if ((eH == eH)) | |
1040 | - | then { | |
1041 | - | let eG = aY(gc) | |
1042 | - | let fS = dL.payments[0] | |
1043 | - | let ec = fS.assetId | |
1044 | - | let eo = fS.amount | |
1045 | - | let ds = dl(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1046 | - | if ((ds == ds)) | |
1047 | - | then { | |
1048 | - | let ab = dL.caller | |
1049 | - | let ac = dL.transactionId | |
1050 | - | let ge = eF(eG, eo, ec, ab, ac) | |
1051 | - | if ((ge == ge)) | |
1052 | - | then { | |
1053 | - | let eI = ge._5 | |
1054 | - | let fU = ge._4 | |
1055 | - | let dZ = ge._3 | |
1056 | - | let de = ge._2 | |
1057 | - | let gf = ge._1 | |
1058 | - | let dT = if (if ((fO > 0)) | |
1059 | - | then (fO > gf) | |
1060 | - | else false) | |
1061 | - | then aL(makeString(["amount to receive is less than ", toString(fO)], "")) | |
1062 | - | else gf | |
1063 | - | let gg = invoke(aO, "burn", [eo], [AttachedPayment(ec, eo)]) | |
1064 | - | if ((gg == gg)) | |
1065 | - | then { | |
1066 | - | let gh = [ScriptTransfer(ab, dT, eG)] | |
1067 | - | let fY = if ((dZ > 0)) | |
1068 | - | then [ScriptTransfer(aP, dZ, eG)] | |
1069 | - | else nil | |
1070 | - | let gi = { | |
1071 | - | let gj = if ((this == aP)) | |
1072 | - | then 0 | |
1073 | - | else dZ | |
1074 | - | if (eI) | |
1075 | - | then $Tuple2(-((dT + gj)), 0) | |
1076 | - | else $Tuple2(0, -((dT + gj))) | |
1077 | - | } | |
1078 | - | let du = gi._1 | |
1079 | - | let dv = gi._2 | |
1080 | - | let gk = dt(du, dv, 0) | |
1081 | - | let fK = gk._1 | |
1082 | - | let dk = gk._2 | |
1083 | - | let fL = dx(ds, dk) | |
1084 | - | if ((fL == fL)) | |
1085 | - | then $Tuple2((((de ++ gh) ++ fY) ++ fK), dT) | |
1086 | - | else throw("Strict value is not equal to itself.") | |
1087 | - | } | |
1088 | - | else throw("Strict value is not equal to itself.") | |
1089 | - | } | |
1090 | - | else throw("Strict value is not equal to itself.") | |
1091 | - | } | |
1092 | - | else throw("Strict value is not equal to itself.") | |
1093 | - | } | |
1094 | - | else throw("Strict value is not equal to itself.") | |
1095 | - | } | |
1096 | - | ||
1097 | - | ||
1098 | - | ||
1099 | - | @Callable(dL) | |
1100 | - | func getOneTknREADONLY (eG,eo) = { | |
1101 | - | let gl = eF(aY(eG), eo, bh, unit, unit) | |
1102 | - | let gf = gl._1 | |
1103 | - | let de = gl._2 | |
1104 | - | let dZ = gl._3 | |
1105 | - | let fU = gl._4 | |
1106 | - | let eI = gl._5 | |
1107 | - | $Tuple2(nil, $Tuple3(gf, dZ, fU)) | |
1108 | - | } | |
1109 | - | ||
1110 | - | ||
1111 | - | ||
1112 | - | @Callable(dL) | |
1113 | - | func unstakeAndGetOneTkn (gm,gc,fO) = { | |
1114 | - | let fQ = { | |
1115 | - | let aR = invoke(aO, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1116 | - | if ($isInstanceOf(aR, "Boolean")) | |
1117 | - | then aR | |
1118 | - | else throw(($getType(aR) + " couldn't be cast to Boolean")) | |
1119 | - | } | |
1120 | - | let gd = if (if (aT()) | |
1121 | - | then true | |
1122 | - | else (bg == n)) | |
1123 | - | then true | |
1124 | - | else fQ | |
1125 | - | let eH = [if (if (!(gd)) | |
1126 | - | then true | |
1127 | - | else fc(dL)) | |
1128 | - | then true | |
1129 | - | else aL("get operation is blocked by admin"), if ((size(dL.payments) == 0)) | |
1130 | - | then true | |
1131 | - | else aL("no payments are expected")] | |
1132 | - | if ((eH == eH)) | |
1133 | - | then { | |
1134 | - | let eG = aY(gc) | |
1135 | - | let ab = dL.caller | |
1136 | - | let ac = dL.transactionId | |
1137 | - | let ds = dl(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1138 | - | if ((ds == ds)) | |
1139 | - | then { | |
1140 | - | let gn = invoke(bn, "unstake", [toBase58String(bh), gm], nil) | |
1141 | - | if ((gn == gn)) | |
1142 | - | then { | |
1143 | - | let go = eF(eG, gm, bh, ab, ac) | |
1144 | - | if ((go == go)) | |
1145 | - | then { | |
1146 | - | let eI = go._5 | |
1147 | - | let fU = go._4 | |
1148 | - | let dZ = go._3 | |
1149 | - | let de = go._2 | |
1150 | - | let gf = go._1 | |
1151 | - | let dT = if (if ((fO > 0)) | |
1152 | - | then (fO > gf) | |
1153 | - | else false) | |
1154 | - | then aL(makeString(["amount to receive is less than ", toString(fO)], "")) | |
1155 | - | else gf | |
1156 | - | let gg = invoke(aO, "burn", [gm], [AttachedPayment(bh, gm)]) | |
1157 | - | if ((gg == gg)) | |
1199 | + | else if (fl) | |
1200 | + | then $Tuple2(-(fe), 0) | |
1201 | + | else $Tuple2(0, -(fe)) | |
1202 | + | let eB = hh._1 | |
1203 | + | let eC = hh._2 | |
1204 | + | let hi = eA(eB, eC, 0) | |
1205 | + | let gR = hi._1 | |
1206 | + | let er = hi._2 | |
1207 | + | let eL = value(getString(aj)) | |
1208 | + | let gS = eE(ez, er) | |
1209 | + | if ((gS == gS)) | |
1158 | 1210 | then { | |
1159 | - | let gh = [ScriptTransfer(dL.caller, dT, eG)] | |
1160 | - | let fY = if ((dZ > 0)) | |
1161 | - | then [ScriptTransfer(aP, dZ, eG)] | |
1162 | - | else nil | |
1163 | - | let gp = { | |
1164 | - | let gj = if ((this == aP)) | |
1165 | - | then 0 | |
1166 | - | else dZ | |
1167 | - | if (eI) | |
1168 | - | then $Tuple2(-((dT + gj)), 0) | |
1169 | - | else $Tuple2(0, -((dT + gj))) | |
1170 | - | } | |
1171 | - | let du = gp._1 | |
1172 | - | let dv = gp._2 | |
1173 | - | let gq = dt(du, dv, 0) | |
1174 | - | let fK = gq._1 | |
1175 | - | let dk = gq._2 | |
1176 | - | let fL = dx(ds, dk) | |
1177 | - | if ((fL == fL)) | |
1178 | - | then $Tuple2((((de ++ gh) ++ fY) ++ fK), dT) | |
1211 | + | let gT = invoke(this, "rebalance", nil, nil) | |
1212 | + | if ((gT == gT)) | |
1213 | + | then $Tuple2((((el ++ gO) ++ hg) ++ gR), he) | |
1179 | 1214 | else throw("Strict value is not equal to itself.") | |
1180 | 1215 | } | |
1181 | 1216 | else throw("Strict value is not equal to itself.") | |
1182 | 1217 | } | |
1183 | 1218 | else throw("Strict value is not equal to itself.") | |
1184 | 1219 | } | |
1185 | 1220 | else throw("Strict value is not equal to itself.") | |
1186 | 1221 | } | |
1187 | 1222 | else throw("Strict value is not equal to itself.") | |
1188 | 1223 | } | |
1189 | 1224 | else throw("Strict value is not equal to itself.") | |
1190 | 1225 | } | |
1191 | 1226 | ||
1192 | 1227 | ||
1193 | 1228 | ||
1194 | - | @Callable(dL) | |
1195 | - | func get () = { | |
1196 | - | let cP = dK(dL) | |
1197 | - | let gr = cP._1 | |
1198 | - | let cw = cP._2 | |
1199 | - | let dN = cP._3 | |
1200 | - | let ce = cP._4 | |
1201 | - | let cx = cP._5 | |
1202 | - | let ds = dl(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1203 | - | if ((ds == ds)) | |
1229 | + | @Callable(eS) | |
1230 | + | func putOneTknREADONLY (fh,fg) = { | |
1231 | + | let hj = ff(fg, bd(fh), unit, unit) | |
1232 | + | let hd = hj._1 | |
1233 | + | let el = hj._2 | |
1234 | + | let fe = hj._3 | |
1235 | + | let hc = hj._4 | |
1236 | + | let fl = hj._5 | |
1237 | + | $Tuple2(nil, $Tuple3(hd, fe, hc)) | |
1238 | + | } | |
1239 | + | ||
1240 | + | ||
1241 | + | ||
1242 | + | @Callable(eS) | |
1243 | + | func getOneTkn (hk,gW) = { | |
1244 | + | let gY = { | |
1245 | + | let aW = invoke(aT, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1246 | + | if ($isInstanceOf(aW, "Boolean")) | |
1247 | + | then aW | |
1248 | + | else throw(($getType(aW) + " couldn't be cast to Boolean")) | |
1249 | + | } | |
1250 | + | let hl = if (if (aY()) | |
1251 | + | then true | |
1252 | + | else (bl == n)) | |
1253 | + | then true | |
1254 | + | else gY | |
1255 | + | let fM = [if (if (!(hl)) | |
1256 | + | then true | |
1257 | + | else gh(eS)) | |
1258 | + | then true | |
1259 | + | else aQ("get operation is blocked by admin"), if ((size(eS.payments) == 1)) | |
1260 | + | then true | |
1261 | + | else aQ("exactly 1 payment are expected")] | |
1262 | + | if ((fM == fM)) | |
1204 | 1263 | then { | |
1205 | - | let gs = invoke(aO, "burn", [dN], [AttachedPayment(ce, dN)]) | |
1206 | - | if ((gs == gs)) | |
1264 | + | let fL = bd(hk) | |
1265 | + | let ha = eS.payments[0] | |
1266 | + | let fh = ha.assetId | |
1267 | + | let ft = ha.amount | |
1268 | + | let ez = es(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1269 | + | if ((ez == ez)) | |
1207 | 1270 | then { | |
1208 | - | let gt = dt(-(gr), -(cw), 0) | |
1209 | - | let fK = gt._1 | |
1210 | - | let dk = gt._2 | |
1211 | - | let fL = dx(ds, dk) | |
1212 | - | if ((fL == fL)) | |
1213 | - | then (cx ++ fK) | |
1271 | + | let ab = eS.caller | |
1272 | + | let ac = eS.transactionId | |
1273 | + | let hm = fK(fL, ft, fh, ab, ac) | |
1274 | + | if ((hm == hm)) | |
1275 | + | then { | |
1276 | + | let fN = hm._5 | |
1277 | + | let hc = hm._4 | |
1278 | + | let fe = hm._3 | |
1279 | + | let el = hm._2 | |
1280 | + | let hn = hm._1 | |
1281 | + | let bW = if (if ((gW > 0)) | |
1282 | + | then (gW > hn) | |
1283 | + | else false) | |
1284 | + | then aQ(makeString(["amount to receive is less than ", toString(gW)], "")) | |
1285 | + | else hn | |
1286 | + | let ho = invoke(aT, "burn", [ft], [AttachedPayment(fh, ft)]) | |
1287 | + | if ((ho == ho)) | |
1288 | + | then { | |
1289 | + | let gC = cH(hk, bW) | |
1290 | + | let hp = [ScriptTransfer(ab, bW, fL)] | |
1291 | + | let hg = if ((fe > 0)) | |
1292 | + | then [ScriptTransfer(aU, fe, fL)] | |
1293 | + | else nil | |
1294 | + | let hq = { | |
1295 | + | let hr = if ((this == aU)) | |
1296 | + | then 0 | |
1297 | + | else fe | |
1298 | + | if (fN) | |
1299 | + | then $Tuple2(-((bW + hr)), 0) | |
1300 | + | else $Tuple2(0, -((bW + hr))) | |
1301 | + | } | |
1302 | + | let eB = hq._1 | |
1303 | + | let eC = hq._2 | |
1304 | + | let hs = eA(eB, eC, 0) | |
1305 | + | let gR = hs._1 | |
1306 | + | let er = hs._2 | |
1307 | + | let gS = eE(ez, er) | |
1308 | + | if ((gS == gS)) | |
1309 | + | then $Tuple2(((((el ++ gC) ++ hp) ++ hg) ++ gR), bW) | |
1310 | + | else throw("Strict value is not equal to itself.") | |
1311 | + | } | |
1312 | + | else throw("Strict value is not equal to itself.") | |
1313 | + | } | |
1214 | 1314 | else throw("Strict value is not equal to itself.") | |
1215 | 1315 | } | |
1216 | 1316 | else throw("Strict value is not equal to itself.") | |
1217 | 1317 | } | |
1218 | 1318 | else throw("Strict value is not equal to itself.") | |
1219 | 1319 | } | |
1220 | 1320 | ||
1221 | 1321 | ||
1222 | 1322 | ||
1223 | - | @Callable(dL) | |
1224 | - | func getNoLess (gu,gv) = { | |
1225 | - | let cP = dK(dL) | |
1226 | - | let cv = cP._1 | |
1227 | - | let cw = cP._2 | |
1228 | - | let dN = cP._3 | |
1229 | - | let ce = cP._4 | |
1230 | - | let cx = cP._5 | |
1231 | - | if ((gu > cv)) | |
1232 | - | then throw(((("noLessThenAmtAsset failed: " + toString(cv)) + " < ") + toString(gu))) | |
1233 | - | else if ((gv > cw)) | |
1234 | - | then throw(((("noLessThenPriceAsset failed: " + toString(cw)) + " < ") + toString(gv))) | |
1235 | - | else { | |
1236 | - | let ds = dl(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1237 | - | if ((ds == ds)) | |
1238 | - | then { | |
1239 | - | let gs = invoke(aO, "burn", [dN], [AttachedPayment(ce, dN)]) | |
1240 | - | if ((gs == gs)) | |
1241 | - | then { | |
1242 | - | let gw = dt(-(cv), -(cw), 0) | |
1243 | - | let fK = gw._1 | |
1244 | - | let dk = gw._2 | |
1245 | - | let fL = dx(ds, dk) | |
1246 | - | if ((fL == fL)) | |
1247 | - | then (cx ++ fK) | |
1248 | - | else throw("Strict value is not equal to itself.") | |
1249 | - | } | |
1250 | - | else throw("Strict value is not equal to itself.") | |
1251 | - | } | |
1252 | - | else throw("Strict value is not equal to itself.") | |
1253 | - | } | |
1323 | + | @Callable(eS) | |
1324 | + | func getOneTknREADONLY (fL,ft) = { | |
1325 | + | let ht = fK(bd(fL), ft, bm, unit, unit) | |
1326 | + | let hn = ht._1 | |
1327 | + | let el = ht._2 | |
1328 | + | let fe = ht._3 | |
1329 | + | let hc = ht._4 | |
1330 | + | let fN = ht._5 | |
1331 | + | $Tuple2(nil, $Tuple3(hn, fe, hc)) | |
1254 | 1332 | } | |
1255 | 1333 | ||
1256 | 1334 | ||
1257 | 1335 | ||
1258 | - | @Callable(dL) | |
1259 | - | func unstakeAndGet (dT) = { | |
1260 | - | let gx = if ((size(dL.payments) != 0)) | |
1261 | - | then throw("No payments are expected") | |
1262 | - | else true | |
1263 | - | if ((gx == gx)) | |
1336 | + | @Callable(eS) | |
1337 | + | func unstakeAndGetOneTkn (hu,hk,gW) = { | |
1338 | + | let gY = { | |
1339 | + | let aW = invoke(aT, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1340 | + | if ($isInstanceOf(aW, "Boolean")) | |
1341 | + | then aW | |
1342 | + | else throw(($getType(aW) + " couldn't be cast to Boolean")) | |
1343 | + | } | |
1344 | + | let hl = if (if (aY()) | |
1345 | + | then true | |
1346 | + | else (bl == n)) | |
1347 | + | then true | |
1348 | + | else gY | |
1349 | + | let fM = [if (if (!(hl)) | |
1350 | + | then true | |
1351 | + | else gh(eS)) | |
1352 | + | then true | |
1353 | + | else aQ("get operation is blocked by admin"), if ((size(eS.payments) == 0)) | |
1354 | + | then true | |
1355 | + | else aQ("no payments are expected")] | |
1356 | + | if ((fM == fM)) | |
1264 | 1357 | then { | |
1265 | - | let bT = aV() | |
1266 | - | let cg = fromBase58String(bT[q]) | |
1267 | - | let ds = dl(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1268 | - | if ((ds == ds)) | |
1358 | + | let fL = bd(hk) | |
1359 | + | let ab = eS.caller | |
1360 | + | let ac = eS.transactionId | |
1361 | + | let ez = es(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1362 | + | if ((ez == ez)) | |
1269 | 1363 | then { | |
1270 | - | let | |
1271 | - | if (( | |
1364 | + | let hv = invoke(bs, "unstake", [toBase58String(bm), hu], nil) | |
1365 | + | if ((hv == hv)) | |
1272 | 1366 | then { | |
1273 | - | let cP = cc(toBase58String(dL.transactionId), toBase58String(cg), dT, dL.caller) | |
1274 | - | let cv = cP._1 | |
1275 | - | let cw = cP._2 | |
1276 | - | let cj = parseIntValue(cP._9) | |
1277 | - | let cx = cP._10 | |
1278 | - | let gy = if (if (aT()) | |
1279 | - | then true | |
1280 | - | else (cj == n)) | |
1281 | - | then throw(("Get operation is blocked by admin. Status = " + toString(cj))) | |
1282 | - | else true | |
1283 | - | if ((gy == gy)) | |
1367 | + | let hw = fK(fL, hu, bm, ab, ac) | |
1368 | + | if ((hw == hw)) | |
1284 | 1369 | then { | |
1285 | - | let gs = invoke(aO, "burn", [dT], [AttachedPayment(cg, dT)]) | |
1286 | - | if ((gs == gs)) | |
1370 | + | let fN = hw._5 | |
1371 | + | let hc = hw._4 | |
1372 | + | let fe = hw._3 | |
1373 | + | let el = hw._2 | |
1374 | + | let hn = hw._1 | |
1375 | + | let bW = if (if ((gW > 0)) | |
1376 | + | then (gW > hn) | |
1377 | + | else false) | |
1378 | + | then aQ(makeString(["amount to receive is less than ", toString(gW)], "")) | |
1379 | + | else hn | |
1380 | + | let ho = invoke(aT, "burn", [hu], [AttachedPayment(bm, hu)]) | |
1381 | + | if ((ho == ho)) | |
1287 | 1382 | then { | |
1288 | - | let gz = dt(-(cv), -(cw), 0) | |
1289 | - | let fK = gz._1 | |
1290 | - | let dk = gz._2 | |
1291 | - | let fL = dx(ds, dk) | |
1292 | - | if ((fL == fL)) | |
1293 | - | then (cx ++ fK) | |
1383 | + | let gC = cH(hk, bW) | |
1384 | + | let hp = [ScriptTransfer(eS.caller, bW, fL)] | |
1385 | + | let hg = if ((fe > 0)) | |
1386 | + | then [ScriptTransfer(aU, fe, fL)] | |
1387 | + | else nil | |
1388 | + | let hx = { | |
1389 | + | let hr = if ((this == aU)) | |
1390 | + | then 0 | |
1391 | + | else fe | |
1392 | + | if (fN) | |
1393 | + | then $Tuple2(-((bW + hr)), 0) | |
1394 | + | else $Tuple2(0, -((bW + hr))) | |
1395 | + | } | |
1396 | + | let eB = hx._1 | |
1397 | + | let eC = hx._2 | |
1398 | + | let hy = eA(eB, eC, 0) | |
1399 | + | let gR = hy._1 | |
1400 | + | let er = hy._2 | |
1401 | + | let gS = eE(ez, er) | |
1402 | + | if ((gS == gS)) | |
1403 | + | then $Tuple2(((((el ++ gC) ++ hp) ++ hg) ++ gR), bW) | |
1294 | 1404 | else throw("Strict value is not equal to itself.") | |
1295 | 1405 | } | |
1296 | 1406 | else throw("Strict value is not equal to itself.") | |
1297 | 1407 | } | |
1298 | 1408 | else throw("Strict value is not equal to itself.") | |
1299 | 1409 | } | |
1300 | 1410 | else throw("Strict value is not equal to itself.") | |
1301 | 1411 | } | |
1302 | 1412 | else throw("Strict value is not equal to itself.") | |
1303 | 1413 | } | |
1304 | 1414 | else throw("Strict value is not equal to itself.") | |
1305 | 1415 | } | |
1306 | 1416 | ||
1307 | 1417 | ||
1308 | 1418 | ||
1309 | - | @Callable( | |
1310 | - | func | |
1311 | - | let | |
1312 | - | | |
1313 | - | | |
1314 | - | let | |
1315 | - | | |
1316 | - | | |
1317 | - | | |
1318 | - | | |
1319 | - | if (( | |
1419 | + | @Callable(eS) | |
1420 | + | func get () = { | |
1421 | + | let dW = eR(eS) | |
1422 | + | let dC = dW._1 | |
1423 | + | let dD = dW._2 | |
1424 | + | let eU = dW._3 | |
1425 | + | let dl = dW._4 | |
1426 | + | let dE = dW._5 | |
1427 | + | let gC = cM(dC, dD) | |
1428 | + | let ez = es(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1429 | + | if ((ez == ez)) | |
1320 | 1430 | then { | |
1321 | - | let | |
1322 | - | if (( | |
1431 | + | let hz = invoke(aT, "burn", [eU], [AttachedPayment(dl, eU)]) | |
1432 | + | if ((hz == hz)) | |
1323 | 1433 | then { | |
1324 | - | let gn = invoke(bn, "unstake", [toBase58String(bh), gm], nil) | |
1325 | - | if ((gn == gn)) | |
1434 | + | let hA = eA(-(dC), -(dD), 0) | |
1435 | + | let gR = hA._1 | |
1436 | + | let er = hA._2 | |
1437 | + | let gS = eE(ez, er) | |
1438 | + | if ((gS == gS)) | |
1439 | + | then ((gC ++ dE) ++ gR) | |
1440 | + | else throw("Strict value is not equal to itself.") | |
1441 | + | } | |
1442 | + | else throw("Strict value is not equal to itself.") | |
1443 | + | } | |
1444 | + | else throw("Strict value is not equal to itself.") | |
1445 | + | } | |
1446 | + | ||
1447 | + | ||
1448 | + | ||
1449 | + | @Callable(eS) | |
1450 | + | func getNoLess (hB,hC) = { | |
1451 | + | let dW = eR(eS) | |
1452 | + | let dC = dW._1 | |
1453 | + | let dD = dW._2 | |
1454 | + | let eU = dW._3 | |
1455 | + | let dl = dW._4 | |
1456 | + | let dE = dW._5 | |
1457 | + | if ((hB > dC)) | |
1458 | + | then throw(((("noLessThenAmtAsset failed: " + toString(dC)) + " < ") + toString(hB))) | |
1459 | + | else if ((hC > dD)) | |
1460 | + | then throw(((("noLessThenPriceAsset failed: " + toString(dD)) + " < ") + toString(hC))) | |
1461 | + | else { | |
1462 | + | let gC = cM(dC, dD) | |
1463 | + | let ez = es(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1464 | + | if ((ez == ez)) | |
1465 | + | then { | |
1466 | + | let hz = invoke(aT, "burn", [eU], [AttachedPayment(dl, eU)]) | |
1467 | + | if ((hz == hz)) | |
1468 | + | then { | |
1469 | + | let hD = eA(-(dC), -(dD), 0) | |
1470 | + | let gR = hD._1 | |
1471 | + | let er = hD._2 | |
1472 | + | let gS = eE(ez, er) | |
1473 | + | if ((gS == gS)) | |
1474 | + | then ((gC ++ dE) ++ gR) | |
1475 | + | else throw("Strict value is not equal to itself.") | |
1476 | + | } | |
1477 | + | else throw("Strict value is not equal to itself.") | |
1478 | + | } | |
1479 | + | else throw("Strict value is not equal to itself.") | |
1480 | + | } | |
1481 | + | } | |
1482 | + | ||
1483 | + | ||
1484 | + | ||
1485 | + | @Callable(eS) | |
1486 | + | func unstakeAndGet (bW) = { | |
1487 | + | let hE = if ((size(eS.payments) != 0)) | |
1488 | + | then throw("No payments are expected") | |
1489 | + | else true | |
1490 | + | if ((hE == hE)) | |
1491 | + | then { | |
1492 | + | let da = ba() | |
1493 | + | let dn = fromBase58String(da[q]) | |
1494 | + | let ez = es(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1495 | + | if ((ez == ez)) | |
1496 | + | then { | |
1497 | + | let hv = invoke(bs, "unstake", [toBase58String(dn), bW], nil) | |
1498 | + | if ((hv == hv)) | |
1326 | 1499 | then { | |
1327 | - | let cP = cc(toBase58String(dL.transactionId), toBase58String(bh), gm, dL.caller) | |
1328 | - | let cv = cP._1 | |
1329 | - | let cw = cP._2 | |
1330 | - | let cx = cP._10 | |
1331 | - | let gB = [if ((cv >= gA)) | |
1500 | + | let dW = dj(toBase58String(eS.transactionId), toBase58String(dn), bW, eS.caller) | |
1501 | + | let dC = dW._1 | |
1502 | + | let dD = dW._2 | |
1503 | + | let dq = parseIntValue(dW._9) | |
1504 | + | let dE = dW._10 | |
1505 | + | let gC = cM(dC, dD) | |
1506 | + | let hF = if (if (aY()) | |
1332 | 1507 | then true | |
1333 | - | else | |
1334 | - | then | |
1335 | - | else | |
1336 | - | if (( | |
1508 | + | else (dq == n)) | |
1509 | + | then throw(("Get operation is blocked by admin. Status = " + toString(dq))) | |
1510 | + | else true | |
1511 | + | if ((hF == hF)) | |
1337 | 1512 | then { | |
1338 | - | let | |
1339 | - | if (( | |
1513 | + | let hz = invoke(aT, "burn", [bW], [AttachedPayment(dn, bW)]) | |
1514 | + | if ((hz == hz)) | |
1340 | 1515 | then { | |
1341 | - | let | |
1342 | - | let | |
1343 | - | let | |
1344 | - | let | |
1345 | - | if (( | |
1346 | - | then ( | |
1516 | + | let hG = eA(-(dC), -(dD), 0) | |
1517 | + | let gR = hG._1 | |
1518 | + | let er = hG._2 | |
1519 | + | let gS = eE(ez, er) | |
1520 | + | if ((gS == gS)) | |
1521 | + | then ((gC ++ dE) ++ gR) | |
1347 | 1522 | else throw("Strict value is not equal to itself.") | |
1348 | 1523 | } | |
1349 | 1524 | else throw("Strict value is not equal to itself.") | |
1350 | 1525 | } | |
1351 | 1526 | else throw("Strict value is not equal to itself.") | |
1352 | 1527 | } | |
1353 | 1528 | else throw("Strict value is not equal to itself.") | |
1354 | 1529 | } | |
1355 | 1530 | else throw("Strict value is not equal to itself.") | |
1356 | 1531 | } | |
1357 | 1532 | else throw("Strict value is not equal to itself.") | |
1358 | 1533 | } | |
1359 | 1534 | ||
1360 | 1535 | ||
1361 | 1536 | ||
1362 | - | @Callable(dL) | |
1363 | - | func activate (gD,gE) = if ((toString(dL.caller) != toString(aO))) | |
1364 | - | then throw("permissions denied") | |
1365 | - | else $Tuple2([StringEntry(ae(), gD), StringEntry(af(), gE)], "success") | |
1366 | - | ||
1367 | - | ||
1368 | - | ||
1369 | - | @Callable(dL) | |
1370 | - | func refreshKLp () = { | |
1371 | - | let gF = valueOrElse(getInteger(ak), 0) | |
1372 | - | let gG = if (((height - gF) >= an)) | |
1373 | - | then unit | |
1374 | - | else aL(makeString([toString(an), " blocks have not passed since the previous call"], "")) | |
1375 | - | if ((gG == gG)) | |
1537 | + | @Callable(eS) | |
1538 | + | func unstakeAndGetNoLess (hu,hH,hC) = { | |
1539 | + | let hl = if (aY()) | |
1540 | + | then true | |
1541 | + | else (bl == n) | |
1542 | + | let fM = [if (!(hl)) | |
1543 | + | then true | |
1544 | + | else throw("get operation is blocked by admin"), if ((size(eS.payments) == 0)) | |
1545 | + | then true | |
1546 | + | else throw("no payments are expected")] | |
1547 | + | if ((fM == fM)) | |
1376 | 1548 | then { | |
1377 | - | let dE = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, aj), "0")), aN("invalid kLp")) | |
1378 | - | let gH = dt(0, 0, 0) | |
1379 | - | let gI = gH._1 | |
1380 | - | let dk = gH._2 | |
1381 | - | let dw = if ((dE != dk)) | |
1382 | - | then gI | |
1383 | - | else aL("nothing to refresh") | |
1384 | - | $Tuple2(dw, toString(dk)) | |
1549 | + | let ez = es(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1550 | + | if ((ez == ez)) | |
1551 | + | then { | |
1552 | + | let hv = invoke(bs, "unstake", [toBase58String(bm), hu], nil) | |
1553 | + | if ((hv == hv)) | |
1554 | + | then { | |
1555 | + | let dW = dj(toBase58String(eS.transactionId), toBase58String(bm), hu, eS.caller) | |
1556 | + | let dC = dW._1 | |
1557 | + | let dD = dW._2 | |
1558 | + | let dE = dW._10 | |
1559 | + | let gC = cM(dC, dD) | |
1560 | + | let hI = [if ((dC >= hH)) | |
1561 | + | then true | |
1562 | + | else throw(makeString(["amount asset amount to receive is less than ", toString(hH)], "")), if ((dD >= hC)) | |
1563 | + | then true | |
1564 | + | else throw(makeString(["price asset amount to receive is less than ", toString(hC)], ""))] | |
1565 | + | if ((hI == hI)) | |
1566 | + | then { | |
1567 | + | let hz = invoke(aT, "burn", [hu], [AttachedPayment(bm, hu)]) | |
1568 | + | if ((hz == hz)) | |
1569 | + | then { | |
1570 | + | let hJ = eA(-(dC), -(dD), 0) | |
1571 | + | let gR = hJ._1 | |
1572 | + | let er = hJ._2 | |
1573 | + | let gS = eE(ez, er) | |
1574 | + | if ((gS == gS)) | |
1575 | + | then ((gC ++ dE) ++ gR) | |
1576 | + | else throw("Strict value is not equal to itself.") | |
1577 | + | } | |
1578 | + | else throw("Strict value is not equal to itself.") | |
1579 | + | } | |
1580 | + | else throw("Strict value is not equal to itself.") | |
1581 | + | } | |
1582 | + | else throw("Strict value is not equal to itself.") | |
1583 | + | } | |
1584 | + | else throw("Strict value is not equal to itself.") | |
1385 | 1585 | } | |
1386 | 1586 | else throw("Strict value is not equal to itself.") | |
1387 | 1587 | } | |
1388 | 1588 | ||
1389 | 1589 | ||
1390 | 1590 | ||
1391 | - | @Callable(dL) | |
1392 | - | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aV()) | |
1591 | + | @Callable(eS) | |
1592 | + | func activate (hK,hL) = if ((toString(eS.caller) != toString(aT))) | |
1593 | + | then throw("permissions denied") | |
1594 | + | else $Tuple2([StringEntry(ae(), hK), StringEntry(af(), hL)], "success") | |
1393 | 1595 | ||
1394 | 1596 | ||
1395 | 1597 | ||
1396 | - | @Callable(dL) | |
1397 | - | func getAccBalanceWrapperREADONLY (bF) = $Tuple2(nil, bE(bF)) | |
1398 | - | ||
1399 | - | ||
1400 | - | ||
1401 | - | @Callable(dL) | |
1402 | - | func calcPricesWrapperREADONLY (bN,bO,bS) = { | |
1403 | - | let cb = bR(bN, bO, bS) | |
1404 | - | $Tuple2(nil, [toString(cb[0]), toString(cb[1]), toString(cb[2])]) | |
1598 | + | @Callable(eS) | |
1599 | + | func refreshKLp () = { | |
1600 | + | let hM = valueOrElse(getInteger(ak), 0) | |
1601 | + | let hN = if (((height - hM) >= an)) | |
1602 | + | then unit | |
1603 | + | else aQ(makeString([toString(an), " blocks have not passed since the previous call"], "")) | |
1604 | + | if ((hN == hN)) | |
1605 | + | then { | |
1606 | + | let eL = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, aj), "0")), aS("invalid kLp")) | |
1607 | + | let hO = eA(0, 0, 0) | |
1608 | + | let hP = hO._1 | |
1609 | + | let er = hO._2 | |
1610 | + | let eD = if ((eL != er)) | |
1611 | + | then hP | |
1612 | + | else aQ("nothing to refresh") | |
1613 | + | $Tuple2(eD, toString(er)) | |
1614 | + | } | |
1615 | + | else throw("Strict value is not equal to itself.") | |
1405 | 1616 | } | |
1406 | 1617 | ||
1407 | 1618 | ||
1408 | 1619 | ||
1409 | - | @Callable(dL) | |
1620 | + | @Callable(eS) | |
1621 | + | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, ba()) | |
1622 | + | ||
1623 | + | ||
1624 | + | ||
1625 | + | @Callable(eS) | |
1626 | + | func getAccBalanceWrapperREADONLY (ap) = $Tuple2(nil, bJ(ap)) | |
1627 | + | ||
1628 | + | ||
1629 | + | ||
1630 | + | @Callable(eS) | |
1631 | + | func calcPricesWrapperREADONLY (cU,cV,cZ) = { | |
1632 | + | let di = cY(cU, cV, cZ) | |
1633 | + | $Tuple2(nil, [toString(di[0]), toString(di[1]), toString(di[2])]) | |
1634 | + | } | |
1635 | + | ||
1636 | + | ||
1637 | + | ||
1638 | + | @Callable(eS) | |
1410 | 1639 | func toX18WrapperREADONLY (E,F) = $Tuple2(nil, toString(D(E, F))) | |
1411 | 1640 | ||
1412 | 1641 | ||
1413 | 1642 | ||
1414 | - | @Callable( | |
1643 | + | @Callable(eS) | |
1415 | 1644 | func fromX18WrapperREADONLY (I,J) = $Tuple2(nil, H(parseBigIntValue(I), J)) | |
1416 | 1645 | ||
1417 | 1646 | ||
1418 | 1647 | ||
1419 | - | @Callable( | |
1420 | - | func calcPriceBigIntWrapperREADONLY ( | |
1648 | + | @Callable(eS) | |
1649 | + | func calcPriceBigIntWrapperREADONLY (bN,bO) = $Tuple2(nil, toString(bM(parseBigIntValue(bN), parseBigIntValue(bO)))) | |
1421 | 1650 | ||
1422 | 1651 | ||
1423 | 1652 | ||
1424 | - | @Callable( | |
1425 | - | func estimatePutOperationWrapperREADONLY ( | |
1653 | + | @Callable(eS) | |
1654 | + | func estimatePutOperationWrapperREADONLY (dk,dG,dH,dI,dJ,dK,ab,dL,dM) = $Tuple2(nil, dF(dk, dG, dH, dI, dJ, dK, ab, dL, dM)) | |
1426 | 1655 | ||
1427 | 1656 | ||
1428 | 1657 | ||
1429 | - | @Callable( | |
1430 | - | func estimateGetOperationWrapperREADONLY ( | |
1431 | - | let | |
1432 | - | $Tuple2(nil, $Tuple10( | |
1658 | + | @Callable(eS) | |
1659 | + | func estimateGetOperationWrapperREADONLY (dk,dl,dm,ab) = { | |
1660 | + | let dW = dj(dk, dl, dm, addressFromStringValue(ab)) | |
1661 | + | $Tuple2(nil, $Tuple10(dW._1, dW._2, dW._3, dW._4, dW._5, dW._6, dW._7, toString(dW._8), dW._9, dW._10)) | |
1433 | 1662 | } | |
1434 | 1663 | ||
1435 | 1664 | ||
1436 | 1665 | ||
1437 | - | @Callable( | |
1666 | + | @Callable(eS) | |
1438 | 1667 | func statsREADONLY () = { | |
1439 | - | let | |
1440 | - | let | |
1441 | - | let | |
1442 | - | let | |
1443 | - | let | |
1444 | - | let | |
1445 | - | let | |
1446 | - | let | |
1447 | - | let | |
1448 | - | let | |
1449 | - | let | |
1450 | - | let | |
1668 | + | let da = ba() | |
1669 | + | let dn = fromBase58String(da[q]) | |
1670 | + | let hQ = da[r] | |
1671 | + | let hR = da[s] | |
1672 | + | let dP = da[v] | |
1673 | + | let dQ = da[w] | |
1674 | + | let db = parseIntValue(da[t]) | |
1675 | + | let dc = parseIntValue(da[u]) | |
1676 | + | let hS = valueOrErrorMessage(assetInfo(dn), (("Asset " + toBase58String(dn)) + " doesn't exist")).quantity | |
1677 | + | let hT = bJ(hQ) | |
1678 | + | let hU = bJ(hR) | |
1679 | + | let hV = if ((hS == 0)) | |
1451 | 1680 | then [e, e, e] | |
1452 | - | else | |
1453 | - | let | |
1454 | - | let | |
1455 | - | let | |
1456 | - | let | |
1457 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString( | |
1681 | + | else cY(hT, hU, hS) | |
1682 | + | let dx = 0 | |
1683 | + | let hW = H(hV[1], b) | |
1684 | + | let hX = H(hV[2], b) | |
1685 | + | let hY = value(getInteger(aT, aD(toString(this)))) | |
1686 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(hT), toString(hU), toString(hS), toString(dx), toString(hW), toString(hX), toString(hY)], j)) | |
1458 | 1687 | } | |
1459 | 1688 | ||
1460 | 1689 | ||
1461 | 1690 | ||
1462 | - | @Callable( | |
1463 | - | func evaluatePutByAmountAssetREADONLY ( | |
1464 | - | let | |
1465 | - | let | |
1466 | - | let | |
1467 | - | let | |
1468 | - | let | |
1469 | - | let | |
1470 | - | let | |
1471 | - | let | |
1472 | - | let | |
1473 | - | let | |
1474 | - | let | |
1475 | - | let | |
1476 | - | let | |
1477 | - | let | |
1478 | - | let | |
1691 | + | @Callable(eS) | |
1692 | + | func evaluatePutByAmountAssetREADONLY (dH) = { | |
1693 | + | let da = ba() | |
1694 | + | let dn = fromBase58String(da[q]) | |
1695 | + | let dN = da[r] | |
1696 | + | let do = fromBase58String(dN) | |
1697 | + | let dO = da[s] | |
1698 | + | let dp = fromBase58String(dO) | |
1699 | + | let db = parseIntValue(da[t]) | |
1700 | + | let dc = parseIntValue(da[u]) | |
1701 | + | let dq = da[p] | |
1702 | + | let hS = valueOrErrorMessage(assetInfo(dn), (("Asset " + toBase58String(dn)) + " doesn't exist")).quantity | |
1703 | + | let hT = bJ(dN) | |
1704 | + | let hU = bJ(dO) | |
1705 | + | let cW = D(hT, db) | |
1706 | + | let cX = D(hU, dc) | |
1707 | + | let dw = if ((hS == 0)) | |
1479 | 1708 | then e | |
1480 | - | else | |
1481 | - | let | |
1482 | - | let | |
1483 | - | let | |
1484 | - | let | |
1485 | - | let | |
1486 | - | let | |
1487 | - | let | |
1488 | - | let | |
1489 | - | let | |
1490 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString( | |
1709 | + | else bM(cX, cW) | |
1710 | + | let dT = D(dH, db) | |
1711 | + | let dU = fraction(dT, dw, d) | |
1712 | + | let dJ = H(dU, dc) | |
1713 | + | let eY = dF("", 500000, dH, do, dJ, dp, "", true, false) | |
1714 | + | let ee = eY._1 | |
1715 | + | let hZ = eY._3 | |
1716 | + | let ds = eY._4 | |
1717 | + | let du = eY._5 | |
1718 | + | let dr = eY._6 | |
1719 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(ee), toString(H(dw, b)), toString(ds), toString(du), toString(dr), dq, toString(dH), toString(dJ)], j)) | |
1491 | 1720 | } | |
1492 | 1721 | ||
1493 | 1722 | ||
1494 | 1723 | ||
1495 | - | @Callable( | |
1496 | - | func evaluatePutByPriceAssetREADONLY ( | |
1497 | - | let | |
1498 | - | let | |
1499 | - | let | |
1500 | - | let | |
1501 | - | let | |
1502 | - | let | |
1503 | - | let | |
1504 | - | let | |
1505 | - | let | |
1506 | - | let | |
1507 | - | let | |
1508 | - | let | |
1509 | - | let | |
1510 | - | let | |
1511 | - | let | |
1724 | + | @Callable(eS) | |
1725 | + | func evaluatePutByPriceAssetREADONLY (dJ) = { | |
1726 | + | let da = ba() | |
1727 | + | let dn = fromBase58String(da[q]) | |
1728 | + | let dN = da[r] | |
1729 | + | let do = fromBase58String(dN) | |
1730 | + | let dO = da[s] | |
1731 | + | let dp = fromBase58String(dO) | |
1732 | + | let db = parseIntValue(da[t]) | |
1733 | + | let dc = parseIntValue(da[u]) | |
1734 | + | let dq = da[p] | |
1735 | + | let hS = valueOrErrorMessage(assetInfo(dn), (("Asset " + toBase58String(dn)) + " doesn't exist")).quantity | |
1736 | + | let ia = bJ(dN) | |
1737 | + | let ib = bJ(dO) | |
1738 | + | let ic = D(ia, db) | |
1739 | + | let id = D(ib, dc) | |
1740 | + | let dw = if ((hS == 0)) | |
1512 | 1741 | then e | |
1513 | - | else | |
1514 | - | let | |
1515 | - | let | |
1516 | - | let | |
1517 | - | let | |
1518 | - | let | |
1519 | - | let | |
1520 | - | let | |
1521 | - | let | |
1522 | - | let | |
1523 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString( | |
1742 | + | else bM(id, ic) | |
1743 | + | let dU = D(dJ, dc) | |
1744 | + | let dT = fraction(dU, d, dw) | |
1745 | + | let dH = H(dT, db) | |
1746 | + | let eY = dF("", 500000, dH, do, dJ, dp, "", true, false) | |
1747 | + | let ee = eY._1 | |
1748 | + | let hZ = eY._3 | |
1749 | + | let ds = eY._4 | |
1750 | + | let du = eY._5 | |
1751 | + | let dr = eY._6 | |
1752 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(ee), toString(H(dw, b)), toString(ds), toString(du), toString(dr), dq, toString(dH), toString(dJ)], j)) | |
1524 | 1753 | } | |
1525 | 1754 | ||
1526 | 1755 | ||
1527 | 1756 | ||
1528 | - | @Callable( | |
1529 | - | func evaluateGetREADONLY ( | |
1530 | - | let | |
1531 | - | let | |
1532 | - | let | |
1533 | - | let | |
1534 | - | let | |
1535 | - | let | |
1536 | - | let | |
1537 | - | let | |
1538 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString( | |
1757 | + | @Callable(eS) | |
1758 | + | func evaluateGetREADONLY (ie,if) = { | |
1759 | + | let dW = dj("", ie, if, this) | |
1760 | + | let dC = dW._1 | |
1761 | + | let dD = dW._2 | |
1762 | + | let ds = dW._5 | |
1763 | + | let du = dW._6 | |
1764 | + | let dr = dW._7 | |
1765 | + | let dx = dW._8 | |
1766 | + | let dq = parseIntValue(dW._9) | |
1767 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(dC), toString(dD), toString(ds), toString(du), toString(dr), toString(dx), toString(dq)], j)) | |
1539 | 1768 | } | |
1540 | 1769 | ||
1541 | 1770 | ||
1542 | - | @Verifier( | |
1543 | - | func | |
1544 | - | let | |
1545 | - | let | |
1546 | - | if ($isInstanceOf( | |
1771 | + | @Verifier(ig) | |
1772 | + | func ih () = { | |
1773 | + | let ii = { | |
1774 | + | let bT = ge() | |
1775 | + | if ($isInstanceOf(bT, "ByteVector")) | |
1547 | 1776 | then { | |
1548 | - | let | |
1549 | - | | |
1777 | + | let gi = bT | |
1778 | + | gi | |
1550 | 1779 | } | |
1551 | - | else if ($isInstanceOf( | |
1552 | - | then | |
1780 | + | else if ($isInstanceOf(bT, "Unit")) | |
1781 | + | then ig.senderPublicKey | |
1553 | 1782 | else throw("Match error") | |
1554 | 1783 | } | |
1555 | - | let | |
1556 | - | if ($isInstanceOf( | |
1784 | + | let bT = ig | |
1785 | + | if ($isInstanceOf(bT, "Order")) | |
1557 | 1786 | then { | |
1558 | - | let | |
1559 | - | let | |
1560 | - | let | |
1561 | - | let | |
1562 | - | let | |
1563 | - | let | |
1564 | - | let | |
1565 | - | if (if (if ( | |
1566 | - | then | |
1787 | + | let eH = bT | |
1788 | + | let ij = aZ() | |
1789 | + | let ik = eG(eH) | |
1790 | + | let aI = ik._1 | |
1791 | + | let aJ = ik._2 | |
1792 | + | let aK = sigVerify(eH.bodyBytes, eH.proofs[0], eH.senderPublicKey) | |
1793 | + | let aL = sigVerify(eH.bodyBytes, eH.proofs[1], ij) | |
1794 | + | if (if (if (aI) | |
1795 | + | then aK | |
1567 | 1796 | else false) | |
1568 | - | then | |
1797 | + | then aL | |
1569 | 1798 | else false) | |
1570 | 1799 | then true | |
1571 | - | else | |
1800 | + | else aH(aI, aJ, aK, aL) | |
1572 | 1801 | } | |
1573 | - | else if ($isInstanceOf( | |
1802 | + | else if ($isInstanceOf(bT, "SetScriptTransaction")) | |
1574 | 1803 | then { | |
1575 | - | let | |
1576 | - | if (sigVerify( | |
1804 | + | let gf = bT | |
1805 | + | if (sigVerify(ig.bodyBytes, ig.proofs[0], ii)) | |
1577 | 1806 | then true | |
1578 | 1807 | else { | |
1579 | - | let | |
1580 | - | let | |
1581 | - | let | |
1582 | - | if (( | |
1583 | - | then ( | |
1808 | + | let il = blake2b256(value(gf.script)) | |
1809 | + | let im = fromBase64String(value(getString(aT, aF()))) | |
1810 | + | let in = scriptHash(this) | |
1811 | + | if ((im == il)) | |
1812 | + | then (in != il) | |
1584 | 1813 | else false | |
1585 | 1814 | } | |
1586 | 1815 | } | |
1587 | - | else sigVerify( | |
1816 | + | else sigVerify(ig.bodyBytes, ig.proofs[0], ii) | |
1588 | 1817 | } | |
1589 | 1818 |
github/deemru/w8io/026f985 336.63 ms ◑