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