tx · G46EbvhUp8mM8ndb5NoenpmVNZw36UaADbnx9KNXSVEz 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy: -0.03000000 Waves 2022.08.02 17:53 [2167017] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves
{ "type": 13, "id": "G46EbvhUp8mM8ndb5NoenpmVNZw36UaADbnx9KNXSVEz", "fee": 3000000, "feeAssetId": null, "timestamp": 1659452042517, "version": 1, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "3P8ryYfQXHtveicTzC1U2HgFsAbYewUSVuYFSQ33PDLWnpZrtkvPdHEQ2825XTwEh4NHP2V1mUd1WeBnojviC9zQ" ], "script": "base64:BgJACAISCAoGCAgBAQEIEgUKAwEIAhIDCgEBEgMKAQESBAoCCAgSBAoCCAgSAwoBCBIDCgEIEgQKAggBEgMKAQgSAGwAA1NFUAICX18ABlNDQUxFOAAIAAVNVUxUOACAwtcvAA5QT09MV0VJR0hUTVVMVAUFTVVMVDgBBHN0cmYCB2FkZHJlc3MDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUHYWRkcmVzcwUDa2V5CQCsAgIJAKwCAgIPbWFuZGF0b3J5IHRoaXMuBQNrZXkCDyBpcyBub3QgZGVmaW5lZAEDaW96AgdhZGRyZXNzA2tleQkBC3ZhbHVlT3JFbHNlAgkAmggCBQdhZGRyZXNzBQNrZXkAAAEDaW9kAwdhZGRyZXNzA2tleQpkZWZhdWx0VmFsCQELdmFsdWVPckVsc2UCCQCaCAIFB2FkZHJlc3MFA2tleQUKZGVmYXVsdFZhbAEDaW9mAgdhZGRyZXNzA2tleQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCaCAIFB2FkZHJlc3MFA2tleQkArAICCQCsAgICD21hbmRhdG9yeSB0aGlzLgUDa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yBtYW5hZ2VyAwkAAAIFB2NoZWNrUE0FB2NoZWNrUE0JAMwIAgkBC1N0cmluZ0VudHJ5AgkBE2tleU1hbmFnZXJQdWJsaWNLZXkACQDYBAEJAQV2YWx1ZQEFAnBtCQDMCAIJAQtEZWxldGVFbnRyeQEJARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAED3RhcmdldFB1YmxpY0tleQQHJG1hdGNoMAkBFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAnBrBQckbWF0Y2gwBQJwawMJAAECBQckbWF0Y2gwAgRVbml0CAUCdHgPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFD3RhcmdldFB1YmxpY0tleZhTj1U=", "chainId": 84, "height": 2167017, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8GSPM6h6gqDSXK5jUruTiL5fLqUZokWPnwrvT4MsJYxQ Next: BuHrw8k6RxiXinH9TgDWJnTKVbvvY2EgyiagQYBqjgUq Diff:
Old | New | Differences | |
---|---|---|---|
159 | 159 | ||
160 | 160 | func readConfigArrayOrFail () = split(strf(this, keyConfig()), SEP) | |
161 | 161 | ||
162 | + | ||
163 | + | let mathContract = addressFromStringValue(readConfigArrayOrFail()[IdxCfgMathContract]) | |
162 | 164 | ||
163 | 165 | func formatConfigS (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = makeString(["%s%d%d%d", assetId, minLockAmount, minLockDuration, maxLockDuration, mathContract], SEP) | |
164 | 166 | ||
378 | 380 | let userNumStr = userRecordArray[IdxLockUserNum] | |
379 | 381 | let gwxRewardEmissionStartHeight = valueOrElse(getInteger(gwxRewardContract, keyGwxRewardEmissionStartHeight()), 0) | |
380 | 382 | let EMPTYSTR = "empty" | |
381 | - | let $ | |
383 | + | let $t01395814526 = if ((lpAssetIdStr != EMPTYSTR)) | |
382 | 384 | then { | |
383 | 385 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
384 | 386 | let pw1 = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
388 | 390 | else if (readOnly) | |
389 | 391 | then $Tuple2(0, 0) | |
390 | 392 | else throw(("not readonly mode: unsupported lp asset " + lpAssetIdStr)) | |
391 | - | let poolWeight0 = $ | |
392 | - | let poolWeight1 = $ | |
393 | + | let poolWeight0 = $t01395814526._1 | |
394 | + | let poolWeight1 = $t01395814526._2 | |
393 | 395 | let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent()) | |
394 | 396 | let emissionStart = iof(emissionContract, keyEmissionStartBlock()) | |
395 | 397 | let emissionEnd = iof(emissionContract, keyEmissionEndBlock()) | |
457 | 459 | let minLockAmount = parseIntValue(cfgArray[IdxCfgMinLockAmount]) | |
458 | 460 | let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration]) | |
459 | 461 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
460 | - | let mathContract = addressFromStringValue(cfgArray[IdxCfgMathContract]) | |
461 | 462 | if ((size(i.payments) != 1)) | |
462 | 463 | then throw("invalid payment - exact one payment must be attached") | |
463 | 464 | else { | |
514 | 515 | let arr = if (userIsExisting) | |
515 | 516 | then nil | |
516 | 517 | else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)] | |
517 | - | ((((arr ++ LockParamsEntry(userAddressStr, userNumStr, pmtAmount, lockStart, duration, k, b, period)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting) | |
518 | + | $Tuple2(((((arr ++ LockParamsEntry(userAddressStr, userNumStr, pmtAmount, lockStart, duration, k, b, period)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting) | |
518 | 519 | then 0 | |
519 | - | else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, k, b, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(totalCachedGwxKEY, (totalCachedGwx + gWxAmountStart))]) | |
520 | + | else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, k, b, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(totalCachedGwxKEY, (totalCachedGwx + gWxAmountStart))]), gWxAmountStart) | |
520 | 521 | } | |
521 | 522 | } | |
522 | 523 | } | |
535 | 536 | ||
536 | 537 | @Callable(i) | |
537 | 538 | func lockRef (duration,referrerAddress,signature) = { | |
538 | - | let lockActionsResult = lockActions(i, duration) | |
539 | + | let $t02296623031 = lockActions(i, duration) | |
540 | + | let lockActionsResult = $t02296623031._1 | |
541 | + | let gWxAmountStart = $t02296623031._2 | |
539 | 542 | let referralAddress = toString(i.caller) | |
540 | 543 | let refInv = if (if ((referrerAddress == "")) | |
541 | 544 | then true | |
543 | 546 | then unit | |
544 | 547 | else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil) | |
545 | 548 | if ((refInv == refInv)) | |
546 | - | then $Tuple2(lockActionsResult, unit) | |
549 | + | then { | |
550 | + | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
551 | + | if ((updateRefActivity == updateRefActivity)) | |
552 | + | then $Tuple2(lockActionsResult, unit) | |
553 | + | else throw("Strict value is not equal to itself.") | |
554 | + | } | |
547 | 555 | else throw("Strict value is not equal to itself.") | |
548 | 556 | } | |
549 | 557 | ||
550 | 558 | ||
551 | 559 | ||
552 | 560 | @Callable(i) | |
553 | - | func lock (duration) = lockActions(i, duration) | |
561 | + | func lock (duration) = { | |
562 | + | let $t02348923554 = lockActions(i, duration) | |
563 | + | let lockActionsResult = $t02348923554._1 | |
564 | + | let gWxAmountStart = $t02348923554._2 | |
565 | + | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
566 | + | if ((updateRefActivity == updateRefActivity)) | |
567 | + | then $Tuple2(lockActionsResult, unit) | |
568 | + | else throw("Strict value is not equal to itself.") | |
569 | + | } | |
554 | 570 | ||
555 | 571 | ||
556 | 572 | ||
561 | 577 | let assetId = fromBase58String(assetIdStr) | |
562 | 578 | let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration]) | |
563 | 579 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
564 | - | let mathContract = addressFromStringValue(cfgArray[IdxCfgMathContract]) | |
565 | 580 | let pmtAmount = extractOptionalPaymentAmountOrFail(i, assetId) | |
566 | 581 | let userAddressStr = toString(i.caller) | |
567 | 582 | let userRecordArray = readLockParamsRecordOrFail(userAddressStr) | |
582 | 597 | else { | |
583 | 598 | let coeffX8 = fraction(lockDurationNew, MULT8, maxLockDuration) | |
584 | 599 | let gWxAmountStart = fraction(userAmountNew, coeffX8, MULT8) | |
585 | - | let lockStartNew = height | |
586 | - | let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStartNew, lockDurationNew], nil)) | |
587 | - | let k = ai(gWxParamsResultList[0]) | |
588 | - | let b = ai(gWxParamsResultList[1]) | |
589 | - | let period = toString(ai(gWxParamsResultList[2])) | |
590 | - | let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent()) | |
591 | - | let emissionStart = iof(emissionContract, keyEmissionStartBlock()) | |
592 | - | let emissionEnd = iof(emissionContract, keyEmissionEndBlock()) | |
593 | - | let h = if ((height > emissionEnd)) | |
594 | - | then emissionEnd | |
595 | - | else height | |
596 | - | let dh = max([(h - emissionStart), 0]) | |
597 | - | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
598 | - | let userBoostEmissionLastIntegral = ioz(this, userBoostEmissionLastIntegralKEY) | |
599 | - | let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3) | |
600 | - | let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral) | |
601 | - | if ((0 > userBoostEmissionIntegral)) | |
602 | - | then throw("wrong calculations") | |
603 | - | else { | |
604 | - | let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr) | |
605 | - | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
606 | - | let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY) | |
607 | - | let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY) | |
608 | - | let currUserGwx = calcCurrentGwxAmount(userAddressStr) | |
609 | - | let gwxDiff = (gWxAmountStart - currUserGwx) | |
610 | - | if ((0 > gwxDiff)) | |
611 | - | then throw(("gwxDiff is less then 0: " + toString(gwxDiff))) | |
600 | + | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
601 | + | if ((updateRefActivity == updateRefActivity)) | |
602 | + | then { | |
603 | + | let lockStartNew = height | |
604 | + | let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStartNew, lockDurationNew], nil)) | |
605 | + | let k = ai(gWxParamsResultList[0]) | |
606 | + | let b = ai(gWxParamsResultList[1]) | |
607 | + | let period = toString(ai(gWxParamsResultList[2])) | |
608 | + | let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent()) | |
609 | + | let emissionStart = iof(emissionContract, keyEmissionStartBlock()) | |
610 | + | let emissionEnd = iof(emissionContract, keyEmissionEndBlock()) | |
611 | + | let h = if ((height > emissionEnd)) | |
612 | + | then emissionEnd | |
613 | + | else height | |
614 | + | let dh = max([(h - emissionStart), 0]) | |
615 | + | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
616 | + | let userBoostEmissionLastIntegral = ioz(this, userBoostEmissionLastIntegralKEY) | |
617 | + | let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3) | |
618 | + | let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral) | |
619 | + | if ((0 > userBoostEmissionIntegral)) | |
620 | + | then throw("wrong calculations") | |
612 | 621 | else { | |
613 | - | let totalCachedGwxKEY = keyTotalCachedGwx() | |
614 | - | let totalCachedGwx = valueOrElse(getInteger(this, totalCachedGwxKEY), 0) | |
615 | - | let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr) | |
616 | - | let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY) | |
617 | - | let userBoostAvaliableToClaimTotalNew = fraction(userBoostEmissionIntegral, currUserGwx, totalCachedGwx) | |
618 | - | let userMaxBoostIntNew = ((gWxAmountStart * lockDurationNew) / 2) | |
619 | - | let remainingUserMaxBoostInt = ((currUserGwx * remainingDuration) / 2) | |
620 | - | let userMaxBoostIntDiff = (userMaxBoostIntNew - remainingUserMaxBoostInt) | |
621 | - | (((LockParamsEntry(userAddressStr, userNumStr, userAmountNew, lockStartNew, lockDurationNew, k, b, period) ++ StatsEntry(pmtAmount, deltaDuration, 0, 0)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, lockDurationNew, k, b, i)) ++ [IntegerEntry(totalCachedGwxKEY, (totalCachedGwx + gwxDiff))]) | |
622 | + | let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr) | |
623 | + | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
624 | + | let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY) | |
625 | + | let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY) | |
626 | + | let currUserGwx = calcCurrentGwxAmount(userAddressStr) | |
627 | + | let gwxDiff = (gWxAmountStart - currUserGwx) | |
628 | + | if ((0 > gwxDiff)) | |
629 | + | then throw(("gwxDiff is less then 0: " + toString(gwxDiff))) | |
630 | + | else { | |
631 | + | let totalCachedGwxKEY = keyTotalCachedGwx() | |
632 | + | let totalCachedGwx = valueOrElse(getInteger(this, totalCachedGwxKEY), 0) | |
633 | + | let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr) | |
634 | + | let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY) | |
635 | + | let userBoostAvaliableToClaimTotalNew = fraction(userBoostEmissionIntegral, currUserGwx, totalCachedGwx) | |
636 | + | let userMaxBoostIntNew = ((gWxAmountStart * lockDurationNew) / 2) | |
637 | + | let remainingUserMaxBoostInt = ((currUserGwx * remainingDuration) / 2) | |
638 | + | let userMaxBoostIntDiff = (userMaxBoostIntNew - remainingUserMaxBoostInt) | |
639 | + | (((LockParamsEntry(userAddressStr, userNumStr, userAmountNew, lockStartNew, lockDurationNew, k, b, period) ++ StatsEntry(pmtAmount, deltaDuration, 0, 0)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, lockDurationNew, k, b, i)) ++ [IntegerEntry(totalCachedGwxKEY, (totalCachedGwx + gwxDiff))]) | |
640 | + | } | |
622 | 641 | } | |
623 | 642 | } | |
643 | + | else throw("Strict value is not equal to itself.") | |
624 | 644 | } | |
625 | 645 | } | |
626 | 646 | ||
630 | 650 | func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller)) | |
631 | 651 | then throw("permissions denied") | |
632 | 652 | else { | |
633 | - | let $ | |
634 | - | let userBoostAvailable = $ | |
635 | - | let dataState = $ | |
636 | - | let debug = $ | |
653 | + | let $t02853328635 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false) | |
654 | + | let userBoostAvailable = $t02853328635._1 | |
655 | + | let dataState = $t02853328635._2 | |
656 | + | let debug = $t02853328635._3 | |
637 | 657 | $Tuple2(dataState, [userBoostAvailable]) | |
638 | 658 | } | |
639 | 659 | ||
641 | 661 | ||
642 | 662 | @Callable(i) | |
643 | 663 | func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = { | |
644 | - | let $ | |
645 | - | let userBoostAvailable = $ | |
646 | - | let dataState = $ | |
647 | - | let debug = $ | |
664 | + | let $t02876728868 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true) | |
665 | + | let userBoostAvailable = $t02876728868._1 | |
666 | + | let dataState = $t02876728868._2 | |
667 | + | let debug = $t02876728868._3 | |
648 | 668 | $Tuple2(nil, [userBoostAvailable, debug]) | |
649 | 669 | } | |
650 | 670 | ||
660 | 680 | let lockEnd = (lockStart + lockDuration) | |
661 | 681 | let cfgArray = readConfigArrayOrFail() | |
662 | 682 | let assetId = fromBase58String(cfgArray[IdxCfgAssetId]) | |
663 | - | let mathContract = addressFromStringValue(cfgArray[IdxCfgMathContract]) | |
664 | 683 | if ((lockEnd >= height)) | |
665 | 684 | then throw((("wait " + toString(lockEnd)) + " to unlock")) | |
666 | 685 | else if ((0 >= userAmount)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let SCALE8 = 8 | |
7 | 7 | ||
8 | 8 | let MULT8 = 100000000 | |
9 | 9 | ||
10 | 10 | let POOLWEIGHTMULT = MULT8 | |
11 | 11 | ||
12 | 12 | func strf (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined")) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func ioz (address,key) = valueOrElse(getInteger(address, key), 0) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func iod (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func iof (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func abs (val) = if ((0 > val)) | |
25 | 25 | then -(val) | |
26 | 26 | else val | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func aal (val) = match val { | |
30 | 30 | case valAnyLyst: List[Any] => | |
31 | 31 | valAnyLyst | |
32 | 32 | case _ => | |
33 | 33 | throw("fail to cast into List[Any]") | |
34 | 34 | } | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func ai (val) = match val { | |
38 | 38 | case valInt: Int => | |
39 | 39 | valInt | |
40 | 40 | case _ => | |
41 | 41 | throw("fail to cast into Int") | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | let referralsContractAddressOrFail = addressFromStringValue(strf(this, keyReferralsContractAddress())) | |
49 | 49 | ||
50 | 50 | let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP) | |
51 | 51 | ||
52 | 52 | let referralProgramNameDefault = "wxlock" | |
53 | 53 | ||
54 | 54 | let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault) | |
55 | 55 | ||
56 | 56 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | let IdxFactoryCfgStakingDapp = 1 | |
60 | 60 | ||
61 | 61 | let IdxFactoryCfgBoostingDapp = 2 | |
62 | 62 | ||
63 | 63 | let IdxFactoryCfgIdoDapp = 3 | |
64 | 64 | ||
65 | 65 | let IdxFactoryCfgTeamDapp = 4 | |
66 | 66 | ||
67 | 67 | let IdxFactoryCfgEmissionDapp = 5 | |
68 | 68 | ||
69 | 69 | let IdxFactoryCfgRestDapp = 6 | |
70 | 70 | ||
71 | 71 | let IdxFactoryCfgSlippageDapp = 7 | |
72 | 72 | ||
73 | 73 | let IdxFactoryCfgDaoDapp = 8 | |
74 | 74 | ||
75 | 75 | let IdxFactoryCfgMarketingDapp = 9 | |
76 | 76 | ||
77 | 77 | let IdxFactoryCfgGwxRewardDapp = 10 | |
78 | 78 | ||
79 | 79 | let IdxFactoryCfgBirdsDapp = 11 | |
80 | 80 | ||
81 | 81 | func keyFactoryCfg () = "%s__factoryConfig" | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keyFactoryLpList () = "%s__lpTokensList" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyFactoryPoolWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num)) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func readFactoryAddressOrFail () = addressFromStringValue(strf(this, keyFactoryAddress())) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func readFactoryCfgOrFail (factory) = split(strf(factory, keyFactoryCfg()), SEP) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp]) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func keyNextPeriod () = "%s__nextPeriod" | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight" | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | let IdxCfgAssetId = 1 | |
148 | 148 | ||
149 | 149 | let IdxCfgMinLockAmount = 2 | |
150 | 150 | ||
151 | 151 | let IdxCfgMinLockDuration = 3 | |
152 | 152 | ||
153 | 153 | let IdxCfgMaxLockDuration = 4 | |
154 | 154 | ||
155 | 155 | let IdxCfgMathContract = 5 | |
156 | 156 | ||
157 | 157 | func keyConfig () = "%s__config" | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func readConfigArrayOrFail () = split(strf(this, keyConfig()), SEP) | |
161 | 161 | ||
162 | + | ||
163 | + | let mathContract = addressFromStringValue(readConfigArrayOrFail()[IdxCfgMathContract]) | |
162 | 164 | ||
163 | 165 | func formatConfigS (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = makeString(["%s%d%d%d", assetId, minLockAmount, minLockDuration, maxLockDuration, mathContract], SEP) | |
164 | 166 | ||
165 | 167 | ||
166 | 168 | func formatConfig (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = formatConfigS(assetId, toString(minLockAmount), toString(minLockDuration), toString(maxLockDuration), mathContract) | |
167 | 169 | ||
168 | 170 | ||
169 | 171 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
170 | 172 | case s: String => | |
171 | 173 | fromBase58String(s) | |
172 | 174 | case _: Unit => | |
173 | 175 | unit | |
174 | 176 | case _ => | |
175 | 177 | throw("Match error") | |
176 | 178 | } | |
177 | 179 | ||
178 | 180 | ||
179 | 181 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
180 | 182 | case s: String => | |
181 | 183 | fromBase58String(s) | |
182 | 184 | case _: Unit => | |
183 | 185 | unit | |
184 | 186 | case _ => | |
185 | 187 | throw("Match error") | |
186 | 188 | } | |
187 | 189 | ||
188 | 190 | ||
189 | 191 | func mustManager (i) = { | |
190 | 192 | let pd = throw("Permission denied") | |
191 | 193 | match managerPublicKeyOrUnit() { | |
192 | 194 | case pk: ByteVector => | |
193 | 195 | if ((i.callerPublicKey == pk)) | |
194 | 196 | then true | |
195 | 197 | else pd | |
196 | 198 | case _: Unit => | |
197 | 199 | if ((i.caller == this)) | |
198 | 200 | then true | |
199 | 201 | else pd | |
200 | 202 | case _ => | |
201 | 203 | throw("Match error") | |
202 | 204 | } | |
203 | 205 | } | |
204 | 206 | ||
205 | 207 | ||
206 | 208 | let IdxLockUserNum = 1 | |
207 | 209 | ||
208 | 210 | let IdxLockAmount = 2 | |
209 | 211 | ||
210 | 212 | let IdxLockStart = 3 | |
211 | 213 | ||
212 | 214 | let IdxLockDuration = 4 | |
213 | 215 | ||
214 | 216 | let IdxLockParamK = 5 | |
215 | 217 | ||
216 | 218 | let IdxLockParamB = 6 | |
217 | 219 | ||
218 | 220 | func keyLockParamsRecord (userAddress) = makeString(["%s%s__lock", userAddress], SEP) | |
219 | 221 | ||
220 | 222 | ||
221 | 223 | func readLockParamsRecordOrFail (userAddress) = split(strf(this, keyLockParamsRecord(userAddress)), SEP) | |
222 | 224 | ||
223 | 225 | ||
224 | 226 | func formatLockParamsRecordS (userNum,amount,start,duration,paramK,paramB,lastUpdTimestamp,gwxAmount) = makeString(["%d%d%d%d%d%d%d%d", userNum, amount, start, duration, paramK, paramB, lastUpdTimestamp, gwxAmount], SEP) | |
225 | 227 | ||
226 | 228 | ||
227 | 229 | func formatLockParamsRecord (userNum,amount,start,duration,paramK,paramB,gwxAmount) = formatLockParamsRecordS(userNum, toString(amount), toString(start), toString(duration), toString(paramK), toString(paramB), toString(lastBlock.timestamp), toString(gwxAmount)) | |
228 | 230 | ||
229 | 231 | ||
230 | 232 | func keyNextUserNum () = "%s__nextUserNum" | |
231 | 233 | ||
232 | 234 | ||
233 | 235 | func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP) | |
234 | 236 | ||
235 | 237 | ||
236 | 238 | func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP) | |
237 | 239 | ||
238 | 240 | ||
239 | 241 | func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP) | |
240 | 242 | ||
241 | 243 | ||
242 | 244 | func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP) | |
243 | 245 | ||
244 | 246 | ||
245 | 247 | func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP) | |
246 | 248 | ||
247 | 249 | ||
248 | 250 | func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP) | |
249 | 251 | ||
250 | 252 | ||
251 | 253 | func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP) | |
252 | 254 | ||
253 | 255 | ||
254 | 256 | func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP) | |
255 | 257 | ||
256 | 258 | ||
257 | 259 | func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP) | |
258 | 260 | ||
259 | 261 | ||
260 | 262 | func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked" | |
261 | 263 | ||
262 | 264 | ||
263 | 265 | func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks" | |
264 | 266 | ||
265 | 267 | ||
266 | 268 | func keyStatsLocksCount () = "%s%s__stats__locksCount" | |
267 | 269 | ||
268 | 270 | ||
269 | 271 | func keyStatsUsersCount () = "%s%s__stats__activeUsersCount" | |
270 | 272 | ||
271 | 273 | ||
272 | 274 | func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastInt", userNum], SEP) | |
273 | 275 | ||
274 | 276 | ||
275 | 277 | func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastInt", userNum, lpAssetId], SEP) | |
276 | 278 | ||
277 | 279 | ||
278 | 280 | func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP) | |
279 | 281 | ||
280 | 282 | ||
281 | 283 | func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total" | |
282 | 284 | ||
283 | 285 | ||
284 | 286 | func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", userNum], SEP) | |
285 | 287 | ||
286 | 288 | ||
287 | 289 | func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", userNum], SEP) | |
288 | 290 | ||
289 | 291 | ||
290 | 292 | func keyTotalCachedGwx () = "%s%s__gwxCached__total" | |
291 | 293 | ||
292 | 294 | ||
293 | 295 | let factoryContract = readFactoryAddressOrFail() | |
294 | 296 | ||
295 | 297 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
296 | 298 | ||
297 | 299 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
298 | 300 | ||
299 | 301 | let stakingContract = getStakingAddressOrFail(factoryCfg) | |
300 | 302 | ||
301 | 303 | let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg) | |
302 | 304 | ||
303 | 305 | func HistoryEntry (type,user,amount,lockStart,duration,k,b,i) = { | |
304 | 306 | let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP) | |
305 | 307 | let historyDATA = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount), toString(lockStart), toString(duration), toString(k), toString(b)], SEP) | |
306 | 308 | StringEntry(historyKEY, historyDATA) | |
307 | 309 | } | |
308 | 310 | ||
309 | 311 | ||
310 | 312 | func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = { | |
311 | 313 | let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks() | |
312 | 314 | let locksCountKEY = keyStatsLocksCount() | |
313 | 315 | let usersCountKEY = keyStatsUsersCount() | |
314 | 316 | let totalAmountKEY = keyLockParamTotalAmount() | |
315 | 317 | let locksDurationSumInBlocks = ioz(this, locksDurationSumInBlocksKEY) | |
316 | 318 | let locksCount = ioz(this, locksCountKEY) | |
317 | 319 | let usersCount = ioz(this, usersCountKEY) | |
318 | 320 | let totalAmount = ioz(this, totalAmountKEY) | |
319 | 321 | [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))] | |
320 | 322 | } | |
321 | 323 | ||
322 | 324 | ||
323 | 325 | func calcGwxAmount (kRaw,bRaw,h) = { | |
324 | 326 | let SCALE = 1000 | |
325 | 327 | (((kRaw * h) + bRaw) / SCALE) | |
326 | 328 | } | |
327 | 329 | ||
328 | 330 | ||
329 | 331 | func LockParamsEntry (userAddress,userNum,amount,start,duration,k,b,period) = { | |
330 | 332 | let userAmountKEY = keyLockParamUserAmount(userNum) | |
331 | 333 | let startBlockKEY = keyLockParamStartBlock(userNum) | |
332 | 334 | let durationKEY = keyLockParamDuration(userNum) | |
333 | 335 | let kKEY = keyLockParamK(userNum) | |
334 | 336 | let bKEY = keyLockParamB(userNum) | |
335 | 337 | let kByPeriodKEY = keyLockParamByPeriodK(userNum, period) | |
336 | 338 | let bByPeriodKEY = keyLockParamByPeriodB(userNum, period) | |
337 | 339 | let gwxAmount = calcGwxAmount(k, b, height) | |
338 | 340 | [IntegerEntry(userAmountKEY, amount), IntegerEntry(startBlockKEY, start), IntegerEntry(durationKEY, duration), IntegerEntry(kKEY, k), IntegerEntry(bKEY, b), IntegerEntry(kByPeriodKEY, k), IntegerEntry(bByPeriodKEY, b), StringEntry(keyLockParamsRecord(userAddress), formatLockParamsRecord(userNum, amount, start, duration, k, b, gwxAmount))] | |
339 | 341 | } | |
340 | 342 | ||
341 | 343 | ||
342 | 344 | func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1)) | |
343 | 345 | then throw("only one payment is allowed") | |
344 | 346 | else if ((size(i.payments) == 0)) | |
345 | 347 | then 0 | |
346 | 348 | else { | |
347 | 349 | let pmt = i.payments[0] | |
348 | 350 | if ((value(pmt.assetId) != expectedAssetId)) | |
349 | 351 | then throw("invalid asset id in payment") | |
350 | 352 | else pmt.amount | |
351 | 353 | } | |
352 | 354 | ||
353 | 355 | ||
354 | 356 | func calcUserGwxAmountAtHeight (userAddress,targetHeight) = { | |
355 | 357 | let EMPTY = "empty" | |
356 | 358 | let user2NumMappingKEY = keyUser2NumMapping(userAddress) | |
357 | 359 | let userNum = valueOrElse(getString(user2NumMappingKEY), EMPTY) | |
358 | 360 | let k = valueOrElse(getInteger(keyLockParamK(userNum)), 0) | |
359 | 361 | let b = valueOrElse(getInteger(keyLockParamB(userNum)), 0) | |
360 | 362 | let gwxAmountCalc = calcGwxAmount(k, b, targetHeight) | |
361 | 363 | let gwxAmount = if ((0 > gwxAmountCalc)) | |
362 | 364 | then 0 | |
363 | 365 | else gwxAmountCalc | |
364 | 366 | gwxAmount | |
365 | 367 | } | |
366 | 368 | ||
367 | 369 | ||
368 | 370 | func calcCurrentGwxAmount (userAddress) = calcUserGwxAmountAtHeight(userAddress, height) | |
369 | 371 | ||
370 | 372 | ||
371 | 373 | func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = { | |
372 | 374 | let EMPTY = "EMPTY" | |
373 | 375 | let userRecordOrEmpty = valueOrElse(getString(this, keyLockParamsRecord(userAddressStr)), EMPTY) | |
374 | 376 | if ((userRecordOrEmpty == EMPTY)) | |
375 | 377 | then $Tuple3(0, nil, "userRecord::is::empty") | |
376 | 378 | else { | |
377 | 379 | let userRecordArray = split(userRecordOrEmpty, SEP) | |
378 | 380 | let userNumStr = userRecordArray[IdxLockUserNum] | |
379 | 381 | let gwxRewardEmissionStartHeight = valueOrElse(getInteger(gwxRewardContract, keyGwxRewardEmissionStartHeight()), 0) | |
380 | 382 | let EMPTYSTR = "empty" | |
381 | - | let $ | |
383 | + | let $t01395814526 = if ((lpAssetIdStr != EMPTYSTR)) | |
382 | 384 | then { | |
383 | 385 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
384 | 386 | let pw1 = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
385 | 387 | let pw0 = valueOrElse(getInteger(factoryContract, keyFactoryPoolWeightHistory(poolAddressStr, 0)), pw1) | |
386 | 388 | $Tuple2(pw0, pw1) | |
387 | 389 | } | |
388 | 390 | else if (readOnly) | |
389 | 391 | then $Tuple2(0, 0) | |
390 | 392 | else throw(("not readonly mode: unsupported lp asset " + lpAssetIdStr)) | |
391 | - | let poolWeight0 = $ | |
392 | - | let poolWeight1 = $ | |
393 | + | let poolWeight0 = $t01395814526._1 | |
394 | + | let poolWeight1 = $t01395814526._2 | |
393 | 395 | let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent()) | |
394 | 396 | let emissionStart = iof(emissionContract, keyEmissionStartBlock()) | |
395 | 397 | let emissionEnd = iof(emissionContract, keyEmissionEndBlock()) | |
396 | 398 | let h = if ((height > emissionEnd)) | |
397 | 399 | then emissionEnd | |
398 | 400 | else height | |
399 | 401 | let dh = max([(h - emissionStart), 0]) | |
400 | 402 | let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNumStr, lpAssetIdStr) | |
401 | 403 | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
402 | 404 | let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), ioz(this, userBoostEmissionLastIntegralKEY)) | |
403 | 405 | let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3) | |
404 | 406 | let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral) | |
405 | 407 | let udh = fraction(userBoostEmissionIntegral, 3, (2 * wxEmissionPerBlock)) | |
406 | 408 | let uLastH = (h - udh) | |
407 | 409 | let udh0 = max([(gwxRewardEmissionStartHeight - uLastH), 0]) | |
408 | 410 | let udh1 = ((h - uLastH) - udh0) | |
409 | 411 | if (if (if ((0 > uLastH)) | |
410 | 412 | then true | |
411 | 413 | else (0 > udh1)) | |
412 | 414 | then true | |
413 | 415 | else (abs(((udh0 + udh1) - udh)) >= 1)) | |
414 | 416 | then throw(((((((("invalid udh calc: udh=" + toString(udh)) + " uLastH=") + toString(uLastH)) + " udh0=") + toString(udh0)) + " udh1=") + toString(udh1))) | |
415 | 417 | else if ((0 > userBoostEmissionIntegral)) | |
416 | 418 | then throw("wrong calculations") | |
417 | 419 | else { | |
418 | 420 | let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr) | |
419 | 421 | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
420 | 422 | let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY) | |
421 | 423 | let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY) | |
422 | 424 | let totalCachedGwxKEY = keyTotalCachedGwx() | |
423 | 425 | let totalCachedGwx = valueOrElse(getInteger(this, totalCachedGwxKEY), 0) | |
424 | 426 | let userCurrGwx = calcCurrentGwxAmount(userAddressStr) | |
425 | 427 | let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr) | |
426 | 428 | let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY) | |
427 | 429 | let userBoostEmissionIntegral0 = if ((udh == 0)) | |
428 | 430 | then 0 | |
429 | 431 | else fraction(userBoostEmissionIntegral, udh0, udh) | |
430 | 432 | let userBoostEmissionIntegral1 = if ((udh == 0)) | |
431 | 433 | then 0 | |
432 | 434 | else fraction(userBoostEmissionIntegral, udh1, udh) | |
433 | 435 | let poolUserBoostEmissionIntegral0 = fraction(userBoostEmissionIntegral0, poolWeight0, POOLWEIGHTMULT) | |
434 | 436 | let poolUserBoostEmissionIntegral1 = fraction(userBoostEmissionIntegral1, poolWeight1, POOLWEIGHTMULT) | |
435 | 437 | let userBoostAvaliableToClaimTotalNew0 = if ((totalCachedGwx == 0)) | |
436 | 438 | then 0 | |
437 | 439 | else fraction(poolUserBoostEmissionIntegral0, userCurrGwx, totalCachedGwx) | |
438 | 440 | let userBoostAvaliableToClaimTotalNew1 = if ((totalCachedGwx == 0)) | |
439 | 441 | then 0 | |
440 | 442 | else fraction(poolUserBoostEmissionIntegral1, userCurrGwx, totalCachedGwx) | |
441 | 443 | let userBoostAvaliableToClaimTotalNew = (userBoostAvaliableToClaimTotalNew0 + userBoostAvaliableToClaimTotalNew1) | |
442 | 444 | let userBoostClaimedKEY = keyUserBoostClaimed(userNumStr) | |
443 | 445 | let userBoostClaimed = ioz(this, userBoostClaimedKEY) | |
444 | 446 | let userBoostAvailable = (userBoostAvaliableToClaimTotalNew - userBoostClaimed) | |
445 | 447 | let dataState = [IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)] | |
446 | 448 | let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(userBoostClaimed), toString(userBoostAvailable), toString(poolWeight0), toString(poolWeight1), toString(h), toString(udh), toString(uLastH), toString(udh0), toString(udh1), toString(userCurrGwx), toString(totalCachedGwx)], ":") | |
447 | 449 | $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug) | |
448 | 450 | } | |
449 | 451 | } | |
450 | 452 | } | |
451 | 453 | ||
452 | 454 | ||
453 | 455 | func lockActions (i,duration) = { | |
454 | 456 | let cfgArray = readConfigArrayOrFail() | |
455 | 457 | let assetIdStr = cfgArray[IdxCfgAssetId] | |
456 | 458 | let assetId = fromBase58String(assetIdStr) | |
457 | 459 | let minLockAmount = parseIntValue(cfgArray[IdxCfgMinLockAmount]) | |
458 | 460 | let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration]) | |
459 | 461 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
460 | - | let mathContract = addressFromStringValue(cfgArray[IdxCfgMathContract]) | |
461 | 462 | if ((size(i.payments) != 1)) | |
462 | 463 | then throw("invalid payment - exact one payment must be attached") | |
463 | 464 | else { | |
464 | 465 | let pmt = i.payments[0] | |
465 | 466 | let pmtAmount = pmt.amount | |
466 | 467 | if ((assetId != value(pmt.assetId))) | |
467 | 468 | then throw((("invalid asset is in payment - " + assetIdStr) + " is expected")) | |
468 | 469 | else { | |
469 | 470 | let nextUserNumKEY = keyNextUserNum() | |
470 | 471 | let userAddressStr = toString(i.caller) | |
471 | 472 | let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr))) | |
472 | 473 | let userNumStr = if (userIsExisting) | |
473 | 474 | then value(getString(keyUser2NumMapping(userAddressStr))) | |
474 | 475 | else toString(iof(this, nextUserNumKEY)) | |
475 | 476 | let userNum = parseIntValue(userNumStr) | |
476 | 477 | let lockStart = height | |
477 | 478 | let startBlockKEY = keyLockParamStartBlock(userNumStr) | |
478 | 479 | let durationKEY = keyLockParamDuration(userNumStr) | |
479 | 480 | let userAmountKEY = keyLockParamUserAmount(userNumStr) | |
480 | 481 | if ((minLockAmount > pmtAmount)) | |
481 | 482 | then throw(("amount is less then minLockAmount=" + toString(minLockAmount))) | |
482 | 483 | else if ((minLockDuration > duration)) | |
483 | 484 | then throw(("passed duration is less then minLockDuration=" + toString(minLockDuration))) | |
484 | 485 | else if ((duration > maxLockDuration)) | |
485 | 486 | then throw(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration))) | |
486 | 487 | else if (if (userIsExisting) | |
487 | 488 | then ((iof(this, startBlockKEY) + iof(this, durationKEY)) >= lockStart) | |
488 | 489 | else false) | |
489 | 490 | then throw("there is an active lock - consider to use increaseLock") | |
490 | 491 | else if ((ioz(this, userAmountKEY) > 0)) | |
491 | 492 | then throw(("there are locked WXs - consider to use increaseLock " + userAmountKEY)) | |
492 | 493 | else { | |
493 | 494 | let coeffX8 = fraction(duration, MULT8, maxLockDuration) | |
494 | 495 | let gWxAmountStart = fraction(pmtAmount, coeffX8, MULT8) | |
495 | 496 | let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStart, duration], nil)) | |
496 | 497 | let k = ai(gWxParamsResultList[0]) | |
497 | 498 | let b = ai(gWxParamsResultList[1]) | |
498 | 499 | let period = toString(ai(gWxParamsResultList[2])) | |
499 | 500 | let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent()) | |
500 | 501 | let emissionStart = iof(emissionContract, keyEmissionStartBlock()) | |
501 | 502 | let emissionEnd = iof(emissionContract, keyEmissionEndBlock()) | |
502 | 503 | let h = if ((height > emissionEnd)) | |
503 | 504 | then emissionEnd | |
504 | 505 | else height | |
505 | 506 | let dh = max([(h - emissionStart), 0]) | |
506 | 507 | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
507 | 508 | let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3) | |
508 | 509 | let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr) | |
509 | 510 | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
510 | 511 | let userMaxBoostInt = ((gWxAmountStart * duration) / 2) | |
511 | 512 | let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY) | |
512 | 513 | let totalCachedGwxKEY = keyTotalCachedGwx() | |
513 | 514 | let totalCachedGwx = valueOrElse(getInteger(this, totalCachedGwxKEY), 0) | |
514 | 515 | let arr = if (userIsExisting) | |
515 | 516 | then nil | |
516 | 517 | else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)] | |
517 | - | ((((arr ++ LockParamsEntry(userAddressStr, userNumStr, pmtAmount, lockStart, duration, k, b, period)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting) | |
518 | + | $Tuple2(((((arr ++ LockParamsEntry(userAddressStr, userNumStr, pmtAmount, lockStart, duration, k, b, period)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting) | |
518 | 519 | then 0 | |
519 | - | else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, k, b, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(totalCachedGwxKEY, (totalCachedGwx + gWxAmountStart))]) | |
520 | + | else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, k, b, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(totalCachedGwxKEY, (totalCachedGwx + gWxAmountStart))]), gWxAmountStart) | |
520 | 521 | } | |
521 | 522 | } | |
522 | 523 | } | |
523 | 524 | } | |
524 | 525 | ||
525 | 526 | ||
526 | 527 | @Callable(i) | |
527 | 528 | func constructor (factoryAddressStr,lockAssetIdStr,minLockAmount,minDuration,maxDuration,mathContract) = { | |
528 | 529 | let checkCaller = mustManager(i) | |
529 | 530 | if ((checkCaller == checkCaller)) | |
530 | 531 | then ([IntegerEntry(keyNextUserNum(), 0), StringEntry(keyConfig(), formatConfig(lockAssetIdStr, minLockAmount, minDuration, maxDuration, mathContract)), StringEntry(keyFactoryAddress(), factoryAddressStr)] ++ StatsEntry(0, 0, 0, 0)) | |
531 | 532 | else throw("Strict value is not equal to itself.") | |
532 | 533 | } | |
533 | 534 | ||
534 | 535 | ||
535 | 536 | ||
536 | 537 | @Callable(i) | |
537 | 538 | func lockRef (duration,referrerAddress,signature) = { | |
538 | - | let lockActionsResult = lockActions(i, duration) | |
539 | + | let $t02296623031 = lockActions(i, duration) | |
540 | + | let lockActionsResult = $t02296623031._1 | |
541 | + | let gWxAmountStart = $t02296623031._2 | |
539 | 542 | let referralAddress = toString(i.caller) | |
540 | 543 | let refInv = if (if ((referrerAddress == "")) | |
541 | 544 | then true | |
542 | 545 | else (signature == base58'')) | |
543 | 546 | then unit | |
544 | 547 | else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil) | |
545 | 548 | if ((refInv == refInv)) | |
546 | - | then $Tuple2(lockActionsResult, unit) | |
549 | + | then { | |
550 | + | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
551 | + | if ((updateRefActivity == updateRefActivity)) | |
552 | + | then $Tuple2(lockActionsResult, unit) | |
553 | + | else throw("Strict value is not equal to itself.") | |
554 | + | } | |
547 | 555 | else throw("Strict value is not equal to itself.") | |
548 | 556 | } | |
549 | 557 | ||
550 | 558 | ||
551 | 559 | ||
552 | 560 | @Callable(i) | |
553 | - | func lock (duration) = lockActions(i, duration) | |
561 | + | func lock (duration) = { | |
562 | + | let $t02348923554 = lockActions(i, duration) | |
563 | + | let lockActionsResult = $t02348923554._1 | |
564 | + | let gWxAmountStart = $t02348923554._2 | |
565 | + | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
566 | + | if ((updateRefActivity == updateRefActivity)) | |
567 | + | then $Tuple2(lockActionsResult, unit) | |
568 | + | else throw("Strict value is not equal to itself.") | |
569 | + | } | |
554 | 570 | ||
555 | 571 | ||
556 | 572 | ||
557 | 573 | @Callable(i) | |
558 | 574 | func increaseLock (deltaDuration) = { | |
559 | 575 | let cfgArray = readConfigArrayOrFail() | |
560 | 576 | let assetIdStr = cfgArray[IdxCfgAssetId] | |
561 | 577 | let assetId = fromBase58String(assetIdStr) | |
562 | 578 | let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration]) | |
563 | 579 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
564 | - | let mathContract = addressFromStringValue(cfgArray[IdxCfgMathContract]) | |
565 | 580 | let pmtAmount = extractOptionalPaymentAmountOrFail(i, assetId) | |
566 | 581 | let userAddressStr = toString(i.caller) | |
567 | 582 | let userRecordArray = readLockParamsRecordOrFail(userAddressStr) | |
568 | 583 | let userNumStr = userRecordArray[IdxLockUserNum] | |
569 | 584 | let userAmount = parseIntValue(userRecordArray[IdxLockAmount]) | |
570 | 585 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
571 | 586 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) | |
572 | 587 | let lockEnd = (lockStart + lockDuration) | |
573 | 588 | let remainingDuration = max([(lockEnd - height), 0]) | |
574 | 589 | let userAmountNew = (userAmount + pmtAmount) | |
575 | 590 | let lockDurationNew = (remainingDuration + deltaDuration) | |
576 | 591 | if ((0 > deltaDuration)) | |
577 | 592 | then throw("duration is less then zero") | |
578 | 593 | else if ((minLockDuration > lockDurationNew)) | |
579 | 594 | then throw(("lockDurationNew is less then minLockDuration=" + toString(minLockDuration))) | |
580 | 595 | else if ((lockDurationNew > maxLockDuration)) | |
581 | 596 | then throw(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(maxLockDuration))) | |
582 | 597 | else { | |
583 | 598 | let coeffX8 = fraction(lockDurationNew, MULT8, maxLockDuration) | |
584 | 599 | let gWxAmountStart = fraction(userAmountNew, coeffX8, MULT8) | |
585 | - | let lockStartNew = height | |
586 | - | let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStartNew, lockDurationNew], nil)) | |
587 | - | let k = ai(gWxParamsResultList[0]) | |
588 | - | let b = ai(gWxParamsResultList[1]) | |
589 | - | let period = toString(ai(gWxParamsResultList[2])) | |
590 | - | let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent()) | |
591 | - | let emissionStart = iof(emissionContract, keyEmissionStartBlock()) | |
592 | - | let emissionEnd = iof(emissionContract, keyEmissionEndBlock()) | |
593 | - | let h = if ((height > emissionEnd)) | |
594 | - | then emissionEnd | |
595 | - | else height | |
596 | - | let dh = max([(h - emissionStart), 0]) | |
597 | - | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
598 | - | let userBoostEmissionLastIntegral = ioz(this, userBoostEmissionLastIntegralKEY) | |
599 | - | let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3) | |
600 | - | let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral) | |
601 | - | if ((0 > userBoostEmissionIntegral)) | |
602 | - | then throw("wrong calculations") | |
603 | - | else { | |
604 | - | let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr) | |
605 | - | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
606 | - | let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY) | |
607 | - | let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY) | |
608 | - | let currUserGwx = calcCurrentGwxAmount(userAddressStr) | |
609 | - | let gwxDiff = (gWxAmountStart - currUserGwx) | |
610 | - | if ((0 > gwxDiff)) | |
611 | - | then throw(("gwxDiff is less then 0: " + toString(gwxDiff))) | |
600 | + | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
601 | + | if ((updateRefActivity == updateRefActivity)) | |
602 | + | then { | |
603 | + | let lockStartNew = height | |
604 | + | let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStartNew, lockDurationNew], nil)) | |
605 | + | let k = ai(gWxParamsResultList[0]) | |
606 | + | let b = ai(gWxParamsResultList[1]) | |
607 | + | let period = toString(ai(gWxParamsResultList[2])) | |
608 | + | let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent()) | |
609 | + | let emissionStart = iof(emissionContract, keyEmissionStartBlock()) | |
610 | + | let emissionEnd = iof(emissionContract, keyEmissionEndBlock()) | |
611 | + | let h = if ((height > emissionEnd)) | |
612 | + | then emissionEnd | |
613 | + | else height | |
614 | + | let dh = max([(h - emissionStart), 0]) | |
615 | + | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
616 | + | let userBoostEmissionLastIntegral = ioz(this, userBoostEmissionLastIntegralKEY) | |
617 | + | let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3) | |
618 | + | let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral) | |
619 | + | if ((0 > userBoostEmissionIntegral)) | |
620 | + | then throw("wrong calculations") | |
612 | 621 | else { | |
613 | - | let totalCachedGwxKEY = keyTotalCachedGwx() | |
614 | - | let totalCachedGwx = valueOrElse(getInteger(this, totalCachedGwxKEY), 0) | |
615 | - | let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr) | |
616 | - | let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY) | |
617 | - | let userBoostAvaliableToClaimTotalNew = fraction(userBoostEmissionIntegral, currUserGwx, totalCachedGwx) | |
618 | - | let userMaxBoostIntNew = ((gWxAmountStart * lockDurationNew) / 2) | |
619 | - | let remainingUserMaxBoostInt = ((currUserGwx * remainingDuration) / 2) | |
620 | - | let userMaxBoostIntDiff = (userMaxBoostIntNew - remainingUserMaxBoostInt) | |
621 | - | (((LockParamsEntry(userAddressStr, userNumStr, userAmountNew, lockStartNew, lockDurationNew, k, b, period) ++ StatsEntry(pmtAmount, deltaDuration, 0, 0)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, lockDurationNew, k, b, i)) ++ [IntegerEntry(totalCachedGwxKEY, (totalCachedGwx + gwxDiff))]) | |
622 | + | let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr) | |
623 | + | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
624 | + | let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY) | |
625 | + | let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY) | |
626 | + | let currUserGwx = calcCurrentGwxAmount(userAddressStr) | |
627 | + | let gwxDiff = (gWxAmountStart - currUserGwx) | |
628 | + | if ((0 > gwxDiff)) | |
629 | + | then throw(("gwxDiff is less then 0: " + toString(gwxDiff))) | |
630 | + | else { | |
631 | + | let totalCachedGwxKEY = keyTotalCachedGwx() | |
632 | + | let totalCachedGwx = valueOrElse(getInteger(this, totalCachedGwxKEY), 0) | |
633 | + | let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr) | |
634 | + | let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY) | |
635 | + | let userBoostAvaliableToClaimTotalNew = fraction(userBoostEmissionIntegral, currUserGwx, totalCachedGwx) | |
636 | + | let userMaxBoostIntNew = ((gWxAmountStart * lockDurationNew) / 2) | |
637 | + | let remainingUserMaxBoostInt = ((currUserGwx * remainingDuration) / 2) | |
638 | + | let userMaxBoostIntDiff = (userMaxBoostIntNew - remainingUserMaxBoostInt) | |
639 | + | (((LockParamsEntry(userAddressStr, userNumStr, userAmountNew, lockStartNew, lockDurationNew, k, b, period) ++ StatsEntry(pmtAmount, deltaDuration, 0, 0)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, lockDurationNew, k, b, i)) ++ [IntegerEntry(totalCachedGwxKEY, (totalCachedGwx + gwxDiff))]) | |
640 | + | } | |
622 | 641 | } | |
623 | 642 | } | |
643 | + | else throw("Strict value is not equal to itself.") | |
624 | 644 | } | |
625 | 645 | } | |
626 | 646 | ||
627 | 647 | ||
628 | 648 | ||
629 | 649 | @Callable(i) | |
630 | 650 | func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller)) | |
631 | 651 | then throw("permissions denied") | |
632 | 652 | else { | |
633 | - | let $ | |
634 | - | let userBoostAvailable = $ | |
635 | - | let dataState = $ | |
636 | - | let debug = $ | |
653 | + | let $t02853328635 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false) | |
654 | + | let userBoostAvailable = $t02853328635._1 | |
655 | + | let dataState = $t02853328635._2 | |
656 | + | let debug = $t02853328635._3 | |
637 | 657 | $Tuple2(dataState, [userBoostAvailable]) | |
638 | 658 | } | |
639 | 659 | ||
640 | 660 | ||
641 | 661 | ||
642 | 662 | @Callable(i) | |
643 | 663 | func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = { | |
644 | - | let $ | |
645 | - | let userBoostAvailable = $ | |
646 | - | let dataState = $ | |
647 | - | let debug = $ | |
664 | + | let $t02876728868 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true) | |
665 | + | let userBoostAvailable = $t02876728868._1 | |
666 | + | let dataState = $t02876728868._2 | |
667 | + | let debug = $t02876728868._3 | |
648 | 668 | $Tuple2(nil, [userBoostAvailable, debug]) | |
649 | 669 | } | |
650 | 670 | ||
651 | 671 | ||
652 | 672 | ||
653 | 673 | @Callable(i) | |
654 | 674 | func unlock (userAddress) = { | |
655 | 675 | let userRecordArray = readLockParamsRecordOrFail(userAddress) | |
656 | 676 | let userNumStr = userRecordArray[IdxLockUserNum] | |
657 | 677 | let userAmount = parseIntValue(userRecordArray[IdxLockAmount]) | |
658 | 678 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
659 | 679 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) | |
660 | 680 | let lockEnd = (lockStart + lockDuration) | |
661 | 681 | let cfgArray = readConfigArrayOrFail() | |
662 | 682 | let assetId = fromBase58String(cfgArray[IdxCfgAssetId]) | |
663 | - | let mathContract = addressFromStringValue(cfgArray[IdxCfgMathContract]) | |
664 | 683 | if ((lockEnd >= height)) | |
665 | 684 | then throw((("wait " + toString(lockEnd)) + " to unlock")) | |
666 | 685 | else if ((0 >= userAmount)) | |
667 | 686 | then throw("nothing to unlock") | |
668 | 687 | else { | |
669 | 688 | let period = valueOrElse(getInteger(mathContract, keyNextPeriod()), 0) | |
670 | 689 | (((LockParamsEntry(userAddress, userNumStr, 0, lockStart, lockDuration, 0, 0, toString(period)) ++ StatsEntry(-(userAmount), 0, 0, -1)) :+ HistoryEntry("unlock", userAddress, userAmount, lockStart, lockDuration, 0, 0, i)) :+ ScriptTransfer(addressFromStringValue(userAddress), userAmount, assetId)) | |
671 | 690 | } | |
672 | 691 | } | |
673 | 692 | ||
674 | 693 | ||
675 | 694 | ||
676 | 695 | @Callable(i) | |
677 | 696 | func gwxUserInfoREADONLY (userAddress) = { | |
678 | 697 | let gwxAmount = calcCurrentGwxAmount(userAddress) | |
679 | 698 | $Tuple2(nil, [gwxAmount]) | |
680 | 699 | } | |
681 | 700 | ||
682 | 701 | ||
683 | 702 | ||
684 | 703 | @Callable(i) | |
685 | 704 | func getUserGwxAmountAtHeightREADONLY (userAddress,targetHeight) = { | |
686 | 705 | let gwxAmount = calcUserGwxAmountAtHeight(userAddress, targetHeight) | |
687 | 706 | $Tuple2(nil, gwxAmount) | |
688 | 707 | } | |
689 | 708 | ||
690 | 709 | ||
691 | 710 | ||
692 | 711 | @Callable(i) | |
693 | 712 | func setManager (pendingManagerPublicKey) = { | |
694 | 713 | let checkCaller = mustManager(i) | |
695 | 714 | if ((checkCaller == checkCaller)) | |
696 | 715 | then { | |
697 | 716 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
698 | 717 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
699 | 718 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
700 | 719 | else throw("Strict value is not equal to itself.") | |
701 | 720 | } | |
702 | 721 | else throw("Strict value is not equal to itself.") | |
703 | 722 | } | |
704 | 723 | ||
705 | 724 | ||
706 | 725 | ||
707 | 726 | @Callable(i) | |
708 | 727 | func confirmManager () = { | |
709 | 728 | let pm = pendingManagerPublicKeyOrUnit() | |
710 | 729 | let hasPM = if (isDefined(pm)) | |
711 | 730 | then true | |
712 | 731 | else throw("No pending manager") | |
713 | 732 | if ((hasPM == hasPM)) | |
714 | 733 | then { | |
715 | 734 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
716 | 735 | then true | |
717 | 736 | else throw("You are not pending manager") | |
718 | 737 | if ((checkPM == checkPM)) | |
719 | 738 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
720 | 739 | else throw("Strict value is not equal to itself.") | |
721 | 740 | } | |
722 | 741 | else throw("Strict value is not equal to itself.") | |
723 | 742 | } | |
724 | 743 | ||
725 | 744 | ||
726 | 745 | @Verifier(tx) | |
727 | 746 | func verify () = { | |
728 | 747 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
729 | 748 | case pk: ByteVector => | |
730 | 749 | pk | |
731 | 750 | case _: Unit => | |
732 | 751 | tx.senderPublicKey | |
733 | 752 | case _ => | |
734 | 753 | throw("Match error") | |
735 | 754 | } | |
736 | 755 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
737 | 756 | } | |
738 | 757 |
github/deemru/w8io/026f985 216.39 ms ◑