tx · EJ3eZimZTcoh46BuCER4W8oFq92pkCzDVXAi8U8uF7Pi 3MqQg3GcBjjk5727HxPKgQfqGQwWm6QA2yL: -0.03800000 Waves 2022.09.14 15:48 [2228790] smart account 3MqQg3GcBjjk5727HxPKgQfqGQwWm6QA2yL > SELF 0.00000000 Waves
{ "type": 13, "id": "EJ3eZimZTcoh46BuCER4W8oFq92pkCzDVXAi8U8uF7Pi", "fee": 3800000, "feeAssetId": null, "timestamp": 1663159628619, "version": 2, "chainId": 84, "sender": "3MqQg3GcBjjk5727HxPKgQfqGQwWm6QA2yL", "senderPublicKey": "4AhS4PdxdW6j71mgHB4Xq7Eewk1rPdm57kDHAwQTTweK", "proofs": [ "3aR2espC4wneMzrYQVHw4a282PbC9CsSAMDnEbNTgLZi8U3gJ2RjEcwVDgRkkyG2bXBxSQorwEFKmexXtMngCQj8", "4GGguNy9NvJkUmcbuxycHVBAPdxVftC6qjUNqwzWyJ8ZZ7erpzTgLajExrqZViWTJfAf3tGubukwtzEAkokwBywP" ], "script": "base64:BgJpCAISBAoCEQESBgoECAEBBBIECgIBBBIECgIRCBIDCgEBEgYKBAgIAQgSBAoCCAESAwoBERIECgIRARIFCgMBCAgSBAoCCAESBQoDCAEBEgASABIECgIRBBIECgIBARIAEgASABIDCgEBXgAJUFJFQ0lTSU9OAMCEPQAFTUFYX0EAwIQ9AAxNQVhfQV9DSEFOR0UACgAIREVDSU1BTFMABgANTUlOX1JBTVBfVElNRQkAaQIAgKMFADwAB3ZlcnNpb24CBTMuMC4wAAhrVmVyc2lvbgIHdmVyc2lvbgAHa0Fzc2V0cwIJYXNzZXRfaWRzAA1rQXNzZXRCYWxhbmNlAghfYmFsYW5jZQAHa0FjdGl2ZQIGYWN0aXZlAAZrQ2F1c2UCDnNodXRkb3duX2NhdXNlAA1rU2hhcmVBc3NldElkAg5zaGFyZV9hc3NldF9pZAARa1NoYXJlQXNzZXRTdXBwbHkCEnNoYXJlX2Fzc2V0X3N1cHBseQAEa0ZlZQI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0eAZwcm9vZnMAAAUMYWRtaW5QdWJLZXkzBgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAURYWRtaW5QdWJLZXlJbnZva2UDAwUTY2FsbFRha2VJbnRvQWNjb3VudAUNc2lnbmVkQnlBZG1pbgcGBRNtdWx0aVNpZ25lZEJ5QWRtaW5zBRNtdWx0aVNpZ25lZEJ5QWRtaW5z7UbC3A==", "height": 2228790, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DxiDNY1rfY5kn5G6HYToZZmKdEjaS2UDcFJBLY72JnH6 Next: 6jWLsSCEiqv863AGbEtUcMNChrGXDasyZyWVvYS9mYbp Diff:
Old | New | Differences | |
---|---|---|---|
67 | 67 | ||
68 | 68 | let kFarmingAddress = "farming_address" | |
69 | 69 | ||
70 | + | let kLPFarmingAddress = "lp_farming" | |
71 | + | ||
70 | 72 | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
71 | 73 | ||
72 | 74 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
95 | 97 | ||
96 | 98 | let farmingAddress = Address(getBase58FromOracle(kFarmingAddress)) | |
97 | 99 | ||
98 | - | let | |
100 | + | let lpFarmingAddress = Address(getBase58FromOracle(kLPFarmingAddress)) | |
99 | 101 | ||
100 | 102 | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
101 | 103 | ||
164 | 166 | ||
165 | 167 | ||
166 | 168 | func calculateFeeDiscount (userAddr) = { | |
167 | - | let swopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserSwopInGov)), 0) | |
169 | + | let user = match userAddr { | |
170 | + | case u: Address => | |
171 | + | toString(u) | |
172 | + | case u: String => | |
173 | + | u | |
174 | + | case _ => | |
175 | + | throw("Unknow type of user Addr") | |
176 | + | } | |
177 | + | let swopAmount = valueOrElse(getInteger(govAddress, (user + kUserSwopInGov)), 0) | |
168 | 178 | let discountValues = split(getStringValue(oracle, kDiscountValues), ",") | |
169 | 179 | let discounts = split(getStringValue(oracle, kDiscounts), ",") | |
170 | 180 | if (if ((swopAmount >= parseIntValue(discountValues[0]))) | |
289 | 299 | else $Tuple2(D, false) | |
290 | 300 | } | |
291 | 301 | ||
292 | - | let $ | |
302 | + | let $t068406952 = { | |
293 | 303 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
294 | 304 | let $s = size($l) | |
295 | 305 | let $acc0 = $Tuple2(toBigInt(S), false) | |
303 | 313 | ||
304 | 314 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
305 | 315 | } | |
306 | - | let D = $ | |
307 | - | let finished = $ | |
316 | + | let D = $t068406952._1 | |
317 | + | let finished = $t068406952._2 | |
308 | 318 | if ((finished == false)) | |
309 | 319 | then throw(("get_D() not finished with " + toString(D))) | |
310 | 320 | else toInt(D) | |
330 | 340 | let D = get_D(xp_, amp) | |
331 | 341 | let Ann = (amp * nCoins) | |
332 | 342 | func S_c (acc,i) = { | |
333 | - | let $ | |
334 | - | let S_ = $ | |
335 | - | let c = $ | |
343 | + | let $t075237540 = acc | |
344 | + | let S_ = $t075237540._1 | |
345 | + | let c = $t075237540._2 | |
336 | 346 | let x_ = if ((in == i)) | |
337 | 347 | then x | |
338 | 348 | else xp_[i] | |
343 | 353 | else $Tuple2(S_, c) | |
344 | 354 | } | |
345 | 355 | ||
346 | - | let $ | |
356 | + | let $t077487849 = { | |
347 | 357 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
348 | 358 | let $s = size($l) | |
349 | 359 | let $acc0 = $Tuple2(0, toBigInt(D)) | |
357 | 367 | ||
358 | 368 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
359 | 369 | } | |
360 | - | let S_ = $ | |
361 | - | let c_ = $ | |
370 | + | let S_ = $t077487849._1 | |
371 | + | let c_ = $t077487849._2 | |
362 | 372 | let c = fraction(c_, toBigInt(D), toBigInt((Ann * nCoins))) | |
363 | 373 | let bD = toBigInt(((S_ + (D / Ann)) - D)) | |
364 | 374 | func y_proc (acc,_i) = if ((acc._2 == true)) | |
375 | 385 | else $Tuple2(y, false) | |
376 | 386 | } | |
377 | 387 | ||
378 | - | let $ | |
388 | + | let $t083318448 = { | |
379 | 389 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] | |
380 | 390 | let $s = size($l) | |
381 | 391 | let $acc0 = $Tuple2(toBigInt(D), false) | |
389 | 399 | ||
390 | 400 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
391 | 401 | } | |
392 | - | let y = $ | |
393 | - | let finished = $ | |
402 | + | let y = $t083318448._1 | |
403 | + | let finished = $t083318448._2 | |
394 | 404 | if ((finished == false)) | |
395 | 405 | then throw(("getY() not finished with " + toString(y))) | |
396 | 406 | else toInt(y) | |
404 | 414 | else { | |
405 | 415 | let Ann = (A_ * nCoins) | |
406 | 416 | func S_c (acc,i) = { | |
407 | - | let $ | |
408 | - | let S_ = $ | |
409 | - | let c = $ | |
417 | + | let $t088278844 = acc | |
418 | + | let S_ = $t088278844._1 | |
419 | + | let c = $t088278844._2 | |
410 | 420 | let x_ = if (if ((in != i)) | |
411 | 421 | then (nCoins > i) | |
412 | 422 | else false) | |
419 | 429 | else $Tuple2(S_, c) | |
420 | 430 | } | |
421 | 431 | ||
422 | - | let $ | |
432 | + | let $t090649165 = { | |
423 | 433 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
424 | 434 | let $s = size($l) | |
425 | 435 | let $acc0 = $Tuple2(0, toBigInt(D)) | |
433 | 443 | ||
434 | 444 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
435 | 445 | } | |
436 | - | let S_ = $ | |
437 | - | let c_ = $ | |
446 | + | let S_ = $t090649165._1 | |
447 | + | let c_ = $t090649165._2 | |
438 | 448 | let c = fraction(c_, toBigInt(D), toBigInt((Ann * nCoins))) | |
439 | 449 | let bD = toBigInt(((S_ + (D / Ann)) - D)) | |
440 | 450 | func y_D_proc (acc,i) = if ((acc._2 == true)) | |
451 | 461 | else $Tuple2(y, false) | |
452 | 462 | } | |
453 | 463 | ||
454 | - | let $ | |
464 | + | let $t096489767 = { | |
455 | 465 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] | |
456 | 466 | let $s = size($l) | |
457 | 467 | let $acc0 = $Tuple2(toBigInt(D), false) | |
465 | 475 | ||
466 | 476 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
467 | 477 | } | |
468 | - | let y = $ | |
469 | - | let finished = $ | |
478 | + | let y = $t096489767._1 | |
479 | + | let finished = $t096489767._2 | |
470 | 480 | if ((finished == false)) | |
471 | 481 | then throw(("get_y_D() not finished with " + toString(y))) | |
472 | 482 | else toInt(y) | |
483 | 493 | let new_y = get_y_D(amp, i, xp, D1) | |
484 | 494 | let dy_0 = (xp[i] - new_y) | |
485 | 495 | func xp_reduced_proc (acc,xp_j) = { | |
486 | - | let $ | |
487 | - | let xp_reduced = $ | |
488 | - | let index = $ | |
496 | + | let $t01040810437 = acc | |
497 | + | let xp_reduced = $t01040810437._1 | |
498 | + | let index = $t01040810437._2 | |
489 | 499 | let dx_expected = if ((index == i)) | |
490 | 500 | then (fraction(xp_j, D1, D0) - new_y) | |
491 | 501 | else (xp_j - fraction(xp_j, D1, D0)) | |
492 | 502 | $Tuple2((xp_reduced :+ (xp_j - fraction(_fee, dx_expected, feeScale6))), (index + 1)) | |
493 | 503 | } | |
494 | 504 | ||
495 | - | let $ | |
505 | + | let $t01069910763 = { | |
496 | 506 | let $l = xp | |
497 | 507 | let $s = size($l) | |
498 | 508 | let $acc0 = $Tuple2(nil, 0) | |
506 | 516 | ||
507 | 517 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
508 | 518 | } | |
509 | - | let xp_reduced = $ | |
510 | - | let index = $ | |
519 | + | let xp_reduced = $t01069910763._1 | |
520 | + | let index = $t01069910763._2 | |
511 | 521 | let xp_reduced_i = xp_reduced[i] | |
512 | 522 | let dy = ((xp_reduced_i - get_y_D(amp, i, xp_reduced, D1)) - 1) | |
513 | 523 | $Tuple2(dy, (dy_0 - dy)) | |
531 | 541 | ||
532 | 542 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
533 | 543 | then { | |
534 | - | let $ | |
535 | - | let call = $ | |
536 | - | let stakingAddr = $ | |
544 | + | let $t01132711393 = calcStakingFuncAndAddres(stake, assetId) | |
545 | + | let call = $t01132711393._1 | |
546 | + | let stakingAddr = $t01132711393._2 | |
537 | 547 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
538 | 548 | } | |
539 | 549 | else { | |
540 | - | let $ | |
541 | - | let call = $ | |
542 | - | let stakingAddr = $ | |
550 | + | let $t01147911545 = calcStakingFuncAndAddres(stake, assetId) | |
551 | + | let call = $t01147911545._1 | |
552 | + | let stakingAddr = $t01147911545._2 | |
543 | 553 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
544 | 554 | } | |
545 | 555 | ||
546 | 556 | ||
547 | 557 | func stake (amount,assetIdString) = if (containsElement(stakingAssets, assetIdString)) | |
548 | 558 | then { | |
549 | - | let $ | |
550 | - | let call = $ | |
551 | - | let addr = $ | |
552 | - | let params = $ | |
553 | - | let payments = $ | |
559 | + | let $t01173211834 = calcStakingParams(true, amount, fromBase58String(assetIdString)) | |
560 | + | let call = $t01173211834._1 | |
561 | + | let addr = $t01173211834._2 | |
562 | + | let params = $t01173211834._3 | |
563 | + | let payments = $t01173211834._4 | |
554 | 564 | invoke(addr, call, params, payments) | |
555 | 565 | } | |
556 | 566 | else 0 | |
558 | 568 | ||
559 | 569 | func unstake (amount,assetIdString) = if (containsElement(stakingAssets, assetIdString)) | |
560 | 570 | then { | |
561 | - | let $ | |
562 | - | let call = $ | |
563 | - | let addr = $ | |
564 | - | let params = $ | |
565 | - | let payments = $ | |
571 | + | let $t01201912122 = calcStakingParams(false, amount, fromBase58String(assetIdString)) | |
572 | + | let call = $t01201912122._1 | |
573 | + | let addr = $t01201912122._2 | |
574 | + | let params = $t01201912122._3 | |
575 | + | let payments = $t01201912122._4 | |
566 | 576 | invoke(addr, call, params, payments) | |
567 | 577 | } | |
568 | 578 | else 0 | |
591 | 601 | func checkSuspicious () = { | |
592 | 602 | let contractBalances = _xp() | |
593 | 603 | func checkBalance (acc,assetId) = { | |
594 | - | let $ | |
595 | - | let suspicious = $ | |
596 | - | let i = $ | |
604 | + | let $t01273312758 = acc | |
605 | + | let suspicious = $t01273312758._1 | |
606 | + | let i = $t01273312758._2 | |
597 | 607 | if (suspicious) | |
598 | 608 | then $Tuple2(suspicious, i) | |
599 | 609 | else { | |
753 | 763 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, payments)) | |
754 | 764 | else { | |
755 | 765 | func parsePayments (acc,assetId) = { | |
756 | - | let $ | |
757 | - | let newBalances = $ | |
758 | - | let i = $ | |
759 | - | let j = $ | |
766 | + | let $t01706617095 = acc | |
767 | + | let newBalances = $t01706617095._1 | |
768 | + | let i = $t01706617095._2 | |
769 | + | let j = $t01706617095._3 | |
760 | 770 | if (if ((paymentsSize > j)) | |
761 | 771 | then (getStrAssetId(payments[j].assetId) == assetId) | |
762 | 772 | else false) | |
764 | 774 | else $Tuple3((newBalances :+ xp[i]), (i + 1), j) | |
765 | 775 | } | |
766 | 776 | ||
767 | - | let $ | |
777 | + | let $t01731517401 = { | |
768 | 778 | let $l = assetIds | |
769 | 779 | let $s = size($l) | |
770 | 780 | let $acc0 = $Tuple3(nil, 0, 0) | |
778 | 788 | ||
779 | 789 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
780 | 790 | } | |
781 | - | let newBalances = $ | |
782 | - | let k = $ | |
783 | - | let parsedPayments = $ | |
791 | + | let newBalances = $t01731517401._1 | |
792 | + | let k = $t01731517401._2 | |
793 | + | let parsedPayments = $t01731517401._3 | |
784 | 794 | if ((paymentsSize > parsedPayments)) | |
785 | 795 | then throw("Incorect payments order") | |
786 | 796 | else if (checkDAppThreshold(newBalances)) | |
792 | 802 | else { | |
793 | 803 | let feeDiscount = calculateFeeDiscount(msg.caller) | |
794 | 804 | func calcScriptActions (acc,newBalance) = { | |
795 | - | let $ | |
796 | - | let invBalances = $ | |
797 | - | let scriptActions = $ | |
798 | - | let i = $ | |
805 | + | let $t01780217843 = acc | |
806 | + | let invBalances = $t01780217843._1 | |
807 | + | let scriptActions = $t01780217843._2 | |
808 | + | let i = $t01780217843._3 | |
799 | 809 | if ((shareSupply > 0)) | |
800 | 810 | then { | |
801 | 811 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
810 | 820 | let finalBalance = (newBalance - fees) | |
811 | 821 | let invariantBalance = (newBalance - fees) | |
812 | 822 | let pmt = (newBalance - xp[i]) | |
823 | + | let lpFees = (fees - governanceFees) | |
813 | 824 | let inv = if ((pmt > 0)) | |
814 | 825 | then stake((pmt - fees), assetIds[i]) | |
815 | 826 | else unstake(fees, assetIds[i]) | |
816 | 827 | if ((inv == inv)) | |
817 | - | then $Tuple3((invBalances :+ invariantBalance), (scriptActions ++ [ScriptTransfer(capMoneyBoxAddress, (fees - governanceFees), fromBase58String(assetIds[i])), ScriptTransfer(moneyBoxAddress, governanceFees, fromBase58String(assetIds[i])), IntegerEntry((assetIds[i] + kAssetBalance), finalBalance)]), (i + 1)) | |
828 | + | then { | |
829 | + | let airdrop = if ((lpFees > 0)) | |
830 | + | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(fromBase58String(assetIds[i]), lpFees)]) | |
831 | + | else 0 | |
832 | + | if ((airdrop == airdrop)) | |
833 | + | then $Tuple3((invBalances :+ invariantBalance), (scriptActions ++ [ScriptTransfer(moneyBoxAddress, governanceFees, fromBase58String(assetIds[i])), IntegerEntry((assetIds[i] + kAssetBalance), finalBalance)]), (i + 1)) | |
834 | + | else throw("Strict value is not equal to itself.") | |
835 | + | } | |
818 | 836 | else throw("Strict value is not equal to itself.") | |
819 | 837 | } | |
820 | 838 | else { | |
825 | 843 | } | |
826 | 844 | } | |
827 | 845 | ||
828 | - | let $ | |
846 | + | let $t01954819636 = { | |
829 | 847 | let $l = newBalances | |
830 | 848 | let $s = size($l) | |
831 | 849 | let $acc0 = $Tuple3(nil, nil, 0) | |
839 | 857 | ||
840 | 858 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
841 | 859 | } | |
842 | - | let invBalances = $ | |
843 | - | let scriptActions = $ | |
860 | + | let invBalances = $t01954819636._1 | |
861 | + | let scriptActions = $t01954819636._2 | |
844 | 862 | let D2 = getDMem(invBalances, amp) | |
845 | 863 | let mint_amount = if ((shareSupply == 0)) | |
846 | 864 | then D1 | |
865 | 883 | } | |
866 | 884 | } | |
867 | 885 | }) | |
886 | + | ||
887 | + | ||
888 | + | ||
889 | + | @Callable(msg) | |
890 | + | func calcMintAmount (newBalances,user) = { | |
891 | + | let amp = _A() | |
892 | + | let xp = _xp() | |
893 | + | let D1 = getDMem(newBalances, amp) | |
894 | + | if ((shareSupply == 0)) | |
895 | + | then $Tuple2(nil, D1) | |
896 | + | else { | |
897 | + | let D0 = getDMem(xp, amp) | |
898 | + | let feeDiscount = calculateFeeDiscount(user) | |
899 | + | func calcInvBalances (acc,newBalance) = { | |
900 | + | let $t02082520851 = acc | |
901 | + | let invBalances = $t02082520851._1 | |
902 | + | let i = $t02082520851._2 | |
903 | + | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
904 | + | let fees = { | |
905 | + | let idealBalance = fraction(D1, xp[i], D0) | |
906 | + | let difference = if ((idealBalance > newBalance)) | |
907 | + | then (idealBalance - newBalance) | |
908 | + | else (newBalance - idealBalance) | |
909 | + | fraction(_fee, difference, feeScale6) | |
910 | + | } | |
911 | + | let invariantBalance = (newBalance - fees) | |
912 | + | $Tuple2((invBalances :+ invariantBalance), (i + 1)) | |
913 | + | } | |
914 | + | ||
915 | + | let $t02145321523 = { | |
916 | + | let $l = newBalances | |
917 | + | let $s = size($l) | |
918 | + | let $acc0 = $Tuple2(nil, 0) | |
919 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
920 | + | then $a | |
921 | + | else calcInvBalances($a, $l[$i]) | |
922 | + | ||
923 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
924 | + | then $a | |
925 | + | else throw("List size exceeds 15") | |
926 | + | ||
927 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
928 | + | } | |
929 | + | let invBalances = $t02145321523._1 | |
930 | + | let k = $t02145321523._2 | |
931 | + | let D2 = getDMem(invBalances, amp) | |
932 | + | let mintAmount = fraction(shareSupply, (D2 - D0), D0) | |
933 | + | $Tuple2(nil, mintAmount) | |
934 | + | } | |
935 | + | } | |
868 | 936 | ||
869 | 937 | ||
870 | 938 | ||
914 | 982 | then throw("Exchange resulted in fewer coins than expected") | |
915 | 983 | else { | |
916 | 984 | func makeNewBalances (acc,tokenBalance) = { | |
917 | - | let $ | |
918 | - | let newBalances = $ | |
919 | - | let i = $ | |
985 | + | let $t02355823584 = acc | |
986 | + | let newBalances = $t02355823584._1 | |
987 | + | let i = $t02355823584._2 | |
920 | 988 | if ((i == fromIndex)) | |
921 | 989 | then $Tuple2((newBalances :+ (tokenBalance + dx)), (i + 1)) | |
922 | 990 | else if ((i == toIndex)) | |
924 | 992 | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
925 | 993 | } | |
926 | 994 | ||
927 | - | let $ | |
995 | + | let $t02383523896 = { | |
928 | 996 | let $l = xp | |
929 | 997 | let $s = size($l) | |
930 | 998 | let $acc0 = $Tuple2(nil, 0) | |
938 | 1006 | ||
939 | 1007 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
940 | 1008 | } | |
941 | - | let newBalances = $ | |
942 | - | let i = $ | |
1009 | + | let newBalances = $t02383523896._1 | |
1010 | + | let i = $t02383523896._2 | |
943 | 1011 | if (checkDAppThreshold(newBalances)) | |
944 | 1012 | then throw() | |
945 | 1013 | else { | |
948 | 1016 | then { | |
949 | 1017 | let us = unstake(_dy, tokenOut) | |
950 | 1018 | if ((us == us)) | |
951 | - | then $Tuple2([IntegerEntry((tokenIn + kAssetBalance), x), IntegerEntry((tokenOut + kAssetBalance), (xp[toIndex] - _dy)), ScriptTransfer(msg.caller, dy, tokenOutB58), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58), ScriptTransfer(capMoneyBoxAddress, (_fee - governanceFees), tokenOutB58)], [dy, tokenOutB58]) | |
1019 | + | then { | |
1020 | + | let lpFees = (_fee - governanceFees) | |
1021 | + | let airdrop = if ((lpFees > 0)) | |
1022 | + | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenOutB58, lpFees)]) | |
1023 | + | else 0 | |
1024 | + | if ((airdrop == airdrop)) | |
1025 | + | then $Tuple2([IntegerEntry((tokenIn + kAssetBalance), x), IntegerEntry((tokenOut + kAssetBalance), (xp[toIndex] - _dy)), ScriptTransfer(msg.caller, dy, tokenOutB58), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58)], [dy, tokenOutB58]) | |
1026 | + | else throw("Strict value is not equal to itself.") | |
1027 | + | } | |
952 | 1028 | else throw("Strict value is not equal to itself.") | |
953 | 1029 | } | |
954 | 1030 | else throw("Strict value is not equal to itself.") | |
973 | 1049 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.originCaller, msg.payments)) | |
974 | 1050 | else { | |
975 | 1051 | func calcScriptActions (acc,balance) = { | |
976 | - | let $ | |
977 | - | let scriptActions = $ | |
978 | - | let i = $ | |
1052 | + | let $t02518725215 = acc | |
1053 | + | let scriptActions = $t02518725215._1 | |
1054 | + | let i = $t02518725215._2 | |
979 | 1055 | let wAmount = fraction(balance, pmtAmount, shareSupply) | |
980 | 1056 | if (assert((wAmount >= minAmounts[i]))) | |
981 | 1057 | then throw("Withdrawal resulted in fewer coins than expected") | |
987 | 1063 | } | |
988 | 1064 | } | |
989 | 1065 | ||
990 | - | let $ | |
1066 | + | let $t02570525773 = { | |
991 | 1067 | let $l = _xp() | |
992 | 1068 | let $s = size($l) | |
993 | 1069 | let $acc0 = $Tuple2(nil, 0) | |
1001 | 1077 | ||
1002 | 1078 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
1003 | 1079 | } | |
1004 | - | let scriptActions = $ | |
1005 | - | let i = $ | |
1080 | + | let scriptActions = $t02570525773._1 | |
1081 | + | let i = $t02570525773._2 | |
1006 | 1082 | (scriptActions ++ [Burn(shareAssetId, pmtAmount), IntegerEntry(kShareAssetSupply, (shareSupply - pmtAmount))]) | |
1007 | 1083 | } | |
1008 | 1084 | } | |
1065 | 1141 | then throw("unknown token") | |
1066 | 1142 | else { | |
1067 | 1143 | let outIndex = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
1144 | + | let tokenOutB58 = fromBase58String(tokenOut) | |
1068 | 1145 | let xp = _xp() | |
1069 | - | let $ | |
1070 | - | let dy = $ | |
1071 | - | let dy_fee = $ | |
1146 | + | let $t02773727819 = _calcWithdrawOneCoin(xp, pmtAmount, outIndex, msg.originCaller) | |
1147 | + | let dy = $t02773727819._1 | |
1148 | + | let dy_fee = $t02773727819._2 | |
1072 | 1149 | if (assert((dy >= minAmount))) | |
1073 | 1150 | then throw("Not enough coins removed") | |
1074 | 1151 | else { | |
1075 | 1152 | let governanceFees = fraction(dy_fee, feeGovernance, feeScale6) | |
1076 | 1153 | let dy_and_fee = (dy + dy_fee) | |
1077 | 1154 | func makeNewBalances (acc,tokenBalance) = { | |
1078 | - | let $ | |
1079 | - | let newBalances = $ | |
1080 | - | let i = $ | |
1155 | + | let $t02807728103 = acc | |
1156 | + | let newBalances = $t02807728103._1 | |
1157 | + | let i = $t02807728103._2 | |
1081 | 1158 | if ((i == outIndex)) | |
1082 | 1159 | then $Tuple2((newBalances :+ (tokenBalance - dy_and_fee)), (i + 1)) | |
1083 | 1160 | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
1084 | 1161 | } | |
1085 | 1162 | ||
1086 | - | let $ | |
1163 | + | let $t02827028331 = { | |
1087 | 1164 | let $l = xp | |
1088 | 1165 | let $s = size($l) | |
1089 | 1166 | let $acc0 = $Tuple2(nil, 0) | |
1097 | 1174 | ||
1098 | 1175 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
1099 | 1176 | } | |
1100 | - | let newBalances = $ | |
1101 | - | let v = $ | |
1177 | + | let newBalances = $t02827028331._1 | |
1178 | + | let v = $t02827028331._2 | |
1102 | 1179 | if (checkDAppThreshold(newBalances)) | |
1103 | 1180 | then throw() | |
1104 | 1181 | else { | |
1105 | 1182 | let us = unstake(dy_and_fee, tokenOut) | |
1106 | 1183 | if ((us == us)) | |
1107 | - | then [ScriptTransfer(msg.originCaller, dy, fromBase58String(tokenOut)), IntegerEntry((assetIds[outIndex] + kAssetBalance), (xp[outIndex] - dy_and_fee)), Burn(shareAssetId, pmtAmount), ScriptTransfer(moneyBoxAddress, governanceFees, fromBase58String(tokenOut)), ScriptTransfer(capMoneyBoxAddress, (dy_fee - governanceFees), fromBase58String(tokenOut)), IntegerEntry(kShareAssetSupply, (shareSupply - pmtAmount))] | |
1184 | + | then { | |
1185 | + | let lpFees = (dy_fee - governanceFees) | |
1186 | + | let airdrop = if ((lpFees > 0)) | |
1187 | + | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenOutB58, lpFees)]) | |
1188 | + | else 0 | |
1189 | + | if ((airdrop == airdrop)) | |
1190 | + | then [ScriptTransfer(msg.originCaller, dy, tokenOutB58), IntegerEntry((assetIds[outIndex] + kAssetBalance), (xp[outIndex] - dy_and_fee)), Burn(shareAssetId, pmtAmount), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58), IntegerEntry(kShareAssetSupply, (shareSupply - pmtAmount))] | |
1191 | + | else throw("Strict value is not equal to itself.") | |
1192 | + | } | |
1108 | 1193 | else throw("Strict value is not equal to itself.") | |
1109 | 1194 | } | |
1110 | 1195 | } | |
1166 | 1251 | let balances = _xp() | |
1167 | 1252 | let D0 = getDMem(balances, amp) | |
1168 | 1253 | func calcNewBalances (acc,balance) = { | |
1169 | - | let $ | |
1170 | - | let newBalances = $ | |
1171 | - | let i = $ | |
1254 | + | let $t03034830374 = acc | |
1255 | + | let newBalances = $t03034830374._1 | |
1256 | + | let i = $t03034830374._2 | |
1172 | 1257 | let newBalance = (balance + (if (deposit) | |
1173 | 1258 | then amounts[i] | |
1174 | 1259 | else -(amounts[i]))) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let PRECISION = 1000000 | |
5 | 5 | ||
6 | 6 | let MAX_A = 1000000 | |
7 | 7 | ||
8 | 8 | let MAX_A_CHANGE = 10 | |
9 | 9 | ||
10 | 10 | let DECIMALS = 6 | |
11 | 11 | ||
12 | 12 | let MIN_RAMP_TIME = (86400 / 60) | |
13 | 13 | ||
14 | 14 | let version = "3.0.0" | |
15 | 15 | ||
16 | 16 | let kVersion = "version" | |
17 | 17 | ||
18 | 18 | let kAssets = "asset_ids" | |
19 | 19 | ||
20 | 20 | let kAssetBalance = "_balance" | |
21 | 21 | ||
22 | 22 | let kActive = "active" | |
23 | 23 | ||
24 | 24 | let kCause = "shutdown_cause" | |
25 | 25 | ||
26 | 26 | let kShareAssetId = "share_asset_id" | |
27 | 27 | ||
28 | 28 | let kShareAssetSupply = "share_asset_supply" | |
29 | 29 | ||
30 | 30 | let kFee = "commission" | |
31 | 31 | ||
32 | 32 | let kDAppThresholdCoef = "dAppThresholdCoef" | |
33 | 33 | ||
34 | 34 | let kUSDNAddress = "staking_usdnnsbt_address" | |
35 | 35 | ||
36 | 36 | let kDiscounts = "discounts" | |
37 | 37 | ||
38 | 38 | let kDiscountValues = "discount_values" | |
39 | 39 | ||
40 | 40 | let kUserSwopInGov = "_SWOP_amount" | |
41 | 41 | ||
42 | 42 | let kFirstHarvest = "first_harvest" | |
43 | 43 | ||
44 | 44 | let kFirstHarvestHeight = "first_harvest_height" | |
45 | 45 | ||
46 | 46 | let kShareLimit = "share_limit_on_first_harvest" | |
47 | 47 | ||
48 | 48 | let kBasePeriod = "base_period" | |
49 | 49 | ||
50 | 50 | let kPeriodLength = "period_length" | |
51 | 51 | ||
52 | 52 | let kStartHeight = "start_height" | |
53 | 53 | ||
54 | 54 | let kAdminPubKey1 = "admin_pub_1" | |
55 | 55 | ||
56 | 56 | let kAdminPubKey2 = "admin_pub_2" | |
57 | 57 | ||
58 | 58 | let kAdminPubKey3 = "admin_pub_3" | |
59 | 59 | ||
60 | 60 | let kAdminInvokePubKey = "admin_invoke_pub" | |
61 | 61 | ||
62 | 62 | let kMoneyBoxAddress = "money_box_address" | |
63 | 63 | ||
64 | 64 | let kGovAddress = "governance_address" | |
65 | 65 | ||
66 | 66 | let kVotingAddress = "voting_address" | |
67 | 67 | ||
68 | 68 | let kFarmingAddress = "farming_address" | |
69 | 69 | ||
70 | + | let kLPFarmingAddress = "lp_farming" | |
71 | + | ||
70 | 72 | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
71 | 73 | ||
72 | 74 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
73 | 75 | case string: String => | |
74 | 76 | fromBase58String(string) | |
75 | 77 | case nothing => | |
76 | 78 | throw((key + "is empty")) | |
77 | 79 | } | |
78 | 80 | ||
79 | 81 | ||
80 | 82 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
81 | 83 | ||
82 | 84 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
83 | 85 | ||
84 | 86 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
85 | 87 | ||
86 | 88 | let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
87 | 89 | ||
88 | 90 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
89 | 91 | ||
90 | 92 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
91 | 93 | ||
92 | 94 | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
93 | 95 | ||
94 | 96 | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
95 | 97 | ||
96 | 98 | let farmingAddress = Address(getBase58FromOracle(kFarmingAddress)) | |
97 | 99 | ||
98 | - | let | |
100 | + | let lpFarmingAddress = Address(getBase58FromOracle(kLPFarmingAddress)) | |
99 | 101 | ||
100 | 102 | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
101 | 103 | ||
102 | 104 | let stakingAssets = [toBase58String(USDN)] | |
103 | 105 | ||
104 | 106 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
105 | 107 | ||
106 | 108 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
107 | 109 | ||
108 | 110 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
109 | 111 | ||
110 | 112 | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3) | |
111 | 113 | ||
112 | 114 | let active = getBooleanValue(this, kActive) | |
113 | 115 | ||
114 | 116 | let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId)) | |
115 | 117 | ||
116 | 118 | let shareSupply = getIntegerValue(this, kShareAssetSupply) | |
117 | 119 | ||
118 | 120 | let feeScale6 = 1000000 | |
119 | 121 | ||
120 | 122 | let fee = getIntegerValue(this, kFee) | |
121 | 123 | ||
122 | 124 | let feeGovernance = fraction(40, feeScale6, 100) | |
123 | 125 | ||
124 | 126 | let initial_A = getIntegerValue(this, "initial_A") | |
125 | 127 | ||
126 | 128 | let future_A = getIntegerValue(this, "future_A") | |
127 | 129 | ||
128 | 130 | let initial_A_time = valueOrElse(getInteger(this, "initial_A_time"), 0) | |
129 | 131 | ||
130 | 132 | let future_A_time = valueOrElse(getInteger(this, "future_A_time"), 0) | |
131 | 133 | ||
132 | 134 | let assetIds = split(getStringValue(this, kAssets), ",") | |
133 | 135 | ||
134 | 136 | let nCoins = size(assetIds) | |
135 | 137 | ||
136 | 138 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
137 | 139 | ||
138 | 140 | ||
139 | 141 | func throwIsActive () = throw("DApp is already active") | |
140 | 142 | ||
141 | 143 | ||
142 | 144 | func isActive () = if (active) | |
143 | 145 | then unit | |
144 | 146 | else throw("DApp is inactive at this moment") | |
145 | 147 | ||
146 | 148 | ||
147 | 149 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
148 | 150 | then unit | |
149 | 151 | else throw("Only admin can call this function") | |
150 | 152 | ||
151 | 153 | ||
152 | 154 | func isSelfCall (i) = if ((this == i.caller)) | |
153 | 155 | then unit | |
154 | 156 | else throw("Only contract itself can call this function") | |
155 | 157 | ||
156 | 158 | ||
157 | 159 | let big2 = toBigInt(2) | |
158 | 160 | ||
159 | 161 | let blockTimestamp = height | |
160 | 162 | ||
161 | 163 | func assert (a) = if (a) | |
162 | 164 | then false | |
163 | 165 | else true | |
164 | 166 | ||
165 | 167 | ||
166 | 168 | func calculateFeeDiscount (userAddr) = { | |
167 | - | let swopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserSwopInGov)), 0) | |
169 | + | let user = match userAddr { | |
170 | + | case u: Address => | |
171 | + | toString(u) | |
172 | + | case u: String => | |
173 | + | u | |
174 | + | case _ => | |
175 | + | throw("Unknow type of user Addr") | |
176 | + | } | |
177 | + | let swopAmount = valueOrElse(getInteger(govAddress, (user + kUserSwopInGov)), 0) | |
168 | 178 | let discountValues = split(getStringValue(oracle, kDiscountValues), ",") | |
169 | 179 | let discounts = split(getStringValue(oracle, kDiscounts), ",") | |
170 | 180 | if (if ((swopAmount >= parseIntValue(discountValues[0]))) | |
171 | 181 | then (parseIntValue(discountValues[1]) > swopAmount) | |
172 | 182 | else false) | |
173 | 183 | then (feeScale6 - parseIntValue(discounts[0])) | |
174 | 184 | else if (if ((swopAmount >= parseIntValue(discountValues[1]))) | |
175 | 185 | then (parseIntValue(discountValues[2]) > swopAmount) | |
176 | 186 | else false) | |
177 | 187 | then (feeScale6 - parseIntValue(discounts[1])) | |
178 | 188 | else if (if ((swopAmount >= parseIntValue(discountValues[2]))) | |
179 | 189 | then (parseIntValue(discountValues[3]) > swopAmount) | |
180 | 190 | else false) | |
181 | 191 | then (feeScale6 - parseIntValue(discounts[2])) | |
182 | 192 | else if (if ((swopAmount >= parseIntValue(discountValues[3]))) | |
183 | 193 | then (parseIntValue(discountValues[4]) > swopAmount) | |
184 | 194 | else false) | |
185 | 195 | then (feeScale6 - parseIntValue(discounts[3])) | |
186 | 196 | else if ((swopAmount >= parseIntValue(discountValues[4]))) | |
187 | 197 | then (feeScale6 - parseIntValue(discounts[4])) | |
188 | 198 | else feeScale6 | |
189 | 199 | } | |
190 | 200 | ||
191 | 201 | ||
192 | 202 | func _A () = { | |
193 | 203 | let t1 = future_A_time | |
194 | 204 | let A1 = future_A | |
195 | 205 | if ((t1 > blockTimestamp)) | |
196 | 206 | then { | |
197 | 207 | let A0 = initial_A | |
198 | 208 | let t0 = initial_A_time | |
199 | 209 | if ((A1 > A0)) | |
200 | 210 | then (A0 + (((A1 - A0) * (blockTimestamp - t0)) / (t1 - t0))) | |
201 | 211 | else (A0 - (((A0 - A1) * (blockTimestamp - t0)) / (t1 - t0))) | |
202 | 212 | } | |
203 | 213 | else A1 | |
204 | 214 | } | |
205 | 215 | ||
206 | 216 | ||
207 | 217 | func _xp () = { | |
208 | 218 | func assetBalances (acc,assetId) = (acc :+ valueOrElse(getInteger(this, (assetId + kAssetBalance)), 0)) | |
209 | 219 | ||
210 | 220 | let $l = assetIds | |
211 | 221 | let $s = size($l) | |
212 | 222 | let $acc0 = nil | |
213 | 223 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
214 | 224 | then $a | |
215 | 225 | else assetBalances($a, $l[$i]) | |
216 | 226 | ||
217 | 227 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
218 | 228 | then $a | |
219 | 229 | else throw("List size exceeds 15") | |
220 | 230 | ||
221 | 231 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
222 | 232 | } | |
223 | 233 | ||
224 | 234 | ||
225 | 235 | func _xp_mem (xp) = xp | |
226 | 236 | ||
227 | 237 | ||
228 | 238 | func sumList (acc,element) = (acc + element) | |
229 | 239 | ||
230 | 240 | ||
231 | 241 | func get_D (xp,amp) = { | |
232 | 242 | let @ = invoke(this, "D", [xp, amp], nil) | |
233 | 243 | if ($isInstanceOf(@, "Int")) | |
234 | 244 | then @ | |
235 | 245 | else throw(($getType(invoke(this, "D", [xp, amp], nil)) + " couldn't be cast to Int")) | |
236 | 246 | } | |
237 | 247 | ||
238 | 248 | ||
239 | 249 | func get_D_internal (xp,amp) = { | |
240 | 250 | let S = { | |
241 | 251 | let $l = xp | |
242 | 252 | let $s = size($l) | |
243 | 253 | let $acc0 = 0 | |
244 | 254 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
245 | 255 | then $a | |
246 | 256 | else sumList($a, $l[$i]) | |
247 | 257 | ||
248 | 258 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
249 | 259 | then $a | |
250 | 260 | else throw("List size exceeds 15") | |
251 | 261 | ||
252 | 262 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
253 | 263 | } | |
254 | 264 | if ((S == 0)) | |
255 | 265 | then 0 | |
256 | 266 | else { | |
257 | 267 | let Ann = (amp * nCoins) | |
258 | 268 | let AnnS = (toBigInt(Ann) * toBigInt(S)) | |
259 | 269 | let Ann1 = toBigInt((Ann - 1)) | |
260 | 270 | func Dproc (acc,i) = if ((acc._2 == true)) | |
261 | 271 | then acc | |
262 | 272 | else { | |
263 | 273 | let Dprev = acc._1 | |
264 | 274 | func D_PProc (D_P,i) = if ((nCoins > i)) | |
265 | 275 | then ((D_P * Dprev) / (toBigInt(xp[i]) * toBigInt(nCoins))) | |
266 | 276 | else D_P | |
267 | 277 | ||
268 | 278 | let D_P = { | |
269 | 279 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
270 | 280 | let $s = size($l) | |
271 | 281 | let $acc0 = Dprev | |
272 | 282 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
273 | 283 | then $a | |
274 | 284 | else D_PProc($a, $l[$i]) | |
275 | 285 | ||
276 | 286 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
277 | 287 | then $a | |
278 | 288 | else throw("List size exceeds 15") | |
279 | 289 | ||
280 | 290 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
281 | 291 | } | |
282 | 292 | let D = fraction((AnnS + (toBigInt(nCoins) * D_P)), Dprev, ((Ann1 * Dprev) + (toBigInt((nCoins + 1)) * D_P))) | |
283 | 293 | if ((D > Dprev)) | |
284 | 294 | then if ((1 >= toInt((D - Dprev)))) | |
285 | 295 | then $Tuple2(D, true) | |
286 | 296 | else $Tuple2(D, false) | |
287 | 297 | else if ((1 >= toInt((Dprev - D)))) | |
288 | 298 | then $Tuple2(D, true) | |
289 | 299 | else $Tuple2(D, false) | |
290 | 300 | } | |
291 | 301 | ||
292 | - | let $ | |
302 | + | let $t068406952 = { | |
293 | 303 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
294 | 304 | let $s = size($l) | |
295 | 305 | let $acc0 = $Tuple2(toBigInt(S), false) | |
296 | 306 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
297 | 307 | then $a | |
298 | 308 | else Dproc($a, $l[$i]) | |
299 | 309 | ||
300 | 310 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
301 | 311 | then $a | |
302 | 312 | else throw("List size exceeds 15") | |
303 | 313 | ||
304 | 314 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
305 | 315 | } | |
306 | - | let D = $ | |
307 | - | let finished = $ | |
316 | + | let D = $t068406952._1 | |
317 | + | let finished = $t068406952._2 | |
308 | 318 | if ((finished == false)) | |
309 | 319 | then throw(("get_D() not finished with " + toString(D))) | |
310 | 320 | else toInt(D) | |
311 | 321 | } | |
312 | 322 | } | |
313 | 323 | ||
314 | 324 | ||
315 | 325 | func getDMem (xp,amp) = get_D(_xp_mem(xp), amp) | |
316 | 326 | ||
317 | 327 | ||
318 | 328 | func getY (in,out,x,xp_) = if (assert((in != out))) | |
319 | 329 | then throw("same coin") | |
320 | 330 | else if (assert(if ((out >= 0)) | |
321 | 331 | then (in >= 0) | |
322 | 332 | else false)) | |
323 | 333 | then throw("below zero") | |
324 | 334 | else if (assert(if ((nCoins > out)) | |
325 | 335 | then (nCoins > in) | |
326 | 336 | else false)) | |
327 | 337 | then throw("above N_COINS") | |
328 | 338 | else { | |
329 | 339 | let amp = _A() | |
330 | 340 | let D = get_D(xp_, amp) | |
331 | 341 | let Ann = (amp * nCoins) | |
332 | 342 | func S_c (acc,i) = { | |
333 | - | let $ | |
334 | - | let S_ = $ | |
335 | - | let c = $ | |
343 | + | let $t075237540 = acc | |
344 | + | let S_ = $t075237540._1 | |
345 | + | let c = $t075237540._2 | |
336 | 346 | let x_ = if ((in == i)) | |
337 | 347 | then x | |
338 | 348 | else xp_[i] | |
339 | 349 | if (if ((i != out)) | |
340 | 350 | then (nCoins > i) | |
341 | 351 | else false) | |
342 | 352 | then $Tuple2((S_ + x_), fraction(c, toBigInt(D), toBigInt((x_ * nCoins)))) | |
343 | 353 | else $Tuple2(S_, c) | |
344 | 354 | } | |
345 | 355 | ||
346 | - | let $ | |
356 | + | let $t077487849 = { | |
347 | 357 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
348 | 358 | let $s = size($l) | |
349 | 359 | let $acc0 = $Tuple2(0, toBigInt(D)) | |
350 | 360 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
351 | 361 | then $a | |
352 | 362 | else S_c($a, $l[$i]) | |
353 | 363 | ||
354 | 364 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
355 | 365 | then $a | |
356 | 366 | else throw("List size exceeds 15") | |
357 | 367 | ||
358 | 368 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
359 | 369 | } | |
360 | - | let S_ = $ | |
361 | - | let c_ = $ | |
370 | + | let S_ = $t077487849._1 | |
371 | + | let c_ = $t077487849._2 | |
362 | 372 | let c = fraction(c_, toBigInt(D), toBigInt((Ann * nCoins))) | |
363 | 373 | let bD = toBigInt(((S_ + (D / Ann)) - D)) | |
364 | 374 | func y_proc (acc,_i) = if ((acc._2 == true)) | |
365 | 375 | then acc | |
366 | 376 | else { | |
367 | 377 | let y_prev = acc._1 | |
368 | 378 | let y = (((y_prev * y_prev) + c) / ((big2 * y_prev) + bD)) | |
369 | 379 | if ((y > y_prev)) | |
370 | 380 | then if ((1 >= toInt((y - y_prev)))) | |
371 | 381 | then $Tuple2(y, true) | |
372 | 382 | else $Tuple2(y, false) | |
373 | 383 | else if ((1 >= toInt((y_prev - y)))) | |
374 | 384 | then $Tuple2(y, true) | |
375 | 385 | else $Tuple2(y, false) | |
376 | 386 | } | |
377 | 387 | ||
378 | - | let $ | |
388 | + | let $t083318448 = { | |
379 | 389 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] | |
380 | 390 | let $s = size($l) | |
381 | 391 | let $acc0 = $Tuple2(toBigInt(D), false) | |
382 | 392 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
383 | 393 | then $a | |
384 | 394 | else y_proc($a, $l[$i]) | |
385 | 395 | ||
386 | 396 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
387 | 397 | then $a | |
388 | 398 | else throw("List size exceeds 16") | |
389 | 399 | ||
390 | 400 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
391 | 401 | } | |
392 | - | let y = $ | |
393 | - | let finished = $ | |
402 | + | let y = $t083318448._1 | |
403 | + | let finished = $t083318448._2 | |
394 | 404 | if ((finished == false)) | |
395 | 405 | then throw(("getY() not finished with " + toString(y))) | |
396 | 406 | else toInt(y) | |
397 | 407 | } | |
398 | 408 | ||
399 | 409 | ||
400 | 410 | func get_y_D (A_,in,xp,D) = if (assert((in >= 0))) | |
401 | 411 | then throw("i below zero") | |
402 | 412 | else if (assert((nCoins > in))) | |
403 | 413 | then throw("i above N_COINS") | |
404 | 414 | else { | |
405 | 415 | let Ann = (A_ * nCoins) | |
406 | 416 | func S_c (acc,i) = { | |
407 | - | let $ | |
408 | - | let S_ = $ | |
409 | - | let c = $ | |
417 | + | let $t088278844 = acc | |
418 | + | let S_ = $t088278844._1 | |
419 | + | let c = $t088278844._2 | |
410 | 420 | let x_ = if (if ((in != i)) | |
411 | 421 | then (nCoins > i) | |
412 | 422 | else false) | |
413 | 423 | then xp[i] | |
414 | 424 | else 0 | |
415 | 425 | if (if ((nCoins > i)) | |
416 | 426 | then (in != i) | |
417 | 427 | else false) | |
418 | 428 | then $Tuple2((S_ + x_), fraction(c, toBigInt(D), toBigInt((x_ * nCoins)))) | |
419 | 429 | else $Tuple2(S_, c) | |
420 | 430 | } | |
421 | 431 | ||
422 | - | let $ | |
432 | + | let $t090649165 = { | |
423 | 433 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
424 | 434 | let $s = size($l) | |
425 | 435 | let $acc0 = $Tuple2(0, toBigInt(D)) | |
426 | 436 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
427 | 437 | then $a | |
428 | 438 | else S_c($a, $l[$i]) | |
429 | 439 | ||
430 | 440 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
431 | 441 | then $a | |
432 | 442 | else throw("List size exceeds 15") | |
433 | 443 | ||
434 | 444 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
435 | 445 | } | |
436 | - | let S_ = $ | |
437 | - | let c_ = $ | |
446 | + | let S_ = $t090649165._1 | |
447 | + | let c_ = $t090649165._2 | |
438 | 448 | let c = fraction(c_, toBigInt(D), toBigInt((Ann * nCoins))) | |
439 | 449 | let bD = toBigInt(((S_ + (D / Ann)) - D)) | |
440 | 450 | func y_D_proc (acc,i) = if ((acc._2 == true)) | |
441 | 451 | then acc | |
442 | 452 | else { | |
443 | 453 | let y_prev = acc._1 | |
444 | 454 | let y = (((y_prev * y_prev) + c) / ((big2 * y_prev) + bD)) | |
445 | 455 | if ((y > y_prev)) | |
446 | 456 | then if ((1 >= toInt((y - y_prev)))) | |
447 | 457 | then $Tuple2(y, true) | |
448 | 458 | else $Tuple2(y, false) | |
449 | 459 | else if ((1 >= toInt((y_prev - y)))) | |
450 | 460 | then $Tuple2(y, true) | |
451 | 461 | else $Tuple2(y, false) | |
452 | 462 | } | |
453 | 463 | ||
454 | - | let $ | |
464 | + | let $t096489767 = { | |
455 | 465 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] | |
456 | 466 | let $s = size($l) | |
457 | 467 | let $acc0 = $Tuple2(toBigInt(D), false) | |
458 | 468 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
459 | 469 | then $a | |
460 | 470 | else y_D_proc($a, $l[$i]) | |
461 | 471 | ||
462 | 472 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
463 | 473 | then $a | |
464 | 474 | else throw("List size exceeds 16") | |
465 | 475 | ||
466 | 476 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
467 | 477 | } | |
468 | - | let y = $ | |
469 | - | let finished = $ | |
478 | + | let y = $t096489767._1 | |
479 | + | let finished = $t096489767._2 | |
470 | 480 | if ((finished == false)) | |
471 | 481 | then throw(("get_y_D() not finished with " + toString(y))) | |
472 | 482 | else toInt(y) | |
473 | 483 | } | |
474 | 484 | ||
475 | 485 | ||
476 | 486 | func _calcWithdrawOneCoin (xp,_token_amount,i,caller) = { | |
477 | 487 | let feeDiscount = calculateFeeDiscount(caller) | |
478 | 488 | let amp = _A() | |
479 | 489 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
480 | 490 | let total_supply = shareSupply | |
481 | 491 | let D0 = get_D(xp, amp) | |
482 | 492 | let D1 = (D0 - fraction(_token_amount, D0, total_supply)) | |
483 | 493 | let new_y = get_y_D(amp, i, xp, D1) | |
484 | 494 | let dy_0 = (xp[i] - new_y) | |
485 | 495 | func xp_reduced_proc (acc,xp_j) = { | |
486 | - | let $ | |
487 | - | let xp_reduced = $ | |
488 | - | let index = $ | |
496 | + | let $t01040810437 = acc | |
497 | + | let xp_reduced = $t01040810437._1 | |
498 | + | let index = $t01040810437._2 | |
489 | 499 | let dx_expected = if ((index == i)) | |
490 | 500 | then (fraction(xp_j, D1, D0) - new_y) | |
491 | 501 | else (xp_j - fraction(xp_j, D1, D0)) | |
492 | 502 | $Tuple2((xp_reduced :+ (xp_j - fraction(_fee, dx_expected, feeScale6))), (index + 1)) | |
493 | 503 | } | |
494 | 504 | ||
495 | - | let $ | |
505 | + | let $t01069910763 = { | |
496 | 506 | let $l = xp | |
497 | 507 | let $s = size($l) | |
498 | 508 | let $acc0 = $Tuple2(nil, 0) | |
499 | 509 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
500 | 510 | then $a | |
501 | 511 | else xp_reduced_proc($a, $l[$i]) | |
502 | 512 | ||
503 | 513 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
504 | 514 | then $a | |
505 | 515 | else throw("List size exceeds 15") | |
506 | 516 | ||
507 | 517 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
508 | 518 | } | |
509 | - | let xp_reduced = $ | |
510 | - | let index = $ | |
519 | + | let xp_reduced = $t01069910763._1 | |
520 | + | let index = $t01069910763._2 | |
511 | 521 | let xp_reduced_i = xp_reduced[i] | |
512 | 522 | let dy = ((xp_reduced_i - get_y_D(amp, i, xp_reduced, D1)) - 1) | |
513 | 523 | $Tuple2(dy, (dy_0 - dy)) | |
514 | 524 | } | |
515 | 525 | ||
516 | 526 | ||
517 | 527 | func getStrAssetId (assetId) = match assetId { | |
518 | 528 | case id: ByteVector => | |
519 | 529 | toBase58String(id) | |
520 | 530 | case waves: Unit => | |
521 | 531 | "WAVES" | |
522 | 532 | case _ => | |
523 | 533 | throw("Match error") | |
524 | 534 | } | |
525 | 535 | ||
526 | 536 | ||
527 | 537 | func calcStakingFuncAndAddres (stake,assetId) = if (stake) | |
528 | 538 | then $Tuple2("lockNeutrino", stakingUSDNAddress) | |
529 | 539 | else $Tuple2("unlockNeutrino", stakingUSDNAddress) | |
530 | 540 | ||
531 | 541 | ||
532 | 542 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
533 | 543 | then { | |
534 | - | let $ | |
535 | - | let call = $ | |
536 | - | let stakingAddr = $ | |
544 | + | let $t01132711393 = calcStakingFuncAndAddres(stake, assetId) | |
545 | + | let call = $t01132711393._1 | |
546 | + | let stakingAddr = $t01132711393._2 | |
537 | 547 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
538 | 548 | } | |
539 | 549 | else { | |
540 | - | let $ | |
541 | - | let call = $ | |
542 | - | let stakingAddr = $ | |
550 | + | let $t01147911545 = calcStakingFuncAndAddres(stake, assetId) | |
551 | + | let call = $t01147911545._1 | |
552 | + | let stakingAddr = $t01147911545._2 | |
543 | 553 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
544 | 554 | } | |
545 | 555 | ||
546 | 556 | ||
547 | 557 | func stake (amount,assetIdString) = if (containsElement(stakingAssets, assetIdString)) | |
548 | 558 | then { | |
549 | - | let $ | |
550 | - | let call = $ | |
551 | - | let addr = $ | |
552 | - | let params = $ | |
553 | - | let payments = $ | |
559 | + | let $t01173211834 = calcStakingParams(true, amount, fromBase58String(assetIdString)) | |
560 | + | let call = $t01173211834._1 | |
561 | + | let addr = $t01173211834._2 | |
562 | + | let params = $t01173211834._3 | |
563 | + | let payments = $t01173211834._4 | |
554 | 564 | invoke(addr, call, params, payments) | |
555 | 565 | } | |
556 | 566 | else 0 | |
557 | 567 | ||
558 | 568 | ||
559 | 569 | func unstake (amount,assetIdString) = if (containsElement(stakingAssets, assetIdString)) | |
560 | 570 | then { | |
561 | - | let $ | |
562 | - | let call = $ | |
563 | - | let addr = $ | |
564 | - | let params = $ | |
565 | - | let payments = $ | |
571 | + | let $t01201912122 = calcStakingParams(false, amount, fromBase58String(assetIdString)) | |
572 | + | let call = $t01201912122._1 | |
573 | + | let addr = $t01201912122._2 | |
574 | + | let params = $t01201912122._3 | |
575 | + | let payments = $t01201912122._4 | |
566 | 576 | invoke(addr, call, params, payments) | |
567 | 577 | } | |
568 | 578 | else 0 | |
569 | 579 | ||
570 | 580 | ||
571 | 581 | func stakedAmount (assetId) = { | |
572 | 582 | let stakedAmountCalculated = match assetId { | |
573 | 583 | case aId: ByteVector => | |
574 | 584 | if ((aId == USDN)) | |
575 | 585 | then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
576 | 586 | else 0 | |
577 | 587 | case _: Unit => | |
578 | 588 | 0 | |
579 | 589 | case _ => | |
580 | 590 | throw("Match error") | |
581 | 591 | } | |
582 | 592 | match stakedAmountCalculated { | |
583 | 593 | case i: Int => | |
584 | 594 | i | |
585 | 595 | case _ => | |
586 | 596 | 0 | |
587 | 597 | } | |
588 | 598 | } | |
589 | 599 | ||
590 | 600 | ||
591 | 601 | func checkSuspicious () = { | |
592 | 602 | let contractBalances = _xp() | |
593 | 603 | func checkBalance (acc,assetId) = { | |
594 | - | let $ | |
595 | - | let suspicious = $ | |
596 | - | let i = $ | |
604 | + | let $t01273312758 = acc | |
605 | + | let suspicious = $t01273312758._1 | |
606 | + | let i = $t01273312758._2 | |
597 | 607 | if (suspicious) | |
598 | 608 | then $Tuple2(suspicious, i) | |
599 | 609 | else { | |
600 | 610 | let aBalance = (assetBalance(this, fromBase58String(assetId)) + stakedAmount(fromBase58String(assetId))) | |
601 | 611 | if ((contractBalances[i] > aBalance)) | |
602 | 612 | then $Tuple2(true, i) | |
603 | 613 | else $Tuple2(false, (i + 1)) | |
604 | 614 | } | |
605 | 615 | } | |
606 | 616 | ||
607 | 617 | let $l = assetIds | |
608 | 618 | let $s = size($l) | |
609 | 619 | let $acc0 = $Tuple2(false, 0) | |
610 | 620 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
611 | 621 | then $a | |
612 | 622 | else checkBalance($a, $l[$i]) | |
613 | 623 | ||
614 | 624 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
615 | 625 | then $a | |
616 | 626 | else throw("List size exceeds 15") | |
617 | 627 | ||
618 | 628 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
619 | 629 | } | |
620 | 630 | ||
621 | 631 | ||
622 | 632 | func suspendSuspicious (i) = suspend(("Suspicious state with asset: " + assetIds[i])) | |
623 | 633 | ||
624 | 634 | ||
625 | 635 | func returnPayments (caller,payments) = { | |
626 | 636 | func parsePayments (acc,payment) = (acc :+ ScriptTransfer(caller, payment.amount, payment.assetId)) | |
627 | 637 | ||
628 | 638 | let $l = payments | |
629 | 639 | let $s = size($l) | |
630 | 640 | let $acc0 = nil | |
631 | 641 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
632 | 642 | then $a | |
633 | 643 | else parsePayments($a, $l[$i]) | |
634 | 644 | ||
635 | 645 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
636 | 646 | then $a | |
637 | 647 | else throw("List size exceeds 15") | |
638 | 648 | ||
639 | 649 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
640 | 650 | } | |
641 | 651 | ||
642 | 652 | ||
643 | 653 | func checkDAppThreshold (newBalances) = { | |
644 | 654 | let dAppThresholdCoef = valueOrErrorMessage(getInteger(this, kDAppThresholdCoef), "No dAppThresholdCoef key") | |
645 | 655 | let thresholdScale = 10000 | |
646 | 656 | let maxBalance = max(newBalances) | |
647 | 657 | let minBalance = min(newBalances) | |
648 | 658 | let ratio = fraction(maxBalance, thresholdScale, minBalance) | |
649 | 659 | if ((ratio > (dAppThresholdCoef * thresholdScale))) | |
650 | 660 | then throw("New balance in assets of the DApp is less than threshold") | |
651 | 661 | else false | |
652 | 662 | } | |
653 | 663 | ||
654 | 664 | ||
655 | 665 | func checkCoins (assetIds) = { | |
656 | 666 | let coins = split(assetIds, ",") | |
657 | 667 | func checkCoin (error,assetId) = { | |
658 | 668 | let asset = valueOrErrorMessage(fromBase58String(assetId), ("fromBase58String: " + assetId)) | |
659 | 669 | let decimals = valueOrErrorMessage(assetInfo(asset), ("assetInfo: " + assetId)).decimals | |
660 | 670 | if ((decimals != DECIMALS)) | |
661 | 671 | then throw("wrong decimals") | |
662 | 672 | else false | |
663 | 673 | } | |
664 | 674 | ||
665 | 675 | let $l = coins | |
666 | 676 | let $s = size($l) | |
667 | 677 | let $acc0 = false | |
668 | 678 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
669 | 679 | then $a | |
670 | 680 | else checkCoin($a, $l[$i]) | |
671 | 681 | ||
672 | 682 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
673 | 683 | then $a | |
674 | 684 | else throw("List size exceeds 15") | |
675 | 685 | ||
676 | 686 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
677 | 687 | } | |
678 | 688 | ||
679 | 689 | ||
680 | 690 | @Callable(msg) | |
681 | 691 | func D (xp,amp) = { | |
682 | 692 | let D = get_D_internal(xp, amp) | |
683 | 693 | $Tuple2([IntegerEntry("D", D)], D) | |
684 | 694 | } | |
685 | 695 | ||
686 | 696 | ||
687 | 697 | ||
688 | 698 | @Callable(msg) | |
689 | 699 | func init (assetIds,_A,_dAppThresholdCoef,firstHarvest) = if (!(isDataStorageUntouched(this))) | |
690 | 700 | then throw("Already initialized") | |
691 | 701 | else if ((0 >= _A)) | |
692 | 702 | then throw("Amp must be must > 0") | |
693 | 703 | else if ((0 >= _dAppThresholdCoef)) | |
694 | 704 | then throw("dApp Threshold Coef must be > 0") | |
695 | 705 | else { | |
696 | 706 | let shareName = "s_Multi_USD" | |
697 | 707 | let shareDescription = ("ShareToken of SwopFi protocol for MultiStable USD pool at address " + toString(this)) | |
698 | 708 | let issueToken = Issue(shareName, shareDescription, 0, 6, true) | |
699 | 709 | let tokenId = calculateAssetId(issueToken) | |
700 | 710 | if (checkCoins(assetIds)) | |
701 | 711 | then throw() | |
702 | 712 | else { | |
703 | 713 | let baseEntry = [StringEntry(kVersion, version), StringEntry(kAssets, assetIds), IntegerEntry("initial_A", _A), IntegerEntry("future_A", _A), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), StringEntry(kShareAssetId, toBase58String(tokenId)), IntegerEntry(kShareAssetSupply, 0), IntegerEntry(kDAppThresholdCoef, _dAppThresholdCoef), BooleanEntry(kActive, true), issueToken] | |
704 | 714 | if (firstHarvest) | |
705 | 715 | then (baseEntry ++ [BooleanEntry(kFirstHarvest, firstHarvest), IntegerEntry(kFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
706 | 716 | else baseEntry | |
707 | 717 | } | |
708 | 718 | } | |
709 | 719 | ||
710 | 720 | ||
711 | 721 | ||
712 | 722 | @Callable(msg) | |
713 | 723 | func addLiquidity (minMintAmount,stakeFarming) = valueOrElse(isActive(), { | |
714 | 724 | let amp = _A() | |
715 | 725 | let xp = _xp() | |
716 | 726 | let D0 = if ((shareSupply == 0)) | |
717 | 727 | then 0 | |
718 | 728 | else getDMem(xp, amp) | |
719 | 729 | let payments = msg.payments | |
720 | 730 | let paymentsSize = size(payments) | |
721 | 731 | func validPayments (n) = if ((paymentsSize > nCoins)) | |
722 | 732 | then throw(("payments size > " + toString(nCoins))) | |
723 | 733 | else if ((1 > paymentsSize)) | |
724 | 734 | then throw("payments size < 1") | |
725 | 735 | else if (if ((shareSupply == 0)) | |
726 | 736 | then (nCoins != paymentsSize) | |
727 | 737 | else false) | |
728 | 738 | then throw("initial deposit requires all coins") | |
729 | 739 | else { | |
730 | 740 | func paymantValid (acc,payment) = if (containsElement(assetIds, getStrAssetId(payment.assetId))) | |
731 | 741 | then true | |
732 | 742 | else throw("Invalid asset in payment") | |
733 | 743 | ||
734 | 744 | let $l = payments | |
735 | 745 | let $s = size($l) | |
736 | 746 | let $acc0 = false | |
737 | 747 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
738 | 748 | then $a | |
739 | 749 | else paymantValid($a, $l[$i]) | |
740 | 750 | ||
741 | 751 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
742 | 752 | then $a | |
743 | 753 | else throw("List size exceeds 15") | |
744 | 754 | ||
745 | 755 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
746 | 756 | } | |
747 | 757 | ||
748 | 758 | if (!(validPayments(paymentsSize))) | |
749 | 759 | then throw() | |
750 | 760 | else { | |
751 | 761 | let suspicious = checkSuspicious() | |
752 | 762 | if (suspicious._1) | |
753 | 763 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, payments)) | |
754 | 764 | else { | |
755 | 765 | func parsePayments (acc,assetId) = { | |
756 | - | let $ | |
757 | - | let newBalances = $ | |
758 | - | let i = $ | |
759 | - | let j = $ | |
766 | + | let $t01706617095 = acc | |
767 | + | let newBalances = $t01706617095._1 | |
768 | + | let i = $t01706617095._2 | |
769 | + | let j = $t01706617095._3 | |
760 | 770 | if (if ((paymentsSize > j)) | |
761 | 771 | then (getStrAssetId(payments[j].assetId) == assetId) | |
762 | 772 | else false) | |
763 | 773 | then $Tuple3((newBalances :+ (xp[i] + payments[j].amount)), (i + 1), (j + 1)) | |
764 | 774 | else $Tuple3((newBalances :+ xp[i]), (i + 1), j) | |
765 | 775 | } | |
766 | 776 | ||
767 | - | let $ | |
777 | + | let $t01731517401 = { | |
768 | 778 | let $l = assetIds | |
769 | 779 | let $s = size($l) | |
770 | 780 | let $acc0 = $Tuple3(nil, 0, 0) | |
771 | 781 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
772 | 782 | then $a | |
773 | 783 | else parsePayments($a, $l[$i]) | |
774 | 784 | ||
775 | 785 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
776 | 786 | then $a | |
777 | 787 | else throw("List size exceeds 15") | |
778 | 788 | ||
779 | 789 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
780 | 790 | } | |
781 | - | let newBalances = $ | |
782 | - | let k = $ | |
783 | - | let parsedPayments = $ | |
791 | + | let newBalances = $t01731517401._1 | |
792 | + | let k = $t01731517401._2 | |
793 | + | let parsedPayments = $t01731517401._3 | |
784 | 794 | if ((paymentsSize > parsedPayments)) | |
785 | 795 | then throw("Incorect payments order") | |
786 | 796 | else if (checkDAppThreshold(newBalances)) | |
787 | 797 | then throw() | |
788 | 798 | else { | |
789 | 799 | let D1 = getDMem(newBalances, amp) | |
790 | 800 | if (assert((D1 > D0))) | |
791 | 801 | then throw("D1 > D0") | |
792 | 802 | else { | |
793 | 803 | let feeDiscount = calculateFeeDiscount(msg.caller) | |
794 | 804 | func calcScriptActions (acc,newBalance) = { | |
795 | - | let $ | |
796 | - | let invBalances = $ | |
797 | - | let scriptActions = $ | |
798 | - | let i = $ | |
805 | + | let $t01780217843 = acc | |
806 | + | let invBalances = $t01780217843._1 | |
807 | + | let scriptActions = $t01780217843._2 | |
808 | + | let i = $t01780217843._3 | |
799 | 809 | if ((shareSupply > 0)) | |
800 | 810 | then { | |
801 | 811 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
802 | 812 | let fees = { | |
803 | 813 | let idealBalance = fraction(D1, xp[i], D0) | |
804 | 814 | let difference = if ((idealBalance > newBalance)) | |
805 | 815 | then (idealBalance - newBalance) | |
806 | 816 | else (newBalance - idealBalance) | |
807 | 817 | fraction(_fee, difference, feeScale6) | |
808 | 818 | } | |
809 | 819 | let governanceFees = fraction(fees, feeGovernance, feeScale6) | |
810 | 820 | let finalBalance = (newBalance - fees) | |
811 | 821 | let invariantBalance = (newBalance - fees) | |
812 | 822 | let pmt = (newBalance - xp[i]) | |
823 | + | let lpFees = (fees - governanceFees) | |
813 | 824 | let inv = if ((pmt > 0)) | |
814 | 825 | then stake((pmt - fees), assetIds[i]) | |
815 | 826 | else unstake(fees, assetIds[i]) | |
816 | 827 | if ((inv == inv)) | |
817 | - | then $Tuple3((invBalances :+ invariantBalance), (scriptActions ++ [ScriptTransfer(capMoneyBoxAddress, (fees - governanceFees), fromBase58String(assetIds[i])), ScriptTransfer(moneyBoxAddress, governanceFees, fromBase58String(assetIds[i])), IntegerEntry((assetIds[i] + kAssetBalance), finalBalance)]), (i + 1)) | |
828 | + | then { | |
829 | + | let airdrop = if ((lpFees > 0)) | |
830 | + | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(fromBase58String(assetIds[i]), lpFees)]) | |
831 | + | else 0 | |
832 | + | if ((airdrop == airdrop)) | |
833 | + | then $Tuple3((invBalances :+ invariantBalance), (scriptActions ++ [ScriptTransfer(moneyBoxAddress, governanceFees, fromBase58String(assetIds[i])), IntegerEntry((assetIds[i] + kAssetBalance), finalBalance)]), (i + 1)) | |
834 | + | else throw("Strict value is not equal to itself.") | |
835 | + | } | |
818 | 836 | else throw("Strict value is not equal to itself.") | |
819 | 837 | } | |
820 | 838 | else { | |
821 | 839 | let inv = stake(newBalance, assetIds[i]) | |
822 | 840 | if ((inv == inv)) | |
823 | 841 | then $Tuple3((invBalances :+ newBalance), (scriptActions :+ IntegerEntry((assetIds[i] + kAssetBalance), newBalance)), (i + 1)) | |
824 | 842 | else throw("Strict value is not equal to itself.") | |
825 | 843 | } | |
826 | 844 | } | |
827 | 845 | ||
828 | - | let $ | |
846 | + | let $t01954819636 = { | |
829 | 847 | let $l = newBalances | |
830 | 848 | let $s = size($l) | |
831 | 849 | let $acc0 = $Tuple3(nil, nil, 0) | |
832 | 850 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
833 | 851 | then $a | |
834 | 852 | else calcScriptActions($a, $l[$i]) | |
835 | 853 | ||
836 | 854 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
837 | 855 | then $a | |
838 | 856 | else throw("List size exceeds 15") | |
839 | 857 | ||
840 | 858 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
841 | 859 | } | |
842 | - | let invBalances = $ | |
843 | - | let scriptActions = $ | |
860 | + | let invBalances = $t01954819636._1 | |
861 | + | let scriptActions = $t01954819636._2 | |
844 | 862 | let D2 = getDMem(invBalances, amp) | |
845 | 863 | let mint_amount = if ((shareSupply == 0)) | |
846 | 864 | then D1 | |
847 | 865 | else fraction(shareSupply, (D2 - D0), D0) | |
848 | 866 | if (assert((mint_amount >= minMintAmount))) | |
849 | 867 | then throw("Slippage screwed you") | |
850 | 868 | else if (stakeFarming) | |
851 | 869 | then { | |
852 | 870 | let re = invoke(this, "reissueShare", [mint_amount], nil) | |
853 | 871 | if ((re == re)) | |
854 | 872 | then { | |
855 | 873 | let s = invoke(farmingAddress, "lockShareTokens", [toString(this)], [AttachedPayment(shareAssetId, mint_amount)]) | |
856 | 874 | if ((s == s)) | |
857 | 875 | then (scriptActions :+ IntegerEntry(kShareAssetSupply, (shareSupply + mint_amount))) | |
858 | 876 | else throw("Strict value is not equal to itself.") | |
859 | 877 | } | |
860 | 878 | else throw("Strict value is not equal to itself.") | |
861 | 879 | } | |
862 | 880 | else (scriptActions ++ [Reissue(shareAssetId, mint_amount, true), ScriptTransfer(msg.caller, mint_amount, shareAssetId), IntegerEntry(kShareAssetSupply, (shareSupply + mint_amount))]) | |
863 | 881 | } | |
864 | 882 | } | |
865 | 883 | } | |
866 | 884 | } | |
867 | 885 | }) | |
886 | + | ||
887 | + | ||
888 | + | ||
889 | + | @Callable(msg) | |
890 | + | func calcMintAmount (newBalances,user) = { | |
891 | + | let amp = _A() | |
892 | + | let xp = _xp() | |
893 | + | let D1 = getDMem(newBalances, amp) | |
894 | + | if ((shareSupply == 0)) | |
895 | + | then $Tuple2(nil, D1) | |
896 | + | else { | |
897 | + | let D0 = getDMem(xp, amp) | |
898 | + | let feeDiscount = calculateFeeDiscount(user) | |
899 | + | func calcInvBalances (acc,newBalance) = { | |
900 | + | let $t02082520851 = acc | |
901 | + | let invBalances = $t02082520851._1 | |
902 | + | let i = $t02082520851._2 | |
903 | + | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
904 | + | let fees = { | |
905 | + | let idealBalance = fraction(D1, xp[i], D0) | |
906 | + | let difference = if ((idealBalance > newBalance)) | |
907 | + | then (idealBalance - newBalance) | |
908 | + | else (newBalance - idealBalance) | |
909 | + | fraction(_fee, difference, feeScale6) | |
910 | + | } | |
911 | + | let invariantBalance = (newBalance - fees) | |
912 | + | $Tuple2((invBalances :+ invariantBalance), (i + 1)) | |
913 | + | } | |
914 | + | ||
915 | + | let $t02145321523 = { | |
916 | + | let $l = newBalances | |
917 | + | let $s = size($l) | |
918 | + | let $acc0 = $Tuple2(nil, 0) | |
919 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
920 | + | then $a | |
921 | + | else calcInvBalances($a, $l[$i]) | |
922 | + | ||
923 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
924 | + | then $a | |
925 | + | else throw("List size exceeds 15") | |
926 | + | ||
927 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
928 | + | } | |
929 | + | let invBalances = $t02145321523._1 | |
930 | + | let k = $t02145321523._2 | |
931 | + | let D2 = getDMem(invBalances, amp) | |
932 | + | let mintAmount = fraction(shareSupply, (D2 - D0), D0) | |
933 | + | $Tuple2(nil, mintAmount) | |
934 | + | } | |
935 | + | } | |
868 | 936 | ||
869 | 937 | ||
870 | 938 | ||
871 | 939 | @Callable(msg) | |
872 | 940 | func reissueShare (amount) = valueOrElse(isSelfCall(msg), [Reissue(shareAssetId, amount, true)]) | |
873 | 941 | ||
874 | 942 | ||
875 | 943 | ||
876 | 944 | @Callable(msg) | |
877 | 945 | func getDy (assetFrom,assetTo,dx,userAddress) = { | |
878 | 946 | let xp = _xp() | |
879 | 947 | let fromIndex = valueOrErrorMessage(indexOf(assetIds, assetFrom), "unknown token in") | |
880 | 948 | let toIndex = valueOrErrorMessage(indexOf(assetIds, assetTo), "unknown token out") | |
881 | 949 | let x = (xp[fromIndex] + dx) | |
882 | 950 | let y = getY(fromIndex, toIndex, x, xp) | |
883 | 951 | let dy = ((xp[toIndex] - y) - 1) | |
884 | 952 | let feeDiscount = calculateFeeDiscount(Address(fromBase58String(userAddress))) | |
885 | 953 | let _fee = fraction(fraction(fee, feeDiscount, feeScale6, CEILING), dy, feeScale6) | |
886 | 954 | $Tuple2(nil, $Tuple2((dy - _fee), _fee)) | |
887 | 955 | } | |
888 | 956 | ||
889 | 957 | ||
890 | 958 | ||
891 | 959 | @Callable(msg) | |
892 | 960 | func exchange (tokenOut,min_dy) = valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
893 | 961 | then throw("size(payments) != 1") | |
894 | 962 | else { | |
895 | 963 | let suspicious = checkSuspicious() | |
896 | 964 | if (suspicious._1) | |
897 | 965 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, msg.payments)) | |
898 | 966 | else { | |
899 | 967 | let payment = msg.payments[0] | |
900 | 968 | let tokenIn = getStrAssetId(payment.assetId) | |
901 | 969 | let tokenOutB58 = fromBase58String(tokenOut) | |
902 | 970 | let dx = payment.amount | |
903 | 971 | let fromIndex = valueOrErrorMessage(indexOf(assetIds, tokenIn), "unknown token in") | |
904 | 972 | let toIndex = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
905 | 973 | let xp = _xp() | |
906 | 974 | let x = (xp[fromIndex] + dx) | |
907 | 975 | let y = getY(fromIndex, toIndex, x, xp) | |
908 | 976 | let _dy = ((xp[toIndex] - y) - 1) | |
909 | 977 | let feeDiscount = calculateFeeDiscount(msg.caller) | |
910 | 978 | let _fee = fraction(_dy, fraction(fee, feeDiscount, feeScale6, CEILING), feeScale6) | |
911 | 979 | let dy = (_dy - _fee) | |
912 | 980 | let governanceFees = fraction(_fee, feeGovernance, feeScale6) | |
913 | 981 | if (assert((dy >= min_dy))) | |
914 | 982 | then throw("Exchange resulted in fewer coins than expected") | |
915 | 983 | else { | |
916 | 984 | func makeNewBalances (acc,tokenBalance) = { | |
917 | - | let $ | |
918 | - | let newBalances = $ | |
919 | - | let i = $ | |
985 | + | let $t02355823584 = acc | |
986 | + | let newBalances = $t02355823584._1 | |
987 | + | let i = $t02355823584._2 | |
920 | 988 | if ((i == fromIndex)) | |
921 | 989 | then $Tuple2((newBalances :+ (tokenBalance + dx)), (i + 1)) | |
922 | 990 | else if ((i == toIndex)) | |
923 | 991 | then $Tuple2((newBalances :+ (tokenBalance - _dy)), (i + 1)) | |
924 | 992 | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
925 | 993 | } | |
926 | 994 | ||
927 | - | let $ | |
995 | + | let $t02383523896 = { | |
928 | 996 | let $l = xp | |
929 | 997 | let $s = size($l) | |
930 | 998 | let $acc0 = $Tuple2(nil, 0) | |
931 | 999 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
932 | 1000 | then $a | |
933 | 1001 | else makeNewBalances($a, $l[$i]) | |
934 | 1002 | ||
935 | 1003 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
936 | 1004 | then $a | |
937 | 1005 | else throw("List size exceeds 15") | |
938 | 1006 | ||
939 | 1007 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
940 | 1008 | } | |
941 | - | let newBalances = $ | |
942 | - | let i = $ | |
1009 | + | let newBalances = $t02383523896._1 | |
1010 | + | let i = $t02383523896._2 | |
943 | 1011 | if (checkDAppThreshold(newBalances)) | |
944 | 1012 | then throw() | |
945 | 1013 | else { | |
946 | 1014 | let s = stake(payment.amount, getStrAssetId(payment.assetId)) | |
947 | 1015 | if ((s == s)) | |
948 | 1016 | then { | |
949 | 1017 | let us = unstake(_dy, tokenOut) | |
950 | 1018 | if ((us == us)) | |
951 | - | then $Tuple2([IntegerEntry((tokenIn + kAssetBalance), x), IntegerEntry((tokenOut + kAssetBalance), (xp[toIndex] - _dy)), ScriptTransfer(msg.caller, dy, tokenOutB58), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58), ScriptTransfer(capMoneyBoxAddress, (_fee - governanceFees), tokenOutB58)], [dy, tokenOutB58]) | |
1019 | + | then { | |
1020 | + | let lpFees = (_fee - governanceFees) | |
1021 | + | let airdrop = if ((lpFees > 0)) | |
1022 | + | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenOutB58, lpFees)]) | |
1023 | + | else 0 | |
1024 | + | if ((airdrop == airdrop)) | |
1025 | + | then $Tuple2([IntegerEntry((tokenIn + kAssetBalance), x), IntegerEntry((tokenOut + kAssetBalance), (xp[toIndex] - _dy)), ScriptTransfer(msg.caller, dy, tokenOutB58), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58)], [dy, tokenOutB58]) | |
1026 | + | else throw("Strict value is not equal to itself.") | |
1027 | + | } | |
952 | 1028 | else throw("Strict value is not equal to itself.") | |
953 | 1029 | } | |
954 | 1030 | else throw("Strict value is not equal to itself.") | |
955 | 1031 | } | |
956 | 1032 | } | |
957 | 1033 | } | |
958 | 1034 | }) | |
959 | 1035 | ||
960 | 1036 | ||
961 | 1037 | ||
962 | 1038 | @Callable(msg) | |
963 | 1039 | func withdraw (minAmounts) = valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
964 | 1040 | then throw("size(payments) != 1") | |
965 | 1041 | else { | |
966 | 1042 | let pmtAmount = msg.payments[0].amount | |
967 | 1043 | let pmtAssetId = msg.payments[0].assetId | |
968 | 1044 | if ((shareAssetId != pmtAssetId)) | |
969 | 1045 | then throw("unknown payment token") | |
970 | 1046 | else { | |
971 | 1047 | let suspicious = checkSuspicious() | |
972 | 1048 | if (suspicious._1) | |
973 | 1049 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.originCaller, msg.payments)) | |
974 | 1050 | else { | |
975 | 1051 | func calcScriptActions (acc,balance) = { | |
976 | - | let $ | |
977 | - | let scriptActions = $ | |
978 | - | let i = $ | |
1052 | + | let $t02518725215 = acc | |
1053 | + | let scriptActions = $t02518725215._1 | |
1054 | + | let i = $t02518725215._2 | |
979 | 1055 | let wAmount = fraction(balance, pmtAmount, shareSupply) | |
980 | 1056 | if (assert((wAmount >= minAmounts[i]))) | |
981 | 1057 | then throw("Withdrawal resulted in fewer coins than expected") | |
982 | 1058 | else { | |
983 | 1059 | let us = unstake(wAmount, assetIds[i]) | |
984 | 1060 | if ((us == us)) | |
985 | 1061 | then $Tuple2((scriptActions ++ [IntegerEntry((assetIds[i] + kAssetBalance), (balance - wAmount)), ScriptTransfer(msg.originCaller, wAmount, fromBase58String(assetIds[i]))]), (i + 1)) | |
986 | 1062 | else throw("Strict value is not equal to itself.") | |
987 | 1063 | } | |
988 | 1064 | } | |
989 | 1065 | ||
990 | - | let $ | |
1066 | + | let $t02570525773 = { | |
991 | 1067 | let $l = _xp() | |
992 | 1068 | let $s = size($l) | |
993 | 1069 | let $acc0 = $Tuple2(nil, 0) | |
994 | 1070 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
995 | 1071 | then $a | |
996 | 1072 | else calcScriptActions($a, $l[$i]) | |
997 | 1073 | ||
998 | 1074 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
999 | 1075 | then $a | |
1000 | 1076 | else throw("List size exceeds 15") | |
1001 | 1077 | ||
1002 | 1078 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
1003 | 1079 | } | |
1004 | - | let scriptActions = $ | |
1005 | - | let i = $ | |
1080 | + | let scriptActions = $t02570525773._1 | |
1081 | + | let i = $t02570525773._2 | |
1006 | 1082 | (scriptActions ++ [Burn(shareAssetId, pmtAmount), IntegerEntry(kShareAssetSupply, (shareSupply - pmtAmount))]) | |
1007 | 1083 | } | |
1008 | 1084 | } | |
1009 | 1085 | }) | |
1010 | 1086 | ||
1011 | 1087 | ||
1012 | 1088 | ||
1013 | 1089 | @Callable(msg) | |
1014 | 1090 | func withdrawWithUnlock (minAmounts,unlockAmount) = valueOrElse(isActive(), if ((0 >= unlockAmount)) | |
1015 | 1091 | then throw("Unlock amount must be positive") | |
1016 | 1092 | else { | |
1017 | 1093 | let suspicious = checkSuspicious() | |
1018 | 1094 | if (suspicious._1) | |
1019 | 1095 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, msg.payments)) | |
1020 | 1096 | else { | |
1021 | 1097 | let pmtAmount = if ((size(msg.payments) > 0)) | |
1022 | 1098 | then if ((size(msg.payments) != 1)) | |
1023 | 1099 | then throw("size(payments) != 1") | |
1024 | 1100 | else { | |
1025 | 1101 | let pmtAssetId = msg.payments[0].assetId | |
1026 | 1102 | if ((shareAssetId != pmtAssetId)) | |
1027 | 1103 | then throw("unknown payment token") | |
1028 | 1104 | else msg.payments[0].amount | |
1029 | 1105 | } | |
1030 | 1106 | else 0 | |
1031 | 1107 | let unlock = invoke(farmingAddress, "withdrawShareTokens", [toString(this), unlockAmount], nil) | |
1032 | 1108 | if ((unlock == unlock)) | |
1033 | 1109 | then { | |
1034 | 1110 | let withdrawAmount = (pmtAmount + unlockAmount) | |
1035 | 1111 | let inv = invoke(this, "withdraw", [minAmounts], [AttachedPayment(shareAssetId, withdrawAmount)]) | |
1036 | 1112 | if ((inv == inv)) | |
1037 | 1113 | then nil | |
1038 | 1114 | else throw("Strict value is not equal to itself.") | |
1039 | 1115 | } | |
1040 | 1116 | else throw("Strict value is not equal to itself.") | |
1041 | 1117 | } | |
1042 | 1118 | }) | |
1043 | 1119 | ||
1044 | 1120 | ||
1045 | 1121 | ||
1046 | 1122 | @Callable(msg) | |
1047 | 1123 | func calcWithdrawOneCoin (tokenAmount,tokenOut,user) = { | |
1048 | 1124 | let i = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
1049 | 1125 | $Tuple2(nil, _calcWithdrawOneCoin(_xp(), tokenAmount, i, Address(fromBase58String(user)))._1) | |
1050 | 1126 | } | |
1051 | 1127 | ||
1052 | 1128 | ||
1053 | 1129 | ||
1054 | 1130 | @Callable(msg) | |
1055 | 1131 | func withdrawOneCoin (tokenOut,minAmount) = valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
1056 | 1132 | then throw("size(payments) != 1") | |
1057 | 1133 | else { | |
1058 | 1134 | let suspicious = checkSuspicious() | |
1059 | 1135 | if (suspicious._1) | |
1060 | 1136 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.originCaller, msg.payments)) | |
1061 | 1137 | else { | |
1062 | 1138 | let pmtAmount = msg.payments[0].amount | |
1063 | 1139 | let pmtAssetId = msg.payments[0].assetId | |
1064 | 1140 | if ((pmtAssetId != shareAssetId)) | |
1065 | 1141 | then throw("unknown token") | |
1066 | 1142 | else { | |
1067 | 1143 | let outIndex = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
1144 | + | let tokenOutB58 = fromBase58String(tokenOut) | |
1068 | 1145 | let xp = _xp() | |
1069 | - | let $ | |
1070 | - | let dy = $ | |
1071 | - | let dy_fee = $ | |
1146 | + | let $t02773727819 = _calcWithdrawOneCoin(xp, pmtAmount, outIndex, msg.originCaller) | |
1147 | + | let dy = $t02773727819._1 | |
1148 | + | let dy_fee = $t02773727819._2 | |
1072 | 1149 | if (assert((dy >= minAmount))) | |
1073 | 1150 | then throw("Not enough coins removed") | |
1074 | 1151 | else { | |
1075 | 1152 | let governanceFees = fraction(dy_fee, feeGovernance, feeScale6) | |
1076 | 1153 | let dy_and_fee = (dy + dy_fee) | |
1077 | 1154 | func makeNewBalances (acc,tokenBalance) = { | |
1078 | - | let $ | |
1079 | - | let newBalances = $ | |
1080 | - | let i = $ | |
1155 | + | let $t02807728103 = acc | |
1156 | + | let newBalances = $t02807728103._1 | |
1157 | + | let i = $t02807728103._2 | |
1081 | 1158 | if ((i == outIndex)) | |
1082 | 1159 | then $Tuple2((newBalances :+ (tokenBalance - dy_and_fee)), (i + 1)) | |
1083 | 1160 | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
1084 | 1161 | } | |
1085 | 1162 | ||
1086 | - | let $ | |
1163 | + | let $t02827028331 = { | |
1087 | 1164 | let $l = xp | |
1088 | 1165 | let $s = size($l) | |
1089 | 1166 | let $acc0 = $Tuple2(nil, 0) | |
1090 | 1167 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1091 | 1168 | then $a | |
1092 | 1169 | else makeNewBalances($a, $l[$i]) | |
1093 | 1170 | ||
1094 | 1171 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1095 | 1172 | then $a | |
1096 | 1173 | else throw("List size exceeds 15") | |
1097 | 1174 | ||
1098 | 1175 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
1099 | 1176 | } | |
1100 | - | let newBalances = $ | |
1101 | - | let v = $ | |
1177 | + | let newBalances = $t02827028331._1 | |
1178 | + | let v = $t02827028331._2 | |
1102 | 1179 | if (checkDAppThreshold(newBalances)) | |
1103 | 1180 | then throw() | |
1104 | 1181 | else { | |
1105 | 1182 | let us = unstake(dy_and_fee, tokenOut) | |
1106 | 1183 | if ((us == us)) | |
1107 | - | then [ScriptTransfer(msg.originCaller, dy, fromBase58String(tokenOut)), IntegerEntry((assetIds[outIndex] + kAssetBalance), (xp[outIndex] - dy_and_fee)), Burn(shareAssetId, pmtAmount), ScriptTransfer(moneyBoxAddress, governanceFees, fromBase58String(tokenOut)), ScriptTransfer(capMoneyBoxAddress, (dy_fee - governanceFees), fromBase58String(tokenOut)), IntegerEntry(kShareAssetSupply, (shareSupply - pmtAmount))] | |
1184 | + | then { | |
1185 | + | let lpFees = (dy_fee - governanceFees) | |
1186 | + | let airdrop = if ((lpFees > 0)) | |
1187 | + | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenOutB58, lpFees)]) | |
1188 | + | else 0 | |
1189 | + | if ((airdrop == airdrop)) | |
1190 | + | then [ScriptTransfer(msg.originCaller, dy, tokenOutB58), IntegerEntry((assetIds[outIndex] + kAssetBalance), (xp[outIndex] - dy_and_fee)), Burn(shareAssetId, pmtAmount), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58), IntegerEntry(kShareAssetSupply, (shareSupply - pmtAmount))] | |
1191 | + | else throw("Strict value is not equal to itself.") | |
1192 | + | } | |
1108 | 1193 | else throw("Strict value is not equal to itself.") | |
1109 | 1194 | } | |
1110 | 1195 | } | |
1111 | 1196 | } | |
1112 | 1197 | } | |
1113 | 1198 | }) | |
1114 | 1199 | ||
1115 | 1200 | ||
1116 | 1201 | ||
1117 | 1202 | @Callable(msg) | |
1118 | 1203 | func withdrawOneCoinWithUnlock (tokenOut,minAmount,unlockAmount) = valueOrElse(isActive(), if ((0 >= unlockAmount)) | |
1119 | 1204 | then throw("Unlock amount must be positive") | |
1120 | 1205 | else { | |
1121 | 1206 | let suspicious = checkSuspicious() | |
1122 | 1207 | if (suspicious._1) | |
1123 | 1208 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, msg.payments)) | |
1124 | 1209 | else { | |
1125 | 1210 | let pmtAmount = if ((size(msg.payments) > 0)) | |
1126 | 1211 | then if ((size(msg.payments) != 1)) | |
1127 | 1212 | then throw("size(payments) != 1") | |
1128 | 1213 | else { | |
1129 | 1214 | let pmtAssetId = msg.payments[0].assetId | |
1130 | 1215 | if ((shareAssetId != pmtAssetId)) | |
1131 | 1216 | then throw("unknown payment token") | |
1132 | 1217 | else msg.payments[0].amount | |
1133 | 1218 | } | |
1134 | 1219 | else 0 | |
1135 | 1220 | let unlock = invoke(farmingAddress, "withdrawShareTokens", [toString(this), unlockAmount], nil) | |
1136 | 1221 | if ((unlock == unlock)) | |
1137 | 1222 | then { | |
1138 | 1223 | let withdrawAmount = (pmtAmount + unlockAmount) | |
1139 | 1224 | let inv = invoke(this, "withdrawOneCoin", [tokenOut, minAmount], [AttachedPayment(shareAssetId, withdrawAmount)]) | |
1140 | 1225 | if ((inv == inv)) | |
1141 | 1226 | then nil | |
1142 | 1227 | else throw("Strict value is not equal to itself.") | |
1143 | 1228 | } | |
1144 | 1229 | else throw("Strict value is not equal to itself.") | |
1145 | 1230 | } | |
1146 | 1231 | }) | |
1147 | 1232 | ||
1148 | 1233 | ||
1149 | 1234 | ||
1150 | 1235 | @Callable(msg) | |
1151 | 1236 | func A () = $Tuple2(nil, _A()) | |
1152 | 1237 | ||
1153 | 1238 | ||
1154 | 1239 | ||
1155 | 1240 | @Callable(msg) | |
1156 | 1241 | func getVirtualPrice () = { | |
1157 | 1242 | let D = get_D(_xp(), _A()) | |
1158 | 1243 | $Tuple2(nil, fraction(D, PRECISION, shareSupply)) | |
1159 | 1244 | } | |
1160 | 1245 | ||
1161 | 1246 | ||
1162 | 1247 | ||
1163 | 1248 | @Callable(msg) | |
1164 | 1249 | func calcTokenAmount (amounts,deposit) = { | |
1165 | 1250 | let amp = _A() | |
1166 | 1251 | let balances = _xp() | |
1167 | 1252 | let D0 = getDMem(balances, amp) | |
1168 | 1253 | func calcNewBalances (acc,balance) = { | |
1169 | - | let $ | |
1170 | - | let newBalances = $ | |
1171 | - | let i = $ | |
1254 | + | let $t03034830374 = acc | |
1255 | + | let newBalances = $t03034830374._1 | |
1256 | + | let i = $t03034830374._2 | |
1172 | 1257 | let newBalance = (balance + (if (deposit) | |
1173 | 1258 | then amounts[i] | |
1174 | 1259 | else -(amounts[i]))) | |
1175 | 1260 | $Tuple2((newBalances :+ newBalance), (i + 1)) | |
1176 | 1261 | } | |
1177 | 1262 | ||
1178 | 1263 | let newBalances = ( let $l = balances | |
1179 | 1264 | let $s = size($l) | |
1180 | 1265 | let $acc0 = $Tuple2(nil, 0) | |
1181 | 1266 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1182 | 1267 | then $a | |
1183 | 1268 | else calcNewBalances($a, $l[$i]) | |
1184 | 1269 | ||
1185 | 1270 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1186 | 1271 | then $a | |
1187 | 1272 | else throw("List size exceeds 15") | |
1188 | 1273 | ||
1189 | 1274 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15))._1 | |
1190 | 1275 | let D1 = getDMem(newBalances, amp) | |
1191 | 1276 | let diff = if (deposit) | |
1192 | 1277 | then (D1 - D0) | |
1193 | 1278 | else (D0 - D1) | |
1194 | 1279 | $Tuple2(nil, fraction(diff, shareSupply, D0)) | |
1195 | 1280 | } | |
1196 | 1281 | ||
1197 | 1282 | ||
1198 | 1283 | ||
1199 | 1284 | @Callable(msg) | |
1200 | 1285 | func rampA (_futureA,_futureTime) = valueOrElse(isActive(), valueOrElse(isAdminCall(msg), if (assert((blockTimestamp >= (initial_A_time + MIN_RAMP_TIME)))) | |
1201 | 1286 | then throw("too often") | |
1202 | 1287 | else if (assert((_futureTime >= (blockTimestamp + MIN_RAMP_TIME)))) | |
1203 | 1288 | then throw("insufficient time") | |
1204 | 1289 | else { | |
1205 | 1290 | let _initial_A = _A() | |
1206 | 1291 | if (assert(if ((_futureA > 0)) | |
1207 | 1292 | then (MAX_A > _futureA) | |
1208 | 1293 | else false)) | |
1209 | 1294 | then throw("out of base range") | |
1210 | 1295 | else if (assert(if (if ((_futureA >= _initial_A)) | |
1211 | 1296 | then ((_initial_A * MAX_A_CHANGE) >= _futureA) | |
1212 | 1297 | else false) | |
1213 | 1298 | then true | |
1214 | 1299 | else if ((_initial_A > _futureA)) | |
1215 | 1300 | then ((_futureA * MAX_A_CHANGE) >= _initial_A) | |
1216 | 1301 | else false)) | |
1217 | 1302 | then throw("out of range") | |
1218 | 1303 | else [IntegerEntry("initial_A", _initial_A), IntegerEntry("future_A", _futureA), IntegerEntry("initial_A_time", blockTimestamp), IntegerEntry("future_A_time", _futureTime)] | |
1219 | 1304 | })) | |
1220 | 1305 | ||
1221 | 1306 | ||
1222 | 1307 | ||
1223 | 1308 | @Callable(msg) | |
1224 | 1309 | func stopRampA () = valueOrElse(isActive(), valueOrElse(isAdminCall(msg), { | |
1225 | 1310 | let currentA = _A() | |
1226 | 1311 | [IntegerEntry("initial_A", currentA), IntegerEntry("future_A", currentA), IntegerEntry("initial_A_time", blockTimestamp), IntegerEntry("future_A_time", blockTimestamp)] | |
1227 | 1312 | })) | |
1228 | 1313 | ||
1229 | 1314 | ||
1230 | 1315 | ||
1231 | 1316 | @Callable(msg) | |
1232 | 1317 | func shutdown () = valueOrElse(isAdminCall(msg), if (!(active)) | |
1233 | 1318 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
1234 | 1319 | else suspend("Paused by admin")) | |
1235 | 1320 | ||
1236 | 1321 | ||
1237 | 1322 | ||
1238 | 1323 | @Callable(msg) | |
1239 | 1324 | func activate () = valueOrElse(isAdminCall(msg), if (active) | |
1240 | 1325 | then throwIsActive() | |
1241 | 1326 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
1242 | 1327 | ||
1243 | 1328 | ||
1244 | 1329 | ||
1245 | 1330 | @Callable(msg) | |
1246 | 1331 | func keepLimitForFirstHarvest (shareLimit) = valueOrElse(isActive(), valueOrElse(isAdminCall(msg), [IntegerEntry(kShareLimit, shareLimit)])) | |
1247 | 1332 | ||
1248 | 1333 | ||
1249 | 1334 | @Verifier(tx) | |
1250 | 1335 | func verify () = { | |
1251 | 1336 | let multiSignedByAdmins = { | |
1252 | 1337 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
1253 | 1338 | then 1 | |
1254 | 1339 | else 0 | |
1255 | 1340 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
1256 | 1341 | then 1 | |
1257 | 1342 | else 0 | |
1258 | 1343 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
1259 | 1344 | then 1 | |
1260 | 1345 | else 0 | |
1261 | 1346 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
1262 | 1347 | } | |
1263 | 1348 | match tx { | |
1264 | 1349 | case inv: InvokeScriptTransaction => | |
1265 | 1350 | let callTakeIntoAccount = if ((inv.dApp == this)) | |
1266 | 1351 | then (inv.function == "takeIntoAccountExtraFunds") | |
1267 | 1352 | else false | |
1268 | 1353 | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
1269 | 1354 | then true | |
1270 | 1355 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
1271 | 1356 | then true | |
1272 | 1357 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
1273 | 1358 | then true | |
1274 | 1359 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyInvoke) | |
1275 | 1360 | if (if (callTakeIntoAccount) | |
1276 | 1361 | then signedByAdmin | |
1277 | 1362 | else false) | |
1278 | 1363 | then true | |
1279 | 1364 | else multiSignedByAdmins | |
1280 | 1365 | case _ => | |
1281 | 1366 | multiSignedByAdmins | |
1282 | 1367 | } | |
1283 | 1368 | } | |
1284 | 1369 |
github/deemru/w8io/026f985 177.11 ms ◑