tx · CPJBNgiqCoi4X64H6kPiZV8k5jRgYMuRPHtNh9CMpnJ4

3MpygN8qm376tUAHB6mhC5BxG5NKYortiyX:  -0.03600000 Waves

2022.11.24 23:10 [2331630] smart account 3MpygN8qm376tUAHB6mhC5BxG5NKYortiyX > SELF 0.00000000 Waves

{ "type": 13, "id": "CPJBNgiqCoi4X64H6kPiZV8k5jRgYMuRPHtNh9CMpnJ4", "fee": 3600000, "feeAssetId": null, "timestamp": 1669320559477, "version": 2, "chainId": 84, "sender": "3MpygN8qm376tUAHB6mhC5BxG5NKYortiyX", "senderPublicKey": "BjnLnkAMaJLYAK36vQqSepUNjGeMDHfZGfmdYwGcLbmg", "proofs": [ "22WLfVQrCioS7N68owkxKzVsyQQtfwoewZSV6zzT8yj7n6urGE36WNFjexDGMB6mffacTGAgxTkDWVjYpg8Vitt6", "49bzGPDiKvDxcRo8M6hGBhRT4ULncL3dAj4ma5VbbVfSwLM4zrwribEFX6QEf7HxJa6ZeXURjF1YKCQCHXqeiHsx" ], "script": "base64:BgJJCAISAwoBBBIECgIEARIGCgQBAQQBEgMKAQESBgoEAQgBARIECgIBARIDCgEBEgASABIAEgMKAQESBQoDBAEIEgASBAoCAQESAGsAB3ZlcnNpb24CBTIuMC4wAAhrVmVyc2lvbgIHdmVyc2lvbgAHa0FjdGl2ZQIGYWN0aXZlAAtrQWN0aXZlR2xvYgIUYWN0aXZlX2FsbF9jb250cmFjdHMACWtBc3NldElkQQIKQV9hc3NldF9pZAAJa0Fzc2V0SWRCAgpCX2Fzc2V0X2lkAAlrQmFsYW5jZUECD0FfYXNzZXRfYmFsYW5jZQAJa0JhbGFuY2VCAg9CX2Fzc2V0X2JhbGFuY2UADWtTaGFyZUFzc2V0SWQCDnNoYXJlX2Fzc2V0X2lkABFrU2hhcmVBc3NldFN1cHBseQISc2hhcmVfYXNzZXRfc3VwcGx5AARrRmVlAgpjb21taXNzaW9uAAprSW52YXJpYW50AglpbnZhcmlhbnQABmtDYXVzZQIOc2h1d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ACCAUDaW52BGRBcHAFBHRoaXMJAAACCAUDaW52CGZ1bmN0aW9uAhl0YWtlSW50b0FjY291bnRFeHRyYUZ1bmRzBwQNc2lnbmVkQnlBZG1pbgMDAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUMYWRtaW5QdWJLZXkxBgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUMYWRtaW5QdWJLZXkyBgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUMYWRtaW5QdWJLZXkzBgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAURYWRtaW5QdWJLZXlJbnZva2UDAwUTY2FsbFRha2VJbnRvQWNjb3VudAUNc2lnbmVkQnlBZG1pbgcGBRNtdWx0aVNpZ25lZEJ5QWRtaW5zBRNtdWx0aVNpZ25lZEJ5QWRtaW5zgzYhsQ==", "height": 2331630, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A39GaZW6jN363AdoaKKBJKb8j8a7gV5dGrA81BzYiNZE Next: AxEfEyEs8YwBVVDzHc6ehgNVkhK9mTwTX7Zx7cLsYXDg Diff:
OldNewDifferences
66 let kVersion = "version"
77
88 let kActive = "active"
9+
10+let kActiveGlob = "active_all_contracts"
911
1012 let kAssetIdA = "A_asset_id"
1113
110112 let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3)
111113
112114 let active = getBooleanValue(this, kActive)
115+
116+let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true)
113117
114118 let strAssetIdA = getStringValue(this, kAssetIdA)
115119
326330 func throwIsActive () = throw("DApp is already active")
327331
328332
329-func isActive () = if (active)
333+func isActive () = if (if (active)
334+ then activeGlob
335+ else false)
330336 then unit
331337 else throw("DApp is inactive at this moment")
332338
360366
361367 func calcStakingParams (stake,amount,assetId) = if (stake)
362368 then {
363- let $t01038310449 = calcStakingFuncAndAddres(stake, assetId)
364- let call = $t01038310449._1
365- let stakingAddr = $t01038310449._2
369+ let $t01050410570 = calcStakingFuncAndAddres(stake, assetId)
370+ let call = $t01050410570._1
371+ let stakingAddr = $t01050410570._2
366372 $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)])
367373 }
368374 else {
369- let $t01053510601 = calcStakingFuncAndAddres(stake, assetId)
370- let call = $t01053510601._1
371- let stakingAddr = $t01053510601._2
375+ let $t01065610722 = calcStakingFuncAndAddres(stake, assetId)
376+ let call = $t01065610722._1
377+ let stakingAddr = $t01065610722._2
372378 $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil)
373379 }
374380
400406 }
401407
402408
409+func replenishWithTwoTokensCalc (i,stakeFarming,lockType) = {
410+ let pmtAssetIdA = i.payments[0].assetId
411+ let pmtAssetIdB = i.payments[1].assetId
412+ let ratioShareTokensInA = fraction(scale8, i.payments[0].amount, balanceA)
413+ let ratioShareTokensInB = fraction(scale8, i.payments[1].amount, balanceB)
414+ let $t01230412381 = getAssetInfo(pmtAssetIdA)
415+ let pmtStrAssetIdA = $t01230412381._1
416+ let pmtAssetNameA = $t01230412381._2
417+ let pmtDecimalsA = $t01230412381._3
418+ let $t01238612503 = getAssetInfo(pmtAssetIdB)
419+ let pmtStrAssetIdB = $t01238612503._1
420+ let pmtAssetNameB = $t01238612503._2
421+ let pmtDecimalsB = $t01238612503._3
422+ let $t01250813012 = if ((ratioShareTokensInB > ratioShareTokensInA))
423+ then {
424+ let pmt = fraction(balanceB, ratioShareTokensInA, scale8, CEILING)
425+ $Tuple5(i.payments[0].amount, pmt, (i.payments[1].amount - pmt), pmtAssetIdB, ratioShareTokensInA)
426+ }
427+ else {
428+ let pmt = fraction(balanceA, ratioShareTokensInB, scale8, CEILING)
429+ $Tuple5(pmt, i.payments[1].amount, (i.payments[0].amount - pmt), pmtAssetIdA, ratioShareTokensInB)
430+ }
431+ let pmtAmountA = $t01250813012._1
432+ let pmtAmountB = $t01250813012._2
433+ let change = $t01250813012._3
434+ let changeAssetId = $t01250813012._4
435+ let shareTokenRatio = $t01250813012._5
436+ let shareTokenToPayAmount = fraction(shareTokenRatio, shareAssetSupply, scale8)
437+ if (if ((size(i.payments) != 2))
438+ then (size(i.payments) != 3)
439+ else false)
440+ then throw("Two or three payments expected")
441+ else if (if ((pmtAssetIdA != assetIdA))
442+ then true
443+ else (pmtAssetIdB != assetIdB))
444+ then throwAssets()
445+ else if ((shareTokenToPayAmount == 0))
446+ then throw("Too small amount to replenish")
447+ else if ((0 > change))
448+ then throw("Change < 0")
449+ else if (!(hasEnoughBalance))
450+ then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious())
451+ else {
452+ let stake1 = if (contains(stakingAssets, pmtStrAssetIdA))
453+ then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil)
454+ else 0
455+ if ((stake1 == stake1))
456+ then {
457+ let stake2 = if (contains(stakingAssets, pmtStrAssetIdB))
458+ then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil)
459+ else 0
460+ if ((stake2 == stake2))
461+ then {
462+ 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+ if (stakeFarming)
464+ then {
465+ let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmount)] ++ (if ((size(i.payments) == 3))
466+ then [AttachedPayment(if ((i.payments[2].assetId == base58''))
467+ then unit
468+ else i.payments[2].assetId, i.payments[2].amount)]
469+ else nil))
470+ let re = invoke(this, "reissueShare", [shareTokenToPayAmount], nil)
471+ if ((re == re))
472+ then {
473+ let s = invoke(farmingAddress, "lockShareTokensFromPool", [i.caller.bytes, toString(this), lockType], stPayments)
474+ if ((s == s))
475+ then scriptActions
476+ else throw("Strict value is not equal to itself.")
477+ }
478+ else throw("Strict value is not equal to itself.")
479+ }
480+ else (scriptActions ++ [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId)])
481+ }
482+ else throw("Strict value is not equal to itself.")
483+ }
484+ else throw("Strict value is not equal to itself.")
485+ }
486+ }
487+
488+
489+func replenishWithOneTokenCalc (i,virtualSwapTokenPay,virtualSwapTokenGet,stakeFarming,lockType) = {
490+ let $t01540215477 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
491+ let pmtAmount = $t01540215477._1
492+ let pmtAssetId = $t01540215477._2
493+ let $t01548215555 = getAssetInfo(pmtAssetId)
494+ let pmtStrAssetId = $t01548215555._1
495+ let pmtAssetName = $t01548215555._2
496+ let pmtDecimals = $t01548215555._3
497+ let pmtMinThreshold = 5000000
498+ let thresholdValueForMinTolerance = 50000000
499+ let tolerance = if ((thresholdValueForMinTolerance > pmtAmount))
500+ then 100000
501+ else 1
502+ let slippageValueMinForReplenish = (scale8 - ((scale8 * tolerance) / 10000000))
503+ let slippageValueMaxForReplenish = (scale8 + ((scale8 * tolerance) / 10000000))
504+ let slippageValueMinForSwap = (scale8 - ((scale8 * 1) / 10000000))
505+ if ((pmtMinThreshold > pmtAmount))
506+ then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens"))
507+ else if (if ((size(i.payments) != 1))
508+ then (size(i.payments) != 2)
509+ else false)
510+ then throw("One or two payments expected")
511+ else if (!(hasEnoughBalance))
512+ then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
513+ else if (if ((pmtAssetId != assetIdA))
514+ then (pmtAssetId != assetIdB)
515+ else false)
516+ then throwAssets()
517+ else {
518+ let $t01656217204 = if ((pmtAssetId == assetIdA))
519+ then $Tuple6((pmtAmount - virtualSwapTokenPay), virtualSwapTokenGet, (balanceA + virtualSwapTokenPay), (balanceB - virtualSwapTokenGet), (balanceA + pmtAmount), balanceB)
520+ else $Tuple6(virtualSwapTokenGet, (pmtAmount - virtualSwapTokenPay), (balanceA - virtualSwapTokenGet), (balanceB + virtualSwapTokenPay), balanceA, (balanceB + pmtAmount))
521+ let virtualReplenishA = $t01656217204._1
522+ let virtualReplenishB = $t01656217204._2
523+ let balanceAfterSwapA = $t01656217204._3
524+ let balanceAfterSwapB = $t01656217204._4
525+ let newBalanceA = $t01656217204._5
526+ let newBalanceB = $t01656217204._6
527+ let invariantNew = invariantCalc(balanceAfterSwapA, balanceAfterSwapB)
528+ let ratioVirtualBalanceToVirtualReplenish = (fraction(scale16, balanceAfterSwapA, balanceAfterSwapB) / fraction(scale8, virtualReplenishA, virtualReplenishB))
529+ let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2))
530+ if (if ((slippageValueMinForSwap >= fraction(scale8, invariant, invariantNew)))
531+ then true
532+ else (invariant > invariantNew))
533+ then throw("Incorrect virtualSwapTokenPay or virtualSwapTokenGet value")
534+ else if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish))
535+ then true
536+ else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish))
537+ 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)
542+ else {
543+ let ratioShareTokensInA = fraction(virtualReplenishA, scale8, balanceAfterSwapA)
544+ let ratioShareTokensInB = fraction(virtualReplenishB, scale8, balanceAfterSwapB)
545+ let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scale8)
546+ let shareTokenToPayAmountAfterFee = fraction(shareTokenToPayAmount, (feeScale6 - (fee / 2)), feeScale6)
547+ let shareTokenGovernanceReward = fraction(shareTokenToPayAmount, (feeGovernance / 2), feeScale6)
548+ let governanceRewardTokenA = fraction(shareTokenGovernanceReward, balanceA, shareAssetSupply)
549+ let governanceRewardTokenB = fraction(shareTokenGovernanceReward, balanceB, shareAssetSupply)
550+ let $t01919419489 = if ((pmtStrAssetId == strAssetIdA))
551+ then $Tuple3((pmtAmount - governanceRewardTokenA), governanceRewardTokenB, strAssetIdB)
552+ else $Tuple3((pmtAmount - governanceRewardTokenB), governanceRewardTokenA, strAssetIdA)
553+ let stakeAmount = $t01919419489._1
554+ let unstakeAmount = $t01919419489._2
555+ let unstakeAsset = $t01919419489._3
556+ let stake1 = if (contains(stakingAssets, pmtStrAssetId))
557+ then invoke(this, "stakeUnstake", [true, stakeAmount, pmtStrAssetId], nil)
558+ else 0
559+ if ((stake1 == stake1))
560+ then {
561+ let stake2 = if (contains(stakingAssets, unstakeAsset))
562+ then invoke(this, "stakeUnstake", [false, unstakeAmount, unstakeAsset], nil)
563+ else 0
564+ if ((stake2 == stake2))
565+ then {
566+ 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+ if (stakeFarming)
568+ then {
569+ let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmountAfterFee)] ++ (if ((size(i.payments) == 2))
570+ then [AttachedPayment(if ((i.payments[1].assetId == base58''))
571+ then unit
572+ else i.payments[1].assetId, i.payments[1].amount)]
573+ else nil))
574+ let re = invoke(this, "reissueShare", [shareTokenToPayAmountAfterFee], nil)
575+ if ((re == re))
576+ then {
577+ let s = invoke(farmingAddress, "lockShareTokensFromPool", [i.caller.bytes, toString(this), lockType], stPayments)
578+ if ((s == s))
579+ then scriptActions
580+ else throw("Strict value is not equal to itself.")
581+ }
582+ else throw("Strict value is not equal to itself.")
583+ }
584+ else (scriptActions ++ [Reissue(shareAssetId, shareTokenToPayAmountAfterFee, true), ScriptTransfer(i.caller, shareTokenToPayAmountAfterFee, shareAssetId)])
585+ }
586+ else throw("Strict value is not equal to itself.")
587+ }
588+ else throw("Strict value is not equal to itself.")
589+ }
590+ }
591+ }
592+
593+
594+func withdrawCalc (i,unlockAmount) = {
595+ let $t02147621811 = if ((size(i.payments) == 1))
596+ then if ((i.payments[0].assetId != shareAssetId))
597+ then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId)))
598+ else $Tuple2(i.payments[0].amount, i.payments[0].assetId)
599+ else $Tuple2(0, shareAssetId)
600+ let pmtAmount = $t02147621811._1
601+ let pmtAssetId = $t02147621811._2
602+ if (!(hasEnoughBalance))
603+ then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
604+ else {
605+ let unlock = if ((unlockAmount > 0))
606+ then invoke(farmingAddress, "withdrawShareTokensFromPool", [i.caller.bytes, toString(this), unlockAmount], nil)
607+ else 0
608+ if ((unlock == unlock))
609+ then {
610+ let withdrawAmount = (pmtAmount + unlockAmount)
611+ let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply)
612+ let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply)
613+ let invariantCalculated = invariantCalc((balanceA - amountToPayA), (balanceB - amountToPayB))
614+ let stake1 = if (contains(stakingAssets, strAssetIdA))
615+ then invoke(this, "stakeUnstake", [false, amountToPayA, strAssetIdA], nil)
616+ else 0
617+ if ((stake1 == stake1))
618+ then {
619+ let stake2 = if (contains(stakingAssets, strAssetIdB))
620+ then invoke(this, "stakeUnstake", [false, amountToPayB, strAssetIdB], nil)
621+ else 0
622+ if ((stake2 == stake2))
623+ 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+ else throw("Strict value is not equal to itself.")
625+ }
626+ else throw("Strict value is not equal to itself.")
627+ }
628+ else throw("Strict value is not equal to itself.")
629+ }
630+ }
631+
632+
403633 @Callable(i)
404634 func init (firstHarvest) = {
405- let $t01190111978 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
406- let pmtAmountA = $t01190111978._1
407- let pmtAssetIdA = $t01190111978._2
408- let $t01198312060 = $Tuple2(i.payments[1].amount, i.payments[1].assetId)
409- let pmtAmountB = $t01198312060._1
410- let pmtAssetIdB = $t01198312060._2
411- let $t01206512142 = getAssetInfo(pmtAssetIdA)
412- let pmtStrAssetIdA = $t01206512142._1
413- let pmtAssetNameA = $t01206512142._2
414- let pmtDecimalsA = $t01206512142._3
415- let $t01214712224 = getAssetInfo(pmtAssetIdB)
416- let pmtStrAssetIdB = $t01214712224._1
417- let pmtAssetNameB = $t01214712224._2
418- let pmtDecimalsB = $t01214712224._3
635+ let $t02336323440 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
636+ let pmtAmountA = $t02336323440._1
637+ let pmtAssetIdA = $t02336323440._2
638+ let $t02344523522 = $Tuple2(i.payments[1].amount, i.payments[1].assetId)
639+ let pmtAmountB = $t02344523522._1
640+ let pmtAssetIdB = $t02344523522._2
641+ let $t02352723604 = getAssetInfo(pmtAssetIdA)
642+ let pmtStrAssetIdA = $t02352723604._1
643+ let pmtAssetNameA = $t02352723604._2
644+ let pmtDecimalsA = $t02352723604._3
645+ let $t02360923686 = getAssetInfo(pmtAssetIdB)
646+ let pmtStrAssetIdB = $t02360923686._1
647+ let pmtAssetNameB = $t02360923686._2
648+ let pmtDecimalsB = $t02360923686._3
419649 if (isDefined(getBoolean(this, kActive)))
420650 then throwIsActive()
421651 else if ((pmtAssetIdA == pmtAssetIdB))
452682
453683
454684 @Callable(i)
455-func replenishWithTwoTokens (stakeFarming,lockType) = valueOrElse(isActive(), {
456- let pmtAssetIdA = i.payments[0].assetId
457- let pmtAssetIdB = i.payments[1].assetId
458- let ratioShareTokensInA = fraction(scale8, i.payments[0].amount, balanceA)
459- let ratioShareTokensInB = fraction(scale8, i.payments[1].amount, balanceB)
460- let $t01519415271 = getAssetInfo(pmtAssetIdA)
461- let pmtStrAssetIdA = $t01519415271._1
462- let pmtAssetNameA = $t01519415271._2
463- let pmtDecimalsA = $t01519415271._3
464- let $t01527615393 = getAssetInfo(pmtAssetIdB)
465- let pmtStrAssetIdB = $t01527615393._1
466- let pmtAssetNameB = $t01527615393._2
467- let pmtDecimalsB = $t01527615393._3
468- let $t01539815902 = if ((ratioShareTokensInB > ratioShareTokensInA))
469- then {
470- let pmt = fraction(balanceB, ratioShareTokensInA, scale8, CEILING)
471- $Tuple5(i.payments[0].amount, pmt, (i.payments[1].amount - pmt), pmtAssetIdB, ratioShareTokensInA)
472- }
473- else {
474- let pmt = fraction(balanceA, ratioShareTokensInB, scale8, CEILING)
475- $Tuple5(pmt, i.payments[1].amount, (i.payments[0].amount - pmt), pmtAssetIdA, ratioShareTokensInB)
476- }
477- let pmtAmountA = $t01539815902._1
478- let pmtAmountB = $t01539815902._2
479- let change = $t01539815902._3
480- let changeAssetId = $t01539815902._4
481- let shareTokenRatio = $t01539815902._5
482- let shareTokenToPayAmount = fraction(shareTokenRatio, shareAssetSupply, scale8)
483- if (if ((size(i.payments) != 2))
484- then (size(i.payments) != 3)
685+func replenishWithTwoTokensV2 (stakeFarming,lockType) = valueOrElse(isActive(), replenishWithTwoTokensCalc(i, stakeFarming, lockType))
686+
687+
688+
689+@Callable(i)
690+func replenishWithOneTokenV2 (virtualSwapTokenPay,virtualSwapTokenGet,stakeFarming,lockType) = valueOrElse(isActive(), replenishWithOneTokenCalc(i, virtualSwapTokenPay, virtualSwapTokenGet, stakeFarming, lockType))
691+
692+
693+
694+@Callable(i)
695+func withdrawV2 (unlockAmount) = valueOrElse(isActive(), withdrawCalc(i, unlockAmount))
696+
697+
698+
699+@Callable(i)
700+func withdrawOneToken (unlockAmount,withdrawAsset,estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), {
701+ let $t02705627391 = if ((size(i.payments) == 1))
702+ then if ((i.payments[0].assetId != shareAssetId))
703+ then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId)))
704+ else $Tuple2(i.payments[0].amount, i.payments[0].assetId)
705+ else $Tuple2(0, shareAssetId)
706+ let pmtAmount = $t02705627391._1
707+ let pmtAssetId = $t02705627391._2
708+ let withdrawAmount = (pmtAmount + unlockAmount)
709+ if (if ((withdrawAsset != strAssetIdA))
710+ then (withdrawAsset != strAssetIdB)
485711 else false)
486- then throw("Two or three payments expected")
487- else if (if ((pmtAssetIdA != assetIdA))
488- then true
489- else (pmtAssetIdB != assetIdB))
490- then throwAssets()
491- else if ((shareTokenToPayAmount == 0))
492- then throw("Too small amount to replenish")
493- else if ((0 > change))
494- then throw("Change < 0")
495- else if (!(hasEnoughBalance))
496- then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious())
497- else {
498- let stake1 = if (contains(stakingAssets, pmtStrAssetIdA))
499- then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil)
712+ then throw("Incorrect withdraw asset")
713+ else if ((0 >= withdrawAmount))
714+ then throw("withdraw amount must be grater than 0")
715+ else if (!(hasEnoughBalance))
716+ then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
717+ else {
718+ let unlock = if ((unlockAmount > 0))
719+ then invoke(farmingAddress, "withdrawShareTokensFromPool", [i.caller.bytes, toString(this), unlockAmount], nil)
720+ else 0
721+ if ((unlock == unlock))
722+ then {
723+ let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply)
724+ let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply)
725+ let newVirtBalcA = (balanceA - amountToPayA)
726+ let newVirtBalcB = (balanceB - amountToPayB)
727+ let feeDiscount = calculateFeeDiscount(i.originCaller)
728+ let amountExchangedWithFee = if ((withdrawAsset == strAssetIdA))
729+ then calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayB, assetIdB, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB))
730+ else calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayA, assetIdA, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB))
731+ let govReward = fraction(amountExchangedWithFee, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6)
732+ let amountExchanged = fraction(amountExchangedWithFee, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6)
733+ let $t02899429323 = 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 = $t02899429323._1
737+ let balanceANew = $t02899429323._2
738+ let balanceBNew = $t02899429323._3
739+ let invariantCalculated = invariantCalc(balanceANew, balanceBNew)
740+ let stake1 = if (contains(stakingAssets, withdrawAsset))
741+ then invoke(this, "stakeUnstake", [false, (amountToPay + govReward), withdrawAsset], nil)
500742 else 0
501743 if ((stake1 == stake1))
502- then {
503- let stake2 = if (contains(stakingAssets, pmtStrAssetIdB))
504- then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil)
505- else 0
506- if ((stake2 == stake2))
507- then {
508- 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)]
509- if (stakeFarming)
510- then {
511- let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmount)] ++ (if ((size(i.payments) == 3))
512- then [AttachedPayment(i.payments[2].assetId, i.payments[2].amount)]
513- else nil))
514- let re = invoke(this, "reissueShare", [shareTokenToPayAmount], nil)
515- if ((re == re))
516- then {
517- let s = invoke(farmingAddress, "lockShareTokens", [toString(this), lockType], stPayments)
518- if ((s == s))
519- then scriptActions
520- else throw("Strict value is not equal to itself.")
521- }
522- else throw("Strict value is not equal to itself.")
523- }
524- else (scriptActions ++ [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId)])
525- }
526- else throw("Strict value is not equal to itself.")
527- }
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))]
528745 else throw("Strict value is not equal to itself.")
529746 }
747+ else throw("Strict value is not equal to itself.")
748+ }
530749 })
531750
532751
533752
534753 @Callable(i)
535-func replenishWithOneToken (virtualSwapTokenPay,virtualSwapTokenGet,stakeFarming,lockType) = valueOrElse(isActive(), {
536- let $t01828118356 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
537- let pmtAmount = $t01828118356._1
538- let pmtAssetId = $t01828118356._2
539- let $t01836118434 = getAssetInfo(pmtAssetId)
540- let pmtStrAssetId = $t01836118434._1
541- let pmtAssetName = $t01836118434._2
542- let pmtDecimals = $t01836118434._3
543- let pmtMinThreshold = 5000000
544- let thresholdValueForMinTolerance = 50000000
545- let tolerance = if ((thresholdValueForMinTolerance > pmtAmount))
546- then 100000
547- else 1
548- let slippageValueMinForReplenish = (scale8 - ((scale8 * tolerance) / 10000000))
549- let slippageValueMaxForReplenish = (scale8 + ((scale8 * tolerance) / 10000000))
550- let slippageValueMinForSwap = (scale8 - ((scale8 * 1) / 10000000))
551- if ((pmtMinThreshold > pmtAmount))
552- then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens"))
553- else if (if ((size(i.payments) != 1))
554- then (size(i.payments) != 2)
555- else false)
556- then throw("One or two payments expected")
557- else if (!(hasEnoughBalance))
558- then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
559- else if (if ((pmtAssetId != assetIdA))
560- then (pmtAssetId != assetIdB)
561- else false)
562- then throwAssets()
563- else {
564- let $t01944120083 = if ((pmtAssetId == assetIdA))
565- then $Tuple6((pmtAmount - virtualSwapTokenPay), virtualSwapTokenGet, (balanceA + virtualSwapTokenPay), (balanceB - virtualSwapTokenGet), (balanceA + pmtAmount), balanceB)
566- else $Tuple6(virtualSwapTokenGet, (pmtAmount - virtualSwapTokenPay), (balanceA - virtualSwapTokenGet), (balanceB + virtualSwapTokenPay), balanceA, (balanceB + pmtAmount))
567- let virtualReplenishA = $t01944120083._1
568- let virtualReplenishB = $t01944120083._2
569- let balanceAfterSwapA = $t01944120083._3
570- let balanceAfterSwapB = $t01944120083._4
571- let newBalanceA = $t01944120083._5
572- let newBalanceB = $t01944120083._6
573- let invariantNew = invariantCalc(balanceAfterSwapA, balanceAfterSwapB)
574- let ratioVirtualBalanceToVirtualReplenish = (fraction(scale16, balanceAfterSwapA, balanceAfterSwapB) / fraction(scale8, virtualReplenishA, virtualReplenishB))
575- let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2))
576- if (if ((slippageValueMinForSwap >= fraction(scale8, invariant, invariantNew)))
577- then true
578- else (invariant > invariantNew))
579- then throw("Incorrect virtualSwapTokenPay or virtualSwapTokenGet value")
580- else if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish))
581- then true
582- else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish))
583- then throw("Swap with virtualSwapTokenPay and virtualSwapTokenGet is possible, but ratio after virtual swap is incorrect")
584- else if (if ((dAppThresholdAmount > newBalanceA))
585- then true
586- else (dAppThresholdAmount > newBalanceB))
587- then throwThreshold(dAppThresholdAmount, newBalanceA, newBalanceB)
588- else {
589- let ratioShareTokensInA = fraction(virtualReplenishA, scale8, balanceAfterSwapA)
590- let ratioShareTokensInB = fraction(virtualReplenishB, scale8, balanceAfterSwapB)
591- let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scale8)
592- let shareTokenToPayAmountAfterFee = fraction(shareTokenToPayAmount, (feeScale6 - (fee / 2)), feeScale6)
593- let shareTokenGovernanceReward = fraction(shareTokenToPayAmount, (feeGovernance / 2), feeScale6)
594- let governanceRewardTokenA = fraction(shareTokenGovernanceReward, balanceA, shareAssetSupply)
595- let governanceRewardTokenB = fraction(shareTokenGovernanceReward, balanceB, shareAssetSupply)
596- let $t02207322368 = if ((pmtStrAssetId == strAssetIdA))
597- then $Tuple3((pmtAmount - governanceRewardTokenA), governanceRewardTokenB, strAssetIdB)
598- else $Tuple3((pmtAmount - governanceRewardTokenB), governanceRewardTokenA, strAssetIdA)
599- let stakeAmount = $t02207322368._1
600- let unstakeAmount = $t02207322368._2
601- let unstakeAsset = $t02207322368._3
602- let stake1 = if (contains(stakingAssets, pmtStrAssetId))
603- then invoke(this, "stakeUnstake", [true, stakeAmount, pmtStrAssetId], nil)
604- else 0
605- if ((stake1 == stake1))
606- then {
607- let stake2 = if (contains(stakingAssets, unstakeAsset))
608- then invoke(this, "stakeUnstake", [false, unstakeAmount, unstakeAsset], nil)
609- else 0
610- if ((stake2 == stake2))
611- then {
612- 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)]
613- if (stakeFarming)
614- then {
615- let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmountAfterFee)] ++ (if ((size(i.payments) == 2))
616- then [AttachedPayment(i.payments[1].assetId, i.payments[1].amount)]
617- else nil))
618- let re = invoke(this, "reissueShare", [shareTokenToPayAmountAfterFee], nil)
619- if ((re == re))
620- then {
621- let s = invoke(farmingAddress, "lockShareTokens", [toString(this), lockType], stPayments)
622- if ((s == s))
623- then scriptActions
624- else throw("Strict value is not equal to itself.")
625- }
626- else throw("Strict value is not equal to itself.")
627- }
628- else (scriptActions ++ [Reissue(shareAssetId, shareTokenToPayAmountAfterFee, true), ScriptTransfer(i.caller, shareTokenToPayAmountAfterFee, shareAssetId)])
629- }
630- else throw("Strict value is not equal to itself.")
631- }
632- else throw("Strict value is not equal to itself.")
633- }
634- }
635- })
636-
637-
638-
639-@Callable(i)
640-func withdraw (unlockAmount) = valueOrElse(isActive(), {
641- let $t02429724632 = if ((size(i.payments) == 1))
642- then if ((i.payments[0].assetId != shareAssetId))
643- then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId)))
644- else $Tuple2(i.payments[0].amount, i.payments[0].assetId)
645- else $Tuple2(0, shareAssetId)
646- let pmtAmount = $t02429724632._1
647- let pmtAssetId = $t02429724632._2
648- if (!(hasEnoughBalance))
649- then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
650- else {
651- let unlock = if ((unlockAmount > 0))
652- then invoke(farmingAddress, "withdrawShareTokens", [toString(this), unlockAmount], nil)
653- else 0
654- if ((unlock == unlock))
655- then {
656- let withdrawAmount = (pmtAmount + unlockAmount)
657- let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply)
658- let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply)
659- let invariantCalculated = invariantCalc((balanceA - amountToPayA), (balanceB - amountToPayB))
660- let stake1 = if (contains(stakingAssets, strAssetIdA))
661- then invoke(this, "stakeUnstake", [false, amountToPayA, strAssetIdA], nil)
662- else 0
663- if ((stake1 == stake1))
664- then {
665- let stake2 = if (contains(stakingAssets, strAssetIdB))
666- then invoke(this, "stakeUnstake", [false, amountToPayB, strAssetIdB], nil)
667- else 0
668- if ((stake2 == stake2))
669- 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)]
670- else throw("Strict value is not equal to itself.")
671- }
672- else throw("Strict value is not equal to itself.")
673- }
674- else throw("Strict value is not equal to itself.")
675- }
676- })
677-
678-
679-
680-@Callable(i)
681-func withdrawOneToken (unlockAmount,withdrawAsset,estimatedAmountToReceive,minAmountToReceive) = {
682- let $t02624826583 = if ((size(i.payments) == 1))
683- then if ((i.payments[0].assetId != shareAssetId))
684- then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId)))
685- else $Tuple2(i.payments[0].amount, i.payments[0].assetId)
686- else $Tuple2(0, shareAssetId)
687- let pmtAmount = $t02624826583._1
688- let pmtAssetId = $t02624826583._2
689- if (if ((withdrawAsset != strAssetIdA))
690- then (withdrawAsset != strAssetIdB)
691- else false)
692- then throw("Incorrect withdraw asset")
693- else if (!(hasEnoughBalance))
694- then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
695- else {
696- let unlock = if ((unlockAmount > 0))
697- then invoke(farmingAddress, "withdrawShareTokens", [toString(this), unlockAmount], nil)
698- else 0
699- if ((unlock == unlock))
700- then {
701- let withdrawAmount = (pmtAmount + unlockAmount)
702- let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply)
703- let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply)
704- let newVirtBalcA = (balanceA - amountToPayA)
705- let newVirtBalcB = (balanceB - amountToPayB)
706- let feeDiscount = calculateFeeDiscount(i.originCaller)
707- let amountExchangedWithFee = if ((withdrawAsset == strAssetIdA))
708- then calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayB, assetIdB, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB))
709- else calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayA, assetIdA, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB))
710- let govReward = fraction(amountExchangedWithFee, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6)
711- let amountExchanged = fraction(amountExchangedWithFee, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6)
712- let $t02809428423 = if ((withdrawAsset == strAssetIdA))
713- then $Tuple3((amountToPayA + amountExchanged), (((balanceA - amountToPayA) - amountExchanged) - govReward), balanceB)
714- else $Tuple3((amountToPayB + amountExchanged), balanceA, (((balanceB - amountToPayB) - amountExchanged) - govReward))
715- let amountToPay = $t02809428423._1
716- let balanceANew = $t02809428423._2
717- let balanceBNew = $t02809428423._3
718- let invariantCalculated = invariantCalc(balanceANew, balanceBNew)
719- let stake1 = if (contains(stakingAssets, withdrawAsset))
720- then invoke(this, "stakeUnstake", [false, (amountToPay + govReward), withdrawAsset], nil)
721- else 0
722- if ((stake1 == stake1))
723- 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))]
724- else throw("Strict value is not equal to itself.")
725- }
726- else throw("Strict value is not equal to itself.")
727- }
728- }
729-
730-
731-
732-@Callable(i)
733754 func exchange (estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), {
734- let $t02929529370 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
735- let pmtAmount = $t02929529370._1
736- let pmtAssetId = $t02929529370._2
755+ let $t03019630271 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
756+ let pmtAmount = $t03019630271._1
757+ let pmtAssetId = $t03019630271._2
737758 if ((0 >= estimatedAmountToReceive))
738759 then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive)))
739760 else if ((minAmountToReceive > estimatedAmountToReceive))
760781 let feeDiscount = calculateFeeDiscount(i.originCaller)
761782 let governanceReward = fraction(amount, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6)
762783 let amountMinusFee = fraction(amount, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6)
763- let $t03085431116 = if ((pmtAssetId == assetIdA))
784+ let $t03175532017 = if ((pmtAssetId == assetIdA))
764785 then $Tuple2((balanceA + pmtAmount), ((balanceB - amountMinusFee) - governanceReward))
765786 else $Tuple2(((balanceA - amountMinusFee) - governanceReward), (balanceB + pmtAmount))
766- let newBalanceA = $t03085431116._1
767- let newBalanceB = $t03085431116._2
787+ let newBalanceA = $t03175532017._1
788+ let newBalanceB = $t03175532017._2
768789 let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2))
769790 if (if ((dAppThresholdAmount > newBalanceA))
770791 then true
771792 else (dAppThresholdAmount > newBalanceB))
772793 then throwThreshold(dAppThresholdAmount, newBalanceA, newBalanceB)
773794 else {
774- let $t03141531488 = getAssetInfo(pmtAssetId)
775- let pmtStrAssetId = $t03141531488._1
776- let pmtAssetName = $t03141531488._2
777- let pmtDecimals = $t03141531488._3
778- let $t03150131578 = getAssetInfo(sendAssetId)
779- let sendStrAssetId = $t03150131578._1
780- let sendAssetName = $t03150131578._2
781- let sendDecimals = $t03150131578._3
795+ let $t03231632389 = getAssetInfo(pmtAssetId)
796+ let pmtStrAssetId = $t03231632389._1
797+ let pmtAssetName = $t03231632389._2
798+ let pmtDecimals = $t03231632389._3
799+ let $t03240232479 = getAssetInfo(sendAssetId)
800+ let sendStrAssetId = $t03240232479._1
801+ let sendAssetName = $t03240232479._2
802+ let sendDecimals = $t03240232479._3
782803 let stake1 = if (contains(stakingAssets, pmtStrAssetId))
783804 then invoke(this, "stakeUnstake", [true, pmtAmount, pmtStrAssetId], nil)
784805 else 0
864885 func stakeUnstake (stake,amount,assetIdString) = if ((i.caller != this))
865886 then throw("Only contract itself can invoke this function")
866887 else {
867- let $t03488034983 = calcStakingParams(stake, amount, fromBase58String(assetIdString))
868- let call = $t03488034983._1
869- let addr = $t03488034983._2
870- let params = $t03488034983._3
871- let payments = $t03488034983._4
888+ let $t03578135884 = calcStakingParams(stake, amount, fromBase58String(assetIdString))
889+ let call = $t03578135884._1
890+ let addr = $t03578135884._2
891+ let params = $t03578135884._3
892+ let payments = $t03578135884._4
872893 let inv = invoke(addr, call, params, payments)
873894 if ((inv == inv))
874895 then nil
875896 else throw("Strict value is not equal to itself.")
876897 }
898+
899+
900+
901+@Callable(i)
902+func replenishWithTwoTokens () = valueOrElse(isActive(), replenishWithTwoTokensCalc(i, false, 0))
903+
904+
905+
906+@Callable(i)
907+func replenishWithOneToken (virtualSwapTokenPay,virtualSwapTokenGet) = valueOrElse(isActive(), replenishWithOneTokenCalc(i, virtualSwapTokenPay, virtualSwapTokenGet, false, 0))
908+
909+
910+
911+@Callable(i)
912+func withdraw () = valueOrElse(isActive(), withdrawCalc(i, 0))
877913
878914
879915 @Verifier(tx)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let version = "2.0.0"
55
66 let kVersion = "version"
77
88 let kActive = "active"
9+
10+let kActiveGlob = "active_all_contracts"
911
1012 let kAssetIdA = "A_asset_id"
1113
1214 let kAssetIdB = "B_asset_id"
1315
1416 let kBalanceA = "A_asset_balance"
1517
1618 let kBalanceB = "B_asset_balance"
1719
1820 let kShareAssetId = "share_asset_id"
1921
2022 let kShareAssetSupply = "share_asset_supply"
2123
2224 let kFee = "commission"
2325
2426 let kInvariant = "invariant"
2527
2628 let kCause = "shutdown_cause"
2729
2830 let kUSDNAddress = "staking_usdnnsbt_address"
2931
3032 let kEURNAddress = "staking_eurn_address"
3133
3234 let kDiscounts = "discounts"
3335
3436 let kDiscountValues = "discount_values"
3537
3638 let kUserSwopInGov = "_SWOP_amount"
3739
3840 let kUserGSwopInGov = "_GSwop_amount"
3941
4042 let kFirstHarvest = "first_harvest"
4143
4244 let kFirstHarvestHeight = "first_harvest_height"
4345
4446 let kShareLimit = "share_limit_on_first_harvest"
4547
4648 let kBasePeriod = "base_period"
4749
4850 let kPeriodLength = "period_length"
4951
5052 let kStartHeight = "start_height"
5153
5254 let kAdminPubKey1 = "admin_pub_1"
5355
5456 let kAdminPubKey2 = "admin_pub_2"
5557
5658 let kAdminPubKey3 = "admin_pub_3"
5759
5860 let kAdminInvokePubKey = "admin_invoke_pub"
5961
6062 let kMoneyBoxAddress = "money_box_address"
6163
6264 let kGovAddress = "governance_address"
6365
6466 let kFarmingAddress = "farming_address"
6567
6668 let kVotingAddress = "voting_address"
6769
6870 let kUSDNAssetId = "usdn_asset_id"
6971
7072 let kStakingAssets = "staking_assets"
7173
7274 let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz')
7375
7476 func getBase58FromOracle (key) = match getString(oracle, key) {
7577 case string: String =>
7678 fromBase58String(string)
7779 case nothing =>
7880 throw((key + "is empty"))
7981 }
8082
8183
8284 let adminPubKey1 = getBase58FromOracle(kAdminPubKey1)
8385
8486 let adminPubKey2 = getBase58FromOracle(kAdminPubKey2)
8587
8688 let adminPubKey3 = getBase58FromOracle(kAdminPubKey3)
8789
8890 let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey)
8991
9092 let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress))
9193
9294 let govAddress = Address(getBase58FromOracle(kGovAddress))
9395
9496 let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress))
9597
9698 let votingAddress = Address(getBase58FromOracle(kVotingAddress))
9799
98100 let farmingAddress = Address(getBase58FromOracle(kFarmingAddress))
99101
100102 let USDN = getBase58FromOracle(kUSDNAssetId)
101103
102104 let stakingAssets = getStringValue(oracle, kStakingAssets)
103105
104106 let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod")
105107
106108 let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight")
107109
108110 let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength")
109111
110112 let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3)
111113
112114 let active = getBooleanValue(this, kActive)
115+
116+let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true)
113117
114118 let strAssetIdA = getStringValue(this, kAssetIdA)
115119
116120 let strAssetIdB = getStringValue(this, kAssetIdB)
117121
118122 let assetIdA = if ((strAssetIdA == "WAVES"))
119123 then unit
120124 else fromBase58String(strAssetIdA)
121125
122126 let assetIdB = if ((strAssetIdB == "WAVES"))
123127 then unit
124128 else fromBase58String(strAssetIdB)
125129
126130 let assetNameA = match assetIdA {
127131 case id: ByteVector =>
128132 value(assetInfo(id)).name
129133 case waves: Unit =>
130134 "WAVES"
131135 case _ =>
132136 throw("Match error")
133137 }
134138
135139 let assetNameB = match assetIdB {
136140 case id: ByteVector =>
137141 value(assetInfo(id)).name
138142 case waves: Unit =>
139143 "WAVES"
140144 case _ =>
141145 throw("Match error")
142146 }
143147
144148 let balanceA = getIntegerValue(this, kBalanceA)
145149
146150 let balanceB = getIntegerValue(this, kBalanceB)
147151
148152 let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId))
149153
150154 let shareAssetSupply = getIntegerValue(this, kShareAssetSupply)
151155
152156 let invariant = getIntegerValue(this, kInvariant)
153157
154158 let fee = getIntegerValue(this, kFee)
155159
156160 let feeGovernance = fraction(fee, 40, 100)
157161
158162 let feeScale6 = 1000000
159163
160164 let scale3 = 1000
161165
162166 let scale8 = 100000000
163167
164168 let scale16 = 10000000000000000
165169
166170 let digits8 = 8
167171
168172 let dAppThreshold = 50
169173
170174 let dAppThresholdScale2 = 100
171175
172176 let exchangeRatioLimitMin = 90000000
173177
174178 let exchangeRatioLimitMax = 110000000
175179
176180 let alpha = 50
177181
178182 let alphaDigits = 2
179183
180184 let beta = 4600000000000000
181185
182186 func accountBalance (assetId) = match assetId {
183187 case id: ByteVector =>
184188 assetBalance(this, id)
185189 case waves: Unit =>
186190 wavesBalance(this).available
187191 case _ =>
188192 throw("Match error")
189193 }
190194
191195
192196 func stakedAmount (assetId) = {
193197 let stakedAmountCalculated = match assetId {
194198 case aId: ByteVector =>
195199 if ((aId == USDN))
196200 then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this)))
197201 else 0
198202 case _: Unit =>
199203 0
200204 case _ =>
201205 throw("Match error")
202206 }
203207 match stakedAmountCalculated {
204208 case i: Int =>
205209 i
206210 case _ =>
207211 0
208212 }
209213 }
210214
211215
212216 let stakedAmountA = stakedAmount(assetIdA)
213217
214218 let stakedAmountB = stakedAmount(assetIdB)
215219
216220 let availableBalanceA = (balanceA - stakedAmountA)
217221
218222 let availableBalanceB = (balanceB - stakedAmountB)
219223
220224 let accountBalanceWithStakedA = (accountBalance(assetIdA) + stakedAmountA)
221225
222226 let accountBalanceWithStakedB = (accountBalance(assetIdB) + stakedAmountB)
223227
224228 let hasEnoughBalance = if ((accountBalanceWithStakedA >= balanceA))
225229 then (accountBalanceWithStakedB >= balanceB)
226230 else false
227231
228232 func skewness (x,y) = ((fraction(scale16, x, y) + fraction(scale16, y, x)) / 2)
229233
230234
231235 func invariantCalc (x,y) = {
232236 let sk = skewness(x, y)
233237 (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)))
234238 }
235239
236240
237241 func calculateSendAmount (amountToSendEstimated,minTokenReceiveAmount,tokenReceiveAmount,tokenId,balcA,balcB,invCur) = {
238242 let worstAllowedNewInvariantRatio = (scale16 - ((scale16 * 1) / 10000000))
239243 let deltaBetweenMaxAndMinSendValue = (amountToSendEstimated - minTokenReceiveAmount)
240244 let x = (balcA + tokenReceiveAmount)
241245 let y = (balcB + tokenReceiveAmount)
242246 func getStepAmount (acc,step) = if ((acc._1 == -1))
243247 then {
244248 let amountToSend = (amountToSendEstimated - (((step * deltaBetweenMaxAndMinSendValue) / 3) / scale3))
245249 let stepInvariant = if ((tokenId == assetIdA))
246250 then invariantCalc(x, (balcB - amountToSend))
247251 else invariantCalc((balcA - amountToSend), y)
248252 if ((stepInvariant > invCur))
249253 then $Tuple2(amountToSend, stepInvariant)
250254 else $Tuple2(-1, 0)
251255 }
252256 else acc
253257
254258 let amountToSendMin = getStepAmount($Tuple2(-1, 0), 3000)
255259 if ((0 > amountToSendMin._1))
256260 then throw("Price is worse than minReceived")
257261 else {
258262 let invEstimated = if ((tokenId == assetIdA))
259263 then invariantCalc(x, (balcB - amountToSendEstimated))
260264 else if ((tokenId == assetIdB))
261265 then invariantCalc((balcA - amountToSendEstimated), y)
262266 else throw("Wrong asset in payment")
263267 if ((invCur > invEstimated))
264268 then if ((worstAllowedNewInvariantRatio >= fraction(scale16, invCur, invEstimated)))
265269 then throw("The requested price is too not profitable for user")
266270 else {
267271 let a = {
268272 let $l = [25, 200, 500]
269273 let $s = size($l)
270274 let $acc0 = $Tuple2(-1, 0)
271275 func $f0_1 ($a,$i) = if (($i >= $s))
272276 then $a
273277 else getStepAmount($a, $l[$i])
274278
275279 func $f0_2 ($a,$i) = if (($i >= $s))
276280 then $a
277281 else throw("List size exceeds 3")
278282
279283 $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
280284 }
281285 if ((0 > a._1))
282286 then amountToSendMin._1
283287 else a._1
284288 }
285289 else {
286290 let a = {
287291 let $l = [-500, -200, -25]
288292 let $s = size($l)
289293 let $acc0 = $Tuple2(-1, 0)
290294 func $f0_1 ($a,$i) = if (($i >= $s))
291295 then $a
292296 else getStepAmount($a, $l[$i])
293297
294298 func $f0_2 ($a,$i) = if (($i >= $s))
295299 then $a
296300 else throw("List size exceeds 3")
297301
298302 $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
299303 }
300304 let tupleSendBetter = if ((0 > a._1))
301305 then $Tuple2(amountToSendEstimated, invEstimated)
302306 else a
303307 if ((worstAllowedNewInvariantRatio >= fraction(scale16, invCur, tupleSendBetter._2)))
304308 then throw("The requested price is too not profitable for user")
305309 else tupleSendBetter._1
306310 }
307311 }
308312 }
309313
310314
311315 func getAssetInfo (assetId) = match assetId {
312316 case id: ByteVector =>
313317 let stringId = toBase58String(id)
314318 let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist"))
315319 $Tuple3(stringId, info.name, info.decimals)
316320 case waves: Unit =>
317321 $Tuple3("WAVES", "WAVES", 8)
318322 case _ =>
319323 throw("Match error")
320324 }
321325
322326
323327 func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)]
324328
325329
326330 func throwIsActive () = throw("DApp is already active")
327331
328332
329-func isActive () = if (active)
333+func isActive () = if (if (active)
334+ then activeGlob
335+ else false)
330336 then unit
331337 else throw("DApp is inactive at this moment")
332338
333339
334340 func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))
335341 then unit
336342 else throw("Only admin can call this function")
337343
338344
339345 func isSelfCall (i) = if ((this == i.caller))
340346 then unit
341347 else throw("Only contract itself can call this function")
342348
343349
344350 func throwAssets () = throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB))
345351
346352
347353 func throwOnePayment () = throw("One attached payment expected")
348354
349355
350356 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))
351357
352358
353359 func suspendSuspicious () = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB))
354360
355361
356362 func calcStakingFuncAndAddres (stake,assetId) = if (stake)
357363 then $Tuple2("lockNeutrino", stakingUSDNAddress)
358364 else $Tuple2("unlockNeutrino", stakingUSDNAddress)
359365
360366
361367 func calcStakingParams (stake,amount,assetId) = if (stake)
362368 then {
363- let $t01038310449 = calcStakingFuncAndAddres(stake, assetId)
364- let call = $t01038310449._1
365- let stakingAddr = $t01038310449._2
369+ let $t01050410570 = calcStakingFuncAndAddres(stake, assetId)
370+ let call = $t01050410570._1
371+ let stakingAddr = $t01050410570._2
366372 $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)])
367373 }
368374 else {
369- let $t01053510601 = calcStakingFuncAndAddres(stake, assetId)
370- let call = $t01053510601._1
371- let stakingAddr = $t01053510601._2
375+ let $t01065610722 = calcStakingFuncAndAddres(stake, assetId)
376+ let call = $t01065610722._1
377+ let stakingAddr = $t01065610722._2
372378 $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil)
373379 }
374380
375381
376382 func calculateFeeDiscount (userAddr) = {
377383 let swopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserSwopInGov)), 0)
378384 let gSwopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserGSwopInGov)), 0)
379385 let discountValues = split(getStringValue(oracle, kDiscountValues), ",")
380386 let discounts = split(getStringValue(oracle, kDiscounts), ",")
381387 if (if ((gSwopAmount >= parseIntValue(discountValues[0])))
382388 then (parseIntValue(discountValues[1]) > gSwopAmount)
383389 else false)
384390 then (feeScale6 - parseIntValue(discounts[0]))
385391 else if (if ((gSwopAmount >= parseIntValue(discountValues[1])))
386392 then (parseIntValue(discountValues[2]) > gSwopAmount)
387393 else false)
388394 then (feeScale6 - parseIntValue(discounts[1]))
389395 else if (if ((gSwopAmount >= parseIntValue(discountValues[2])))
390396 then (parseIntValue(discountValues[3]) > gSwopAmount)
391397 else false)
392398 then (feeScale6 - parseIntValue(discounts[2]))
393399 else if (if ((gSwopAmount >= parseIntValue(discountValues[3])))
394400 then (parseIntValue(discountValues[4]) > gSwopAmount)
395401 else false)
396402 then (feeScale6 - parseIntValue(discounts[3]))
397403 else if ((gSwopAmount >= parseIntValue(discountValues[4])))
398404 then (feeScale6 - parseIntValue(discounts[4]))
399405 else feeScale6
400406 }
401407
402408
409+func replenishWithTwoTokensCalc (i,stakeFarming,lockType) = {
410+ let pmtAssetIdA = i.payments[0].assetId
411+ let pmtAssetIdB = i.payments[1].assetId
412+ let ratioShareTokensInA = fraction(scale8, i.payments[0].amount, balanceA)
413+ let ratioShareTokensInB = fraction(scale8, i.payments[1].amount, balanceB)
414+ let $t01230412381 = getAssetInfo(pmtAssetIdA)
415+ let pmtStrAssetIdA = $t01230412381._1
416+ let pmtAssetNameA = $t01230412381._2
417+ let pmtDecimalsA = $t01230412381._3
418+ let $t01238612503 = getAssetInfo(pmtAssetIdB)
419+ let pmtStrAssetIdB = $t01238612503._1
420+ let pmtAssetNameB = $t01238612503._2
421+ let pmtDecimalsB = $t01238612503._3
422+ let $t01250813012 = if ((ratioShareTokensInB > ratioShareTokensInA))
423+ then {
424+ let pmt = fraction(balanceB, ratioShareTokensInA, scale8, CEILING)
425+ $Tuple5(i.payments[0].amount, pmt, (i.payments[1].amount - pmt), pmtAssetIdB, ratioShareTokensInA)
426+ }
427+ else {
428+ let pmt = fraction(balanceA, ratioShareTokensInB, scale8, CEILING)
429+ $Tuple5(pmt, i.payments[1].amount, (i.payments[0].amount - pmt), pmtAssetIdA, ratioShareTokensInB)
430+ }
431+ let pmtAmountA = $t01250813012._1
432+ let pmtAmountB = $t01250813012._2
433+ let change = $t01250813012._3
434+ let changeAssetId = $t01250813012._4
435+ let shareTokenRatio = $t01250813012._5
436+ let shareTokenToPayAmount = fraction(shareTokenRatio, shareAssetSupply, scale8)
437+ if (if ((size(i.payments) != 2))
438+ then (size(i.payments) != 3)
439+ else false)
440+ then throw("Two or three payments expected")
441+ else if (if ((pmtAssetIdA != assetIdA))
442+ then true
443+ else (pmtAssetIdB != assetIdB))
444+ then throwAssets()
445+ else if ((shareTokenToPayAmount == 0))
446+ then throw("Too small amount to replenish")
447+ else if ((0 > change))
448+ then throw("Change < 0")
449+ else if (!(hasEnoughBalance))
450+ then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious())
451+ else {
452+ let stake1 = if (contains(stakingAssets, pmtStrAssetIdA))
453+ then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil)
454+ else 0
455+ if ((stake1 == stake1))
456+ then {
457+ let stake2 = if (contains(stakingAssets, pmtStrAssetIdB))
458+ then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil)
459+ else 0
460+ if ((stake2 == stake2))
461+ then {
462+ 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+ if (stakeFarming)
464+ then {
465+ let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmount)] ++ (if ((size(i.payments) == 3))
466+ then [AttachedPayment(if ((i.payments[2].assetId == base58''))
467+ then unit
468+ else i.payments[2].assetId, i.payments[2].amount)]
469+ else nil))
470+ let re = invoke(this, "reissueShare", [shareTokenToPayAmount], nil)
471+ if ((re == re))
472+ then {
473+ let s = invoke(farmingAddress, "lockShareTokensFromPool", [i.caller.bytes, toString(this), lockType], stPayments)
474+ if ((s == s))
475+ then scriptActions
476+ else throw("Strict value is not equal to itself.")
477+ }
478+ else throw("Strict value is not equal to itself.")
479+ }
480+ else (scriptActions ++ [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId)])
481+ }
482+ else throw("Strict value is not equal to itself.")
483+ }
484+ else throw("Strict value is not equal to itself.")
485+ }
486+ }
487+
488+
489+func replenishWithOneTokenCalc (i,virtualSwapTokenPay,virtualSwapTokenGet,stakeFarming,lockType) = {
490+ let $t01540215477 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
491+ let pmtAmount = $t01540215477._1
492+ let pmtAssetId = $t01540215477._2
493+ let $t01548215555 = getAssetInfo(pmtAssetId)
494+ let pmtStrAssetId = $t01548215555._1
495+ let pmtAssetName = $t01548215555._2
496+ let pmtDecimals = $t01548215555._3
497+ let pmtMinThreshold = 5000000
498+ let thresholdValueForMinTolerance = 50000000
499+ let tolerance = if ((thresholdValueForMinTolerance > pmtAmount))
500+ then 100000
501+ else 1
502+ let slippageValueMinForReplenish = (scale8 - ((scale8 * tolerance) / 10000000))
503+ let slippageValueMaxForReplenish = (scale8 + ((scale8 * tolerance) / 10000000))
504+ let slippageValueMinForSwap = (scale8 - ((scale8 * 1) / 10000000))
505+ if ((pmtMinThreshold > pmtAmount))
506+ then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens"))
507+ else if (if ((size(i.payments) != 1))
508+ then (size(i.payments) != 2)
509+ else false)
510+ then throw("One or two payments expected")
511+ else if (!(hasEnoughBalance))
512+ then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
513+ else if (if ((pmtAssetId != assetIdA))
514+ then (pmtAssetId != assetIdB)
515+ else false)
516+ then throwAssets()
517+ else {
518+ let $t01656217204 = if ((pmtAssetId == assetIdA))
519+ then $Tuple6((pmtAmount - virtualSwapTokenPay), virtualSwapTokenGet, (balanceA + virtualSwapTokenPay), (balanceB - virtualSwapTokenGet), (balanceA + pmtAmount), balanceB)
520+ else $Tuple6(virtualSwapTokenGet, (pmtAmount - virtualSwapTokenPay), (balanceA - virtualSwapTokenGet), (balanceB + virtualSwapTokenPay), balanceA, (balanceB + pmtAmount))
521+ let virtualReplenishA = $t01656217204._1
522+ let virtualReplenishB = $t01656217204._2
523+ let balanceAfterSwapA = $t01656217204._3
524+ let balanceAfterSwapB = $t01656217204._4
525+ let newBalanceA = $t01656217204._5
526+ let newBalanceB = $t01656217204._6
527+ let invariantNew = invariantCalc(balanceAfterSwapA, balanceAfterSwapB)
528+ let ratioVirtualBalanceToVirtualReplenish = (fraction(scale16, balanceAfterSwapA, balanceAfterSwapB) / fraction(scale8, virtualReplenishA, virtualReplenishB))
529+ let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2))
530+ if (if ((slippageValueMinForSwap >= fraction(scale8, invariant, invariantNew)))
531+ then true
532+ else (invariant > invariantNew))
533+ then throw("Incorrect virtualSwapTokenPay or virtualSwapTokenGet value")
534+ else if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish))
535+ then true
536+ else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish))
537+ 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)
542+ else {
543+ let ratioShareTokensInA = fraction(virtualReplenishA, scale8, balanceAfterSwapA)
544+ let ratioShareTokensInB = fraction(virtualReplenishB, scale8, balanceAfterSwapB)
545+ let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scale8)
546+ let shareTokenToPayAmountAfterFee = fraction(shareTokenToPayAmount, (feeScale6 - (fee / 2)), feeScale6)
547+ let shareTokenGovernanceReward = fraction(shareTokenToPayAmount, (feeGovernance / 2), feeScale6)
548+ let governanceRewardTokenA = fraction(shareTokenGovernanceReward, balanceA, shareAssetSupply)
549+ let governanceRewardTokenB = fraction(shareTokenGovernanceReward, balanceB, shareAssetSupply)
550+ let $t01919419489 = if ((pmtStrAssetId == strAssetIdA))
551+ then $Tuple3((pmtAmount - governanceRewardTokenA), governanceRewardTokenB, strAssetIdB)
552+ else $Tuple3((pmtAmount - governanceRewardTokenB), governanceRewardTokenA, strAssetIdA)
553+ let stakeAmount = $t01919419489._1
554+ let unstakeAmount = $t01919419489._2
555+ let unstakeAsset = $t01919419489._3
556+ let stake1 = if (contains(stakingAssets, pmtStrAssetId))
557+ then invoke(this, "stakeUnstake", [true, stakeAmount, pmtStrAssetId], nil)
558+ else 0
559+ if ((stake1 == stake1))
560+ then {
561+ let stake2 = if (contains(stakingAssets, unstakeAsset))
562+ then invoke(this, "stakeUnstake", [false, unstakeAmount, unstakeAsset], nil)
563+ else 0
564+ if ((stake2 == stake2))
565+ then {
566+ 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+ if (stakeFarming)
568+ then {
569+ let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmountAfterFee)] ++ (if ((size(i.payments) == 2))
570+ then [AttachedPayment(if ((i.payments[1].assetId == base58''))
571+ then unit
572+ else i.payments[1].assetId, i.payments[1].amount)]
573+ else nil))
574+ let re = invoke(this, "reissueShare", [shareTokenToPayAmountAfterFee], nil)
575+ if ((re == re))
576+ then {
577+ let s = invoke(farmingAddress, "lockShareTokensFromPool", [i.caller.bytes, toString(this), lockType], stPayments)
578+ if ((s == s))
579+ then scriptActions
580+ else throw("Strict value is not equal to itself.")
581+ }
582+ else throw("Strict value is not equal to itself.")
583+ }
584+ else (scriptActions ++ [Reissue(shareAssetId, shareTokenToPayAmountAfterFee, true), ScriptTransfer(i.caller, shareTokenToPayAmountAfterFee, shareAssetId)])
585+ }
586+ else throw("Strict value is not equal to itself.")
587+ }
588+ else throw("Strict value is not equal to itself.")
589+ }
590+ }
591+ }
592+
593+
594+func withdrawCalc (i,unlockAmount) = {
595+ let $t02147621811 = if ((size(i.payments) == 1))
596+ then if ((i.payments[0].assetId != shareAssetId))
597+ then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId)))
598+ else $Tuple2(i.payments[0].amount, i.payments[0].assetId)
599+ else $Tuple2(0, shareAssetId)
600+ let pmtAmount = $t02147621811._1
601+ let pmtAssetId = $t02147621811._2
602+ if (!(hasEnoughBalance))
603+ then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
604+ else {
605+ let unlock = if ((unlockAmount > 0))
606+ then invoke(farmingAddress, "withdrawShareTokensFromPool", [i.caller.bytes, toString(this), unlockAmount], nil)
607+ else 0
608+ if ((unlock == unlock))
609+ then {
610+ let withdrawAmount = (pmtAmount + unlockAmount)
611+ let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply)
612+ let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply)
613+ let invariantCalculated = invariantCalc((balanceA - amountToPayA), (balanceB - amountToPayB))
614+ let stake1 = if (contains(stakingAssets, strAssetIdA))
615+ then invoke(this, "stakeUnstake", [false, amountToPayA, strAssetIdA], nil)
616+ else 0
617+ if ((stake1 == stake1))
618+ then {
619+ let stake2 = if (contains(stakingAssets, strAssetIdB))
620+ then invoke(this, "stakeUnstake", [false, amountToPayB, strAssetIdB], nil)
621+ else 0
622+ if ((stake2 == stake2))
623+ 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+ else throw("Strict value is not equal to itself.")
625+ }
626+ else throw("Strict value is not equal to itself.")
627+ }
628+ else throw("Strict value is not equal to itself.")
629+ }
630+ }
631+
632+
403633 @Callable(i)
404634 func init (firstHarvest) = {
405- let $t01190111978 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
406- let pmtAmountA = $t01190111978._1
407- let pmtAssetIdA = $t01190111978._2
408- let $t01198312060 = $Tuple2(i.payments[1].amount, i.payments[1].assetId)
409- let pmtAmountB = $t01198312060._1
410- let pmtAssetIdB = $t01198312060._2
411- let $t01206512142 = getAssetInfo(pmtAssetIdA)
412- let pmtStrAssetIdA = $t01206512142._1
413- let pmtAssetNameA = $t01206512142._2
414- let pmtDecimalsA = $t01206512142._3
415- let $t01214712224 = getAssetInfo(pmtAssetIdB)
416- let pmtStrAssetIdB = $t01214712224._1
417- let pmtAssetNameB = $t01214712224._2
418- let pmtDecimalsB = $t01214712224._3
635+ let $t02336323440 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
636+ let pmtAmountA = $t02336323440._1
637+ let pmtAssetIdA = $t02336323440._2
638+ let $t02344523522 = $Tuple2(i.payments[1].amount, i.payments[1].assetId)
639+ let pmtAmountB = $t02344523522._1
640+ let pmtAssetIdB = $t02344523522._2
641+ let $t02352723604 = getAssetInfo(pmtAssetIdA)
642+ let pmtStrAssetIdA = $t02352723604._1
643+ let pmtAssetNameA = $t02352723604._2
644+ let pmtDecimalsA = $t02352723604._3
645+ let $t02360923686 = getAssetInfo(pmtAssetIdB)
646+ let pmtStrAssetIdB = $t02360923686._1
647+ let pmtAssetNameB = $t02360923686._2
648+ let pmtDecimalsB = $t02360923686._3
419649 if (isDefined(getBoolean(this, kActive)))
420650 then throwIsActive()
421651 else if ((pmtAssetIdA == pmtAssetIdB))
422652 then throw("Assets must be different")
423653 else {
424654 let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7))
425655 let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this))
426656 let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2)
427657 let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN), pow(10, 0, shareDecimals, 0, 0, DOWN))
428658 let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true)
429659 let shareIssueId = calculateAssetId(shareIssue)
430660 let invariantCalculated = invariantCalc(pmtAmountA, pmtAmountB)
431661 let stake1 = if (contains(stakingAssets, pmtStrAssetIdA))
432662 then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil)
433663 else 0
434664 if ((stake1 == stake1))
435665 then {
436666 let stake2 = if (contains(stakingAssets, pmtStrAssetIdB))
437667 then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil)
438668 else 0
439669 if ((stake2 == stake2))
440670 then {
441671 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)]
442672 if (firstHarvest)
443673 then (baseEntry ++ [BooleanEntry(kFirstHarvest, firstHarvest), IntegerEntry(kFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))])
444674 else baseEntry
445675 }
446676 else throw("Strict value is not equal to itself.")
447677 }
448678 else throw("Strict value is not equal to itself.")
449679 }
450680 }
451681
452682
453683
454684 @Callable(i)
455-func replenishWithTwoTokens (stakeFarming,lockType) = valueOrElse(isActive(), {
456- let pmtAssetIdA = i.payments[0].assetId
457- let pmtAssetIdB = i.payments[1].assetId
458- let ratioShareTokensInA = fraction(scale8, i.payments[0].amount, balanceA)
459- let ratioShareTokensInB = fraction(scale8, i.payments[1].amount, balanceB)
460- let $t01519415271 = getAssetInfo(pmtAssetIdA)
461- let pmtStrAssetIdA = $t01519415271._1
462- let pmtAssetNameA = $t01519415271._2
463- let pmtDecimalsA = $t01519415271._3
464- let $t01527615393 = getAssetInfo(pmtAssetIdB)
465- let pmtStrAssetIdB = $t01527615393._1
466- let pmtAssetNameB = $t01527615393._2
467- let pmtDecimalsB = $t01527615393._3
468- let $t01539815902 = if ((ratioShareTokensInB > ratioShareTokensInA))
469- then {
470- let pmt = fraction(balanceB, ratioShareTokensInA, scale8, CEILING)
471- $Tuple5(i.payments[0].amount, pmt, (i.payments[1].amount - pmt), pmtAssetIdB, ratioShareTokensInA)
472- }
473- else {
474- let pmt = fraction(balanceA, ratioShareTokensInB, scale8, CEILING)
475- $Tuple5(pmt, i.payments[1].amount, (i.payments[0].amount - pmt), pmtAssetIdA, ratioShareTokensInB)
476- }
477- let pmtAmountA = $t01539815902._1
478- let pmtAmountB = $t01539815902._2
479- let change = $t01539815902._3
480- let changeAssetId = $t01539815902._4
481- let shareTokenRatio = $t01539815902._5
482- let shareTokenToPayAmount = fraction(shareTokenRatio, shareAssetSupply, scale8)
483- if (if ((size(i.payments) != 2))
484- then (size(i.payments) != 3)
685+func replenishWithTwoTokensV2 (stakeFarming,lockType) = valueOrElse(isActive(), replenishWithTwoTokensCalc(i, stakeFarming, lockType))
686+
687+
688+
689+@Callable(i)
690+func replenishWithOneTokenV2 (virtualSwapTokenPay,virtualSwapTokenGet,stakeFarming,lockType) = valueOrElse(isActive(), replenishWithOneTokenCalc(i, virtualSwapTokenPay, virtualSwapTokenGet, stakeFarming, lockType))
691+
692+
693+
694+@Callable(i)
695+func withdrawV2 (unlockAmount) = valueOrElse(isActive(), withdrawCalc(i, unlockAmount))
696+
697+
698+
699+@Callable(i)
700+func withdrawOneToken (unlockAmount,withdrawAsset,estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), {
701+ let $t02705627391 = if ((size(i.payments) == 1))
702+ then if ((i.payments[0].assetId != shareAssetId))
703+ then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId)))
704+ else $Tuple2(i.payments[0].amount, i.payments[0].assetId)
705+ else $Tuple2(0, shareAssetId)
706+ let pmtAmount = $t02705627391._1
707+ let pmtAssetId = $t02705627391._2
708+ let withdrawAmount = (pmtAmount + unlockAmount)
709+ if (if ((withdrawAsset != strAssetIdA))
710+ then (withdrawAsset != strAssetIdB)
485711 else false)
486- then throw("Two or three payments expected")
487- else if (if ((pmtAssetIdA != assetIdA))
488- then true
489- else (pmtAssetIdB != assetIdB))
490- then throwAssets()
491- else if ((shareTokenToPayAmount == 0))
492- then throw("Too small amount to replenish")
493- else if ((0 > change))
494- then throw("Change < 0")
495- else if (!(hasEnoughBalance))
496- then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious())
497- else {
498- let stake1 = if (contains(stakingAssets, pmtStrAssetIdA))
499- then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil)
712+ then throw("Incorrect withdraw asset")
713+ else if ((0 >= withdrawAmount))
714+ then throw("withdraw amount must be grater than 0")
715+ else if (!(hasEnoughBalance))
716+ then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
717+ else {
718+ let unlock = if ((unlockAmount > 0))
719+ then invoke(farmingAddress, "withdrawShareTokensFromPool", [i.caller.bytes, toString(this), unlockAmount], nil)
720+ else 0
721+ if ((unlock == unlock))
722+ then {
723+ let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply)
724+ let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply)
725+ let newVirtBalcA = (balanceA - amountToPayA)
726+ let newVirtBalcB = (balanceB - amountToPayB)
727+ let feeDiscount = calculateFeeDiscount(i.originCaller)
728+ let amountExchangedWithFee = if ((withdrawAsset == strAssetIdA))
729+ then calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayB, assetIdB, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB))
730+ else calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayA, assetIdA, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB))
731+ let govReward = fraction(amountExchangedWithFee, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6)
732+ let amountExchanged = fraction(amountExchangedWithFee, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6)
733+ let $t02899429323 = 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 = $t02899429323._1
737+ let balanceANew = $t02899429323._2
738+ let balanceBNew = $t02899429323._3
739+ let invariantCalculated = invariantCalc(balanceANew, balanceBNew)
740+ let stake1 = if (contains(stakingAssets, withdrawAsset))
741+ then invoke(this, "stakeUnstake", [false, (amountToPay + govReward), withdrawAsset], nil)
500742 else 0
501743 if ((stake1 == stake1))
502- then {
503- let stake2 = if (contains(stakingAssets, pmtStrAssetIdB))
504- then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil)
505- else 0
506- if ((stake2 == stake2))
507- then {
508- 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)]
509- if (stakeFarming)
510- then {
511- let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmount)] ++ (if ((size(i.payments) == 3))
512- then [AttachedPayment(i.payments[2].assetId, i.payments[2].amount)]
513- else nil))
514- let re = invoke(this, "reissueShare", [shareTokenToPayAmount], nil)
515- if ((re == re))
516- then {
517- let s = invoke(farmingAddress, "lockShareTokens", [toString(this), lockType], stPayments)
518- if ((s == s))
519- then scriptActions
520- else throw("Strict value is not equal to itself.")
521- }
522- else throw("Strict value is not equal to itself.")
523- }
524- else (scriptActions ++ [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId)])
525- }
526- else throw("Strict value is not equal to itself.")
527- }
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))]
528745 else throw("Strict value is not equal to itself.")
529746 }
747+ else throw("Strict value is not equal to itself.")
748+ }
530749 })
531750
532751
533752
534753 @Callable(i)
535-func replenishWithOneToken (virtualSwapTokenPay,virtualSwapTokenGet,stakeFarming,lockType) = valueOrElse(isActive(), {
536- let $t01828118356 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
537- let pmtAmount = $t01828118356._1
538- let pmtAssetId = $t01828118356._2
539- let $t01836118434 = getAssetInfo(pmtAssetId)
540- let pmtStrAssetId = $t01836118434._1
541- let pmtAssetName = $t01836118434._2
542- let pmtDecimals = $t01836118434._3
543- let pmtMinThreshold = 5000000
544- let thresholdValueForMinTolerance = 50000000
545- let tolerance = if ((thresholdValueForMinTolerance > pmtAmount))
546- then 100000
547- else 1
548- let slippageValueMinForReplenish = (scale8 - ((scale8 * tolerance) / 10000000))
549- let slippageValueMaxForReplenish = (scale8 + ((scale8 * tolerance) / 10000000))
550- let slippageValueMinForSwap = (scale8 - ((scale8 * 1) / 10000000))
551- if ((pmtMinThreshold > pmtAmount))
552- then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens"))
553- else if (if ((size(i.payments) != 1))
554- then (size(i.payments) != 2)
555- else false)
556- then throw("One or two payments expected")
557- else if (!(hasEnoughBalance))
558- then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
559- else if (if ((pmtAssetId != assetIdA))
560- then (pmtAssetId != assetIdB)
561- else false)
562- then throwAssets()
563- else {
564- let $t01944120083 = if ((pmtAssetId == assetIdA))
565- then $Tuple6((pmtAmount - virtualSwapTokenPay), virtualSwapTokenGet, (balanceA + virtualSwapTokenPay), (balanceB - virtualSwapTokenGet), (balanceA + pmtAmount), balanceB)
566- else $Tuple6(virtualSwapTokenGet, (pmtAmount - virtualSwapTokenPay), (balanceA - virtualSwapTokenGet), (balanceB + virtualSwapTokenPay), balanceA, (balanceB + pmtAmount))
567- let virtualReplenishA = $t01944120083._1
568- let virtualReplenishB = $t01944120083._2
569- let balanceAfterSwapA = $t01944120083._3
570- let balanceAfterSwapB = $t01944120083._4
571- let newBalanceA = $t01944120083._5
572- let newBalanceB = $t01944120083._6
573- let invariantNew = invariantCalc(balanceAfterSwapA, balanceAfterSwapB)
574- let ratioVirtualBalanceToVirtualReplenish = (fraction(scale16, balanceAfterSwapA, balanceAfterSwapB) / fraction(scale8, virtualReplenishA, virtualReplenishB))
575- let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2))
576- if (if ((slippageValueMinForSwap >= fraction(scale8, invariant, invariantNew)))
577- then true
578- else (invariant > invariantNew))
579- then throw("Incorrect virtualSwapTokenPay or virtualSwapTokenGet value")
580- else if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish))
581- then true
582- else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish))
583- then throw("Swap with virtualSwapTokenPay and virtualSwapTokenGet is possible, but ratio after virtual swap is incorrect")
584- else if (if ((dAppThresholdAmount > newBalanceA))
585- then true
586- else (dAppThresholdAmount > newBalanceB))
587- then throwThreshold(dAppThresholdAmount, newBalanceA, newBalanceB)
588- else {
589- let ratioShareTokensInA = fraction(virtualReplenishA, scale8, balanceAfterSwapA)
590- let ratioShareTokensInB = fraction(virtualReplenishB, scale8, balanceAfterSwapB)
591- let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scale8)
592- let shareTokenToPayAmountAfterFee = fraction(shareTokenToPayAmount, (feeScale6 - (fee / 2)), feeScale6)
593- let shareTokenGovernanceReward = fraction(shareTokenToPayAmount, (feeGovernance / 2), feeScale6)
594- let governanceRewardTokenA = fraction(shareTokenGovernanceReward, balanceA, shareAssetSupply)
595- let governanceRewardTokenB = fraction(shareTokenGovernanceReward, balanceB, shareAssetSupply)
596- let $t02207322368 = if ((pmtStrAssetId == strAssetIdA))
597- then $Tuple3((pmtAmount - governanceRewardTokenA), governanceRewardTokenB, strAssetIdB)
598- else $Tuple3((pmtAmount - governanceRewardTokenB), governanceRewardTokenA, strAssetIdA)
599- let stakeAmount = $t02207322368._1
600- let unstakeAmount = $t02207322368._2
601- let unstakeAsset = $t02207322368._3
602- let stake1 = if (contains(stakingAssets, pmtStrAssetId))
603- then invoke(this, "stakeUnstake", [true, stakeAmount, pmtStrAssetId], nil)
604- else 0
605- if ((stake1 == stake1))
606- then {
607- let stake2 = if (contains(stakingAssets, unstakeAsset))
608- then invoke(this, "stakeUnstake", [false, unstakeAmount, unstakeAsset], nil)
609- else 0
610- if ((stake2 == stake2))
611- then {
612- 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)]
613- if (stakeFarming)
614- then {
615- let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmountAfterFee)] ++ (if ((size(i.payments) == 2))
616- then [AttachedPayment(i.payments[1].assetId, i.payments[1].amount)]
617- else nil))
618- let re = invoke(this, "reissueShare", [shareTokenToPayAmountAfterFee], nil)
619- if ((re == re))
620- then {
621- let s = invoke(farmingAddress, "lockShareTokens", [toString(this), lockType], stPayments)
622- if ((s == s))
623- then scriptActions
624- else throw("Strict value is not equal to itself.")
625- }
626- else throw("Strict value is not equal to itself.")
627- }
628- else (scriptActions ++ [Reissue(shareAssetId, shareTokenToPayAmountAfterFee, true), ScriptTransfer(i.caller, shareTokenToPayAmountAfterFee, shareAssetId)])
629- }
630- else throw("Strict value is not equal to itself.")
631- }
632- else throw("Strict value is not equal to itself.")
633- }
634- }
635- })
636-
637-
638-
639-@Callable(i)
640-func withdraw (unlockAmount) = valueOrElse(isActive(), {
641- let $t02429724632 = if ((size(i.payments) == 1))
642- then if ((i.payments[0].assetId != shareAssetId))
643- then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId)))
644- else $Tuple2(i.payments[0].amount, i.payments[0].assetId)
645- else $Tuple2(0, shareAssetId)
646- let pmtAmount = $t02429724632._1
647- let pmtAssetId = $t02429724632._2
648- if (!(hasEnoughBalance))
649- then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
650- else {
651- let unlock = if ((unlockAmount > 0))
652- then invoke(farmingAddress, "withdrawShareTokens", [toString(this), unlockAmount], nil)
653- else 0
654- if ((unlock == unlock))
655- then {
656- let withdrawAmount = (pmtAmount + unlockAmount)
657- let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply)
658- let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply)
659- let invariantCalculated = invariantCalc((balanceA - amountToPayA), (balanceB - amountToPayB))
660- let stake1 = if (contains(stakingAssets, strAssetIdA))
661- then invoke(this, "stakeUnstake", [false, amountToPayA, strAssetIdA], nil)
662- else 0
663- if ((stake1 == stake1))
664- then {
665- let stake2 = if (contains(stakingAssets, strAssetIdB))
666- then invoke(this, "stakeUnstake", [false, amountToPayB, strAssetIdB], nil)
667- else 0
668- if ((stake2 == stake2))
669- 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)]
670- else throw("Strict value is not equal to itself.")
671- }
672- else throw("Strict value is not equal to itself.")
673- }
674- else throw("Strict value is not equal to itself.")
675- }
676- })
677-
678-
679-
680-@Callable(i)
681-func withdrawOneToken (unlockAmount,withdrawAsset,estimatedAmountToReceive,minAmountToReceive) = {
682- let $t02624826583 = if ((size(i.payments) == 1))
683- then if ((i.payments[0].assetId != shareAssetId))
684- then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId)))
685- else $Tuple2(i.payments[0].amount, i.payments[0].assetId)
686- else $Tuple2(0, shareAssetId)
687- let pmtAmount = $t02624826583._1
688- let pmtAssetId = $t02624826583._2
689- if (if ((withdrawAsset != strAssetIdA))
690- then (withdrawAsset != strAssetIdB)
691- else false)
692- then throw("Incorrect withdraw asset")
693- else if (!(hasEnoughBalance))
694- then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
695- else {
696- let unlock = if ((unlockAmount > 0))
697- then invoke(farmingAddress, "withdrawShareTokens", [toString(this), unlockAmount], nil)
698- else 0
699- if ((unlock == unlock))
700- then {
701- let withdrawAmount = (pmtAmount + unlockAmount)
702- let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply)
703- let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply)
704- let newVirtBalcA = (balanceA - amountToPayA)
705- let newVirtBalcB = (balanceB - amountToPayB)
706- let feeDiscount = calculateFeeDiscount(i.originCaller)
707- let amountExchangedWithFee = if ((withdrawAsset == strAssetIdA))
708- then calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayB, assetIdB, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB))
709- else calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, amountToPayA, assetIdA, newVirtBalcA, newVirtBalcB, invariantCalc(newVirtBalcA, newVirtBalcB))
710- let govReward = fraction(amountExchangedWithFee, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6)
711- let amountExchanged = fraction(amountExchangedWithFee, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6)
712- let $t02809428423 = if ((withdrawAsset == strAssetIdA))
713- then $Tuple3((amountToPayA + amountExchanged), (((balanceA - amountToPayA) - amountExchanged) - govReward), balanceB)
714- else $Tuple3((amountToPayB + amountExchanged), balanceA, (((balanceB - amountToPayB) - amountExchanged) - govReward))
715- let amountToPay = $t02809428423._1
716- let balanceANew = $t02809428423._2
717- let balanceBNew = $t02809428423._3
718- let invariantCalculated = invariantCalc(balanceANew, balanceBNew)
719- let stake1 = if (contains(stakingAssets, withdrawAsset))
720- then invoke(this, "stakeUnstake", [false, (amountToPay + govReward), withdrawAsset], nil)
721- else 0
722- if ((stake1 == stake1))
723- 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))]
724- else throw("Strict value is not equal to itself.")
725- }
726- else throw("Strict value is not equal to itself.")
727- }
728- }
729-
730-
731-
732-@Callable(i)
733754 func exchange (estimatedAmountToReceive,minAmountToReceive) = valueOrElse(isActive(), {
734- let $t02929529370 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
735- let pmtAmount = $t02929529370._1
736- let pmtAssetId = $t02929529370._2
755+ let $t03019630271 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
756+ let pmtAmount = $t03019630271._1
757+ let pmtAssetId = $t03019630271._2
737758 if ((0 >= estimatedAmountToReceive))
738759 then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive)))
739760 else if ((minAmountToReceive > estimatedAmountToReceive))
740761 then throw("Minimal amount can't be greater than estimated.")
741762 else if ((size(i.payments) != 1))
742763 then throwOnePayment()
743764 else if (!(hasEnoughBalance))
744765 then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious())
745766 else if (if ((pmtAssetId != assetIdA))
746767 then (pmtAssetId != assetIdB)
747768 else false)
748769 then throwAssets()
749770 else if ((10000000 > pmtAmount))
750771 then throw("Only swap of 10.000000 or more tokens is allowed")
751772 else if (if ((exchangeRatioLimitMin > fraction(scale8, minAmountToReceive, pmtAmount)))
752773 then true
753774 else (fraction(scale8, estimatedAmountToReceive, pmtAmount) > exchangeRatioLimitMax))
754775 then throw("Incorrect args and pmt ratio")
755776 else {
756777 let sendAssetId = if ((pmtAssetId == assetIdA))
757778 then assetIdB
758779 else assetIdA
759780 let amount = calculateSendAmount(estimatedAmountToReceive, minAmountToReceive, pmtAmount, pmtAssetId, balanceA, balanceB, invariant)
760781 let feeDiscount = calculateFeeDiscount(i.originCaller)
761782 let governanceReward = fraction(amount, fraction(feeGovernance, feeDiscount, feeScale6, CEILING), feeScale6)
762783 let amountMinusFee = fraction(amount, (feeScale6 - fraction(fee, feeDiscount, feeScale6, CEILING)), feeScale6)
763- let $t03085431116 = if ((pmtAssetId == assetIdA))
784+ let $t03175532017 = if ((pmtAssetId == assetIdA))
764785 then $Tuple2((balanceA + pmtAmount), ((balanceB - amountMinusFee) - governanceReward))
765786 else $Tuple2(((balanceA - amountMinusFee) - governanceReward), (balanceB + pmtAmount))
766- let newBalanceA = $t03085431116._1
767- let newBalanceB = $t03085431116._2
787+ let newBalanceA = $t03175532017._1
788+ let newBalanceB = $t03175532017._2
768789 let dAppThresholdAmount = fraction((newBalanceA + newBalanceB), dAppThreshold, (2 * dAppThresholdScale2))
769790 if (if ((dAppThresholdAmount > newBalanceA))
770791 then true
771792 else (dAppThresholdAmount > newBalanceB))
772793 then throwThreshold(dAppThresholdAmount, newBalanceA, newBalanceB)
773794 else {
774- let $t03141531488 = getAssetInfo(pmtAssetId)
775- let pmtStrAssetId = $t03141531488._1
776- let pmtAssetName = $t03141531488._2
777- let pmtDecimals = $t03141531488._3
778- let $t03150131578 = getAssetInfo(sendAssetId)
779- let sendStrAssetId = $t03150131578._1
780- let sendAssetName = $t03150131578._2
781- let sendDecimals = $t03150131578._3
795+ let $t03231632389 = getAssetInfo(pmtAssetId)
796+ let pmtStrAssetId = $t03231632389._1
797+ let pmtAssetName = $t03231632389._2
798+ let pmtDecimals = $t03231632389._3
799+ let $t03240232479 = getAssetInfo(sendAssetId)
800+ let sendStrAssetId = $t03240232479._1
801+ let sendAssetName = $t03240232479._2
802+ let sendDecimals = $t03240232479._3
782803 let stake1 = if (contains(stakingAssets, pmtStrAssetId))
783804 then invoke(this, "stakeUnstake", [true, pmtAmount, pmtStrAssetId], nil)
784805 else 0
785806 if ((stake1 == stake1))
786807 then {
787808 let stake2 = if (contains(stakingAssets, sendStrAssetId))
788809 then invoke(this, "stakeUnstake", [false, (amountMinusFee + governanceReward), sendStrAssetId], nil)
789810 else 0
790811 if ((stake2 == stake2))
791812 then $Tuple2([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kInvariant, invariantCalc(newBalanceA, newBalanceB)), ScriptTransfer(i.caller, amountMinusFee, sendAssetId), ScriptTransfer(moneyBoxAddress, governanceReward, sendAssetId)], [amountMinusFee, sendAssetId])
792813 else throw("Strict value is not equal to itself.")
793814 }
794815 else throw("Strict value is not equal to itself.")
795816 }
796817 }
797818 })
798819
799820
800821
801822 @Callable(msg)
802823 func reissueShare (amount) = valueOrElse(isSelfCall(msg), [Reissue(shareAssetId, amount, true)])
803824
804825
805826
806827 @Callable(i)
807828 func shutdown () = valueOrElse(isAdminCall(i), if (!(active))
808829 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified")))
809830 else suspend("Paused by admin"))
810831
811832
812833
813834 @Callable(i)
814835 func activate () = valueOrElse(isAdminCall(i), if (active)
815836 then throwIsActive()
816837 else [BooleanEntry(kActive, true), DeleteEntry(kCause)])
817838
818839
819840
820841 @Callable(i)
821842 func takeIntoAccountExtraFunds () = valueOrElse(isActive(), {
822843 let amountEnrollA = (accountBalanceWithStakedA - balanceA)
823844 let amountEnrollB = (accountBalanceWithStakedB - balanceB)
824845 let invariantNew = invariantCalc((balanceA + amountEnrollA), (balanceB + amountEnrollB))
825846 if ((i.caller != moneyBoxAddress))
826847 then throw("Only the money box can call this function")
827848 else if (if ((0 > amountEnrollA))
828849 then true
829850 else (0 > amountEnrollB))
830851 then suspend("Enroll amount negative")
831852 else if (if ((amountEnrollA == 0))
832853 then (amountEnrollB == 0)
833854 else false)
834855 then throw("No money to take")
835856 else {
836857 let stake1 = if (if (contains(stakingAssets, strAssetIdA))
837858 then (amountEnrollA > 0)
838859 else false)
839860 then invoke(this, "stakeUnstake", [true, amountEnrollA, strAssetIdA], nil)
840861 else 0
841862 if ((stake1 == stake1))
842863 then {
843864 let stake2 = if (if (contains(stakingAssets, strAssetIdB))
844865 then (amountEnrollB > 0)
845866 else false)
846867 then invoke(this, "stakeUnstake", [true, amountEnrollB, strAssetIdB], nil)
847868 else 0
848869 if ((stake2 == stake2))
849870 then [IntegerEntry(kInvariant, invariantNew), IntegerEntry(kBalanceA, (balanceA + amountEnrollA)), IntegerEntry(kBalanceB, (balanceB + amountEnrollB))]
850871 else throw("Strict value is not equal to itself.")
851872 }
852873 else throw("Strict value is not equal to itself.")
853874 }
854875 })
855876
856877
857878
858879 @Callable(i)
859880 func keepLimitForFirstHarvest (shareLimit) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), [IntegerEntry(kShareLimit, shareLimit)]))
860881
861882
862883
863884 @Callable(i)
864885 func stakeUnstake (stake,amount,assetIdString) = if ((i.caller != this))
865886 then throw("Only contract itself can invoke this function")
866887 else {
867- let $t03488034983 = calcStakingParams(stake, amount, fromBase58String(assetIdString))
868- let call = $t03488034983._1
869- let addr = $t03488034983._2
870- let params = $t03488034983._3
871- let payments = $t03488034983._4
888+ let $t03578135884 = calcStakingParams(stake, amount, fromBase58String(assetIdString))
889+ let call = $t03578135884._1
890+ let addr = $t03578135884._2
891+ let params = $t03578135884._3
892+ let payments = $t03578135884._4
872893 let inv = invoke(addr, call, params, payments)
873894 if ((inv == inv))
874895 then nil
875896 else throw("Strict value is not equal to itself.")
876897 }
898+
899+
900+
901+@Callable(i)
902+func replenishWithTwoTokens () = valueOrElse(isActive(), replenishWithTwoTokensCalc(i, false, 0))
903+
904+
905+
906+@Callable(i)
907+func replenishWithOneToken (virtualSwapTokenPay,virtualSwapTokenGet) = valueOrElse(isActive(), replenishWithOneTokenCalc(i, virtualSwapTokenPay, virtualSwapTokenGet, false, 0))
908+
909+
910+
911+@Callable(i)
912+func withdraw () = valueOrElse(isActive(), withdrawCalc(i, 0))
877913
878914
879915 @Verifier(tx)
880916 func verify () = {
881917 let multiSignedByAdmins = {
882918 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
883919 then 1
884920 else 0
885921 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
886922 then 1
887923 else 0
888924 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
889925 then 1
890926 else 0
891927 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
892928 }
893929 match tx {
894930 case inv: InvokeScriptTransaction =>
895931 let callTakeIntoAccount = if ((inv.dApp == this))
896932 then (inv.function == "takeIntoAccountExtraFunds")
897933 else false
898934 let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
899935 then true
900936 else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2))
901937 then true
902938 else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3))
903939 then true
904940 else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyInvoke)
905941 if (if (callTakeIntoAccount)
906942 then signedByAdmin
907943 else false)
908944 then true
909945 else multiSignedByAdmins
910946 case _ =>
911947 multiSignedByAdmins
912948 }
913949 }
914950

github/deemru/w8io/026f985 
217.60 ms