tx · EKSesAnP68WHkuQ7YVvgEicae27p2jtHiVbgJ3s3rZkg 3MpygN8qm376tUAHB6mhC5BxG5NKYortiyX: -0.14000000 Waves 2022.12.13 12:25 [2358366] smart account 3MpygN8qm376tUAHB6mhC5BxG5NKYortiyX > SELF 0.00000000 Waves
{ "type": 13, "id": "EKSesAnP68WHkuQ7YVvgEicae27p2jtHiVbgJ3s3rZkg", "fee": 14000000, "feeAssetId": null, "timestamp": 1670923532203, "version": 2, "chainId": 84, "sender": "3MpygN8qm376tUAHB6mhC5BxG5NKYortiyX", "senderPublicKey": "BjnLnkAMaJLYAK36vQqSepUNjGeMDHfZGfmdYwGcLbmg", "proofs": [ "2aZSTB5GeXBzBFJex6dD3bAz3pKHY9pviiCoAJBMVF6pHxavp7XNug23UaCP4rLfvhV77p3V7ZqkzoThps2CkNss", "q5ftxmMeZjGyeLBNr6ruSF1ys6TGZj1i6KFfmXYC4ub62e7T5eeGjKpAYBujkqrYgVVSunguGcyMwsMSDYksF3u" ], "script": "base64:BgJJCAISAwoBBBIECgIEARIGCgQBAQQBEgMKAQESBgoEAQgBARIECgIBARIDCgEBEgASABIAEgMKAQESBQoDBAEIEgASBAoCAQESAGoAB3ZlcnNpb24CBTIuMC4wAAhrVmVyc2lvbgIHdmVyc2lvbgAHa0FjdGl2ZQIGYWN0aXZlAAtrQWN0aXZlR2xvYgIUYWN0aXZlX2FsbF9jb250cmFjdHMACWtBc3NldElkQQIKQV9hc3NldF9pZAAJa0Fzc2V0SWRCAgpCX2Fzc2V0X2lkAAlrQmFsYW5jZUECD0FfYXNzZXRfYmFsYW5jZQAJa0JhbGFuY2VCAg9CX2Fzc2V0X2JhbGFuY2UADWtTaGFyZUFzc2V0SWQCDnNoYXJlX2Fzc2V0X2lkABFrU2hhcmVBc3NldFN1cHBseQISc2hhcmVfYXNzZXRfc3VwcGx5AARrRmVlAgpjb21taXNzaW9uAAprSW52YXJpYW50AglpbnZhcmlhbnQABmtDYXVzZQIOc2h1dGRvd25fY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WRtaW5zBRNtdWx0aVNpZ25lZEJ5QWRtaW5zgc0IzQ==", "height": 2358366, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AxEfEyEs8YwBVVDzHc6ehgNVkhK9mTwTX7Zx7cLsYXDg Next: 9NADwe7v2BerZDrNXTSVe7Fry5p5QAm4eFJLgmrV3XCt Diff:
Old | New | Differences | |
---|---|---|---|
50 | 50 | let kPeriodLength = "period_length" | |
51 | 51 | ||
52 | 52 | let kStartHeight = "start_height" | |
53 | + | ||
54 | + | let kDAppThreshold = "dApp_threshold" | |
53 | 55 | ||
54 | 56 | let kAdminPubKey1 = "admin_pub_1" | |
55 | 57 | ||
169 | 171 | ||
170 | 172 | let digits8 = 8 | |
171 | 173 | ||
172 | - | let | |
174 | + | let exchangeRatioLimitMin = 80000000 | |
173 | 175 | ||
174 | - | let dAppThresholdScale2 = 100 | |
175 | - | ||
176 | - | let exchangeRatioLimitMin = 90000000 | |
177 | - | ||
178 | - | let exchangeRatioLimitMax = 110000000 | |
176 | + | let exchangeRatioLimitMax = 120000000 | |
179 | 177 | ||
180 | 178 | let alpha = 50 | |
181 | 179 | ||
353 | 351 | func throwOnePayment () = throw("One attached payment expected") | |
354 | 352 | ||
355 | 353 | ||
356 | - | func throwThreshold (threshold,amountA,amountB) = throw(((((((((("New balance in assets of the DApp is less than threshold " + toString(threshold)) + ": ") + toString(amountA)) + " ") + assetNameA) + ", ") + toString(amountB)) + " ") + assetNameB)) | |
357 | - | ||
358 | - | ||
359 | 354 | func suspendSuspicious () = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB)) | |
360 | 355 | ||
361 | 356 | ||
366 | 361 | ||
367 | 362 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
368 | 363 | then { | |
369 | - | let $ | |
370 | - | let call = $ | |
371 | - | let stakingAddr = $ | |
364 | + | let $t01020710273 = calcStakingFuncAndAddres(stake, assetId) | |
365 | + | let call = $t01020710273._1 | |
366 | + | let stakingAddr = $t01020710273._2 | |
372 | 367 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
373 | 368 | } | |
374 | 369 | else { | |
375 | - | let $ | |
376 | - | let call = $ | |
377 | - | let stakingAddr = $ | |
370 | + | let $t01035910425 = calcStakingFuncAndAddres(stake, assetId) | |
371 | + | let call = $t01035910425._1 | |
372 | + | let stakingAddr = $t01035910425._2 | |
378 | 373 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
379 | 374 | } | |
380 | 375 | ||
406 | 401 | } | |
407 | 402 | ||
408 | 403 | ||
404 | + | func checkDAppThreshold (newBalanceA,newBalanceB,pmtAssetId) = { | |
405 | + | let dAppThreshold = getIntegerValue(this, kDAppThreshold) | |
406 | + | let ratio = if (if ((pmtAssetId == assetIdA)) | |
407 | + | then (newBalanceA > newBalanceB) | |
408 | + | else false) | |
409 | + | then fraction(newBalanceA, 1, newBalanceB, CEILING) | |
410 | + | else if (if ((pmtAssetId == assetIdB)) | |
411 | + | then (newBalanceB > newBalanceA) | |
412 | + | else false) | |
413 | + | then fraction(newBalanceB, 1, newBalanceA, CEILING) | |
414 | + | else 0 | |
415 | + | if ((ratio > dAppThreshold)) | |
416 | + | then { | |
417 | + | let $t01217012278 = if ((pmtAssetId == assetIdA)) | |
418 | + | then $Tuple2(assetNameB, assetNameA) | |
419 | + | else $Tuple2(assetNameA, assetNameB) | |
420 | + | let token1 = $t01217012278._1 | |
421 | + | let token2 = $t01217012278._2 | |
422 | + | throw((((("Buying " + token1) + " is temporarily unavailable due to the ") + token2) + " depeg")) | |
423 | + | } | |
424 | + | else true | |
425 | + | } | |
426 | + | ||
427 | + | ||
409 | 428 | func replenishWithTwoTokensCalc (i,stakeFarming,lockType) = { | |
410 | 429 | let pmtAssetIdA = i.payments[0].assetId | |
411 | 430 | let pmtAssetIdB = i.payments[1].assetId | |
412 | 431 | let ratioShareTokensInA = fraction(scale8, i.payments[0].amount, balanceA) | |
413 | 432 | let ratioShareTokensInB = fraction(scale8, i.payments[1].amount, balanceB) | |
414 | - | let $ | |
415 | - | let pmtStrAssetIdA = $ | |
416 | - | let pmtAssetNameA = $ | |
417 | - | let pmtDecimalsA = $ | |
418 | - | let $ | |
419 | - | let pmtStrAssetIdB = $ | |
420 | - | let pmtAssetNameB = $ | |
421 | - | let pmtDecimalsB = $ | |
422 | - | let $ | |
433 | + | let $t01273812815 = getAssetInfo(pmtAssetIdA) | |
434 | + | let pmtStrAssetIdA = $t01273812815._1 | |
435 | + | let pmtAssetNameA = $t01273812815._2 | |
436 | + | let pmtDecimalsA = $t01273812815._3 | |
437 | + | let $t01282012937 = getAssetInfo(pmtAssetIdB) | |
438 | + | let pmtStrAssetIdB = $t01282012937._1 | |
439 | + | let pmtAssetNameB = $t01282012937._2 | |
440 | + | let pmtDecimalsB = $t01282012937._3 | |
441 | + | let $t01294213446 = if ((ratioShareTokensInB > ratioShareTokensInA)) | |
423 | 442 | then { | |
424 | 443 | let pmt = fraction(balanceB, ratioShareTokensInA, scale8, CEILING) | |
425 | 444 | $Tuple5(i.payments[0].amount, pmt, (i.payments[1].amount - pmt), pmtAssetIdB, ratioShareTokensInA) | |
428 | 447 | let pmt = fraction(balanceA, ratioShareTokensInB, scale8, CEILING) | |
429 | 448 | $Tuple5(pmt, i.payments[1].amount, (i.payments[0].amount - pmt), pmtAssetIdA, ratioShareTokensInB) | |
430 | 449 | } | |
431 | - | let pmtAmountA = $ | |
432 | - | let pmtAmountB = $ | |
433 | - | let change = $ | |
434 | - | let changeAssetId = $ | |
435 | - | let shareTokenRatio = $ | |
450 | + | let pmtAmountA = $t01294213446._1 | |
451 | + | let pmtAmountB = $t01294213446._2 | |
452 | + | let change = $t01294213446._3 | |
453 | + | let changeAssetId = $t01294213446._4 | |
454 | + | let shareTokenRatio = $t01294213446._5 | |
436 | 455 | let shareTokenToPayAmount = fraction(shareTokenRatio, shareAssetSupply, scale8) | |
437 | 456 | if (if ((size(i.payments) != 2)) | |
438 | 457 | then (size(i.payments) != 3) | |
487 | 506 | ||
488 | 507 | ||
489 | 508 | func replenishWithOneTokenCalc (i,virtualSwapTokenPay,virtualSwapTokenGet,stakeFarming,lockType) = { | |
490 | - | let $ | |
491 | - | let pmtAmount = $ | |
492 | - | let pmtAssetId = $ | |
493 | - | let $ | |
494 | - | let pmtStrAssetId = $ | |
495 | - | let pmtAssetName = $ | |
496 | - | let pmtDecimals = $ | |
509 | + | let $t01583615911 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
510 | + | let pmtAmount = $t01583615911._1 | |
511 | + | let pmtAssetId = $t01583615911._2 | |
512 | + | let $t01591615989 = getAssetInfo(pmtAssetId) | |
513 | + | let pmtStrAssetId = $t01591615989._1 | |
514 | + | let pmtAssetName = $t01591615989._2 | |
515 | + | let pmtDecimals = $t01591615989._3 | |
497 | 516 | let pmtMinThreshold = 5000000 | |
498 | 517 | let thresholdValueForMinTolerance = 50000000 | |
499 | 518 | let tolerance = if ((thresholdValueForMinTolerance > pmtAmount)) | |
515 | 534 | else false) | |
516 | 535 | then throwAssets() | |
517 | 536 | else { | |
518 | - | let $ | |
537 | + | let $t01699117633 = if ((pmtAssetId == assetIdA)) | |
519 | 538 | then $Tuple6((pmtAmount - virtualSwapTokenPay), virtualSwapTokenGet, (balanceA + virtualSwapTokenPay), (balanceB - virtualSwapTokenGet), (balanceA + pmtAmount), balanceB) | |
520 | 539 | else $Tuple6(virtualSwapTokenGet, (pmtAmount - virtualSwapTokenPay), (balanceA - virtualSwapTokenGet), (balanceB + virtualSwapTokenPay), balanceA, (balanceB + pmtAmount)) | |
521 | - | let virtualReplenishA = $ | |
522 | - | let virtualReplenishB = $ | |
523 | - | let balanceAfterSwapA = $ | |
524 | - | let balanceAfterSwapB = $ | |
525 | - | let newBalanceA = $ | |
526 | - | let newBalanceB = $ | |
540 | + | let virtualReplenishA = $t01699117633._1 | |
541 | + | let virtualReplenishB = $t01699117633._2 | |
542 | + | let balanceAfterSwapA = $t01699117633._3 | |
543 | + | let balanceAfterSwapB = $t01699117633._4 | |
544 | + | let newBalanceA = $t01699117633._5 | |
545 | + | let newBalanceB = $t01699117633._6 | |
527 | 546 | let invariantNew = invariantCalc(balanceAfterSwapA, balanceAfterSwapB) | |
528 | 547 | let ratioVirtualBalanceToVirtualReplenish = (fraction(scale16, balanceAfterSwapA, balanceAfterSwapB) / fraction(scale8, virtualReplenishA, virtualReplenishB)) | |
529 | - | let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2)) | |
530 | 548 | if (if ((slippageValueMinForSwap >= fraction(scale8, invariant, invariantNew))) | |
531 | 549 | then true | |
532 | 550 | else (invariant > invariantNew)) | |
535 | 553 | then true | |
536 | 554 | else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish)) | |
537 | 555 | then throw("Swap with virtualSwapTokenPay and virtualSwapTokenGet is possible, but ratio after virtual swap is incorrect") | |
538 | - | else if (if ((dAppThresholdAmount > newBalanceA)) | |
539 | - | then true | |
540 | - | else (dAppThresholdAmount > newBalanceB)) | |
541 | - | then throwThreshold(dAppThresholdAmount, newBalanceA, newBalanceB) | |
556 | + | else if (!(checkDAppThreshold(newBalanceA, newBalanceB, pmtAssetId))) | |
557 | + | then throw() | |
542 | 558 | else { | |
543 | 559 | let ratioShareTokensInA = fraction(virtualReplenishA, scale8, balanceAfterSwapA) | |
544 | 560 | let ratioShareTokensInB = fraction(virtualReplenishB, scale8, balanceAfterSwapB) | |
547 | 563 | let shareTokenGovernanceReward = fraction(shareTokenToPayAmount, (feeGovernance / 2), feeScale6) | |
548 | 564 | let governanceRewardTokenA = fraction(shareTokenGovernanceReward, balanceA, shareAssetSupply) | |
549 | 565 | let governanceRewardTokenB = fraction(shareTokenGovernanceReward, balanceB, shareAssetSupply) | |
550 | - | let $ | |
566 | + | let $t01938419667 = if ((pmtStrAssetId == strAssetIdA)) | |
551 | 567 | then $Tuple3((pmtAmount - governanceRewardTokenA), governanceRewardTokenB, strAssetIdB) | |
552 | 568 | else $Tuple3((pmtAmount - governanceRewardTokenB), governanceRewardTokenA, strAssetIdA) | |
553 | - | let stakeAmount = $ | |
554 | - | let unstakeAmount = $ | |
555 | - | let unstakeAsset = $ | |
569 | + | let stakeAmount = $t01938419667._1 | |
570 | + | let unstakeAmount = $t01938419667._2 | |
571 | + | let unstakeAsset = $t01938419667._3 | |
556 | 572 | let stake1 = if (contains(stakingAssets, pmtStrAssetId)) | |
557 | 573 | then invoke(this, "stakeUnstake", [true, stakeAmount, pmtStrAssetId], nil) | |
558 | 574 | else 0 | |
592 | 608 | ||
593 | 609 | ||
594 | 610 | func withdrawCalc (i,unlockAmount) = { | |
595 | - | let $ | |
611 | + | let $t02151621851 = if ((size(i.payments) == 1)) | |
596 | 612 | then if ((i.payments[0].assetId != shareAssetId)) | |
597 | 613 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
598 | 614 | else $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
599 | 615 | else $Tuple2(0, shareAssetId) | |
600 | - | let pmtAmount = $ | |
601 | - | let pmtAssetId = $ | |
616 | + | let pmtAmount = $t02151621851._1 | |
617 | + | let pmtAssetId = $t02151621851._2 | |
602 | 618 | if (!(hasEnoughBalance)) | |
603 | 619 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
604 | 620 | else { | |
632 | 648 | ||
633 | 649 | @Callable(i) | |
634 | 650 | func init (firstHarvest) = { | |
635 | - | let $ | |
636 | - | let pmtAmountA = $ | |
637 | - | let pmtAssetIdA = $ | |
638 | - | let $ | |
639 | - | let pmtAmountB = $ | |
640 | - | let pmtAssetIdB = $ | |
641 | - | let $ | |
642 | - | let pmtStrAssetIdA = $ | |
643 | - | let pmtAssetNameA = $ | |
644 | - | let pmtDecimalsA = $ | |
645 | - | let $ | |
646 | - | let pmtStrAssetIdB = $ | |
647 | - | let pmtAssetNameB = $ | |
648 | - | let pmtDecimalsB = $ | |
651 | + | let $t02340323480 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
652 | + | let pmtAmountA = $t02340323480._1 | |
653 | + | let pmtAssetIdA = $t02340323480._2 | |
654 | + | let $t02348523562 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
655 | + | let pmtAmountB = $t02348523562._1 | |
656 | + | let pmtAssetIdB = $t02348523562._2 | |
657 | + | let $t02356723644 = getAssetInfo(pmtAssetIdA) | |
658 | + | let pmtStrAssetIdA = $t02356723644._1 | |
659 | + | let pmtAssetNameA = $t02356723644._2 | |
660 | + | let pmtDecimalsA = $t02356723644._3 | |
661 | + | let $t02364923726 = getAssetInfo(pmtAssetIdB) | |
662 | + | let pmtStrAssetIdB = $t02364923726._1 | |
663 | + | let pmtAssetNameB = $t02364923726._2 | |
664 | + | let pmtDecimalsB = $t02364923726._3 | |
649 | 665 | if (isDefined(getBoolean(this, kActive))) | |
650 | 666 | then throwIsActive() | |
651 | 667 | else if ((pmtAssetIdA == pmtAssetIdB)) | |
668 | 684 | else 0 | |
669 | 685 | if ((stake2 == stake2)) | |
670 | 686 | then { | |
671 | - | let baseEntry = [StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssetIdA, pmtStrAssetIdA), StringEntry(kAssetIdB, pmtStrAssetIdB), IntegerEntry(kBalanceA, pmtAmountA), IntegerEntry(kBalanceB, pmtAmountB), IntegerEntry(kInvariant, invariantCalculated), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), shareIssue, StringEntry(kShareAssetId, toBase58String(shareIssueId)), IntegerEntry(kShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
687 | + | let baseEntry = [StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssetIdA, pmtStrAssetIdA), StringEntry(kAssetIdB, pmtStrAssetIdB), IntegerEntry(kBalanceA, pmtAmountA), IntegerEntry(kBalanceB, pmtAmountB), IntegerEntry(kInvariant, invariantCalculated), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), IntegerEntry(kDAppThreshold, 3), shareIssue, StringEntry(kShareAssetId, toBase58String(shareIssueId)), IntegerEntry(kShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
672 | 688 | if (firstHarvest) | |
673 | 689 | then (baseEntry ++ [BooleanEntry(kFirstHarvest, firstHarvest), IntegerEntry(kFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
674 | 690 | else baseEntry | |
698 | 714 | ||
699 | 715 | @Callable(i) | |
700 | 716 | func withdrawOneToken (unlockAmount,withdrawAsset,estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), { | |
701 | - | let $ | |
717 | + | let $t02714127476 = if ((size(i.payments) == 1)) | |
702 | 718 | then if ((i.payments[0].assetId != shareAssetId)) | |
703 | 719 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
704 | 720 | else $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
705 | 721 | else $Tuple2(0, shareAssetId) | |
706 | - | let pmtAmount = $ | |
707 | - | let pmtAssetId = $ | |
722 | + | let pmtAmount = $t02714127476._1 | |
723 | + | let pmtAssetId = $t02714127476._2 | |
708 | 724 | let withdrawAmount = (pmtAmount + unlockAmount) | |
709 | 725 | if (if ((withdrawAsset != strAssetIdA)) | |
710 | 726 | then (withdrawAsset != strAssetIdB) | |
730 | 746 | else calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayA, assetIdA, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB)) | |
731 | 747 | let govReward = fraction(amountExchangedWithFee, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
732 | 748 | let amountExchanged = fraction(amountExchangedWithFee, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
733 | - | let $t02900329332 = if ((withdrawAsset == strAssetIdA)) | |
734 | - | then $Tuple3((amountToPayA + amountExchanged), (((balanceA - amountToPayA) - amountExchanged) - govReward), balanceB) | |
735 | - | else $Tuple3((amountToPayB + amountExchanged), balanceA, (((balanceB - amountToPayB) - amountExchanged) - govReward)) | |
736 | - | let amountToPay = $t02900329332._1 | |
737 | - | let balanceANew = $t02900329332._2 | |
738 | - | let balanceBNew = $t02900329332._3 | |
739 | - | let invariantCalculated = invariantCalc(balanceANew, balanceBNew) | |
740 | - | let stake1 = if (contains(stakingAssets, withdrawAsset)) | |
741 | - | then invoke(this, "stakeUnstake", [false, (amountToPay + govReward), withdrawAsset], nil) | |
742 | - | else 0 | |
743 | - | if ((stake1 == stake1)) | |
744 | - | then [IntegerEntry(kBalanceA, balanceANew), IntegerEntry(kBalanceB, balanceBNew), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), IntegerEntry(kInvariant, invariantCalculated), Burn(shareAssetId, withdrawAmount), ScriptTransfer(i.caller, amountToPay, fromBase58String(withdrawAsset)), ScriptTransfer(moneyBoxAddress, govReward, fromBase58String(withdrawAsset))] | |
745 | - | else throw("Strict value is not equal to itself.") | |
749 | + | let $t02907929441 = if ((withdrawAsset == strAssetIdA)) | |
750 | + | then $Tuple4((amountToPayA + amountExchanged), (((balanceA - amountToPayA) - amountExchanged) - govReward), balanceB, assetIdB) | |
751 | + | else $Tuple4((amountToPayB + amountExchanged), balanceA, (((balanceB - amountToPayB) - amountExchanged) - govReward), assetIdA) | |
752 | + | let amountToPay = $t02907929441._1 | |
753 | + | let balanceANew = $t02907929441._2 | |
754 | + | let balanceBNew = $t02907929441._3 | |
755 | + | let virtAssetId = $t02907929441._4 | |
756 | + | if (!(checkDAppThreshold(balanceANew, balanceBNew, virtAssetId))) | |
757 | + | then throw() | |
758 | + | else { | |
759 | + | let invariantCalculated = invariantCalc(balanceANew, balanceBNew) | |
760 | + | let stake1 = if (contains(stakingAssets, withdrawAsset)) | |
761 | + | then invoke(this, "stakeUnstake", [false, (amountToPay + govReward), withdrawAsset], nil) | |
762 | + | else 0 | |
763 | + | if ((stake1 == stake1)) | |
764 | + | then [IntegerEntry(kBalanceA, balanceANew), IntegerEntry(kBalanceB, balanceBNew), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), IntegerEntry(kInvariant, invariantCalculated), Burn(shareAssetId, withdrawAmount), ScriptTransfer(i.caller, amountToPay, fromBase58String(withdrawAsset)), ScriptTransfer(moneyBoxAddress, govReward, fromBase58String(withdrawAsset))] | |
765 | + | else throw("Strict value is not equal to itself.") | |
766 | + | } | |
746 | 767 | } | |
747 | 768 | else throw("Strict value is not equal to itself.") | |
748 | 769 | } | |
752 | 773 | ||
753 | 774 | @Callable(i) | |
754 | 775 | func exchange (estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), { | |
755 | - | let $ | |
756 | - | let pmtAmount = $ | |
757 | - | let pmtAssetId = $ | |
776 | + | let $t03040430479 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
777 | + | let pmtAmount = $t03040430479._1 | |
778 | + | let pmtAssetId = $t03040430479._2 | |
758 | 779 | if ((0 >= estimatedAmountToReceive)) | |
759 | 780 | then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive))) | |
760 | 781 | else if ((minAmountToReceive > estimatedAmountToReceive)) | |
781 | 802 | let feeDiscount = calculateFeeDiscount(i.originCaller) | |
782 | 803 | let governanceReward = fraction(amount, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
783 | 804 | let amountMinusFee = fraction(amount, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
784 | - | let $ | |
805 | + | let $t03196332225 = if ((pmtAssetId == assetIdA)) | |
785 | 806 | then $Tuple2((balanceA + pmtAmount), ((balanceB - amountMinusFee) - governanceReward)) | |
786 | 807 | else $Tuple2(((balanceA - amountMinusFee) - governanceReward), (balanceB + pmtAmount)) | |
787 | - | let newBalanceA = $t03176432026._1 | |
788 | - | let newBalanceB = $t03176432026._2 | |
789 | - | let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2)) | |
790 | - | if (if ((dAppThresholdAmount > newBalanceA)) | |
791 | - | then true | |
792 | - | else (dAppThresholdAmount > newBalanceB)) | |
793 | - | then throwThreshold(dAppThresholdAmount, newBalanceA, newBalanceB) | |
808 | + | let newBalanceA = $t03196332225._1 | |
809 | + | let newBalanceB = $t03196332225._2 | |
810 | + | if (!(checkDAppThreshold(newBalanceA, newBalanceB, pmtAssetId))) | |
811 | + | then throw() | |
794 | 812 | else { | |
795 | - | let $ | |
796 | - | let pmtStrAssetId = $ | |
797 | - | let pmtAssetName = $ | |
798 | - | let pmtDecimals = $ | |
799 | - | let $ | |
800 | - | let sendStrAssetId = $ | |
801 | - | let sendAssetName = $ | |
802 | - | let sendDecimals = $ | |
813 | + | let $t03232332396 = getAssetInfo(pmtAssetId) | |
814 | + | let pmtStrAssetId = $t03232332396._1 | |
815 | + | let pmtAssetName = $t03232332396._2 | |
816 | + | let pmtDecimals = $t03232332396._3 | |
817 | + | let $t03240532482 = getAssetInfo(sendAssetId) | |
818 | + | let sendStrAssetId = $t03240532482._1 | |
819 | + | let sendAssetName = $t03240532482._2 | |
820 | + | let sendDecimals = $t03240532482._3 | |
803 | 821 | let stake1 = if (contains(stakingAssets, pmtStrAssetId)) | |
804 | 822 | then invoke(this, "stakeUnstake", [true, pmtAmount, pmtStrAssetId], nil) | |
805 | 823 | else 0 | |
840 | 858 | ||
841 | 859 | @Callable(i) | |
842 | 860 | func takeIntoAccountExtraFunds () = valueOrElse(isActive(), { | |
843 | - | let amountEnrollA = (accountBalanceWithStakedA - balanceA) | |
844 | - | let amountEnrollB = (accountBalanceWithStakedB - balanceB) | |
845 | - | let invariantNew = invariantCalc((balanceA + amountEnrollA), (balanceB + amountEnrollB)) | |
846 | - | if ((i.caller != moneyBoxAddress)) | |
847 | - | then throw("Only the money box can call this function") | |
848 | - | else if (if ((0 > amountEnrollA)) | |
849 | - | then true | |
850 | - | else (0 > amountEnrollB)) | |
851 | - | then suspend("Enroll amount negative") | |
852 | - | else if (if ((amountEnrollA == 0)) | |
853 | - | then (amountEnrollB == 0) | |
854 | - | else false) | |
855 | - | then throw("No money to take") | |
856 | - | else { | |
857 | - | let stake1 = if (if (contains(stakingAssets, strAssetIdA)) | |
858 | - | then (amountEnrollA > 0) | |
861 | + | let claim = if (if ((assetIdA == USDN)) | |
862 | + | then true | |
863 | + | else (assetIdB == USDN)) | |
864 | + | then invoke(stakingUSDNAddress, "claimRewards", nil, nil) | |
865 | + | else 0 | |
866 | + | if ((claim == claim)) | |
867 | + | then { | |
868 | + | let amountEnrollA = (accountBalanceWithStakedA - balanceA) | |
869 | + | let amountEnrollB = (accountBalanceWithStakedB - balanceB) | |
870 | + | let invariantNew = invariantCalc((balanceA + amountEnrollA), (balanceB + amountEnrollB)) | |
871 | + | if ((i.caller != moneyBoxAddress)) | |
872 | + | then throw("Only the money box can call this function") | |
873 | + | else if (if ((0 > amountEnrollA)) | |
874 | + | then true | |
875 | + | else (0 > amountEnrollB)) | |
876 | + | then suspend("Enroll amount negative") | |
877 | + | else if (if ((amountEnrollA == 0)) | |
878 | + | then (amountEnrollB == 0) | |
859 | 879 | else false) | |
860 | - | then invoke(this, "stakeUnstake", [true, amountEnrollA, strAssetIdA], nil) | |
861 | - | else 0 | |
862 | - | if ((stake1 == stake1)) | |
863 | - | then { | |
864 | - | let stake2 = if (if (contains(stakingAssets, strAssetIdB)) | |
865 | - | then (amountEnrollB > 0) | |
880 | + | then throw("No money to take") | |
881 | + | else { | |
882 | + | let stake1 = if (if (contains(stakingAssets, strAssetIdA)) | |
883 | + | then (amountEnrollA > 0) | |
866 | 884 | else false) | |
867 | - | then invoke(this, "stakeUnstake", [true, | |
885 | + | then invoke(this, "stakeUnstake", [true, amountEnrollA, strAssetIdA], nil) | |
868 | 886 | else 0 | |
869 | - | if ((stake2 == stake2)) | |
870 | - | then [IntegerEntry(kInvariant, invariantNew), IntegerEntry(kBalanceA, (balanceA + amountEnrollA)), IntegerEntry(kBalanceB, (balanceB + amountEnrollB))] | |
887 | + | if ((stake1 == stake1)) | |
888 | + | then { | |
889 | + | let stake2 = if (if (contains(stakingAssets, strAssetIdB)) | |
890 | + | then (amountEnrollB > 0) | |
891 | + | else false) | |
892 | + | then invoke(this, "stakeUnstake", [true, amountEnrollB, strAssetIdB], nil) | |
893 | + | else 0 | |
894 | + | if ((stake2 == stake2)) | |
895 | + | then [IntegerEntry(kInvariant, invariantNew), IntegerEntry(kBalanceA, (balanceA + amountEnrollA)), IntegerEntry(kBalanceB, (balanceB + amountEnrollB))] | |
896 | + | else throw("Strict value is not equal to itself.") | |
897 | + | } | |
871 | 898 | else throw("Strict value is not equal to itself.") | |
872 | 899 | } | |
873 | - | | |
874 | - | | |
900 | + | } | |
901 | + | else throw("Strict value is not equal to itself.") | |
875 | 902 | }) | |
876 | 903 | ||
877 | 904 | ||
885 | 912 | func stakeUnstake (stake,amount,assetIdString) = if ((i.caller != this)) | |
886 | 913 | then throw("Only contract itself can invoke this function") | |
887 | 914 | else { | |
888 | - | let $ | |
889 | - | let call = $ | |
890 | - | let addr = $ | |
891 | - | let params = $ | |
892 | - | let payments = $ | |
915 | + | let $t03584535948 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
916 | + | let call = $t03584535948._1 | |
917 | + | let addr = $t03584535948._2 | |
918 | + | let params = $t03584535948._3 | |
919 | + | let payments = $t03584535948._4 | |
893 | 920 | let inv = invoke(addr, call, params, payments) | |
894 | 921 | if ((inv == inv)) | |
895 | 922 | then nil |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let version = "2.0.0" | |
5 | 5 | ||
6 | 6 | let kVersion = "version" | |
7 | 7 | ||
8 | 8 | let kActive = "active" | |
9 | 9 | ||
10 | 10 | let kActiveGlob = "active_all_contracts" | |
11 | 11 | ||
12 | 12 | let kAssetIdA = "A_asset_id" | |
13 | 13 | ||
14 | 14 | let kAssetIdB = "B_asset_id" | |
15 | 15 | ||
16 | 16 | let kBalanceA = "A_asset_balance" | |
17 | 17 | ||
18 | 18 | let kBalanceB = "B_asset_balance" | |
19 | 19 | ||
20 | 20 | let kShareAssetId = "share_asset_id" | |
21 | 21 | ||
22 | 22 | let kShareAssetSupply = "share_asset_supply" | |
23 | 23 | ||
24 | 24 | let kFee = "commission" | |
25 | 25 | ||
26 | 26 | let kInvariant = "invariant" | |
27 | 27 | ||
28 | 28 | let kCause = "shutdown_cause" | |
29 | 29 | ||
30 | 30 | let kUSDNAddress = "staking_usdnnsbt_address" | |
31 | 31 | ||
32 | 32 | let kEURNAddress = "staking_eurn_address" | |
33 | 33 | ||
34 | 34 | let kDiscounts = "discounts" | |
35 | 35 | ||
36 | 36 | let kDiscountValues = "discount_values" | |
37 | 37 | ||
38 | 38 | let kUserSwopInGov = "_SWOP_amount" | |
39 | 39 | ||
40 | 40 | let kUserGSwopInGov = "_GSwop_amount" | |
41 | 41 | ||
42 | 42 | let kFirstHarvest = "first_harvest" | |
43 | 43 | ||
44 | 44 | let kFirstHarvestHeight = "first_harvest_height" | |
45 | 45 | ||
46 | 46 | let kShareLimit = "share_limit_on_first_harvest" | |
47 | 47 | ||
48 | 48 | let kBasePeriod = "base_period" | |
49 | 49 | ||
50 | 50 | let kPeriodLength = "period_length" | |
51 | 51 | ||
52 | 52 | let kStartHeight = "start_height" | |
53 | + | ||
54 | + | let kDAppThreshold = "dApp_threshold" | |
53 | 55 | ||
54 | 56 | let kAdminPubKey1 = "admin_pub_1" | |
55 | 57 | ||
56 | 58 | let kAdminPubKey2 = "admin_pub_2" | |
57 | 59 | ||
58 | 60 | let kAdminPubKey3 = "admin_pub_3" | |
59 | 61 | ||
60 | 62 | let kAdminInvokePubKey = "admin_invoke_pub" | |
61 | 63 | ||
62 | 64 | let kMoneyBoxAddress = "money_box_address" | |
63 | 65 | ||
64 | 66 | let kGovAddress = "governance_address" | |
65 | 67 | ||
66 | 68 | let kFarmingAddress = "farming_address" | |
67 | 69 | ||
68 | 70 | let kVotingAddress = "voting_address" | |
69 | 71 | ||
70 | 72 | let kUSDNAssetId = "usdn_asset_id" | |
71 | 73 | ||
72 | 74 | let kStakingAssets = "staking_assets" | |
73 | 75 | ||
74 | 76 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
75 | 77 | ||
76 | 78 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
77 | 79 | case string: String => | |
78 | 80 | fromBase58String(string) | |
79 | 81 | case nothing => | |
80 | 82 | throw((key + "is empty")) | |
81 | 83 | } | |
82 | 84 | ||
83 | 85 | ||
84 | 86 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
85 | 87 | ||
86 | 88 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
87 | 89 | ||
88 | 90 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
89 | 91 | ||
90 | 92 | let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
91 | 93 | ||
92 | 94 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
93 | 95 | ||
94 | 96 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
95 | 97 | ||
96 | 98 | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
97 | 99 | ||
98 | 100 | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
99 | 101 | ||
100 | 102 | let farmingAddress = Address(getBase58FromOracle(kFarmingAddress)) | |
101 | 103 | ||
102 | 104 | let USDN = getBase58FromOracle(kUSDNAssetId) | |
103 | 105 | ||
104 | 106 | let stakingAssets = getStringValue(oracle, kStakingAssets) | |
105 | 107 | ||
106 | 108 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
107 | 109 | ||
108 | 110 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
109 | 111 | ||
110 | 112 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
111 | 113 | ||
112 | 114 | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3) | |
113 | 115 | ||
114 | 116 | let active = getBooleanValue(this, kActive) | |
115 | 117 | ||
116 | 118 | let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true) | |
117 | 119 | ||
118 | 120 | let strAssetIdA = getStringValue(this, kAssetIdA) | |
119 | 121 | ||
120 | 122 | let strAssetIdB = getStringValue(this, kAssetIdB) | |
121 | 123 | ||
122 | 124 | let assetIdA = if ((strAssetIdA == "WAVES")) | |
123 | 125 | then unit | |
124 | 126 | else fromBase58String(strAssetIdA) | |
125 | 127 | ||
126 | 128 | let assetIdB = if ((strAssetIdB == "WAVES")) | |
127 | 129 | then unit | |
128 | 130 | else fromBase58String(strAssetIdB) | |
129 | 131 | ||
130 | 132 | let assetNameA = match assetIdA { | |
131 | 133 | case id: ByteVector => | |
132 | 134 | value(assetInfo(id)).name | |
133 | 135 | case waves: Unit => | |
134 | 136 | "WAVES" | |
135 | 137 | case _ => | |
136 | 138 | throw("Match error") | |
137 | 139 | } | |
138 | 140 | ||
139 | 141 | let assetNameB = match assetIdB { | |
140 | 142 | case id: ByteVector => | |
141 | 143 | value(assetInfo(id)).name | |
142 | 144 | case waves: Unit => | |
143 | 145 | "WAVES" | |
144 | 146 | case _ => | |
145 | 147 | throw("Match error") | |
146 | 148 | } | |
147 | 149 | ||
148 | 150 | let balanceA = getIntegerValue(this, kBalanceA) | |
149 | 151 | ||
150 | 152 | let balanceB = getIntegerValue(this, kBalanceB) | |
151 | 153 | ||
152 | 154 | let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId)) | |
153 | 155 | ||
154 | 156 | let shareAssetSupply = getIntegerValue(this, kShareAssetSupply) | |
155 | 157 | ||
156 | 158 | let invariant = getIntegerValue(this, kInvariant) | |
157 | 159 | ||
158 | 160 | let fee = getIntegerValue(this, kFee) | |
159 | 161 | ||
160 | 162 | let feeGovernance = fraction(fee, 40, 100) | |
161 | 163 | ||
162 | 164 | let feeScale6 = 1000000 | |
163 | 165 | ||
164 | 166 | let scale3 = 1000 | |
165 | 167 | ||
166 | 168 | let scale8 = 100000000 | |
167 | 169 | ||
168 | 170 | let scale16 = 10000000000000000 | |
169 | 171 | ||
170 | 172 | let digits8 = 8 | |
171 | 173 | ||
172 | - | let | |
174 | + | let exchangeRatioLimitMin = 80000000 | |
173 | 175 | ||
174 | - | let dAppThresholdScale2 = 100 | |
175 | - | ||
176 | - | let exchangeRatioLimitMin = 90000000 | |
177 | - | ||
178 | - | let exchangeRatioLimitMax = 110000000 | |
176 | + | let exchangeRatioLimitMax = 120000000 | |
179 | 177 | ||
180 | 178 | let alpha = 50 | |
181 | 179 | ||
182 | 180 | let alphaDigits = 2 | |
183 | 181 | ||
184 | 182 | let beta = 4600000000000000 | |
185 | 183 | ||
186 | 184 | func accountBalance (assetId) = match assetId { | |
187 | 185 | case id: ByteVector => | |
188 | 186 | assetBalance(this, id) | |
189 | 187 | case waves: Unit => | |
190 | 188 | wavesBalance(this).available | |
191 | 189 | case _ => | |
192 | 190 | throw("Match error") | |
193 | 191 | } | |
194 | 192 | ||
195 | 193 | ||
196 | 194 | func stakedAmount (assetId) = { | |
197 | 195 | let stakedAmountCalculated = match assetId { | |
198 | 196 | case aId: ByteVector => | |
199 | 197 | if ((aId == USDN)) | |
200 | 198 | then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
201 | 199 | else 0 | |
202 | 200 | case _: Unit => | |
203 | 201 | 0 | |
204 | 202 | case _ => | |
205 | 203 | throw("Match error") | |
206 | 204 | } | |
207 | 205 | match stakedAmountCalculated { | |
208 | 206 | case i: Int => | |
209 | 207 | i | |
210 | 208 | case _ => | |
211 | 209 | 0 | |
212 | 210 | } | |
213 | 211 | } | |
214 | 212 | ||
215 | 213 | ||
216 | 214 | let stakedAmountA = stakedAmount(assetIdA) | |
217 | 215 | ||
218 | 216 | let stakedAmountB = stakedAmount(assetIdB) | |
219 | 217 | ||
220 | 218 | let availableBalanceA = (balanceA - stakedAmountA) | |
221 | 219 | ||
222 | 220 | let availableBalanceB = (balanceB - stakedAmountB) | |
223 | 221 | ||
224 | 222 | let accountBalanceWithStakedA = (accountBalance(assetIdA) + stakedAmountA) | |
225 | 223 | ||
226 | 224 | let accountBalanceWithStakedB = (accountBalance(assetIdB) + stakedAmountB) | |
227 | 225 | ||
228 | 226 | let hasEnoughBalance = if ((accountBalanceWithStakedA >= balanceA)) | |
229 | 227 | then (accountBalanceWithStakedB >= balanceB) | |
230 | 228 | else false | |
231 | 229 | ||
232 | 230 | func skewness (x,y) = ((fraction(scale16, x, y) + fraction(scale16, y, x)) / 2) | |
233 | 231 | ||
234 | 232 | ||
235 | 233 | func invariantCalc (x,y) = { | |
236 | 234 | let sk = skewness(x, y) | |
237 | 235 | (fraction((x + y), scale16, pow(sk, digits8, alpha, alphaDigits, digits8, CEILING)) + (2 * fraction(toInt(pow(fraction(toBigInt(x), toBigInt(y), toBigInt(scale8)), 0, toBigInt(5), 1, (digits8 / 2), DOWN)), pow((sk - beta), digits8, alpha, alphaDigits, digits8, DOWN), scale8))) | |
238 | 236 | } | |
239 | 237 | ||
240 | 238 | ||
241 | 239 | func calculateSendAmount (amountToSendEstimated,minTokenReceiveAmount,tokenReceiveAmount,tokenId,balcA,balcB,invCur) = { | |
242 | 240 | let worstAllowedNewInvariantRatio = (scale16 - ((scale16 * 1) / 10000000)) | |
243 | 241 | let deltaBetweenMaxAndMinSendValue = (amountToSendEstimated - minTokenReceiveAmount) | |
244 | 242 | let x = (balcA + tokenReceiveAmount) | |
245 | 243 | let y = (balcB + tokenReceiveAmount) | |
246 | 244 | func getStepAmount (acc,step) = if ((acc._1 == -1)) | |
247 | 245 | then { | |
248 | 246 | let amountToSend = (amountToSendEstimated - (((step * deltaBetweenMaxAndMinSendValue) / 3) / scale3)) | |
249 | 247 | let stepInvariant = if ((tokenId == assetIdA)) | |
250 | 248 | then invariantCalc(x, (balcB - amountToSend)) | |
251 | 249 | else invariantCalc((balcA - amountToSend), y) | |
252 | 250 | if ((stepInvariant > invCur)) | |
253 | 251 | then $Tuple2(amountToSend, stepInvariant) | |
254 | 252 | else $Tuple2(-1, 0) | |
255 | 253 | } | |
256 | 254 | else acc | |
257 | 255 | ||
258 | 256 | let amountToSendMin = getStepAmount($Tuple2(-1, 0), 3000) | |
259 | 257 | if ((0 > amountToSendMin._1)) | |
260 | 258 | then throw("Price is worse than minReceived") | |
261 | 259 | else { | |
262 | 260 | let invEstimated = if ((tokenId == assetIdA)) | |
263 | 261 | then invariantCalc(x, (balcB - amountToSendEstimated)) | |
264 | 262 | else if ((tokenId == assetIdB)) | |
265 | 263 | then invariantCalc((balcA - amountToSendEstimated), y) | |
266 | 264 | else throw("Wrong asset in payment") | |
267 | 265 | if ((invCur > invEstimated)) | |
268 | 266 | then if ((worstAllowedNewInvariantRatio >= fraction(scale16, invCur, invEstimated))) | |
269 | 267 | then throw("The requested price is too not profitable for user") | |
270 | 268 | else { | |
271 | 269 | let a = { | |
272 | 270 | let $l = [25, 200, 500] | |
273 | 271 | let $s = size($l) | |
274 | 272 | let $acc0 = $Tuple2(-1, 0) | |
275 | 273 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
276 | 274 | then $a | |
277 | 275 | else getStepAmount($a, $l[$i]) | |
278 | 276 | ||
279 | 277 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
280 | 278 | then $a | |
281 | 279 | else throw("List size exceeds 3") | |
282 | 280 | ||
283 | 281 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
284 | 282 | } | |
285 | 283 | if ((0 > a._1)) | |
286 | 284 | then amountToSendMin._1 | |
287 | 285 | else a._1 | |
288 | 286 | } | |
289 | 287 | else { | |
290 | 288 | let a = { | |
291 | 289 | let $l = [-500, -200, -25] | |
292 | 290 | let $s = size($l) | |
293 | 291 | let $acc0 = $Tuple2(-1, 0) | |
294 | 292 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
295 | 293 | then $a | |
296 | 294 | else getStepAmount($a, $l[$i]) | |
297 | 295 | ||
298 | 296 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
299 | 297 | then $a | |
300 | 298 | else throw("List size exceeds 3") | |
301 | 299 | ||
302 | 300 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
303 | 301 | } | |
304 | 302 | let tupleSendBetter = if ((0 > a._1)) | |
305 | 303 | then $Tuple2(amountToSendEstimated, invEstimated) | |
306 | 304 | else a | |
307 | 305 | if ((worstAllowedNewInvariantRatio >= fraction(scale16, invCur, tupleSendBetter._2))) | |
308 | 306 | then throw("The requested price is too not profitable for user") | |
309 | 307 | else tupleSendBetter._1 | |
310 | 308 | } | |
311 | 309 | } | |
312 | 310 | } | |
313 | 311 | ||
314 | 312 | ||
315 | 313 | func getAssetInfo (assetId) = match assetId { | |
316 | 314 | case id: ByteVector => | |
317 | 315 | let stringId = toBase58String(id) | |
318 | 316 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
319 | 317 | $Tuple3(stringId, info.name, info.decimals) | |
320 | 318 | case waves: Unit => | |
321 | 319 | $Tuple3("WAVES", "WAVES", 8) | |
322 | 320 | case _ => | |
323 | 321 | throw("Match error") | |
324 | 322 | } | |
325 | 323 | ||
326 | 324 | ||
327 | 325 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
328 | 326 | ||
329 | 327 | ||
330 | 328 | func throwIsActive () = throw("DApp is already active") | |
331 | 329 | ||
332 | 330 | ||
333 | 331 | func isActive () = if (if (active) | |
334 | 332 | then activeGlob | |
335 | 333 | else false) | |
336 | 334 | then unit | |
337 | 335 | else throw("DApp is inactive at this moment") | |
338 | 336 | ||
339 | 337 | ||
340 | 338 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
341 | 339 | then unit | |
342 | 340 | else throw("Only admin can call this function") | |
343 | 341 | ||
344 | 342 | ||
345 | 343 | func isSelfCall (i) = if ((this == i.caller)) | |
346 | 344 | then unit | |
347 | 345 | else throw("Only contract itself can call this function") | |
348 | 346 | ||
349 | 347 | ||
350 | 348 | func throwAssets () = throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
351 | 349 | ||
352 | 350 | ||
353 | 351 | func throwOnePayment () = throw("One attached payment expected") | |
354 | 352 | ||
355 | 353 | ||
356 | - | func throwThreshold (threshold,amountA,amountB) = throw(((((((((("New balance in assets of the DApp is less than threshold " + toString(threshold)) + ": ") + toString(amountA)) + " ") + assetNameA) + ", ") + toString(amountB)) + " ") + assetNameB)) | |
357 | - | ||
358 | - | ||
359 | 354 | func suspendSuspicious () = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB)) | |
360 | 355 | ||
361 | 356 | ||
362 | 357 | func calcStakingFuncAndAddres (stake,assetId) = if (stake) | |
363 | 358 | then $Tuple2("lockNeutrino", stakingUSDNAddress) | |
364 | 359 | else $Tuple2("unlockNeutrino", stakingUSDNAddress) | |
365 | 360 | ||
366 | 361 | ||
367 | 362 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
368 | 363 | then { | |
369 | - | let $ | |
370 | - | let call = $ | |
371 | - | let stakingAddr = $ | |
364 | + | let $t01020710273 = calcStakingFuncAndAddres(stake, assetId) | |
365 | + | let call = $t01020710273._1 | |
366 | + | let stakingAddr = $t01020710273._2 | |
372 | 367 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
373 | 368 | } | |
374 | 369 | else { | |
375 | - | let $ | |
376 | - | let call = $ | |
377 | - | let stakingAddr = $ | |
370 | + | let $t01035910425 = calcStakingFuncAndAddres(stake, assetId) | |
371 | + | let call = $t01035910425._1 | |
372 | + | let stakingAddr = $t01035910425._2 | |
378 | 373 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
379 | 374 | } | |
380 | 375 | ||
381 | 376 | ||
382 | 377 | func calculateFeeDiscount (userAddr) = { | |
383 | 378 | let swopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserSwopInGov)), 0) | |
384 | 379 | let gSwopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserGSwopInGov)), swopAmount) | |
385 | 380 | let discountValues = split(getStringValue(oracle, kDiscountValues), ",") | |
386 | 381 | let discounts = split(getStringValue(oracle, kDiscounts), ",") | |
387 | 382 | if (if ((gSwopAmount >= parseIntValue(discountValues[0]))) | |
388 | 383 | then (parseIntValue(discountValues[1]) > gSwopAmount) | |
389 | 384 | else false) | |
390 | 385 | then (feeScale6 - parseIntValue(discounts[0])) | |
391 | 386 | else if (if ((gSwopAmount >= parseIntValue(discountValues[1]))) | |
392 | 387 | then (parseIntValue(discountValues[2]) > gSwopAmount) | |
393 | 388 | else false) | |
394 | 389 | then (feeScale6 - parseIntValue(discounts[1])) | |
395 | 390 | else if (if ((gSwopAmount >= parseIntValue(discountValues[2]))) | |
396 | 391 | then (parseIntValue(discountValues[3]) > gSwopAmount) | |
397 | 392 | else false) | |
398 | 393 | then (feeScale6 - parseIntValue(discounts[2])) | |
399 | 394 | else if (if ((gSwopAmount >= parseIntValue(discountValues[3]))) | |
400 | 395 | then (parseIntValue(discountValues[4]) > gSwopAmount) | |
401 | 396 | else false) | |
402 | 397 | then (feeScale6 - parseIntValue(discounts[3])) | |
403 | 398 | else if ((gSwopAmount >= parseIntValue(discountValues[4]))) | |
404 | 399 | then (feeScale6 - parseIntValue(discounts[4])) | |
405 | 400 | else feeScale6 | |
406 | 401 | } | |
407 | 402 | ||
408 | 403 | ||
404 | + | func checkDAppThreshold (newBalanceA,newBalanceB,pmtAssetId) = { | |
405 | + | let dAppThreshold = getIntegerValue(this, kDAppThreshold) | |
406 | + | let ratio = if (if ((pmtAssetId == assetIdA)) | |
407 | + | then (newBalanceA > newBalanceB) | |
408 | + | else false) | |
409 | + | then fraction(newBalanceA, 1, newBalanceB, CEILING) | |
410 | + | else if (if ((pmtAssetId == assetIdB)) | |
411 | + | then (newBalanceB > newBalanceA) | |
412 | + | else false) | |
413 | + | then fraction(newBalanceB, 1, newBalanceA, CEILING) | |
414 | + | else 0 | |
415 | + | if ((ratio > dAppThreshold)) | |
416 | + | then { | |
417 | + | let $t01217012278 = if ((pmtAssetId == assetIdA)) | |
418 | + | then $Tuple2(assetNameB, assetNameA) | |
419 | + | else $Tuple2(assetNameA, assetNameB) | |
420 | + | let token1 = $t01217012278._1 | |
421 | + | let token2 = $t01217012278._2 | |
422 | + | throw((((("Buying " + token1) + " is temporarily unavailable due to the ") + token2) + " depeg")) | |
423 | + | } | |
424 | + | else true | |
425 | + | } | |
426 | + | ||
427 | + | ||
409 | 428 | func replenishWithTwoTokensCalc (i,stakeFarming,lockType) = { | |
410 | 429 | let pmtAssetIdA = i.payments[0].assetId | |
411 | 430 | let pmtAssetIdB = i.payments[1].assetId | |
412 | 431 | let ratioShareTokensInA = fraction(scale8, i.payments[0].amount, balanceA) | |
413 | 432 | let ratioShareTokensInB = fraction(scale8, i.payments[1].amount, balanceB) | |
414 | - | let $ | |
415 | - | let pmtStrAssetIdA = $ | |
416 | - | let pmtAssetNameA = $ | |
417 | - | let pmtDecimalsA = $ | |
418 | - | let $ | |
419 | - | let pmtStrAssetIdB = $ | |
420 | - | let pmtAssetNameB = $ | |
421 | - | let pmtDecimalsB = $ | |
422 | - | let $ | |
433 | + | let $t01273812815 = getAssetInfo(pmtAssetIdA) | |
434 | + | let pmtStrAssetIdA = $t01273812815._1 | |
435 | + | let pmtAssetNameA = $t01273812815._2 | |
436 | + | let pmtDecimalsA = $t01273812815._3 | |
437 | + | let $t01282012937 = getAssetInfo(pmtAssetIdB) | |
438 | + | let pmtStrAssetIdB = $t01282012937._1 | |
439 | + | let pmtAssetNameB = $t01282012937._2 | |
440 | + | let pmtDecimalsB = $t01282012937._3 | |
441 | + | let $t01294213446 = if ((ratioShareTokensInB > ratioShareTokensInA)) | |
423 | 442 | then { | |
424 | 443 | let pmt = fraction(balanceB, ratioShareTokensInA, scale8, CEILING) | |
425 | 444 | $Tuple5(i.payments[0].amount, pmt, (i.payments[1].amount - pmt), pmtAssetIdB, ratioShareTokensInA) | |
426 | 445 | } | |
427 | 446 | else { | |
428 | 447 | let pmt = fraction(balanceA, ratioShareTokensInB, scale8, CEILING) | |
429 | 448 | $Tuple5(pmt, i.payments[1].amount, (i.payments[0].amount - pmt), pmtAssetIdA, ratioShareTokensInB) | |
430 | 449 | } | |
431 | - | let pmtAmountA = $ | |
432 | - | let pmtAmountB = $ | |
433 | - | let change = $ | |
434 | - | let changeAssetId = $ | |
435 | - | let shareTokenRatio = $ | |
450 | + | let pmtAmountA = $t01294213446._1 | |
451 | + | let pmtAmountB = $t01294213446._2 | |
452 | + | let change = $t01294213446._3 | |
453 | + | let changeAssetId = $t01294213446._4 | |
454 | + | let shareTokenRatio = $t01294213446._5 | |
436 | 455 | let shareTokenToPayAmount = fraction(shareTokenRatio, shareAssetSupply, scale8) | |
437 | 456 | if (if ((size(i.payments) != 2)) | |
438 | 457 | then (size(i.payments) != 3) | |
439 | 458 | else false) | |
440 | 459 | then throw("Two or three payments expected") | |
441 | 460 | else if (if ((pmtAssetIdA != assetIdA)) | |
442 | 461 | then true | |
443 | 462 | else (pmtAssetIdB != assetIdB)) | |
444 | 463 | then throwAssets() | |
445 | 464 | else if ((shareTokenToPayAmount == 0)) | |
446 | 465 | then throw("Too small amount to replenish") | |
447 | 466 | else if ((0 > change)) | |
448 | 467 | then throw("Change < 0") | |
449 | 468 | else if (!(hasEnoughBalance)) | |
450 | 469 | then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious()) | |
451 | 470 | else { | |
452 | 471 | let stake1 = if (contains(stakingAssets, pmtStrAssetIdA)) | |
453 | 472 | then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil) | |
454 | 473 | else 0 | |
455 | 474 | if ((stake1 == stake1)) | |
456 | 475 | then { | |
457 | 476 | let stake2 = if (contains(stakingAssets, pmtStrAssetIdB)) | |
458 | 477 | then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
459 | 478 | else 0 | |
460 | 479 | if ((stake2 == stake2)) | |
461 | 480 | then { | |
462 | 481 | let scriptActions = [IntegerEntry(kBalanceA, (balanceA + pmtAmountA)), IntegerEntry(kBalanceB, (balanceB + pmtAmountB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(kInvariant, invariantCalc((balanceA + pmtAmountA), (balanceB + pmtAmountB))), ScriptTransfer(i.caller, change, changeAssetId)] | |
463 | 482 | if (stakeFarming) | |
464 | 483 | then { | |
465 | 484 | let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmount)] ++ (if ((size(i.payments) == 3)) | |
466 | 485 | then [AttachedPayment(if ((i.payments[2].assetId == base58'')) | |
467 | 486 | then unit | |
468 | 487 | else i.payments[2].assetId, i.payments[2].amount)] | |
469 | 488 | else nil)) | |
470 | 489 | let re = invoke(this, "reissueShare", [shareTokenToPayAmount], nil) | |
471 | 490 | if ((re == re)) | |
472 | 491 | then { | |
473 | 492 | let s = invoke(farmingAddress, "lockShareTokensFromPool", [i.caller.bytes, toString(this), lockType], stPayments) | |
474 | 493 | if ((s == s)) | |
475 | 494 | then scriptActions | |
476 | 495 | else throw("Strict value is not equal to itself.") | |
477 | 496 | } | |
478 | 497 | else throw("Strict value is not equal to itself.") | |
479 | 498 | } | |
480 | 499 | else (scriptActions ++ [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId)]) | |
481 | 500 | } | |
482 | 501 | else throw("Strict value is not equal to itself.") | |
483 | 502 | } | |
484 | 503 | else throw("Strict value is not equal to itself.") | |
485 | 504 | } | |
486 | 505 | } | |
487 | 506 | ||
488 | 507 | ||
489 | 508 | func replenishWithOneTokenCalc (i,virtualSwapTokenPay,virtualSwapTokenGet,stakeFarming,lockType) = { | |
490 | - | let $ | |
491 | - | let pmtAmount = $ | |
492 | - | let pmtAssetId = $ | |
493 | - | let $ | |
494 | - | let pmtStrAssetId = $ | |
495 | - | let pmtAssetName = $ | |
496 | - | let pmtDecimals = $ | |
509 | + | let $t01583615911 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
510 | + | let pmtAmount = $t01583615911._1 | |
511 | + | let pmtAssetId = $t01583615911._2 | |
512 | + | let $t01591615989 = getAssetInfo(pmtAssetId) | |
513 | + | let pmtStrAssetId = $t01591615989._1 | |
514 | + | let pmtAssetName = $t01591615989._2 | |
515 | + | let pmtDecimals = $t01591615989._3 | |
497 | 516 | let pmtMinThreshold = 5000000 | |
498 | 517 | let thresholdValueForMinTolerance = 50000000 | |
499 | 518 | let tolerance = if ((thresholdValueForMinTolerance > pmtAmount)) | |
500 | 519 | then 100000 | |
501 | 520 | else 1 | |
502 | 521 | let slippageValueMinForReplenish = (scale8 - ((scale8 * tolerance) / 10000000)) | |
503 | 522 | let slippageValueMaxForReplenish = (scale8 + ((scale8 * tolerance) / 10000000)) | |
504 | 523 | let slippageValueMinForSwap = (scale8 - ((scale8 * 1) / 10000000)) | |
505 | 524 | if ((pmtMinThreshold > pmtAmount)) | |
506 | 525 | then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens")) | |
507 | 526 | else if (if ((size(i.payments) != 1)) | |
508 | 527 | then (size(i.payments) != 2) | |
509 | 528 | else false) | |
510 | 529 | then throw("One or two payments expected") | |
511 | 530 | else if (!(hasEnoughBalance)) | |
512 | 531 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
513 | 532 | else if (if ((pmtAssetId != assetIdA)) | |
514 | 533 | then (pmtAssetId != assetIdB) | |
515 | 534 | else false) | |
516 | 535 | then throwAssets() | |
517 | 536 | else { | |
518 | - | let $ | |
537 | + | let $t01699117633 = if ((pmtAssetId == assetIdA)) | |
519 | 538 | then $Tuple6((pmtAmount - virtualSwapTokenPay), virtualSwapTokenGet, (balanceA + virtualSwapTokenPay), (balanceB - virtualSwapTokenGet), (balanceA + pmtAmount), balanceB) | |
520 | 539 | else $Tuple6(virtualSwapTokenGet, (pmtAmount - virtualSwapTokenPay), (balanceA - virtualSwapTokenGet), (balanceB + virtualSwapTokenPay), balanceA, (balanceB + pmtAmount)) | |
521 | - | let virtualReplenishA = $ | |
522 | - | let virtualReplenishB = $ | |
523 | - | let balanceAfterSwapA = $ | |
524 | - | let balanceAfterSwapB = $ | |
525 | - | let newBalanceA = $ | |
526 | - | let newBalanceB = $ | |
540 | + | let virtualReplenishA = $t01699117633._1 | |
541 | + | let virtualReplenishB = $t01699117633._2 | |
542 | + | let balanceAfterSwapA = $t01699117633._3 | |
543 | + | let balanceAfterSwapB = $t01699117633._4 | |
544 | + | let newBalanceA = $t01699117633._5 | |
545 | + | let newBalanceB = $t01699117633._6 | |
527 | 546 | let invariantNew = invariantCalc(balanceAfterSwapA, balanceAfterSwapB) | |
528 | 547 | let ratioVirtualBalanceToVirtualReplenish = (fraction(scale16, balanceAfterSwapA, balanceAfterSwapB) / fraction(scale8, virtualReplenishA, virtualReplenishB)) | |
529 | - | let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2)) | |
530 | 548 | if (if ((slippageValueMinForSwap >= fraction(scale8, invariant, invariantNew))) | |
531 | 549 | then true | |
532 | 550 | else (invariant > invariantNew)) | |
533 | 551 | then throw("Incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
534 | 552 | else if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish)) | |
535 | 553 | then true | |
536 | 554 | else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish)) | |
537 | 555 | then throw("Swap with virtualSwapTokenPay and virtualSwapTokenGet is possible, but ratio after virtual swap is incorrect") | |
538 | - | else if (if ((dAppThresholdAmount > newBalanceA)) | |
539 | - | then true | |
540 | - | else (dAppThresholdAmount > newBalanceB)) | |
541 | - | then throwThreshold(dAppThresholdAmount, newBalanceA, newBalanceB) | |
556 | + | else if (!(checkDAppThreshold(newBalanceA, newBalanceB, pmtAssetId))) | |
557 | + | then throw() | |
542 | 558 | else { | |
543 | 559 | let ratioShareTokensInA = fraction(virtualReplenishA, scale8, balanceAfterSwapA) | |
544 | 560 | let ratioShareTokensInB = fraction(virtualReplenishB, scale8, balanceAfterSwapB) | |
545 | 561 | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scale8) | |
546 | 562 | let shareTokenToPayAmountAfterFee = fraction(shareTokenToPayAmount, (feeScale6 - (fee / 2)), feeScale6) | |
547 | 563 | let shareTokenGovernanceReward = fraction(shareTokenToPayAmount, (feeGovernance / 2), feeScale6) | |
548 | 564 | let governanceRewardTokenA = fraction(shareTokenGovernanceReward, balanceA, shareAssetSupply) | |
549 | 565 | let governanceRewardTokenB = fraction(shareTokenGovernanceReward, balanceB, shareAssetSupply) | |
550 | - | let $ | |
566 | + | let $t01938419667 = if ((pmtStrAssetId == strAssetIdA)) | |
551 | 567 | then $Tuple3((pmtAmount - governanceRewardTokenA), governanceRewardTokenB, strAssetIdB) | |
552 | 568 | else $Tuple3((pmtAmount - governanceRewardTokenB), governanceRewardTokenA, strAssetIdA) | |
553 | - | let stakeAmount = $ | |
554 | - | let unstakeAmount = $ | |
555 | - | let unstakeAsset = $ | |
569 | + | let stakeAmount = $t01938419667._1 | |
570 | + | let unstakeAmount = $t01938419667._2 | |
571 | + | let unstakeAsset = $t01938419667._3 | |
556 | 572 | let stake1 = if (contains(stakingAssets, pmtStrAssetId)) | |
557 | 573 | then invoke(this, "stakeUnstake", [true, stakeAmount, pmtStrAssetId], nil) | |
558 | 574 | else 0 | |
559 | 575 | if ((stake1 == stake1)) | |
560 | 576 | then { | |
561 | 577 | let stake2 = if (contains(stakingAssets, unstakeAsset)) | |
562 | 578 | then invoke(this, "stakeUnstake", [false, unstakeAmount, unstakeAsset], nil) | |
563 | 579 | else 0 | |
564 | 580 | if ((stake2 == stake2)) | |
565 | 581 | then { | |
566 | 582 | let scriptActions = [IntegerEntry(kBalanceA, (newBalanceA - governanceRewardTokenA)), IntegerEntry(kBalanceB, (newBalanceB - governanceRewardTokenB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmountAfterFee)), IntegerEntry(kInvariant, invariantCalc((newBalanceA - governanceRewardTokenA), (newBalanceB - governanceRewardTokenB))), ScriptTransfer(moneyBoxAddress, governanceRewardTokenA, assetIdA), ScriptTransfer(moneyBoxAddress, governanceRewardTokenB, assetIdB)] | |
567 | 583 | if (stakeFarming) | |
568 | 584 | then { | |
569 | 585 | let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmountAfterFee)] ++ (if ((size(i.payments) == 2)) | |
570 | 586 | then [AttachedPayment(if ((i.payments[1].assetId == base58'')) | |
571 | 587 | then unit | |
572 | 588 | else i.payments[1].assetId, i.payments[1].amount)] | |
573 | 589 | else nil)) | |
574 | 590 | let re = invoke(this, "reissueShare", [shareTokenToPayAmountAfterFee], nil) | |
575 | 591 | if ((re == re)) | |
576 | 592 | then { | |
577 | 593 | let s = invoke(farmingAddress, "lockShareTokensFromPool", [i.caller.bytes, toString(this), lockType], stPayments) | |
578 | 594 | if ((s == s)) | |
579 | 595 | then scriptActions | |
580 | 596 | else throw("Strict value is not equal to itself.") | |
581 | 597 | } | |
582 | 598 | else throw("Strict value is not equal to itself.") | |
583 | 599 | } | |
584 | 600 | else (scriptActions ++ [Reissue(shareAssetId, shareTokenToPayAmountAfterFee, true), ScriptTransfer(i.caller, shareTokenToPayAmountAfterFee, shareAssetId)]) | |
585 | 601 | } | |
586 | 602 | else throw("Strict value is not equal to itself.") | |
587 | 603 | } | |
588 | 604 | else throw("Strict value is not equal to itself.") | |
589 | 605 | } | |
590 | 606 | } | |
591 | 607 | } | |
592 | 608 | ||
593 | 609 | ||
594 | 610 | func withdrawCalc (i,unlockAmount) = { | |
595 | - | let $ | |
611 | + | let $t02151621851 = if ((size(i.payments) == 1)) | |
596 | 612 | then if ((i.payments[0].assetId != shareAssetId)) | |
597 | 613 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
598 | 614 | else $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
599 | 615 | else $Tuple2(0, shareAssetId) | |
600 | - | let pmtAmount = $ | |
601 | - | let pmtAssetId = $ | |
616 | + | let pmtAmount = $t02151621851._1 | |
617 | + | let pmtAssetId = $t02151621851._2 | |
602 | 618 | if (!(hasEnoughBalance)) | |
603 | 619 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
604 | 620 | else { | |
605 | 621 | let unlock = if ((unlockAmount > 0)) | |
606 | 622 | then invoke(farmingAddress, "withdrawShareTokensFromPool", [i.caller.bytes, toString(this), unlockAmount], nil) | |
607 | 623 | else 0 | |
608 | 624 | if ((unlock == unlock)) | |
609 | 625 | then { | |
610 | 626 | let withdrawAmount = (pmtAmount + unlockAmount) | |
611 | 627 | let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply) | |
612 | 628 | let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply) | |
613 | 629 | let invariantCalculated = invariantCalc((balanceA - amountToPayA), (balanceB - amountToPayB)) | |
614 | 630 | let stake1 = if (contains(stakingAssets, strAssetIdA)) | |
615 | 631 | then invoke(this, "stakeUnstake", [false, amountToPayA, strAssetIdA], nil) | |
616 | 632 | else 0 | |
617 | 633 | if ((stake1 == stake1)) | |
618 | 634 | then { | |
619 | 635 | let stake2 = if (contains(stakingAssets, strAssetIdB)) | |
620 | 636 | then invoke(this, "stakeUnstake", [false, amountToPayB, strAssetIdB], nil) | |
621 | 637 | else 0 | |
622 | 638 | if ((stake2 == stake2)) | |
623 | 639 | then [IntegerEntry(kBalanceA, (balanceA - amountToPayA)), IntegerEntry(kBalanceB, (balanceB - amountToPayB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), IntegerEntry(kInvariant, invariantCalculated), Burn(shareAssetId, withdrawAmount), ScriptTransfer(i.caller, amountToPayA, assetIdA), ScriptTransfer(i.caller, amountToPayB, assetIdB)] | |
624 | 640 | else throw("Strict value is not equal to itself.") | |
625 | 641 | } | |
626 | 642 | else throw("Strict value is not equal to itself.") | |
627 | 643 | } | |
628 | 644 | else throw("Strict value is not equal to itself.") | |
629 | 645 | } | |
630 | 646 | } | |
631 | 647 | ||
632 | 648 | ||
633 | 649 | @Callable(i) | |
634 | 650 | func init (firstHarvest) = { | |
635 | - | let $ | |
636 | - | let pmtAmountA = $ | |
637 | - | let pmtAssetIdA = $ | |
638 | - | let $ | |
639 | - | let pmtAmountB = $ | |
640 | - | let pmtAssetIdB = $ | |
641 | - | let $ | |
642 | - | let pmtStrAssetIdA = $ | |
643 | - | let pmtAssetNameA = $ | |
644 | - | let pmtDecimalsA = $ | |
645 | - | let $ | |
646 | - | let pmtStrAssetIdB = $ | |
647 | - | let pmtAssetNameB = $ | |
648 | - | let pmtDecimalsB = $ | |
651 | + | let $t02340323480 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
652 | + | let pmtAmountA = $t02340323480._1 | |
653 | + | let pmtAssetIdA = $t02340323480._2 | |
654 | + | let $t02348523562 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
655 | + | let pmtAmountB = $t02348523562._1 | |
656 | + | let pmtAssetIdB = $t02348523562._2 | |
657 | + | let $t02356723644 = getAssetInfo(pmtAssetIdA) | |
658 | + | let pmtStrAssetIdA = $t02356723644._1 | |
659 | + | let pmtAssetNameA = $t02356723644._2 | |
660 | + | let pmtDecimalsA = $t02356723644._3 | |
661 | + | let $t02364923726 = getAssetInfo(pmtAssetIdB) | |
662 | + | let pmtStrAssetIdB = $t02364923726._1 | |
663 | + | let pmtAssetNameB = $t02364923726._2 | |
664 | + | let pmtDecimalsB = $t02364923726._3 | |
649 | 665 | if (isDefined(getBoolean(this, kActive))) | |
650 | 666 | then throwIsActive() | |
651 | 667 | else if ((pmtAssetIdA == pmtAssetIdB)) | |
652 | 668 | then throw("Assets must be different") | |
653 | 669 | else { | |
654 | 670 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
655 | 671 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
656 | 672 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
657 | 673 | let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN), pow(10, 0, shareDecimals, 0, 0, DOWN)) | |
658 | 674 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
659 | 675 | let shareIssueId = calculateAssetId(shareIssue) | |
660 | 676 | let invariantCalculated = invariantCalc(pmtAmountA, pmtAmountB) | |
661 | 677 | let stake1 = if (contains(stakingAssets, pmtStrAssetIdA)) | |
662 | 678 | then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil) | |
663 | 679 | else 0 | |
664 | 680 | if ((stake1 == stake1)) | |
665 | 681 | then { | |
666 | 682 | let stake2 = if (contains(stakingAssets, pmtStrAssetIdB)) | |
667 | 683 | then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
668 | 684 | else 0 | |
669 | 685 | if ((stake2 == stake2)) | |
670 | 686 | then { | |
671 | - | let baseEntry = [StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssetIdA, pmtStrAssetIdA), StringEntry(kAssetIdB, pmtStrAssetIdB), IntegerEntry(kBalanceA, pmtAmountA), IntegerEntry(kBalanceB, pmtAmountB), IntegerEntry(kInvariant, invariantCalculated), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), shareIssue, StringEntry(kShareAssetId, toBase58String(shareIssueId)), IntegerEntry(kShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
687 | + | let baseEntry = [StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssetIdA, pmtStrAssetIdA), StringEntry(kAssetIdB, pmtStrAssetIdB), IntegerEntry(kBalanceA, pmtAmountA), IntegerEntry(kBalanceB, pmtAmountB), IntegerEntry(kInvariant, invariantCalculated), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), IntegerEntry(kDAppThreshold, 3), shareIssue, StringEntry(kShareAssetId, toBase58String(shareIssueId)), IntegerEntry(kShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
672 | 688 | if (firstHarvest) | |
673 | 689 | then (baseEntry ++ [BooleanEntry(kFirstHarvest, firstHarvest), IntegerEntry(kFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
674 | 690 | else baseEntry | |
675 | 691 | } | |
676 | 692 | else throw("Strict value is not equal to itself.") | |
677 | 693 | } | |
678 | 694 | else throw("Strict value is not equal to itself.") | |
679 | 695 | } | |
680 | 696 | } | |
681 | 697 | ||
682 | 698 | ||
683 | 699 | ||
684 | 700 | @Callable(i) | |
685 | 701 | func replenishWithTwoTokensV2 (stakeFarming,lockType) = valueOrElse(isActive(), replenishWithTwoTokensCalc(i, stakeFarming, lockType)) | |
686 | 702 | ||
687 | 703 | ||
688 | 704 | ||
689 | 705 | @Callable(i) | |
690 | 706 | func replenishWithOneTokenV2 (virtualSwapTokenPay,virtualSwapTokenGet,stakeFarming,lockType) = valueOrElse(isActive(), replenishWithOneTokenCalc(i, virtualSwapTokenPay, virtualSwapTokenGet, stakeFarming, lockType)) | |
691 | 707 | ||
692 | 708 | ||
693 | 709 | ||
694 | 710 | @Callable(i) | |
695 | 711 | func withdrawV2 (unlockAmount) = valueOrElse(isActive(), withdrawCalc(i, unlockAmount)) | |
696 | 712 | ||
697 | 713 | ||
698 | 714 | ||
699 | 715 | @Callable(i) | |
700 | 716 | func withdrawOneToken (unlockAmount,withdrawAsset,estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), { | |
701 | - | let $ | |
717 | + | let $t02714127476 = if ((size(i.payments) == 1)) | |
702 | 718 | then if ((i.payments[0].assetId != shareAssetId)) | |
703 | 719 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
704 | 720 | else $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
705 | 721 | else $Tuple2(0, shareAssetId) | |
706 | - | let pmtAmount = $ | |
707 | - | let pmtAssetId = $ | |
722 | + | let pmtAmount = $t02714127476._1 | |
723 | + | let pmtAssetId = $t02714127476._2 | |
708 | 724 | let withdrawAmount = (pmtAmount + unlockAmount) | |
709 | 725 | if (if ((withdrawAsset != strAssetIdA)) | |
710 | 726 | then (withdrawAsset != strAssetIdB) | |
711 | 727 | else false) | |
712 | 728 | then throw("Incorrect withdraw asset") | |
713 | 729 | else if ((0 >= withdrawAmount)) | |
714 | 730 | then throw("withdraw amount must be grater than 0") | |
715 | 731 | else if (!(hasEnoughBalance)) | |
716 | 732 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
717 | 733 | else { | |
718 | 734 | let unlock = if ((unlockAmount > 0)) | |
719 | 735 | then invoke(farmingAddress, "withdrawShareTokensFromPool", [i.caller.bytes, toString(this), unlockAmount], nil) | |
720 | 736 | else 0 | |
721 | 737 | if ((unlock == unlock)) | |
722 | 738 | then { | |
723 | 739 | let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply) | |
724 | 740 | let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply) | |
725 | 741 | let newVirtBalcA = (balanceA - amountToPayA) | |
726 | 742 | let newVirtBalcB = (balanceB - amountToPayB) | |
727 | 743 | let feeDiscount = calculateFeeDiscount(i.originCaller) | |
728 | 744 | let amountExchangedWithFee = if ((withdrawAsset == strAssetIdA)) | |
729 | 745 | then calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayB, assetIdB, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB)) | |
730 | 746 | else calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayA, assetIdA, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB)) | |
731 | 747 | let govReward = fraction(amountExchangedWithFee, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
732 | 748 | let amountExchanged = fraction(amountExchangedWithFee, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
733 | - | let $t02900329332 = if ((withdrawAsset == strAssetIdA)) | |
734 | - | then $Tuple3((amountToPayA + amountExchanged), (((balanceA - amountToPayA) - amountExchanged) - govReward), balanceB) | |
735 | - | else $Tuple3((amountToPayB + amountExchanged), balanceA, (((balanceB - amountToPayB) - amountExchanged) - govReward)) | |
736 | - | let amountToPay = $t02900329332._1 | |
737 | - | let balanceANew = $t02900329332._2 | |
738 | - | let balanceBNew = $t02900329332._3 | |
739 | - | let invariantCalculated = invariantCalc(balanceANew, balanceBNew) | |
740 | - | let stake1 = if (contains(stakingAssets, withdrawAsset)) | |
741 | - | then invoke(this, "stakeUnstake", [false, (amountToPay + govReward), withdrawAsset], nil) | |
742 | - | else 0 | |
743 | - | if ((stake1 == stake1)) | |
744 | - | then [IntegerEntry(kBalanceA, balanceANew), IntegerEntry(kBalanceB, balanceBNew), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), IntegerEntry(kInvariant, invariantCalculated), Burn(shareAssetId, withdrawAmount), ScriptTransfer(i.caller, amountToPay, fromBase58String(withdrawAsset)), ScriptTransfer(moneyBoxAddress, govReward, fromBase58String(withdrawAsset))] | |
745 | - | else throw("Strict value is not equal to itself.") | |
749 | + | let $t02907929441 = if ((withdrawAsset == strAssetIdA)) | |
750 | + | then $Tuple4((amountToPayA + amountExchanged), (((balanceA - amountToPayA) - amountExchanged) - govReward), balanceB, assetIdB) | |
751 | + | else $Tuple4((amountToPayB + amountExchanged), balanceA, (((balanceB - amountToPayB) - amountExchanged) - govReward), assetIdA) | |
752 | + | let amountToPay = $t02907929441._1 | |
753 | + | let balanceANew = $t02907929441._2 | |
754 | + | let balanceBNew = $t02907929441._3 | |
755 | + | let virtAssetId = $t02907929441._4 | |
756 | + | if (!(checkDAppThreshold(balanceANew, balanceBNew, virtAssetId))) | |
757 | + | then throw() | |
758 | + | else { | |
759 | + | let invariantCalculated = invariantCalc(balanceANew, balanceBNew) | |
760 | + | let stake1 = if (contains(stakingAssets, withdrawAsset)) | |
761 | + | then invoke(this, "stakeUnstake", [false, (amountToPay + govReward), withdrawAsset], nil) | |
762 | + | else 0 | |
763 | + | if ((stake1 == stake1)) | |
764 | + | then [IntegerEntry(kBalanceA, balanceANew), IntegerEntry(kBalanceB, balanceBNew), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), IntegerEntry(kInvariant, invariantCalculated), Burn(shareAssetId, withdrawAmount), ScriptTransfer(i.caller, amountToPay, fromBase58String(withdrawAsset)), ScriptTransfer(moneyBoxAddress, govReward, fromBase58String(withdrawAsset))] | |
765 | + | else throw("Strict value is not equal to itself.") | |
766 | + | } | |
746 | 767 | } | |
747 | 768 | else throw("Strict value is not equal to itself.") | |
748 | 769 | } | |
749 | 770 | }) | |
750 | 771 | ||
751 | 772 | ||
752 | 773 | ||
753 | 774 | @Callable(i) | |
754 | 775 | func exchange (estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), { | |
755 | - | let $ | |
756 | - | let pmtAmount = $ | |
757 | - | let pmtAssetId = $ | |
776 | + | let $t03040430479 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
777 | + | let pmtAmount = $t03040430479._1 | |
778 | + | let pmtAssetId = $t03040430479._2 | |
758 | 779 | if ((0 >= estimatedAmountToReceive)) | |
759 | 780 | then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive))) | |
760 | 781 | else if ((minAmountToReceive > estimatedAmountToReceive)) | |
761 | 782 | then throw("Minimal amount can't be greater than estimated.") | |
762 | 783 | else if ((size(i.payments) != 1)) | |
763 | 784 | then throwOnePayment() | |
764 | 785 | else if (!(hasEnoughBalance)) | |
765 | 786 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
766 | 787 | else if (if ((pmtAssetId != assetIdA)) | |
767 | 788 | then (pmtAssetId != assetIdB) | |
768 | 789 | else false) | |
769 | 790 | then throwAssets() | |
770 | 791 | else if ((10000000 > pmtAmount)) | |
771 | 792 | then throw("Only swap of 10.000000 or more tokens is allowed") | |
772 | 793 | else if (if ((exchangeRatioLimitMin > fraction(scale8, minAmountToReceive, pmtAmount))) | |
773 | 794 | then true | |
774 | 795 | else (fraction(scale8, estimatedAmountToReceive, pmtAmount) > exchangeRatioLimitMax)) | |
775 | 796 | then throw("Incorrect args and pmt ratio") | |
776 | 797 | else { | |
777 | 798 | let sendAssetId = if ((pmtAssetId == assetIdA)) | |
778 | 799 | then assetIdB | |
779 | 800 | else assetIdA | |
780 | 801 | let amount = calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, pmtAmount, pmtAssetId, balanceA, balanceB, invariant) | |
781 | 802 | let feeDiscount = calculateFeeDiscount(i.originCaller) | |
782 | 803 | let governanceReward = fraction(amount, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6) | |
783 | 804 | let amountMinusFee = fraction(amount, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6) | |
784 | - | let $ | |
805 | + | let $t03196332225 = if ((pmtAssetId == assetIdA)) | |
785 | 806 | then $Tuple2((balanceA + pmtAmount), ((balanceB - amountMinusFee) - governanceReward)) | |
786 | 807 | else $Tuple2(((balanceA - amountMinusFee) - governanceReward), (balanceB + pmtAmount)) | |
787 | - | let newBalanceA = $t03176432026._1 | |
788 | - | let newBalanceB = $t03176432026._2 | |
789 | - | let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2)) | |
790 | - | if (if ((dAppThresholdAmount > newBalanceA)) | |
791 | - | then true | |
792 | - | else (dAppThresholdAmount > newBalanceB)) | |
793 | - | then throwThreshold(dAppThresholdAmount, newBalanceA, newBalanceB) | |
808 | + | let newBalanceA = $t03196332225._1 | |
809 | + | let newBalanceB = $t03196332225._2 | |
810 | + | if (!(checkDAppThreshold(newBalanceA, newBalanceB, pmtAssetId))) | |
811 | + | then throw() | |
794 | 812 | else { | |
795 | - | let $ | |
796 | - | let pmtStrAssetId = $ | |
797 | - | let pmtAssetName = $ | |
798 | - | let pmtDecimals = $ | |
799 | - | let $ | |
800 | - | let sendStrAssetId = $ | |
801 | - | let sendAssetName = $ | |
802 | - | let sendDecimals = $ | |
813 | + | let $t03232332396 = getAssetInfo(pmtAssetId) | |
814 | + | let pmtStrAssetId = $t03232332396._1 | |
815 | + | let pmtAssetName = $t03232332396._2 | |
816 | + | let pmtDecimals = $t03232332396._3 | |
817 | + | let $t03240532482 = getAssetInfo(sendAssetId) | |
818 | + | let sendStrAssetId = $t03240532482._1 | |
819 | + | let sendAssetName = $t03240532482._2 | |
820 | + | let sendDecimals = $t03240532482._3 | |
803 | 821 | let stake1 = if (contains(stakingAssets, pmtStrAssetId)) | |
804 | 822 | then invoke(this, "stakeUnstake", [true, pmtAmount, pmtStrAssetId], nil) | |
805 | 823 | else 0 | |
806 | 824 | if ((stake1 == stake1)) | |
807 | 825 | then { | |
808 | 826 | let stake2 = if (contains(stakingAssets, sendStrAssetId)) | |
809 | 827 | then invoke(this, "stakeUnstake", [false, (amountMinusFee + governanceReward), sendStrAssetId], nil) | |
810 | 828 | else 0 | |
811 | 829 | if ((stake2 == stake2)) | |
812 | 830 | then $Tuple2([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kInvariant, invariantCalc(newBalanceA, newBalanceB)), ScriptTransfer(i.caller, amountMinusFee, sendAssetId), ScriptTransfer(moneyBoxAddress, governanceReward, sendAssetId)], [amountMinusFee, sendAssetId]) | |
813 | 831 | else throw("Strict value is not equal to itself.") | |
814 | 832 | } | |
815 | 833 | else throw("Strict value is not equal to itself.") | |
816 | 834 | } | |
817 | 835 | } | |
818 | 836 | }) | |
819 | 837 | ||
820 | 838 | ||
821 | 839 | ||
822 | 840 | @Callable(msg) | |
823 | 841 | func reissueShare (amount) = valueOrElse(isSelfCall(msg), [Reissue(shareAssetId, amount, true)]) | |
824 | 842 | ||
825 | 843 | ||
826 | 844 | ||
827 | 845 | @Callable(i) | |
828 | 846 | func shutdown () = valueOrElse(isAdminCall(i), if (!(active)) | |
829 | 847 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
830 | 848 | else suspend("Paused by admin")) | |
831 | 849 | ||
832 | 850 | ||
833 | 851 | ||
834 | 852 | @Callable(i) | |
835 | 853 | func activate () = valueOrElse(isAdminCall(i), if (active) | |
836 | 854 | then throwIsActive() | |
837 | 855 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
838 | 856 | ||
839 | 857 | ||
840 | 858 | ||
841 | 859 | @Callable(i) | |
842 | 860 | func takeIntoAccountExtraFunds () = valueOrElse(isActive(), { | |
843 | - | let amountEnrollA = (accountBalanceWithStakedA - balanceA) | |
844 | - | let amountEnrollB = (accountBalanceWithStakedB - balanceB) | |
845 | - | let invariantNew = invariantCalc((balanceA + amountEnrollA), (balanceB + amountEnrollB)) | |
846 | - | if ((i.caller != moneyBoxAddress)) | |
847 | - | then throw("Only the money box can call this function") | |
848 | - | else if (if ((0 > amountEnrollA)) | |
849 | - | then true | |
850 | - | else (0 > amountEnrollB)) | |
851 | - | then suspend("Enroll amount negative") | |
852 | - | else if (if ((amountEnrollA == 0)) | |
853 | - | then (amountEnrollB == 0) | |
854 | - | else false) | |
855 | - | then throw("No money to take") | |
856 | - | else { | |
857 | - | let stake1 = if (if (contains(stakingAssets, strAssetIdA)) | |
858 | - | then (amountEnrollA > 0) | |
861 | + | let claim = if (if ((assetIdA == USDN)) | |
862 | + | then true | |
863 | + | else (assetIdB == USDN)) | |
864 | + | then invoke(stakingUSDNAddress, "claimRewards", nil, nil) | |
865 | + | else 0 | |
866 | + | if ((claim == claim)) | |
867 | + | then { | |
868 | + | let amountEnrollA = (accountBalanceWithStakedA - balanceA) | |
869 | + | let amountEnrollB = (accountBalanceWithStakedB - balanceB) | |
870 | + | let invariantNew = invariantCalc((balanceA + amountEnrollA), (balanceB + amountEnrollB)) | |
871 | + | if ((i.caller != moneyBoxAddress)) | |
872 | + | then throw("Only the money box can call this function") | |
873 | + | else if (if ((0 > amountEnrollA)) | |
874 | + | then true | |
875 | + | else (0 > amountEnrollB)) | |
876 | + | then suspend("Enroll amount negative") | |
877 | + | else if (if ((amountEnrollA == 0)) | |
878 | + | then (amountEnrollB == 0) | |
859 | 879 | else false) | |
860 | - | then invoke(this, "stakeUnstake", [true, amountEnrollA, strAssetIdA], nil) | |
861 | - | else 0 | |
862 | - | if ((stake1 == stake1)) | |
863 | - | then { | |
864 | - | let stake2 = if (if (contains(stakingAssets, strAssetIdB)) | |
865 | - | then (amountEnrollB > 0) | |
880 | + | then throw("No money to take") | |
881 | + | else { | |
882 | + | let stake1 = if (if (contains(stakingAssets, strAssetIdA)) | |
883 | + | then (amountEnrollA > 0) | |
866 | 884 | else false) | |
867 | - | then invoke(this, "stakeUnstake", [true, | |
885 | + | then invoke(this, "stakeUnstake", [true, amountEnrollA, strAssetIdA], nil) | |
868 | 886 | else 0 | |
869 | - | if ((stake2 == stake2)) | |
870 | - | then [IntegerEntry(kInvariant, invariantNew), IntegerEntry(kBalanceA, (balanceA + amountEnrollA)), IntegerEntry(kBalanceB, (balanceB + amountEnrollB))] | |
887 | + | if ((stake1 == stake1)) | |
888 | + | then { | |
889 | + | let stake2 = if (if (contains(stakingAssets, strAssetIdB)) | |
890 | + | then (amountEnrollB > 0) | |
891 | + | else false) | |
892 | + | then invoke(this, "stakeUnstake", [true, amountEnrollB, strAssetIdB], nil) | |
893 | + | else 0 | |
894 | + | if ((stake2 == stake2)) | |
895 | + | then [IntegerEntry(kInvariant, invariantNew), IntegerEntry(kBalanceA, (balanceA + amountEnrollA)), IntegerEntry(kBalanceB, (balanceB + amountEnrollB))] | |
896 | + | else throw("Strict value is not equal to itself.") | |
897 | + | } | |
871 | 898 | else throw("Strict value is not equal to itself.") | |
872 | 899 | } | |
873 | - | | |
874 | - | | |
900 | + | } | |
901 | + | else throw("Strict value is not equal to itself.") | |
875 | 902 | }) | |
876 | 903 | ||
877 | 904 | ||
878 | 905 | ||
879 | 906 | @Callable(i) | |
880 | 907 | func keepLimitForFirstHarvest (shareLimit) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), [IntegerEntry(kShareLimit, shareLimit)])) | |
881 | 908 | ||
882 | 909 | ||
883 | 910 | ||
884 | 911 | @Callable(i) | |
885 | 912 | func stakeUnstake (stake,amount,assetIdString) = if ((i.caller != this)) | |
886 | 913 | then throw("Only contract itself can invoke this function") | |
887 | 914 | else { | |
888 | - | let $ | |
889 | - | let call = $ | |
890 | - | let addr = $ | |
891 | - | let params = $ | |
892 | - | let payments = $ | |
915 | + | let $t03584535948 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
916 | + | let call = $t03584535948._1 | |
917 | + | let addr = $t03584535948._2 | |
918 | + | let params = $t03584535948._3 | |
919 | + | let payments = $t03584535948._4 | |
893 | 920 | let inv = invoke(addr, call, params, payments) | |
894 | 921 | if ((inv == inv)) | |
895 | 922 | then nil | |
896 | 923 | else throw("Strict value is not equal to itself.") | |
897 | 924 | } | |
898 | 925 | ||
899 | 926 | ||
900 | 927 | ||
901 | 928 | @Callable(i) | |
902 | 929 | func replenishWithTwoTokens () = valueOrElse(isActive(), replenishWithTwoTokensCalc(i, false, 0)) | |
903 | 930 | ||
904 | 931 | ||
905 | 932 | ||
906 | 933 | @Callable(i) | |
907 | 934 | func replenishWithOneToken (virtualSwapTokenPay,virtualSwapTokenGet) = valueOrElse(isActive(), replenishWithOneTokenCalc(i, virtualSwapTokenPay, virtualSwapTokenGet, false, 0)) | |
908 | 935 | ||
909 | 936 | ||
910 | 937 | ||
911 | 938 | @Callable(i) | |
912 | 939 | func withdraw () = valueOrElse(isActive(), withdrawCalc(i, 0)) | |
913 | 940 | ||
914 | 941 | ||
915 | 942 | @Verifier(tx) | |
916 | 943 | func verify () = { | |
917 | 944 | let multiSignedByAdmins = { | |
918 | 945 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
919 | 946 | then 1 | |
920 | 947 | else 0 | |
921 | 948 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
922 | 949 | then 1 | |
923 | 950 | else 0 | |
924 | 951 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
925 | 952 | then 1 | |
926 | 953 | else 0 | |
927 | 954 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
928 | 955 | } | |
929 | 956 | match tx { | |
930 | 957 | case inv: InvokeScriptTransaction => | |
931 | 958 | let callTakeIntoAccount = if ((inv.dApp == this)) | |
932 | 959 | then (inv.function == "takeIntoAccountExtraFunds") | |
933 | 960 | else false | |
934 | 961 | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
935 | 962 | then true | |
936 | 963 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
937 | 964 | then true | |
938 | 965 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
939 | 966 | then true | |
940 | 967 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyInvoke) | |
941 | 968 | if (if (callTakeIntoAccount) | |
942 | 969 | then signedByAdmin | |
943 | 970 | else false) | |
944 | 971 | then true | |
945 | 972 | else multiSignedByAdmins | |
946 | 973 | case _ => | |
947 | 974 | multiSignedByAdmins | |
948 | 975 | } | |
949 | 976 | } | |
950 | 977 |
github/deemru/w8io/026f985 231.58 ms ◑