tx · 12yZeEmQxn2mM5zoUaNVe8BfiAjibCYzyHGrNZ8FWXyb 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy: -0.02800000 Waves 2023.03.15 11:15 [2490890] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves
{ "type": 13, "id": "12yZeEmQxn2mM5zoUaNVe8BfiAjibCYzyHGrNZ8FWXyb", "fee": 2800000, "feeAssetId": null, "timestamp": 1678868162059, "version": 2, "chainId": 84, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "2zUcoBvyBaySBBte6vbDZPS4nzcAHruCj5HHiehgwLBmv6xu9dBNaikpmqQahAeYAAwmoHeSsZ1BeUujn8YuVort" ], "script": "base64:BgLFLwgCEggKBggIAQEBCBIFCgMBCAISAwoBARIDCgEBEgQKAggIEgQKAggIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgASABIFCgMICAQSAwoBCBIECgIICBIDCgEIEgAiA1NFUCIGU0NBTEU4IgVNVUxUOCIOUE9PTFdFSUdIVE1VTFQiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiBHN0cmYiB2FkZHJlc3MiA2tleSIDaW96IgNpb2QiCmRlZmF1bHRWYWwiA2lvZiIDYWJzIgN2YWwiA2FhbCIHJG1hdGNoMCIKdmFsQW55THlzdCICYWkiBnZhbEludCIba2V5UmVmZXJyYWxzQ29udHJhY3RBZGRyZXNzIh5yZWZlcnJhbHNDb250cmFjdEFkZHJlc3NPckZhaWwiFmtleVJlZmVycmFsUHJvZ3JhbU5hbWUiGnJlZmVycmFsUHJvZ3JhbU5hbWVEZWZhdWx0IhNyZWZlcnJhbFByb2dyYW1OYW1lIhFrZXlGYWN0b3J5QWRkcmVzcyIYSWR4RmFjdG9yeUNmZ1N0YWtpbmdEYXBwIhlJZHhGYWN0b3J5Q2Z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l0c2VsZi4CYUkBDmNvbmZpcm1NYW5hZ2VyAAQCZnAJAQJhRwAEAmZxAwkBCWlzRGVmaW5lZAEFAmZwBgkAAgECEk5vIHBlbmRpbmcgbWFuYWdlcgMJAAACBQJmcQUCZnEEAmZyAwkAAAIIBQJhSQ9jYWxsZXJQdWJsaWNLZXkJAQV2YWx1ZQEFAmZwBgkAAgECG1lvdSBhcmUgbm90IHBlbmRpbmcgbWFuYWdlcgMJAAACBQJmcgUCZnIJAMwIAgkBC1N0cmluZ0VudHJ5AgkBAmFmAAkA2AQBCQEFdmFsdWUBBQJmcAkAzAgCCQELRGVsZXRlRW50cnkBCQECYWcABQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAmZzAQJmdAAEAmZ1BAFyCQECYUUAAwkAAQIFAXICCkJ5dGVWZWN0b3IEAmFLBQFyBQJhSwMJAAECBQFyAgRVbml0CAUCZnMPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmZzCWJvZHlCeXRlcwkAkQMCCAUCZnMGcHJvb2ZzAAAFAmZ1IazonQ==", "height": 2490890, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2VJzFgHogPw7zKhEX9MPGZxoc47AriXfqNixh92oVFQb Next: 7p38ousfrmmnwAANUTtjcJDT1pbtJwYKiFWETf2a6zDx Diff:
Old | New | Differences | |
---|---|---|---|
307 | 307 | func keyTotalCachedGwxCorrective () = "%s__gwxCachedTotalCorrective" | |
308 | 308 | ||
309 | 309 | ||
310 | + | func keyVote (amountAssetId,priceAssetId,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP) | |
311 | + | ||
312 | + | ||
313 | + | func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], SEP) | |
314 | + | ||
315 | + | ||
316 | + | func keyCurrentEpochUi () = makeString(["%s", "currentEpochUi"], SEP) | |
317 | + | ||
318 | + | ||
319 | + | func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], SEP) | |
320 | + | ||
321 | + | ||
322 | + | func keyVotingResultStakedIntegral (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegral", lpAssetIdStr, toString(epoch)], SEP) | |
323 | + | ||
324 | + | ||
325 | + | func keyVotingResultStakedLastUpdateHeight (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(epoch)], SEP) | |
326 | + | ||
327 | + | ||
328 | + | func keyVotingResultStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
329 | + | ||
330 | + | ||
331 | + | func keyVoteStakedIntegral (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegral", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
332 | + | ||
333 | + | ||
334 | + | func keyVoteStakedLastUpdateHeight (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
335 | + | ||
336 | + | ||
337 | + | func keyVoteStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
338 | + | ||
339 | + | ||
340 | + | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], SEP) | |
341 | + | ||
342 | + | ||
310 | 343 | let factoryContract = readFactoryAddressOrFail() | |
311 | 344 | ||
312 | 345 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
331 | 364 | } | |
332 | 365 | ||
333 | 366 | func getTotalCachedGwx (correct) = { | |
334 | - | let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP) | |
335 | - | let currentEpochUi = getIntegerValue(votingEmissionContract, keyCurrentEpochUi) | |
367 | + | let currentEpochUi = getIntegerValue(votingEmissionContract, keyCurrentEpochUi()) | |
336 | 368 | let keyTargetEpoch = makeString(["%s%s", "totalCachedGwxCorrection__activationEpoch"], SEP) | |
337 | 369 | let targetEpochOption = getInteger(this, keyTargetEpoch) | |
338 | 370 | let totalCachedGwxRaw = valueOrElse(getInteger(this, keyTotalCachedGwx()), 0) | |
417 | 449 | ||
418 | 450 | ||
419 | 451 | func getVotingEmissionEpochInfo () = { | |
420 | - | let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP) | |
421 | - | let $t01515015438 = { | |
422 | - | let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi)) | |
452 | + | let $t01719017480 = { | |
453 | + | let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi())) | |
423 | 454 | let lastFinalizedEpoch = (currentEpochUi - 1) | |
424 | 455 | if ((0 > lastFinalizedEpoch)) | |
425 | 456 | then throwErr("invalid epoch") | |
426 | 457 | else $Tuple2(currentEpochUi, lastFinalizedEpoch) | |
427 | 458 | } | |
428 | - | let currentEpochUi = $t01515015438._1 | |
429 | - | let lastFinalizedEpoch = $t01515015438._2 | |
430 | - | func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], SEP) | |
431 | - | ||
459 | + | let currentEpochUi = $t01719017480._1 | |
460 | + | let lastFinalizedEpoch = $t01719017480._2 | |
432 | 461 | let currentEpochStartHeight = value(getInteger(votingEmissionContract, keyStartHeightByEpoch(currentEpochUi))) | |
433 | 462 | $Tuple2(lastFinalizedEpoch, currentEpochStartHeight) | |
434 | 463 | } | |
438 | 467 | let idxAmountAssetId = 4 | |
439 | 468 | let idxPriceAssetId = 5 | |
440 | 469 | let poolCfg = { | |
441 | - | let @ = invoke(factoryContract, " | |
470 | + | let @ = invoke(factoryContract, "getPoolConfigByLpAssetIdREADONLY", [lpAssetIdStr], nil) | |
442 | 471 | if ($isInstanceOf(@, "List[Any]")) | |
443 | 472 | then @ | |
444 | 473 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
459 | 488 | } | |
460 | 489 | ||
461 | 490 | ||
462 | - | func keyVote (amountAssetId,priceAssetId,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP) | |
463 | - | ||
464 | - | ||
465 | - | func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], SEP) | |
466 | - | ||
467 | - | ||
468 | - | func keyVotingResultStakedIntegral (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegral", lpAssetIdStr, toString(epoch)], SEP) | |
469 | - | ||
470 | - | ||
471 | - | func keyVotingResultStakedLastUpdateHeight (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(epoch)], SEP) | |
472 | - | ||
473 | - | ||
474 | - | func keyVotingResultStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
475 | - | ||
476 | - | ||
477 | - | func keyVoteStakedIntegral (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegral", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
478 | - | ||
479 | - | ||
480 | - | func keyVoteStakedLastUpdateHeight (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
481 | - | ||
482 | - | ||
483 | - | func keyVoteStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
484 | - | ||
485 | - | ||
486 | - | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], SEP) | |
487 | - | ||
488 | - | ||
489 | 491 | func getUserVoteFinalized (lpAssetIdStr,userAddressStr) = { | |
490 | 492 | let userAddress = addressFromStringValue(userAddressStr) | |
491 | - | let $ | |
492 | - | let lastFinalizedEpoch = $ | |
493 | - | let currentEpochStartHeight = $ | |
494 | - | let $ | |
495 | - | let amountAssetId = $ | |
496 | - | let priceAssetId = $ | |
493 | + | let $t01817118251 = getVotingEmissionEpochInfo() | |
494 | + | let lastFinalizedEpoch = $t01817118251._1 | |
495 | + | let currentEpochStartHeight = $t01817118251._2 | |
496 | + | let $t01825418329 = getPoolAssetsByLpAssetId(lpAssetIdStr) | |
497 | + | let amountAssetId = $t01825418329._1 | |
498 | + | let priceAssetId = $t01825418329._2 | |
497 | 499 | let userVoteKey = keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch) | |
498 | 500 | let userVote = valueOrElse(getInteger(votingEmissionContract, userVoteKey), 0) | |
499 | 501 | userVote | |
510 | 512 | ||
511 | 513 | ||
512 | 514 | func getVotingResultStaked (lpAssetIdStr) = { | |
513 | - | let $ | |
514 | - | let lastFinalizedEpoch = $ | |
515 | - | let currentEpochStartHeight = $ | |
515 | + | let $t01887318953 = getVotingEmissionEpochInfo() | |
516 | + | let lastFinalizedEpoch = $t01887318953._1 | |
517 | + | let currentEpochStartHeight = $t01887318953._2 | |
516 | 518 | let votingResultStakedStart = valueOrElse(getInteger(votingEmissionContract, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), 0) | |
517 | 519 | let votingResultStaked = valueOrElse(getInteger(this, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), votingResultStakedStart) | |
518 | 520 | votingResultStaked | |
520 | 522 | ||
521 | 523 | ||
522 | 524 | func refreshVotingResultStakedIntegral (lpAssetIdStr,stakedVoteDelta) = { | |
523 | - | let $ | |
524 | - | let lastFinalizedEpoch = $ | |
525 | - | let currentEpochStartHeight = $ | |
525 | + | let $t01947419554 = getVotingEmissionEpochInfo() | |
526 | + | let lastFinalizedEpoch = $t01947419554._1 | |
527 | + | let currentEpochStartHeight = $t01947419554._2 | |
526 | 528 | let votingResultStaked = getVotingResultStaked(lpAssetIdStr) | |
527 | 529 | let votingResultStakedNew = (votingResultStaked + stakedVoteDelta) | |
528 | 530 | let votingResultStakedIntegralKey = keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch) | |
536 | 538 | ||
537 | 539 | ||
538 | 540 | func refreshVoteStakedIntegral (lpAssetIdStr,userAddressStr,edge) = { | |
539 | - | let $ | |
540 | - | let lastFinalizedEpoch = $ | |
541 | - | let currentEpochStartHeight = $ | |
541 | + | let $t02075420834 = getVotingEmissionEpochInfo() | |
542 | + | let lastFinalizedEpoch = $t02075420834._1 | |
543 | + | let currentEpochStartHeight = $t02075420834._2 | |
542 | 544 | let userAddress = addressFromStringValue(userAddressStr) | |
543 | 545 | let idxAmountAssetId = 4 | |
544 | 546 | let idxPriceAssetId = 5 | |
545 | 547 | let poolCfg = { | |
546 | - | let @ = invoke(factoryContract, " | |
548 | + | let @ = invoke(factoryContract, "getPoolConfigByLpAssetIdREADONLY", [lpAssetIdStr], nil) | |
547 | 549 | if ($isInstanceOf(@, "List[Any]")) | |
548 | 550 | then @ | |
549 | 551 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
567 | 569 | let stakedVoteDelta = if (edge) | |
568 | 570 | then userVote | |
569 | 571 | else -(userVote) | |
570 | - | let $ | |
571 | - | let votingResultActions = $ | |
572 | - | let votingResultStakedIntegral = $ | |
572 | + | let $t02144721566 = refreshVotingResultStakedIntegral(lpAssetIdStr, stakedVoteDelta) | |
573 | + | let votingResultActions = $t02144721566._1 | |
574 | + | let votingResultStakedIntegral = $t02144721566._2 | |
573 | 575 | let userVoteStaked = if (edge) | |
574 | 576 | then 0 | |
575 | 577 | else userVote | |
587 | 589 | ||
588 | 590 | ||
589 | 591 | func getStakedVotesIntegralsDiff (lpAssetIdStr,userAddressStr) = { | |
590 | - | let $ | |
591 | - | let lastFinalizedEpoch = $ | |
592 | - | let currentEpochStartHeight = $ | |
592 | + | let $t02255822638 = getVotingEmissionEpochInfo() | |
593 | + | let lastFinalizedEpoch = $t02255822638._1 | |
594 | + | let currentEpochStartHeight = $t02255822638._2 | |
593 | 595 | let userAddress = addressFromStringValue(userAddressStr) | |
594 | 596 | let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr) | |
595 | 597 | let votingResultStaked = getVotingResultStaked(lpAssetIdStr) | |
658 | 660 | if ((0 > userBoostEmissionIntegral)) | |
659 | 661 | then throw("wrong calculations") | |
660 | 662 | else { | |
661 | - | let $ | |
662 | - | let stakedVotesIntegralsActions = $ | |
663 | - | let userVoteIntegralDiff = $ | |
664 | - | let totalVotesIntegralDiff = $ | |
663 | + | let $t02716327302 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr) | |
664 | + | let stakedVotesIntegralsActions = $t02716327302._1 | |
665 | + | let userVoteIntegralDiff = $t02716327302._2 | |
666 | + | let totalVotesIntegralDiff = $t02716327302._3 | |
665 | 667 | let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT) | |
666 | 668 | let userBoostAvaliableToClaimTotalNew = if ((totalVotesIntegralDiff == 0)) | |
667 | 669 | then 0 | |
748 | 750 | ||
749 | 751 | @Callable(i) | |
750 | 752 | func lockRef (duration,referrerAddress,signature) = { | |
751 | - | let $ | |
752 | - | let lockActionsResult = $ | |
753 | - | let gWxAmountStart = $ | |
753 | + | let $t03189231957 = lockActions(i, duration) | |
754 | + | let lockActionsResult = $t03189231957._1 | |
755 | + | let gWxAmountStart = $t03189231957._2 | |
754 | 756 | let referralAddress = toString(i.caller) | |
755 | 757 | let refInv = if (if ((referrerAddress == "")) | |
756 | 758 | then true | |
771 | 773 | ||
772 | 774 | @Callable(i) | |
773 | 775 | func lock (duration) = { | |
774 | - | let $ | |
775 | - | let lockActionsResult = $ | |
776 | - | let gWxAmountStart = $ | |
776 | + | let $t03241532480 = lockActions(i, duration) | |
777 | + | let lockActionsResult = $t03241532480._1 | |
778 | + | let gWxAmountStart = $t03241532480._2 | |
777 | 779 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
778 | 780 | if ((updateRefActivity == updateRefActivity)) | |
779 | 781 | then $Tuple2(lockActionsResult, unit) | |
837 | 839 | func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller)) | |
838 | 840 | then throw("permissions denied") | |
839 | 841 | else { | |
840 | - | let $ | |
841 | - | let userBoostAvailable = $ | |
842 | - | let dataState = $ | |
843 | - | let debug = $ | |
842 | + | let $t03556735669 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false) | |
843 | + | let userBoostAvailable = $t03556735669._1 | |
844 | + | let dataState = $t03556735669._2 | |
845 | + | let debug = $t03556735669._3 | |
844 | 846 | $Tuple2(dataState, [userBoostAvailable]) | |
845 | 847 | } | |
846 | 848 | ||
848 | 850 | ||
849 | 851 | @Callable(i) | |
850 | 852 | func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = { | |
851 | - | let $ | |
852 | - | let userBoostAvailable = $ | |
853 | - | let dataState = $ | |
854 | - | let debug = $ | |
853 | + | let $t03580135902 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true) | |
854 | + | let userBoostAvailable = $t03580135902._1 | |
855 | + | let dataState = $t03580135902._2 | |
856 | + | let debug = $t03580135902._3 | |
855 | 857 | $Tuple2(nil, [userBoostAvailable, debug]) | |
856 | 858 | } | |
857 | 859 |
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 wrapErr (msg) = makeString(["boosting.ride:", msg], " ") | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func throwErr (msg) = throw(wrapErr(msg)) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func strf (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined")) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func ioz (address,key) = valueOrElse(getInteger(address, key), 0) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func iod (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func iof (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func abs (val) = if ((0 > val)) | |
31 | 31 | then -(val) | |
32 | 32 | else val | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func aal (val) = match val { | |
36 | 36 | case valAnyLyst: List[Any] => | |
37 | 37 | valAnyLyst | |
38 | 38 | case _ => | |
39 | 39 | throw("fail to cast into List[Any]") | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func ai (val) = match val { | |
44 | 44 | case valInt: Int => | |
45 | 45 | valInt | |
46 | 46 | case _ => | |
47 | 47 | throw("fail to cast into Int") | |
48 | 48 | } | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | let referralsContractAddressOrFail = addressFromStringValue(strf(this, keyReferralsContractAddress())) | |
55 | 55 | ||
56 | 56 | let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP) | |
57 | 57 | ||
58 | 58 | let referralProgramNameDefault = "wxlock" | |
59 | 59 | ||
60 | 60 | let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault) | |
61 | 61 | ||
62 | 62 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | let IdxFactoryCfgStakingDapp = 1 | |
66 | 66 | ||
67 | 67 | let IdxFactoryCfgBoostingDapp = 2 | |
68 | 68 | ||
69 | 69 | let IdxFactoryCfgIdoDapp = 3 | |
70 | 70 | ||
71 | 71 | let IdxFactoryCfgTeamDapp = 4 | |
72 | 72 | ||
73 | 73 | let IdxFactoryCfgEmissionDapp = 5 | |
74 | 74 | ||
75 | 75 | let IdxFactoryCfgRestDapp = 6 | |
76 | 76 | ||
77 | 77 | let IdxFactoryCfgSlippageDapp = 7 | |
78 | 78 | ||
79 | 79 | let IdxFactoryCfgDaoDapp = 8 | |
80 | 80 | ||
81 | 81 | let IdxFactoryCfgMarketingDapp = 9 | |
82 | 82 | ||
83 | 83 | let IdxFactoryCfgGwxRewardDapp = 10 | |
84 | 84 | ||
85 | 85 | let IdxFactoryCfgBirdsDapp = 11 | |
86 | 86 | ||
87 | 87 | func keyFactoryCfg () = "%s__factoryConfig" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyFactoryLpList () = "%s__lpTokensList" | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func keyFactoryPoolWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num)) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func readFactoryAddressOrFail () = addressFromStringValue(strf(this, keyFactoryAddress())) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func readFactoryCfgOrFail (factory) = split(strf(factory, keyFactoryCfg()), SEP) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp]) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func keyBoostingV2LastUpdateHeight () = "%s%s__boostingV2__startBlock" | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func keyBoostingV2Integral () = "%s%s__boostingV2__integral" | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func keyNextPeriod () = "%s__nextPeriod" | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight" | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | let IdxCfgAssetId = 1 | |
160 | 160 | ||
161 | 161 | let IdxCfgMinLockAmount = 2 | |
162 | 162 | ||
163 | 163 | let IdxCfgMinLockDuration = 3 | |
164 | 164 | ||
165 | 165 | let IdxCfgMaxLockDuration = 4 | |
166 | 166 | ||
167 | 167 | let IdxCfgMathContract = 5 | |
168 | 168 | ||
169 | 169 | func keyConfig () = "%s__config" | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func readConfigArrayOrFail () = split(strf(this, keyConfig()), SEP) | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | let mathContract = addressFromStringValue(readConfigArrayOrFail()[IdxCfgMathContract]) | |
176 | 176 | ||
177 | 177 | func formatConfigS (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = makeString(["%s%d%d%d", assetId, minLockAmount, minLockDuration, maxLockDuration, mathContract], SEP) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func formatConfig (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = formatConfigS(assetId, toString(minLockAmount), toString(minLockDuration), toString(maxLockDuration), mathContract) | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
184 | 184 | case s: String => | |
185 | 185 | fromBase58String(s) | |
186 | 186 | case _: Unit => | |
187 | 187 | unit | |
188 | 188 | case _ => | |
189 | 189 | throw("Match error") | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
194 | 194 | case s: String => | |
195 | 195 | fromBase58String(s) | |
196 | 196 | case _: Unit => | |
197 | 197 | unit | |
198 | 198 | case _ => | |
199 | 199 | throw("Match error") | |
200 | 200 | } | |
201 | 201 | ||
202 | 202 | ||
203 | 203 | func mustManager (i) = { | |
204 | 204 | let pd = throw("Permission denied") | |
205 | 205 | match managerPublicKeyOrUnit() { | |
206 | 206 | case pk: ByteVector => | |
207 | 207 | if ((i.callerPublicKey == pk)) | |
208 | 208 | then true | |
209 | 209 | else pd | |
210 | 210 | case _: Unit => | |
211 | 211 | if ((i.caller == this)) | |
212 | 212 | then true | |
213 | 213 | else pd | |
214 | 214 | case _ => | |
215 | 215 | throw("Match error") | |
216 | 216 | } | |
217 | 217 | } | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | let IdxLockUserNum = 1 | |
221 | 221 | ||
222 | 222 | let IdxLockAmount = 2 | |
223 | 223 | ||
224 | 224 | let IdxLockStart = 3 | |
225 | 225 | ||
226 | 226 | let IdxLockDuration = 4 | |
227 | 227 | ||
228 | 228 | let IdxLockParamK = 5 | |
229 | 229 | ||
230 | 230 | let IdxLockParamB = 6 | |
231 | 231 | ||
232 | 232 | func keyLockParamsRecord (userAddress) = makeString(["%s%s__lock", userAddress], SEP) | |
233 | 233 | ||
234 | 234 | ||
235 | 235 | func readLockParamsRecordOrFail (userAddress) = split(strf(this, keyLockParamsRecord(userAddress)), SEP) | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | 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) | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | 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)) | |
242 | 242 | ||
243 | 243 | ||
244 | 244 | func keyNextUserNum () = "%s__nextUserNum" | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP) | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP) | |
251 | 251 | ||
252 | 252 | ||
253 | 253 | func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP) | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP) | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP) | |
260 | 260 | ||
261 | 261 | ||
262 | 262 | func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP) | |
263 | 263 | ||
264 | 264 | ||
265 | 265 | func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP) | |
266 | 266 | ||
267 | 267 | ||
268 | 268 | func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP) | |
269 | 269 | ||
270 | 270 | ||
271 | 271 | func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP) | |
272 | 272 | ||
273 | 273 | ||
274 | 274 | func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked" | |
275 | 275 | ||
276 | 276 | ||
277 | 277 | func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks" | |
278 | 278 | ||
279 | 279 | ||
280 | 280 | func keyStatsLocksCount () = "%s%s__stats__locksCount" | |
281 | 281 | ||
282 | 282 | ||
283 | 283 | func keyStatsUsersCount () = "%s%s__stats__activeUsersCount" | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum], SEP) | |
287 | 287 | ||
288 | 288 | ||
289 | 289 | func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum, lpAssetId], SEP) | |
290 | 290 | ||
291 | 291 | ||
292 | 292 | func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP) | |
293 | 293 | ||
294 | 294 | ||
295 | 295 | func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total" | |
296 | 296 | ||
297 | 297 | ||
298 | 298 | func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", userNum], SEP) | |
299 | 299 | ||
300 | 300 | ||
301 | 301 | func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", userNum], SEP) | |
302 | 302 | ||
303 | 303 | ||
304 | 304 | func keyTotalCachedGwx () = "%s%s__gwxCached__total" | |
305 | 305 | ||
306 | 306 | ||
307 | 307 | func keyTotalCachedGwxCorrective () = "%s__gwxCachedTotalCorrective" | |
308 | 308 | ||
309 | 309 | ||
310 | + | func keyVote (amountAssetId,priceAssetId,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP) | |
311 | + | ||
312 | + | ||
313 | + | func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], SEP) | |
314 | + | ||
315 | + | ||
316 | + | func keyCurrentEpochUi () = makeString(["%s", "currentEpochUi"], SEP) | |
317 | + | ||
318 | + | ||
319 | + | func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], SEP) | |
320 | + | ||
321 | + | ||
322 | + | func keyVotingResultStakedIntegral (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegral", lpAssetIdStr, toString(epoch)], SEP) | |
323 | + | ||
324 | + | ||
325 | + | func keyVotingResultStakedLastUpdateHeight (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(epoch)], SEP) | |
326 | + | ||
327 | + | ||
328 | + | func keyVotingResultStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
329 | + | ||
330 | + | ||
331 | + | func keyVoteStakedIntegral (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegral", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
332 | + | ||
333 | + | ||
334 | + | func keyVoteStakedLastUpdateHeight (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
335 | + | ||
336 | + | ||
337 | + | func keyVoteStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
338 | + | ||
339 | + | ||
340 | + | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], SEP) | |
341 | + | ||
342 | + | ||
310 | 343 | let factoryContract = readFactoryAddressOrFail() | |
311 | 344 | ||
312 | 345 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
313 | 346 | ||
314 | 347 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
315 | 348 | ||
316 | 349 | let stakingContract = getStakingAddressOrFail(factoryCfg) | |
317 | 350 | ||
318 | 351 | let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg) | |
319 | 352 | ||
320 | 353 | let lpStakingPoolsContract = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(makeString(["%s", "lpStakingPoolsContract"], SEP)), wrapErr("lp_staking_pools contract address is undefined"))), wrapErr("invalid lp_staking_pools contract address")) | |
321 | 354 | ||
322 | 355 | let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP) | |
323 | 356 | ||
324 | 357 | let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract)) | |
325 | 358 | ||
326 | 359 | let boostCoeff = { | |
327 | 360 | let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil) | |
328 | 361 | if ($isInstanceOf(@, "Int")) | |
329 | 362 | then @ | |
330 | 363 | else throw(($getType(@) + " couldn't be cast to Int")) | |
331 | 364 | } | |
332 | 365 | ||
333 | 366 | func getTotalCachedGwx (correct) = { | |
334 | - | let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP) | |
335 | - | let currentEpochUi = getIntegerValue(votingEmissionContract, keyCurrentEpochUi) | |
367 | + | let currentEpochUi = getIntegerValue(votingEmissionContract, keyCurrentEpochUi()) | |
336 | 368 | let keyTargetEpoch = makeString(["%s%s", "totalCachedGwxCorrection__activationEpoch"], SEP) | |
337 | 369 | let targetEpochOption = getInteger(this, keyTargetEpoch) | |
338 | 370 | let totalCachedGwxRaw = valueOrElse(getInteger(this, keyTotalCachedGwx()), 0) | |
339 | 371 | let isCorrectionActivated = if (isDefined(targetEpochOption)) | |
340 | 372 | then (currentEpochUi >= value(targetEpochOption)) | |
341 | 373 | else false | |
342 | 374 | let corrective = if (if (isCorrectionActivated) | |
343 | 375 | then correct | |
344 | 376 | else false) | |
345 | 377 | then valueOrElse(getInteger(this, keyTotalCachedGwxCorrective()), 0) | |
346 | 378 | else 0 | |
347 | 379 | max([0, (totalCachedGwxRaw + corrective)]) | |
348 | 380 | } | |
349 | 381 | ||
350 | 382 | ||
351 | 383 | func HistoryEntry (type,user,amount,lockStart,duration,k,b,i) = { | |
352 | 384 | let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP) | |
353 | 385 | 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) | |
354 | 386 | StringEntry(historyKEY, historyDATA) | |
355 | 387 | } | |
356 | 388 | ||
357 | 389 | ||
358 | 390 | func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = { | |
359 | 391 | let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks() | |
360 | 392 | let locksCountKEY = keyStatsLocksCount() | |
361 | 393 | let usersCountKEY = keyStatsUsersCount() | |
362 | 394 | let totalAmountKEY = keyLockParamTotalAmount() | |
363 | 395 | let locksDurationSumInBlocks = ioz(this, locksDurationSumInBlocksKEY) | |
364 | 396 | let locksCount = ioz(this, locksCountKEY) | |
365 | 397 | let usersCount = ioz(this, usersCountKEY) | |
366 | 398 | let totalAmount = ioz(this, totalAmountKEY) | |
367 | 399 | [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))] | |
368 | 400 | } | |
369 | 401 | ||
370 | 402 | ||
371 | 403 | func calcGwxAmount (kRaw,bRaw,h) = { | |
372 | 404 | let SCALE = 1000 | |
373 | 405 | (((kRaw * h) + bRaw) / SCALE) | |
374 | 406 | } | |
375 | 407 | ||
376 | 408 | ||
377 | 409 | func LockParamsEntry (userAddress,userNum,amount,start,duration,k,b,period) = { | |
378 | 410 | let userAmountKEY = keyLockParamUserAmount(userNum) | |
379 | 411 | let startBlockKEY = keyLockParamStartBlock(userNum) | |
380 | 412 | let durationKEY = keyLockParamDuration(userNum) | |
381 | 413 | let kKEY = keyLockParamK(userNum) | |
382 | 414 | let bKEY = keyLockParamB(userNum) | |
383 | 415 | let kByPeriodKEY = keyLockParamByPeriodK(userNum, period) | |
384 | 416 | let bByPeriodKEY = keyLockParamByPeriodB(userNum, period) | |
385 | 417 | let gwxAmount = calcGwxAmount(k, b, height) | |
386 | 418 | [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))] | |
387 | 419 | } | |
388 | 420 | ||
389 | 421 | ||
390 | 422 | func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1)) | |
391 | 423 | then throw("only one payment is allowed") | |
392 | 424 | else if ((size(i.payments) == 0)) | |
393 | 425 | then 0 | |
394 | 426 | else { | |
395 | 427 | let pmt = i.payments[0] | |
396 | 428 | if ((value(pmt.assetId) != expectedAssetId)) | |
397 | 429 | then throw("invalid asset id in payment") | |
398 | 430 | else pmt.amount | |
399 | 431 | } | |
400 | 432 | ||
401 | 433 | ||
402 | 434 | func calcUserGwxAmountAtHeight (userAddress,targetHeight) = { | |
403 | 435 | let EMPTY = "empty" | |
404 | 436 | let user2NumMappingKEY = keyUser2NumMapping(userAddress) | |
405 | 437 | let userNum = valueOrElse(getString(user2NumMappingKEY), EMPTY) | |
406 | 438 | let k = valueOrElse(getInteger(keyLockParamK(userNum)), 0) | |
407 | 439 | let b = valueOrElse(getInteger(keyLockParamB(userNum)), 0) | |
408 | 440 | let gwxAmountCalc = calcGwxAmount(k, b, targetHeight) | |
409 | 441 | let gwxAmount = if ((0 > gwxAmountCalc)) | |
410 | 442 | then 0 | |
411 | 443 | else gwxAmountCalc | |
412 | 444 | gwxAmount | |
413 | 445 | } | |
414 | 446 | ||
415 | 447 | ||
416 | 448 | func calcCurrentGwxAmount (userAddress) = calcUserGwxAmountAtHeight(userAddress, height) | |
417 | 449 | ||
418 | 450 | ||
419 | 451 | func getVotingEmissionEpochInfo () = { | |
420 | - | let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP) | |
421 | - | let $t01515015438 = { | |
422 | - | let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi)) | |
452 | + | let $t01719017480 = { | |
453 | + | let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi())) | |
423 | 454 | let lastFinalizedEpoch = (currentEpochUi - 1) | |
424 | 455 | if ((0 > lastFinalizedEpoch)) | |
425 | 456 | then throwErr("invalid epoch") | |
426 | 457 | else $Tuple2(currentEpochUi, lastFinalizedEpoch) | |
427 | 458 | } | |
428 | - | let currentEpochUi = $t01515015438._1 | |
429 | - | let lastFinalizedEpoch = $t01515015438._2 | |
430 | - | func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], SEP) | |
431 | - | ||
459 | + | let currentEpochUi = $t01719017480._1 | |
460 | + | let lastFinalizedEpoch = $t01719017480._2 | |
432 | 461 | let currentEpochStartHeight = value(getInteger(votingEmissionContract, keyStartHeightByEpoch(currentEpochUi))) | |
433 | 462 | $Tuple2(lastFinalizedEpoch, currentEpochStartHeight) | |
434 | 463 | } | |
435 | 464 | ||
436 | 465 | ||
437 | 466 | func getPoolAssetsByLpAssetId (lpAssetIdStr) = { | |
438 | 467 | let idxAmountAssetId = 4 | |
439 | 468 | let idxPriceAssetId = 5 | |
440 | 469 | let poolCfg = { | |
441 | - | let @ = invoke(factoryContract, " | |
470 | + | let @ = invoke(factoryContract, "getPoolConfigByLpAssetIdREADONLY", [lpAssetIdStr], nil) | |
442 | 471 | if ($isInstanceOf(@, "List[Any]")) | |
443 | 472 | then @ | |
444 | 473 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
445 | 474 | } | |
446 | 475 | let amountAssetId = { | |
447 | 476 | let @ = poolCfg[idxAmountAssetId] | |
448 | 477 | if ($isInstanceOf(@, "String")) | |
449 | 478 | then @ | |
450 | 479 | else throw(($getType(@) + " couldn't be cast to String")) | |
451 | 480 | } | |
452 | 481 | let priceAssetId = { | |
453 | 482 | let @ = poolCfg[idxPriceAssetId] | |
454 | 483 | if ($isInstanceOf(@, "String")) | |
455 | 484 | then @ | |
456 | 485 | else throw(($getType(@) + " couldn't be cast to String")) | |
457 | 486 | } | |
458 | 487 | $Tuple2(amountAssetId, priceAssetId) | |
459 | 488 | } | |
460 | 489 | ||
461 | 490 | ||
462 | - | func keyVote (amountAssetId,priceAssetId,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP) | |
463 | - | ||
464 | - | ||
465 | - | func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], SEP) | |
466 | - | ||
467 | - | ||
468 | - | func keyVotingResultStakedIntegral (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegral", lpAssetIdStr, toString(epoch)], SEP) | |
469 | - | ||
470 | - | ||
471 | - | func keyVotingResultStakedLastUpdateHeight (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(epoch)], SEP) | |
472 | - | ||
473 | - | ||
474 | - | func keyVotingResultStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
475 | - | ||
476 | - | ||
477 | - | func keyVoteStakedIntegral (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegral", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
478 | - | ||
479 | - | ||
480 | - | func keyVoteStakedLastUpdateHeight (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
481 | - | ||
482 | - | ||
483 | - | func keyVoteStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP) | |
484 | - | ||
485 | - | ||
486 | - | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], SEP) | |
487 | - | ||
488 | - | ||
489 | 491 | func getUserVoteFinalized (lpAssetIdStr,userAddressStr) = { | |
490 | 492 | let userAddress = addressFromStringValue(userAddressStr) | |
491 | - | let $ | |
492 | - | let lastFinalizedEpoch = $ | |
493 | - | let currentEpochStartHeight = $ | |
494 | - | let $ | |
495 | - | let amountAssetId = $ | |
496 | - | let priceAssetId = $ | |
493 | + | let $t01817118251 = getVotingEmissionEpochInfo() | |
494 | + | let lastFinalizedEpoch = $t01817118251._1 | |
495 | + | let currentEpochStartHeight = $t01817118251._2 | |
496 | + | let $t01825418329 = getPoolAssetsByLpAssetId(lpAssetIdStr) | |
497 | + | let amountAssetId = $t01825418329._1 | |
498 | + | let priceAssetId = $t01825418329._2 | |
497 | 499 | let userVoteKey = keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch) | |
498 | 500 | let userVote = valueOrElse(getInteger(votingEmissionContract, userVoteKey), 0) | |
499 | 501 | userVote | |
500 | 502 | } | |
501 | 503 | ||
502 | 504 | ||
503 | 505 | func getUserVoteStaked (lpAssetIdStr,userAddressStr) = { | |
504 | 506 | let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(userAddressStr, lpAssetIdStr)), 0) | |
505 | 507 | let userVote = getUserVoteFinalized(lpAssetIdStr, userAddressStr) | |
506 | 508 | if ((stakedByUser == 0)) | |
507 | 509 | then 0 | |
508 | 510 | else userVote | |
509 | 511 | } | |
510 | 512 | ||
511 | 513 | ||
512 | 514 | func getVotingResultStaked (lpAssetIdStr) = { | |
513 | - | let $ | |
514 | - | let lastFinalizedEpoch = $ | |
515 | - | let currentEpochStartHeight = $ | |
515 | + | let $t01887318953 = getVotingEmissionEpochInfo() | |
516 | + | let lastFinalizedEpoch = $t01887318953._1 | |
517 | + | let currentEpochStartHeight = $t01887318953._2 | |
516 | 518 | let votingResultStakedStart = valueOrElse(getInteger(votingEmissionContract, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), 0) | |
517 | 519 | let votingResultStaked = valueOrElse(getInteger(this, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), votingResultStakedStart) | |
518 | 520 | votingResultStaked | |
519 | 521 | } | |
520 | 522 | ||
521 | 523 | ||
522 | 524 | func refreshVotingResultStakedIntegral (lpAssetIdStr,stakedVoteDelta) = { | |
523 | - | let $ | |
524 | - | let lastFinalizedEpoch = $ | |
525 | - | let currentEpochStartHeight = $ | |
525 | + | let $t01947419554 = getVotingEmissionEpochInfo() | |
526 | + | let lastFinalizedEpoch = $t01947419554._1 | |
527 | + | let currentEpochStartHeight = $t01947419554._2 | |
526 | 528 | let votingResultStaked = getVotingResultStaked(lpAssetIdStr) | |
527 | 529 | let votingResultStakedNew = (votingResultStaked + stakedVoteDelta) | |
528 | 530 | let votingResultStakedIntegralKey = keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch) | |
529 | 531 | let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, votingResultStakedIntegralKey), 0) | |
530 | 532 | let votingResultLastUpdateHeightKey = keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch) | |
531 | 533 | let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, votingResultLastUpdateHeightKey), currentEpochStartHeight) | |
532 | 534 | let votingResultStakedIntegralDh = (height - votingResultStakedLastUpdateHeight) | |
533 | 535 | let votingResultStakedIntegral = ((votingResultStakedIntegralDh * votingResultStaked) + votingResultStakedIntegralPrev) | |
534 | 536 | $Tuple2([IntegerEntry(keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedNew), IntegerEntry(votingResultLastUpdateHeightKey, height), IntegerEntry(votingResultStakedIntegralKey, votingResultStakedIntegral)], votingResultStakedIntegral) | |
535 | 537 | } | |
536 | 538 | ||
537 | 539 | ||
538 | 540 | func refreshVoteStakedIntegral (lpAssetIdStr,userAddressStr,edge) = { | |
539 | - | let $ | |
540 | - | let lastFinalizedEpoch = $ | |
541 | - | let currentEpochStartHeight = $ | |
541 | + | let $t02075420834 = getVotingEmissionEpochInfo() | |
542 | + | let lastFinalizedEpoch = $t02075420834._1 | |
543 | + | let currentEpochStartHeight = $t02075420834._2 | |
542 | 544 | let userAddress = addressFromStringValue(userAddressStr) | |
543 | 545 | let idxAmountAssetId = 4 | |
544 | 546 | let idxPriceAssetId = 5 | |
545 | 547 | let poolCfg = { | |
546 | - | let @ = invoke(factoryContract, " | |
548 | + | let @ = invoke(factoryContract, "getPoolConfigByLpAssetIdREADONLY", [lpAssetIdStr], nil) | |
547 | 549 | if ($isInstanceOf(@, "List[Any]")) | |
548 | 550 | then @ | |
549 | 551 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
550 | 552 | } | |
551 | 553 | let amountAssetId = { | |
552 | 554 | let @ = poolCfg[idxAmountAssetId] | |
553 | 555 | if ($isInstanceOf(@, "String")) | |
554 | 556 | then @ | |
555 | 557 | else throw(($getType(@) + " couldn't be cast to String")) | |
556 | 558 | } | |
557 | 559 | let priceAssetId = { | |
558 | 560 | let @ = poolCfg[idxPriceAssetId] | |
559 | 561 | if ($isInstanceOf(@, "String")) | |
560 | 562 | then @ | |
561 | 563 | else throw(($getType(@) + " couldn't be cast to String")) | |
562 | 564 | } | |
563 | 565 | let userVote = valueOrElse(getInteger(votingEmissionContract, keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch)), 0) | |
564 | 566 | let actions = if ((userVote == 0)) | |
565 | 567 | then nil | |
566 | 568 | else { | |
567 | 569 | let stakedVoteDelta = if (edge) | |
568 | 570 | then userVote | |
569 | 571 | else -(userVote) | |
570 | - | let $ | |
571 | - | let votingResultActions = $ | |
572 | - | let votingResultStakedIntegral = $ | |
572 | + | let $t02144721566 = refreshVotingResultStakedIntegral(lpAssetIdStr, stakedVoteDelta) | |
573 | + | let votingResultActions = $t02144721566._1 | |
574 | + | let votingResultStakedIntegral = $t02144721566._2 | |
573 | 575 | let userVoteStaked = if (edge) | |
574 | 576 | then 0 | |
575 | 577 | else userVote | |
576 | 578 | let userVoteStakedIntegralKey = keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
577 | 579 | let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, userVoteStakedIntegralKey), 0) | |
578 | 580 | let userVoteStakedLastUpdateHeightKey = keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
579 | 581 | let userVoteStakedLastUpdateHeight = valueOrElse(getInteger(this, userVoteStakedLastUpdateHeightKey), currentEpochStartHeight) | |
580 | 582 | let userVoteStakedIntegralDh = (height - userVoteStakedLastUpdateHeight) | |
581 | 583 | let userVoteStakedIntegral = ((userVoteStakedIntegralDh * userVoteStaked) + userVoteStakedIntegralPrev) | |
582 | 584 | let voteActions = [IntegerEntry(userVoteStakedLastUpdateHeightKey, height), IntegerEntry(userVoteStakedIntegralKey, userVoteStakedIntegral)] | |
583 | 585 | (votingResultActions ++ voteActions) | |
584 | 586 | } | |
585 | 587 | actions | |
586 | 588 | } | |
587 | 589 | ||
588 | 590 | ||
589 | 591 | func getStakedVotesIntegralsDiff (lpAssetIdStr,userAddressStr) = { | |
590 | - | let $ | |
591 | - | let lastFinalizedEpoch = $ | |
592 | - | let currentEpochStartHeight = $ | |
592 | + | let $t02255822638 = getVotingEmissionEpochInfo() | |
593 | + | let lastFinalizedEpoch = $t02255822638._1 | |
594 | + | let currentEpochStartHeight = $t02255822638._2 | |
593 | 595 | let userAddress = addressFromStringValue(userAddressStr) | |
594 | 596 | let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr) | |
595 | 597 | let votingResultStaked = getVotingResultStaked(lpAssetIdStr) | |
596 | 598 | let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)), 0) | |
597 | 599 | let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)), 0) | |
598 | 600 | let userVoteStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch)), currentEpochStartHeight) | |
599 | 601 | let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)), currentEpochStartHeight) | |
600 | 602 | let userVoteStakedIntegralKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
601 | 603 | let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralKey), 0) | |
602 | 604 | let votingResultStakedIntegralKey = keyVotingResultStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch) | |
603 | 605 | let votingResultStakedIntegralLast = valueOrElse(getInteger(this, votingResultStakedIntegralKey), 0) | |
604 | 606 | let userVoteStakedIntegralDh = (height - userVoteStakedLastUpdateHeight) | |
605 | 607 | let votingResultStakedIntegralDh = (height - votingResultStakedLastUpdateHeight) | |
606 | 608 | let userVoteStakedIntegral = ((userVoteStakedIntegralDh * userVoteStaked) + userVoteStakedIntegralPrev) | |
607 | 609 | let votingResultStakedIntegral = ((votingResultStakedIntegralDh * votingResultStaked) + votingResultStakedIntegralPrev) | |
608 | 610 | let userVoteStakedIntegralDiff = (userVoteStakedIntegral - userVoteStakedIntegralLast) | |
609 | 611 | let votingResultStakedIntegralDiff = (votingResultStakedIntegral - votingResultStakedIntegralLast) | |
610 | 612 | $Tuple3([IntegerEntry(userVoteStakedIntegralKey, userVoteStakedIntegral), IntegerEntry(votingResultStakedIntegralKey, votingResultStakedIntegral)], userVoteStakedIntegralDiff, votingResultStakedIntegralDiff) | |
611 | 613 | } | |
612 | 614 | ||
613 | 615 | ||
614 | 616 | func refreshBoostEmissionIntegral () = { | |
615 | 617 | let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent()) | |
616 | 618 | let boostingV2LastUpdateHeightOption = getInteger(emissionContract, keyBoostingV2LastUpdateHeight()) | |
617 | 619 | let boostingV2IngergalOption = getInteger(this, keyBoostingV2Integral()) | |
618 | 620 | let emissionEnd = iof(emissionContract, keyEmissionEndBlock()) | |
619 | 621 | let h = if ((height > emissionEnd)) | |
620 | 622 | then emissionEnd | |
621 | 623 | else height | |
622 | 624 | let dh = match boostingV2LastUpdateHeightOption { | |
623 | 625 | case lastUpdateHeight: Int => | |
624 | 626 | max([(h - lastUpdateHeight), 0]) | |
625 | 627 | case _: Unit => | |
626 | 628 | 0 | |
627 | 629 | case _ => | |
628 | 630 | throw("Match error") | |
629 | 631 | } | |
630 | 632 | let boostEmissionPerBlock = ((wxEmissionPerBlock * (boostCoeff - 1)) / boostCoeff) | |
631 | 633 | let boostEmissionIntegralPrev = valueOrElse(boostingV2IngergalOption, 0) | |
632 | 634 | let boostEmissionIntegral = ((boostEmissionPerBlock * dh) + boostEmissionIntegralPrev) | |
633 | 635 | $Tuple2([IntegerEntry(keyBoostingV2Integral(), boostEmissionIntegral), IntegerEntry(keyBoostingV2LastUpdateHeight(), height)], boostEmissionIntegral) | |
634 | 636 | } | |
635 | 637 | ||
636 | 638 | ||
637 | 639 | func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = { | |
638 | 640 | let userRecordOption = getString(this, keyLockParamsRecord(userAddressStr)) | |
639 | 641 | if ((userRecordOption == unit)) | |
640 | 642 | then $Tuple3(0, nil, "userRecord::is::empty") | |
641 | 643 | else { | |
642 | 644 | let userRecordArray = split(value(userRecordOption), SEP) | |
643 | 645 | let userNumStr = userRecordArray[IdxLockUserNum] | |
644 | 646 | let EMPTYSTR = "empty" | |
645 | 647 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
646 | 648 | then { | |
647 | 649 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
648 | 650 | getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
649 | 651 | } | |
650 | 652 | else if (readOnly) | |
651 | 653 | then 0 | |
652 | 654 | else throw(("not readonly mode: unsupported lp asset " + lpAssetIdStr)) | |
653 | 655 | let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNumStr, lpAssetIdStr) | |
654 | 656 | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
655 | 657 | let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), ioz(this, userBoostEmissionLastIntegralKEY)) | |
656 | 658 | let boostEmissionIntegral = refreshBoostEmissionIntegral()._2 | |
657 | 659 | let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral) | |
658 | 660 | if ((0 > userBoostEmissionIntegral)) | |
659 | 661 | then throw("wrong calculations") | |
660 | 662 | else { | |
661 | - | let $ | |
662 | - | let stakedVotesIntegralsActions = $ | |
663 | - | let userVoteIntegralDiff = $ | |
664 | - | let totalVotesIntegralDiff = $ | |
663 | + | let $t02716327302 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr) | |
664 | + | let stakedVotesIntegralsActions = $t02716327302._1 | |
665 | + | let userVoteIntegralDiff = $t02716327302._2 | |
666 | + | let totalVotesIntegralDiff = $t02716327302._3 | |
665 | 667 | let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT) | |
666 | 668 | let userBoostAvaliableToClaimTotalNew = if ((totalVotesIntegralDiff == 0)) | |
667 | 669 | then 0 | |
668 | 670 | else fraction(poolUserBoostEmissionIntegral, userVoteIntegralDiff, totalVotesIntegralDiff) | |
669 | 671 | let dataState = ([IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)] ++ stakedVotesIntegralsActions) | |
670 | 672 | let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(poolWeight), toString(userVoteIntegralDiff), toString(totalVotesIntegralDiff)], ":") | |
671 | 673 | $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug) | |
672 | 674 | } | |
673 | 675 | } | |
674 | 676 | } | |
675 | 677 | ||
676 | 678 | ||
677 | 679 | func lockActions (i,duration) = { | |
678 | 680 | let cfgArray = readConfigArrayOrFail() | |
679 | 681 | let assetIdStr = cfgArray[IdxCfgAssetId] | |
680 | 682 | let assetId = fromBase58String(assetIdStr) | |
681 | 683 | let minLockAmount = parseIntValue(cfgArray[IdxCfgMinLockAmount]) | |
682 | 684 | let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration]) | |
683 | 685 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
684 | 686 | if ((size(i.payments) != 1)) | |
685 | 687 | then throw("invalid payment - exact one payment must be attached") | |
686 | 688 | else { | |
687 | 689 | let pmt = i.payments[0] | |
688 | 690 | let pmtAmount = pmt.amount | |
689 | 691 | if ((assetId != value(pmt.assetId))) | |
690 | 692 | then throw((("invalid asset is in payment - " + assetIdStr) + " is expected")) | |
691 | 693 | else { | |
692 | 694 | let nextUserNumKEY = keyNextUserNum() | |
693 | 695 | let userAddressStr = toString(i.caller) | |
694 | 696 | let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr))) | |
695 | 697 | let userNumStr = if (userIsExisting) | |
696 | 698 | then value(getString(keyUser2NumMapping(userAddressStr))) | |
697 | 699 | else toString(iof(this, nextUserNumKEY)) | |
698 | 700 | let userNum = parseIntValue(userNumStr) | |
699 | 701 | let lockStart = height | |
700 | 702 | let startBlockKEY = keyLockParamStartBlock(userNumStr) | |
701 | 703 | let durationKEY = keyLockParamDuration(userNumStr) | |
702 | 704 | let userAmountKEY = keyLockParamUserAmount(userNumStr) | |
703 | 705 | if (if ((minLockAmount > pmtAmount)) | |
704 | 706 | then (i.caller != lpStakingPoolsContract) | |
705 | 707 | else false) | |
706 | 708 | then throw(("amount is less then minLockAmount=" + toString(minLockAmount))) | |
707 | 709 | else if ((minLockDuration > duration)) | |
708 | 710 | then throw(("passed duration is less then minLockDuration=" + toString(minLockDuration))) | |
709 | 711 | else if ((duration > maxLockDuration)) | |
710 | 712 | then throw(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration))) | |
711 | 713 | else if (if (userIsExisting) | |
712 | 714 | then ((iof(this, startBlockKEY) + iof(this, durationKEY)) >= lockStart) | |
713 | 715 | else false) | |
714 | 716 | then throw("there is an active lock - consider to use increaseLock") | |
715 | 717 | else if ((ioz(this, userAmountKEY) > 0)) | |
716 | 718 | then throw(("there are locked WXs - consider to use increaseLock " + userAmountKEY)) | |
717 | 719 | else { | |
718 | 720 | let coeffX8 = fraction(duration, MULT8, maxLockDuration) | |
719 | 721 | let gWxAmountStart = fraction(pmtAmount, coeffX8, MULT8) | |
720 | 722 | let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStart, duration], nil)) | |
721 | 723 | let k = ai(gWxParamsResultList[0]) | |
722 | 724 | let b = ai(gWxParamsResultList[1]) | |
723 | 725 | let period = toString(ai(gWxParamsResultList[2])) | |
724 | 726 | let totalCachedGwxRaw = getTotalCachedGwx(false) | |
725 | 727 | let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr) | |
726 | 728 | let boostEmissionIntegral = refreshBoostEmissionIntegral()._2 | |
727 | 729 | let arr = if (userIsExisting) | |
728 | 730 | then nil | |
729 | 731 | else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)] | |
730 | 732 | $Tuple2(((((arr ++ LockParamsEntry(userAddressStr, userNumStr, pmtAmount, lockStart, duration, k, b, period)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting) | |
731 | 733 | then 0 | |
732 | 734 | else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, k, b, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(keyTotalCachedGwx(), (totalCachedGwxRaw + gWxAmountStart))]), gWxAmountStart) | |
733 | 735 | } | |
734 | 736 | } | |
735 | 737 | } | |
736 | 738 | } | |
737 | 739 | ||
738 | 740 | ||
739 | 741 | @Callable(i) | |
740 | 742 | func constructor (factoryAddressStr,lockAssetIdStr,minLockAmount,minDuration,maxDuration,mathContract) = { | |
741 | 743 | let checkCaller = mustManager(i) | |
742 | 744 | if ((checkCaller == checkCaller)) | |
743 | 745 | then ([IntegerEntry(keyNextUserNum(), 0), StringEntry(keyConfig(), formatConfig(lockAssetIdStr, minLockAmount, minDuration, maxDuration, mathContract)), StringEntry(keyFactoryAddress(), factoryAddressStr)] ++ StatsEntry(0, 0, 0, 0)) | |
744 | 746 | else throw("Strict value is not equal to itself.") | |
745 | 747 | } | |
746 | 748 | ||
747 | 749 | ||
748 | 750 | ||
749 | 751 | @Callable(i) | |
750 | 752 | func lockRef (duration,referrerAddress,signature) = { | |
751 | - | let $ | |
752 | - | let lockActionsResult = $ | |
753 | - | let gWxAmountStart = $ | |
753 | + | let $t03189231957 = lockActions(i, duration) | |
754 | + | let lockActionsResult = $t03189231957._1 | |
755 | + | let gWxAmountStart = $t03189231957._2 | |
754 | 756 | let referralAddress = toString(i.caller) | |
755 | 757 | let refInv = if (if ((referrerAddress == "")) | |
756 | 758 | then true | |
757 | 759 | else (signature == base58'')) | |
758 | 760 | then unit | |
759 | 761 | else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil) | |
760 | 762 | if ((refInv == refInv)) | |
761 | 763 | then { | |
762 | 764 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
763 | 765 | if ((updateRefActivity == updateRefActivity)) | |
764 | 766 | then $Tuple2(lockActionsResult, unit) | |
765 | 767 | else throw("Strict value is not equal to itself.") | |
766 | 768 | } | |
767 | 769 | else throw("Strict value is not equal to itself.") | |
768 | 770 | } | |
769 | 771 | ||
770 | 772 | ||
771 | 773 | ||
772 | 774 | @Callable(i) | |
773 | 775 | func lock (duration) = { | |
774 | - | let $ | |
775 | - | let lockActionsResult = $ | |
776 | - | let gWxAmountStart = $ | |
776 | + | let $t03241532480 = lockActions(i, duration) | |
777 | + | let lockActionsResult = $t03241532480._1 | |
778 | + | let gWxAmountStart = $t03241532480._2 | |
777 | 779 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
778 | 780 | if ((updateRefActivity == updateRefActivity)) | |
779 | 781 | then $Tuple2(lockActionsResult, unit) | |
780 | 782 | else throw("Strict value is not equal to itself.") | |
781 | 783 | } | |
782 | 784 | ||
783 | 785 | ||
784 | 786 | ||
785 | 787 | @Callable(i) | |
786 | 788 | func increaseLock (deltaDuration) = { | |
787 | 789 | let cfgArray = readConfigArrayOrFail() | |
788 | 790 | let assetIdStr = cfgArray[IdxCfgAssetId] | |
789 | 791 | let assetId = fromBase58String(assetIdStr) | |
790 | 792 | let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration]) | |
791 | 793 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
792 | 794 | let pmtAmount = extractOptionalPaymentAmountOrFail(i, assetId) | |
793 | 795 | let userAddressStr = toString(i.caller) | |
794 | 796 | let userRecordArray = readLockParamsRecordOrFail(userAddressStr) | |
795 | 797 | let userNumStr = userRecordArray[IdxLockUserNum] | |
796 | 798 | let userAmount = parseIntValue(userRecordArray[IdxLockAmount]) | |
797 | 799 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
798 | 800 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) | |
799 | 801 | let lockEnd = (lockStart + lockDuration) | |
800 | 802 | let remainingDuration = max([(lockEnd - height), 0]) | |
801 | 803 | let userAmountNew = (userAmount + pmtAmount) | |
802 | 804 | let lockDurationNew = (remainingDuration + deltaDuration) | |
803 | 805 | if ((0 > deltaDuration)) | |
804 | 806 | then throw("duration is less then zero") | |
805 | 807 | else if ((minLockDuration > lockDurationNew)) | |
806 | 808 | then throw(("lockDurationNew is less then minLockDuration=" + toString(minLockDuration))) | |
807 | 809 | else if ((lockDurationNew > maxLockDuration)) | |
808 | 810 | then throw(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(maxLockDuration))) | |
809 | 811 | else { | |
810 | 812 | let coeffX8 = fraction(lockDurationNew, MULT8, maxLockDuration) | |
811 | 813 | let gWxAmountStart = fraction(userAmountNew, coeffX8, MULT8) | |
812 | 814 | let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil) | |
813 | 815 | if ((updateRefActivity == updateRefActivity)) | |
814 | 816 | then { | |
815 | 817 | let lockStartNew = height | |
816 | 818 | let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStartNew, lockDurationNew], nil)) | |
817 | 819 | let k = ai(gWxParamsResultList[0]) | |
818 | 820 | let b = ai(gWxParamsResultList[1]) | |
819 | 821 | let period = toString(ai(gWxParamsResultList[2])) | |
820 | 822 | let currUserGwx = calcCurrentGwxAmount(userAddressStr) | |
821 | 823 | let gwxDiff = (gWxAmountStart - currUserGwx) | |
822 | 824 | if ((0 > gwxDiff)) | |
823 | 825 | then throw(("gwxDiff is less then 0: " + toString(gwxDiff))) | |
824 | 826 | else { | |
825 | 827 | let totalCachedGwxRaw = getTotalCachedGwx(false) | |
826 | 828 | let totalCachedGwxCorrected = getTotalCachedGwx(true) | |
827 | 829 | (((LockParamsEntry(userAddressStr, userNumStr, userAmountNew, lockStartNew, lockDurationNew, k, b, period) ++ StatsEntry(pmtAmount, deltaDuration, 0, 0)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, lockDurationNew, k, b, i)) ++ [IntegerEntry(keyTotalCachedGwx(), (totalCachedGwxRaw + gwxDiff))]) | |
828 | 830 | } | |
829 | 831 | } | |
830 | 832 | else throw("Strict value is not equal to itself.") | |
831 | 833 | } | |
832 | 834 | } | |
833 | 835 | ||
834 | 836 | ||
835 | 837 | ||
836 | 838 | @Callable(i) | |
837 | 839 | func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller)) | |
838 | 840 | then throw("permissions denied") | |
839 | 841 | else { | |
840 | - | let $ | |
841 | - | let userBoostAvailable = $ | |
842 | - | let dataState = $ | |
843 | - | let debug = $ | |
842 | + | let $t03556735669 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false) | |
843 | + | let userBoostAvailable = $t03556735669._1 | |
844 | + | let dataState = $t03556735669._2 | |
845 | + | let debug = $t03556735669._3 | |
844 | 846 | $Tuple2(dataState, [userBoostAvailable]) | |
845 | 847 | } | |
846 | 848 | ||
847 | 849 | ||
848 | 850 | ||
849 | 851 | @Callable(i) | |
850 | 852 | func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = { | |
851 | - | let $ | |
852 | - | let userBoostAvailable = $ | |
853 | - | let dataState = $ | |
854 | - | let debug = $ | |
853 | + | let $t03580135902 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true) | |
854 | + | let userBoostAvailable = $t03580135902._1 | |
855 | + | let dataState = $t03580135902._2 | |
856 | + | let debug = $t03580135902._3 | |
855 | 857 | $Tuple2(nil, [userBoostAvailable, debug]) | |
856 | 858 | } | |
857 | 859 | ||
858 | 860 | ||
859 | 861 | ||
860 | 862 | @Callable(i) | |
861 | 863 | func unlock (userAddress) = { | |
862 | 864 | let userRecordArray = readLockParamsRecordOrFail(userAddress) | |
863 | 865 | let userNumStr = userRecordArray[IdxLockUserNum] | |
864 | 866 | let userAmount = parseIntValue(userRecordArray[IdxLockAmount]) | |
865 | 867 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
866 | 868 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) | |
867 | 869 | let lockEnd = (lockStart + lockDuration) | |
868 | 870 | let cfgArray = readConfigArrayOrFail() | |
869 | 871 | let assetId = fromBase58String(cfgArray[IdxCfgAssetId]) | |
870 | 872 | if ((lockEnd >= height)) | |
871 | 873 | then throw((("wait " + toString(lockEnd)) + " to unlock")) | |
872 | 874 | else if ((0 >= userAmount)) | |
873 | 875 | then throw("nothing to unlock") | |
874 | 876 | else { | |
875 | 877 | let period = valueOrElse(getInteger(mathContract, keyNextPeriod()), 0) | |
876 | 878 | (((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)) | |
877 | 879 | } | |
878 | 880 | } | |
879 | 881 | ||
880 | 882 | ||
881 | 883 | ||
882 | 884 | @Callable(i) | |
883 | 885 | func gwxUserInfoREADONLY (userAddress) = { | |
884 | 886 | let gwxAmount = calcCurrentGwxAmount(userAddress) | |
885 | 887 | $Tuple2(nil, [gwxAmount]) | |
886 | 888 | } | |
887 | 889 | ||
888 | 890 | ||
889 | 891 | ||
890 | 892 | @Callable(i) | |
891 | 893 | func userMaxDurationREADONLY (userAddressStr) = { | |
892 | 894 | let cfgArray = readConfigArrayOrFail() | |
893 | 895 | let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration]) | |
894 | 896 | let userRecordOption = getString(this, keyLockParamsRecord(userAddressStr)) | |
895 | 897 | if ((userRecordOption == unit)) | |
896 | 898 | then $Tuple2(nil, $Tuple2("lock", maxLockDuration)) | |
897 | 899 | else { | |
898 | 900 | let userRecordArray = split(value(userRecordOption), SEP) | |
899 | 901 | let lockStart = parseIntValue(userRecordArray[IdxLockStart]) | |
900 | 902 | let lockDuration = parseIntValue(userRecordArray[IdxLockDuration]) | |
901 | 903 | let lockEnd = (lockStart + lockDuration) | |
902 | 904 | let remainingDuration = max([(lockEnd - height), 0]) | |
903 | 905 | let maxDeltaDuration = (maxLockDuration - remainingDuration) | |
904 | 906 | $Tuple2(nil, $Tuple2("increaseLock", maxDeltaDuration)) | |
905 | 907 | } | |
906 | 908 | } | |
907 | 909 | ||
908 | 910 | ||
909 | 911 | ||
910 | 912 | @Callable(i) | |
911 | 913 | func getUserGwxAmountAtHeightREADONLY (userAddress,targetHeight) = { | |
912 | 914 | let gwxAmount = calcUserGwxAmountAtHeight(userAddress, targetHeight) | |
913 | 915 | $Tuple2(nil, gwxAmount) | |
914 | 916 | } | |
915 | 917 | ||
916 | 918 | ||
917 | 919 | ||
918 | 920 | @Callable(i) | |
919 | 921 | func getTotalCachedGwxREADONLY () = $Tuple2(nil, getTotalCachedGwx(true)) | |
920 | 922 | ||
921 | 923 | ||
922 | 924 | ||
923 | 925 | @Callable(i) | |
924 | 926 | func onBoostEmissionUpdate () = { | |
925 | 927 | let checkCaller = if ((i.caller == emissionContract)) | |
926 | 928 | then true | |
927 | 929 | else mustManager(i) | |
928 | 930 | if ((checkCaller == checkCaller)) | |
929 | 931 | then refreshBoostEmissionIntegral() | |
930 | 932 | else throw("Strict value is not equal to itself.") | |
931 | 933 | } | |
932 | 934 | ||
933 | 935 | ||
934 | 936 | ||
935 | 937 | @Callable(i) | |
936 | 938 | func onStakedVoteUpdate (lpAssetIdStr,userAddressStr,edge) = { | |
937 | 939 | let checkCaller = if ((i.caller == stakingContract)) | |
938 | 940 | then true | |
939 | 941 | else mustManager(i) | |
940 | 942 | if ((checkCaller == checkCaller)) | |
941 | 943 | then { | |
942 | 944 | let actions = refreshVoteStakedIntegral(lpAssetIdStr, userAddressStr, edge) | |
943 | 945 | $Tuple2(actions, unit) | |
944 | 946 | } | |
945 | 947 | else throw("Strict value is not equal to itself.") | |
946 | 948 | } | |
947 | 949 | ||
948 | 950 | ||
949 | 951 | ||
950 | 952 | @Callable(i) | |
951 | 953 | func getVotingResultStakedREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStaked(lpAssetIdStr)) | |
952 | 954 | ||
953 | 955 | ||
954 | 956 | ||
955 | 957 | @Callable(i) | |
956 | 958 | func getUserVoteFinalizedREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteFinalized(lpAssetIdStr, userAddressStr)) | |
957 | 959 | ||
958 | 960 | ||
959 | 961 | ||
960 | 962 | @Callable(i) | |
961 | 963 | func setManager (pendingManagerPublicKey) = { | |
962 | 964 | let checkCaller = mustManager(i) | |
963 | 965 | if ((checkCaller == checkCaller)) | |
964 | 966 | then { | |
965 | 967 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
966 | 968 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
967 | 969 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
968 | 970 | else throw("Strict value is not equal to itself.") | |
969 | 971 | } | |
970 | 972 | else throw("Strict value is not equal to itself.") | |
971 | 973 | } | |
972 | 974 | ||
973 | 975 | ||
974 | 976 | ||
975 | 977 | @Callable(i) | |
976 | 978 | func confirmManager () = { | |
977 | 979 | let pm = pendingManagerPublicKeyOrUnit() | |
978 | 980 | let hasPM = if (isDefined(pm)) | |
979 | 981 | then true | |
980 | 982 | else throw("No pending manager") | |
981 | 983 | if ((hasPM == hasPM)) | |
982 | 984 | then { | |
983 | 985 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
984 | 986 | then true | |
985 | 987 | else throw("You are not pending manager") | |
986 | 988 | if ((checkPM == checkPM)) | |
987 | 989 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
988 | 990 | else throw("Strict value is not equal to itself.") | |
989 | 991 | } | |
990 | 992 | else throw("Strict value is not equal to itself.") | |
991 | 993 | } | |
992 | 994 | ||
993 | 995 | ||
994 | 996 | @Verifier(tx) | |
995 | 997 | func verify () = { | |
996 | 998 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
997 | 999 | case pk: ByteVector => | |
998 | 1000 | pk | |
999 | 1001 | case _: Unit => | |
1000 | 1002 | tx.senderPublicKey | |
1001 | 1003 | case _ => | |
1002 | 1004 | throw("Match error") | |
1003 | 1005 | } | |
1004 | 1006 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1005 | 1007 | } | |
1006 | 1008 |
github/deemru/w8io/026f985 150.67 ms ◑