tx · 46dKdHSxZHcrD88CEobzHgCg2WYXTWUBMCFM8K2CwZxi 3MzYrKxGR6BZcwdHQDDXDRGn7c63zQsqyu3: -0.03400000 Waves 2023.07.19 14:44 [2672693] smart account 3MzYrKxGR6BZcwdHQDDXDRGn7c63zQsqyu3 > SELF 0.00000000 Waves
{ "type": 13, "id": "46dKdHSxZHcrD88CEobzHgCg2WYXTWUBMCFM8K2CwZxi", "fee": 3400000, "feeAssetId": null, "timestamp": 1689767064016, "version": 2, "chainId": 84, "sender": "3MzYrKxGR6BZcwdHQDDXDRGn7c63zQsqyu3", "senderPublicKey": "7GvzKupc5EwAeuw6BXayiGswG3LEmw6artCvXaZzaGKp", "proofs": [ "3TCwYZgLBbYm6tJ2TnjFzkjai8eAmjJGHbeQ6wmKRd8kKeQRhckJegeb1rv7C4SHAKP2WoJ51RXdfp9YaakULoDB" ], "script": "base64:BgJcCAISAwoBCBIDCgEIEgASAwoBCBIECgIIARIGCgQCAQICEgMKAQgSAwoBCBIFCgMICAQSBgoEARgIGBIECgIYCBIECgIICBIECgIICBIDCgEIEgMKAQgSBAoCCAhkAAZTQ0FMRTgACAAFTVVMVDMA6AcABU1VTFQ4AIDC1y8AB1NDQUxFMTgAEgAGTVVMVDE4CQC2AgEAgICQu7rWrfANAANTRVACAl9fAA5QT09MV0VJR0hUTVVMVAUFTVVMVDgACnplcm9CaWdJbnQJALYCAQAAAAlvbmVCaWdJbnQJALYCAQABAQd3cmFwRXJyAQNtc2cJALkJAgkAzAgCAg1zdGFraW5nLnJpZGU6CQDMCAIJAKUIAQUEdGhpcwkAzAgCBQNtc2cFA25pbAIBIAEIdGhyb3dFcnIBA21zZwkAAgEJAQd3cmFwRXJyAQUDbXNnAQlhc0FueUxpc3QBA3ZhbAQHJG1hdGNoMAUDdmFsAwkAAQIFByRtYXRjaDACCUxpc3RbQW55XQQKdmFsQW55THlzdAUHJG1hdGNoMAUKdmFsQW55THlzdAkBCHRocm93RXJyAQIbZmFpbCB0byBjYXN0I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Jlc3NTdHIDCQECIT0CCAUBaQZjYWxsZXIFD2ZhY3RvcnlDb250cmFjdAkBCHRocm93RXJyAQIScGVybWlzc2lvbnMgZGVuaWVkBA0kdDAzMzA0OTMzMTU5CQEUcmVmcmVzaFBvb2xJTlRFR1JBTFMDBQxscEFzc2V0SWRTdHIFDnBvb2xBZGRyZXNzU3RyAAAEEnd4UGVyTHBJbnRlZ3JhbE5ldwgFDSR0MDMzMDQ5MzMxNTkCXzEEEXBvb2xJbnRlZ3JhbFNUQVRFCAUNJHQwMzMwNDkzMzE1OQJfMgQJcG9vbERFQlVHCAUNJHQwMzMwNDkzMzE1OQJfMwURcG9vbEludGVncmFsU1RBVEUBAnR4AQZ2ZXJpZnkABA90YXJnZXRQdWJsaWNLZXkEByRtYXRjaDAJARZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAJwawUHJG1hdGNoMAUCcGsDCQABAgUHJG1hdGNoMAIEVW5pdAgFAnR4D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQ90YXJnZXRQdWJsaWNLZXn8CEgf", "height": 2672693, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GREoUiztZu1cjmLjvssmYUBdRkwga58j37QTkEQdByUJ Next: none Diff:
Old | New | Differences | |
---|---|---|---|
117 | 117 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
118 | 118 | ||
119 | 119 | ||
120 | - | func | |
120 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
148 | + | ||
149 | + | ||
150 | + | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
151 | + | case s: String => | |
152 | + | addressFromStringValue(s) | |
153 | + | case _ => | |
154 | + | this | |
155 | + | } | |
148 | 156 | ||
149 | 157 | ||
150 | 158 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
359 | 367 | ||
360 | 368 | ||
361 | 369 | func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = { | |
362 | - | let $ | |
363 | - | let wxPerLpIntegralNew = $ | |
364 | - | let poolIntegralSTATE = $ | |
365 | - | let poolDEBUG = $ | |
370 | + | let $t01487514997 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount) | |
371 | + | let wxPerLpIntegralNew = $t01487514997._1 | |
372 | + | let poolIntegralSTATE = $t01487514997._2 | |
373 | + | let poolDEBUG = $t01487514997._3 | |
366 | 374 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
367 | 375 | let stakedByUser = readStaked(stakedByUserKEY) | |
368 | 376 | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
380 | 388 | } | |
381 | 389 | ||
382 | 390 | ||
383 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
384 | - | case s: String => | |
385 | - | fromBase58String(s) | |
386 | - | case _: Unit => | |
387 | - | unit | |
388 | - | case _ => | |
389 | - | throw("Match error") | |
390 | - | } | |
391 | - | ||
392 | - | ||
393 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
394 | - | case s: String => | |
395 | - | fromBase58String(s) | |
396 | - | case _: Unit => | |
397 | - | unit | |
398 | - | case _ => | |
399 | - | throw("Match error") | |
400 | - | } | |
391 | + | func managerPublicKeyOrUnit () = { | |
392 | + | let managerVaultAddress = getManagerVaultAddressOrThis() | |
393 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
394 | + | case s: String => | |
395 | + | fromBase58String(s) | |
396 | + | case _: Unit => | |
397 | + | unit | |
398 | + | case _ => | |
399 | + | throw("Match error") | |
400 | + | } | |
401 | + | } | |
401 | 402 | ||
402 | 403 | ||
403 | 404 | let permissionDeniedError = throwErr("Permission denied") | |
421 | 422 | } | |
422 | 423 | ||
423 | 424 | ||
425 | + | func ensureVotingEmissionIsFinalized () = { | |
426 | + | let votingEmissionContract = addressFromStringValue(getStringValue(this, keyVotingEmissionContract())) | |
427 | + | let votingEmissionFinalizationInProgress = { | |
428 | + | let @ = invoke(votingEmissionContract, "isFinalizationInProgress", nil, nil) | |
429 | + | if ($isInstanceOf(@, "Boolean")) | |
430 | + | then @ | |
431 | + | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
432 | + | } | |
433 | + | if (!(votingEmissionFinalizationInProgress)) | |
434 | + | then true | |
435 | + | else throwErr("voting emission should be finalized") | |
436 | + | } | |
437 | + | ||
438 | + | ||
424 | 439 | func stakeActions (i,lpAssetId,poolAddress,userAddress,amount) = { | |
425 | - | let userAddressStr = toString(userAddress) | |
426 | - | let lpAssetIdStr = toBase58String(lpAssetId) | |
427 | - | let poolAddressStr = toString(poolAddress) | |
428 | - | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
429 | - | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
430 | - | let stakedByUser = readStaked(stakedByUserKEY) | |
431 | - | let refreshStakedVote = if ((stakedByUser == 0)) | |
432 | - | then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil) | |
433 | - | else unit | |
434 | - | if ((refreshStakedVote == refreshStakedVote)) | |
440 | + | let checkVotingEmissionFinalization = ensureVotingEmissionIsFinalized() | |
441 | + | if ((checkVotingEmissionFinalization == checkVotingEmissionFinalization)) | |
435 | 442 | then { | |
436 | - | let stakedTotal = readStaked(stakedTotalKEY) | |
437 | - | let $t01806418181 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
438 | - | let wxToClaimUserNew = $t01806418181._1 | |
439 | - | let integralSTATE = $t01806418181._2 | |
440 | - | let debug = $t01806418181._3 | |
441 | - | let listName = getUsersListName(lpAssetIdStr) | |
442 | - | let listActions = if (containsNode(listName, userAddressStr)) | |
443 | - | then nil | |
444 | - | else insertNodeActions(listName, userAddressStr) | |
445 | - | (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
443 | + | let userAddressStr = toString(userAddress) | |
444 | + | let lpAssetIdStr = toBase58String(lpAssetId) | |
445 | + | let poolAddressStr = toString(poolAddress) | |
446 | + | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
447 | + | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
448 | + | let stakedByUser = readStaked(stakedByUserKEY) | |
449 | + | let refreshStakedVote = if ((stakedByUser == 0)) | |
450 | + | then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil) | |
451 | + | else unit | |
452 | + | if ((refreshStakedVote == refreshStakedVote)) | |
453 | + | then { | |
454 | + | let stakedTotal = readStaked(stakedTotalKEY) | |
455 | + | let $t01859918716 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
456 | + | let wxToClaimUserNew = $t01859918716._1 | |
457 | + | let integralSTATE = $t01859918716._2 | |
458 | + | let debug = $t01859918716._3 | |
459 | + | let listName = getUsersListName(lpAssetIdStr) | |
460 | + | let listActions = if (containsNode(listName, userAddressStr)) | |
461 | + | then nil | |
462 | + | else insertNodeActions(listName, userAddressStr) | |
463 | + | (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
464 | + | } | |
465 | + | else throw("Strict value is not equal to itself.") | |
446 | 466 | } | |
447 | 467 | else throw("Strict value is not equal to itself.") | |
448 | 468 | } | |
449 | 469 | ||
450 | 470 | ||
451 | 471 | func unstakeActions (i,lpAssetId,poolAddress,userAddress,lpAssetRecipientAddress,amount) = { | |
452 | - | let userAddressStr = toString(userAddress) | |
453 | - | let lpAssetIdStr = toBase58String(lpAssetId) | |
454 | - | let poolAddressStr = toString(poolAddress) | |
455 | - | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
456 | - | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
457 | - | let stakedByUser = readStaked(stakedByUserKEY) | |
458 | - | let stakedTotal = readStaked(stakedTotalKEY) | |
459 | - | let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2 | |
460 | - | let listName = getUsersListName(lpAssetIdStr) | |
461 | - | let listActions = if (if (containsNode(listName, userAddressStr)) | |
462 | - | then (amount == stakedByUser) | |
463 | - | else false) | |
464 | - | then deleteNodeActions(listName, userAddressStr) | |
465 | - | else nil | |
466 | - | let refreshStakedVote = if ((amount == stakedByUser)) | |
467 | - | then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil) | |
468 | - | else unit | |
469 | - | if ((refreshStakedVote == refreshStakedVote)) | |
472 | + | let checkVotingEmissionFinalization = ensureVotingEmissionIsFinalized() | |
473 | + | if ((checkVotingEmissionFinalization == checkVotingEmissionFinalization)) | |
470 | 474 | then { | |
471 | - | let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)) | |
472 | - | let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1 | |
473 | - | let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward) | |
474 | - | let throwIfNothingToClaim = true | |
475 | - | let r = if ((availableToClaim > zeroBigInt)) | |
476 | - | then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil) | |
475 | + | let userAddressStr = toString(userAddress) | |
476 | + | let lpAssetIdStr = toBase58String(lpAssetId) | |
477 | + | let poolAddressStr = toString(poolAddress) | |
478 | + | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
479 | + | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
480 | + | let stakedByUser = readStaked(stakedByUserKEY) | |
481 | + | let stakedTotal = readStaked(stakedTotalKEY) | |
482 | + | let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2 | |
483 | + | let listName = getUsersListName(lpAssetIdStr) | |
484 | + | let listActions = if (if (containsNode(listName, userAddressStr)) | |
485 | + | then (amount == stakedByUser) | |
486 | + | else false) | |
487 | + | then deleteNodeActions(listName, userAddressStr) | |
488 | + | else nil | |
489 | + | let refreshStakedVote = if ((amount == stakedByUser)) | |
490 | + | then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil) | |
477 | 491 | else unit | |
478 | - | if ((r == r)) | |
479 | - | then if ((amount > stakedByUser)) | |
480 | - | then throwErr(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY)) | |
481 | - | else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
492 | + | if ((refreshStakedVote == refreshStakedVote)) | |
493 | + | then { | |
494 | + | let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)) | |
495 | + | let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1 | |
496 | + | let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward) | |
497 | + | let throwIfNothingToClaim = true | |
498 | + | let r = if ((availableToClaim > zeroBigInt)) | |
499 | + | then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil) | |
500 | + | else unit | |
501 | + | if ((r == r)) | |
502 | + | then if ((amount > stakedByUser)) | |
503 | + | then throwErr(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY)) | |
504 | + | else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
505 | + | else throw("Strict value is not equal to itself.") | |
506 | + | } | |
482 | 507 | else throw("Strict value is not equal to itself.") | |
483 | 508 | } | |
484 | 509 | else throw("Strict value is not equal to itself.") | |
502 | 527 | else "invalid voting emission contract address"] | |
503 | 528 | if ((cheks == cheks)) | |
504 | 529 | then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)] | |
505 | - | else throw("Strict value is not equal to itself.") | |
506 | - | } | |
507 | - | ||
508 | - | ||
509 | - | ||
510 | - | @Callable(i) | |
511 | - | func setManager (pendingManagerPublicKey) = { | |
512 | - | let checkCaller = mustManager(i) | |
513 | - | if ((checkCaller == checkCaller)) | |
514 | - | then { | |
515 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
516 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
517 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
518 | - | else throw("Strict value is not equal to itself.") | |
519 | - | } | |
520 | - | else throw("Strict value is not equal to itself.") | |
521 | - | } | |
522 | - | ||
523 | - | ||
524 | - | ||
525 | - | @Callable(i) | |
526 | - | func confirmManager () = { | |
527 | - | let pm = pendingManagerPublicKeyOrUnit() | |
528 | - | let hasPM = if (isDefined(pm)) | |
529 | - | then true | |
530 | - | else throwErr("No pending manager") | |
531 | - | if ((hasPM == hasPM)) | |
532 | - | then { | |
533 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
534 | - | then true | |
535 | - | else throwErr("You are not pending manager") | |
536 | - | if ((checkPM == checkPM)) | |
537 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
538 | - | else throw("Strict value is not equal to itself.") | |
539 | - | } | |
540 | 530 | else throw("Strict value is not equal to itself.") | |
541 | 531 | } | |
542 | 532 | ||
640 | 630 | let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY) | |
641 | 631 | let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY) | |
642 | 632 | let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY) | |
643 | - | let $ | |
644 | - | let wxToClaimUserNew = $ | |
645 | - | let integralSTATE = $ | |
646 | - | let debug = $ | |
633 | + | let $t02598426096 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
634 | + | let wxToClaimUserNew = $t02598426096._1 | |
635 | + | let integralSTATE = $t02598426096._2 | |
636 | + | let debug = $t02598426096._3 | |
647 | 637 | let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt]) | |
648 | 638 | if ((zeroBigInt >= availableToClaim)) | |
649 | 639 | then if (throwIfNothingToClaim) | |
732 | 722 | else (height - emissionStartBlock) | |
733 | 723 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
734 | 724 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
735 | - | let $ | |
736 | - | let wxToClaimUserNew = $ | |
737 | - | let integralSTATE = $ | |
738 | - | let debug = $ | |
725 | + | let $t03014730259 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
726 | + | let wxToClaimUserNew = $t03014730259._1 | |
727 | + | let integralSTATE = $t03014730259._2 | |
728 | + | let debug = $t03014730259._3 | |
739 | 729 | let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt]) | |
740 | 730 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
741 | 731 | let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0]) | |
819 | 809 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
820 | 810 | then throwErr("permissions denied") | |
821 | 811 | else { | |
822 | - | let $ | |
823 | - | let wxPerLpIntegralNew = $ | |
824 | - | let poolIntegralSTATE = $ | |
825 | - | let poolDEBUG = $ | |
812 | + | let $t03304933159 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
813 | + | let wxPerLpIntegralNew = $t03304933159._1 | |
814 | + | let poolIntegralSTATE = $t03304933159._2 | |
815 | + | let poolDEBUG = $t03304933159._3 | |
826 | 816 | poolIntegralSTATE | |
827 | 817 | } | |
828 | 818 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SCALE8 = 8 | |
5 | 5 | ||
6 | 6 | let MULT3 = 1000 | |
7 | 7 | ||
8 | 8 | let MULT8 = 100000000 | |
9 | 9 | ||
10 | 10 | let SCALE18 = 18 | |
11 | 11 | ||
12 | 12 | let MULT18 = toBigInt(1000000000000000000) | |
13 | 13 | ||
14 | 14 | let SEP = "__" | |
15 | 15 | ||
16 | 16 | let POOLWEIGHTMULT = MULT8 | |
17 | 17 | ||
18 | 18 | let zeroBigInt = toBigInt(0) | |
19 | 19 | ||
20 | 20 | let oneBigInt = toBigInt(1) | |
21 | 21 | ||
22 | 22 | func wrapErr (msg) = makeString(["staking.ride:", toString(this), msg], " ") | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func throwErr (msg) = throw(wrapErr(msg)) | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func asAnyList (val) = match val { | |
29 | 29 | case valAnyLyst: List[Any] => | |
30 | 30 | valAnyLyst | |
31 | 31 | case _ => | |
32 | 32 | throwErr("fail to cast into List[Any]") | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func asInt (val) = match val { | |
37 | 37 | case valInt: Int => | |
38 | 38 | valInt | |
39 | 39 | case _ => | |
40 | 40 | throwErr("fail to cast into Int") | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func asString (val) = match val { | |
45 | 45 | case valStr: String => | |
46 | 46 | valStr | |
47 | 47 | case _ => | |
48 | 48 | throwErr("fail to cast into Int") | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func asByteVector (val) = match val { | |
53 | 53 | case valBin: ByteVector => | |
54 | 54 | valBin | |
55 | 55 | case _ => | |
56 | 56 | throwErr("fail to cast into Int") | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((("mandatory this." + key) + " is not defined"))) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((((("mandatory " + toString(address)) + ".") + key) + " is not defined"))) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), wrapErr((("mandatory this." + key) + " is not defined"))) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0"))) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) { | |
79 | 79 | case s: String => | |
80 | 80 | value(parseBigInt(s)) | |
81 | 81 | case _: Unit => | |
82 | 82 | defaultVal | |
83 | 83 | case _ => | |
84 | 84 | throw("Match error") | |
85 | 85 | } | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18)) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func keyVotingEmissionContract () = "%s__votingEmissionContract" | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | let IdxFactoryCfgStakingDapp = 1 | |
101 | 101 | ||
102 | 102 | let IdxFactoryCfgBoostingDapp = 2 | |
103 | 103 | ||
104 | 104 | let IdxFactoryCfgIdoDapp = 3 | |
105 | 105 | ||
106 | 106 | let IdxFactoryCfgTeamDapp = 4 | |
107 | 107 | ||
108 | 108 | let IdxFactoryCfgEmissionDapp = 5 | |
109 | 109 | ||
110 | 110 | let IdxFactoryCfgRestDapp = 6 | |
111 | 111 | ||
112 | 112 | let IdxFactoryCfgSlippageDapp = 7 | |
113 | 113 | ||
114 | 114 | func keyFactoryCfg () = "%s__factoryConfig" | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
118 | 118 | ||
119 | 119 | ||
120 | - | func | |
120 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyFactoryLpList () = "%s__lpTokensList" | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
148 | + | ||
149 | + | ||
150 | + | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
151 | + | case s: String => | |
152 | + | addressFromStringValue(s) | |
153 | + | case _ => | |
154 | + | this | |
155 | + | } | |
148 | 156 | ||
149 | 157 | ||
150 | 158 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
151 | 159 | ||
152 | 160 | ||
153 | 161 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
154 | 162 | ||
155 | 163 | ||
156 | 164 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
157 | 165 | ||
158 | 166 | ||
159 | 167 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
160 | 168 | ||
161 | 169 | ||
162 | 170 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
163 | 171 | ||
164 | 172 | ||
165 | 173 | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP) | |
166 | 174 | ||
167 | 175 | ||
168 | 176 | func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr) | |
169 | 177 | ||
170 | 178 | ||
171 | 179 | func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP) | |
172 | 180 | ||
173 | 181 | ||
174 | 182 | func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP) | |
175 | 183 | ||
176 | 184 | ||
177 | 185 | func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP) | |
178 | 186 | ||
179 | 187 | ||
180 | 188 | func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed__total", lpAssetIdStr], SEP) | |
181 | 189 | ||
182 | 190 | ||
183 | 191 | func readStaked (key) = valueOrElse(getInteger(this, key), 0) | |
184 | 192 | ||
185 | 193 | ||
186 | 194 | func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP) | |
187 | 195 | ||
188 | 196 | ||
189 | 197 | func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP) | |
190 | 198 | ||
191 | 199 | ||
192 | 200 | func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP) | |
193 | 201 | ||
194 | 202 | ||
195 | 203 | func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP) | |
196 | 204 | ||
197 | 205 | ||
198 | 206 | func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP) | |
199 | 207 | ||
200 | 208 | ||
201 | 209 | func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP) | |
202 | 210 | ||
203 | 211 | ||
204 | 212 | func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP) | |
205 | 213 | ||
206 | 214 | ||
207 | 215 | func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP) | |
208 | 216 | ||
209 | 217 | ||
210 | 218 | func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP) | |
211 | 219 | ||
212 | 220 | ||
213 | 221 | func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP) | |
214 | 222 | ||
215 | 223 | ||
216 | 224 | func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP) | |
217 | 225 | ||
218 | 226 | ||
219 | 227 | func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP) | |
220 | 228 | ||
221 | 229 | ||
222 | 230 | func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP) | |
223 | 231 | ||
224 | 232 | ||
225 | 233 | func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP) | |
226 | 234 | ||
227 | 235 | ||
228 | 236 | func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP) | |
229 | 237 | ||
230 | 238 | ||
231 | 239 | func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount)) | |
232 | 240 | ||
233 | 241 | ||
234 | 242 | let factoryAddress = getStringOrFail(this, keyFactoryAddress()) | |
235 | 243 | ||
236 | 244 | let factoryContract = addressFromStringValue(factoryAddress) | |
237 | 245 | ||
238 | 246 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
239 | 247 | ||
240 | 248 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
241 | 249 | ||
242 | 250 | let boostingContract = getBoostingAddressOrFail(factoryCfg) | |
243 | 251 | ||
244 | 252 | let boostCoeff = { | |
245 | 253 | let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil) | |
246 | 254 | if ($isInstanceOf(@, "Int")) | |
247 | 255 | then @ | |
248 | 256 | else throw(($getType(@) + " couldn't be cast to Int")) | |
249 | 257 | } | |
250 | 258 | ||
251 | 259 | 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")) | |
252 | 260 | ||
253 | 261 | func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP) | |
254 | 262 | ||
255 | 263 | ||
256 | 264 | func getUsersListName (lpAssetId) = makeString(["users", lpAssetId], SEP) | |
257 | 265 | ||
258 | 266 | ||
259 | 267 | func keyListHead (listName) = makeString(["%s%s%s", listName, "head"], SEP) | |
260 | 268 | ||
261 | 269 | ||
262 | 270 | func keyListSize (listName) = makeString(["%s%s%s", listName, "size"], SEP) | |
263 | 271 | ||
264 | 272 | ||
265 | 273 | func keyListPrev (listName,id) = makeString(["%s%s%s%s", listName, id, "prev"], SEP) | |
266 | 274 | ||
267 | 275 | ||
268 | 276 | func keyListNext (listName,id) = makeString(["%s%s%s%s", listName, id, "next"], SEP) | |
269 | 277 | ||
270 | 278 | ||
271 | 279 | func containsNode (listName,id) = { | |
272 | 280 | let headOrUnit = getString(this, keyListHead(listName)) | |
273 | 281 | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
274 | 282 | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
275 | 283 | if (if ((id == valueOrElse(headOrUnit, ""))) | |
276 | 284 | then true | |
277 | 285 | else (prevOrUnit != unit)) | |
278 | 286 | then true | |
279 | 287 | else (nextOrUnit != unit) | |
280 | 288 | } | |
281 | 289 | ||
282 | 290 | ||
283 | 291 | func insertNodeActions (listName,id) = { | |
284 | 292 | let headOrUnit = getString(this, keyListHead(listName)) | |
285 | 293 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
286 | 294 | let checkNode = if (!(containsNode(listName, id))) | |
287 | 295 | then true | |
288 | 296 | else throwErr("Node exists") | |
289 | 297 | if ((checkNode == checkNode)) | |
290 | 298 | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit)) | |
291 | 299 | then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)] | |
292 | 300 | else nil)) ++ [StringEntry(keyListHead(listName), id)]) | |
293 | 301 | else throw("Strict value is not equal to itself.") | |
294 | 302 | } | |
295 | 303 | ||
296 | 304 | ||
297 | 305 | func deleteNodeActions (listName,id) = { | |
298 | 306 | let headOrUnit = getString(this, keyListHead(listName)) | |
299 | 307 | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
300 | 308 | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
301 | 309 | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
302 | 310 | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit)) | |
303 | 311 | then (nextOrUnit != unit) | |
304 | 312 | else false) | |
305 | 313 | then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))] | |
306 | 314 | else if ((nextOrUnit != unit)) | |
307 | 315 | then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))] | |
308 | 316 | else if ((prevOrUnit != unit)) | |
309 | 317 | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))] | |
310 | 318 | else if ((id == valueOrElse(headOrUnit, ""))) | |
311 | 319 | then [DeleteEntry(keyListHead(listName))] | |
312 | 320 | else throwErr(((("invalid node: " + listName) + ".") + id)))) | |
313 | 321 | } | |
314 | 322 | ||
315 | 323 | ||
316 | 324 | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt)) | |
317 | 325 | then (stakedByUser > zeroBigInt) | |
318 | 326 | else false) | |
319 | 327 | then zeroBigInt | |
320 | 328 | else if ((stakedByUser == zeroBigInt)) | |
321 | 329 | then wxPerLpIntegralNew | |
322 | 330 | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt)) | |
323 | 331 | then (stakedByUser > zeroBigInt) | |
324 | 332 | else false) | |
325 | 333 | then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY))) | |
326 | 334 | else throwErr("calcWxPerLpIntegralUserLast: unexpected state") | |
327 | 335 | ||
328 | 336 | ||
329 | 337 | func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = { | |
330 | 338 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
331 | 339 | let stakedTotal = toBigInt(readStaked(stakedTotalKEY)) | |
332 | 340 | let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt)) | |
333 | 341 | then oneBigInt | |
334 | 342 | else stakedTotal | |
335 | 343 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
336 | 344 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
337 | 345 | let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3) | |
338 | 346 | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff)) | |
339 | 347 | let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr) | |
340 | 348 | let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr) | |
341 | 349 | let wxPerLpKEY = keyWxPerLp(lpAssetIdStr) | |
342 | 350 | let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock) | |
343 | 351 | let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY) | |
344 | 352 | let wxPerLpOrZeroX3 = 0 | |
345 | 353 | let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0]) | |
346 | 354 | let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0)) | |
347 | 355 | then toBigInt(wxPerLpOrZeroX3) | |
348 | 356 | else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal) | |
349 | 357 | let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount)) | |
350 | 358 | let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt)) | |
351 | 359 | then oneBigInt | |
352 | 360 | else stakedTotalNew | |
353 | 361 | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh))) | |
354 | 362 | let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew) | |
355 | 363 | let wxPerLpIntegralLastUpdHeightNew = height | |
356 | 364 | let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::") | |
357 | 365 | $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug) | |
358 | 366 | } | |
359 | 367 | ||
360 | 368 | ||
361 | 369 | func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = { | |
362 | - | let $ | |
363 | - | let wxPerLpIntegralNew = $ | |
364 | - | let poolIntegralSTATE = $ | |
365 | - | let poolDEBUG = $ | |
370 | + | let $t01487514997 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount) | |
371 | + | let wxPerLpIntegralNew = $t01487514997._1 | |
372 | + | let poolIntegralSTATE = $t01487514997._2 | |
373 | + | let poolDEBUG = $t01487514997._3 | |
366 | 374 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
367 | 375 | let stakedByUser = readStaked(stakedByUserKEY) | |
368 | 376 | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
369 | 377 | let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr) | |
370 | 378 | let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr) | |
371 | 379 | let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY) | |
372 | 380 | let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY) | |
373 | 381 | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
374 | 382 | let MULT11 = (MULT8 * MULT3) | |
375 | 383 | let wxToClaimUserNew = max([(wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))), zeroBigInt]) | |
376 | 384 | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
377 | 385 | let wxPerLpIntegralUserLastUpdHeightNew = height | |
378 | 386 | let debug = makeString([toString(wxToClaimUser), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::") | |
379 | 387 | $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug) | |
380 | 388 | } | |
381 | 389 | ||
382 | 390 | ||
383 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
384 | - | case s: String => | |
385 | - | fromBase58String(s) | |
386 | - | case _: Unit => | |
387 | - | unit | |
388 | - | case _ => | |
389 | - | throw("Match error") | |
390 | - | } | |
391 | - | ||
392 | - | ||
393 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
394 | - | case s: String => | |
395 | - | fromBase58String(s) | |
396 | - | case _: Unit => | |
397 | - | unit | |
398 | - | case _ => | |
399 | - | throw("Match error") | |
400 | - | } | |
391 | + | func managerPublicKeyOrUnit () = { | |
392 | + | let managerVaultAddress = getManagerVaultAddressOrThis() | |
393 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
394 | + | case s: String => | |
395 | + | fromBase58String(s) | |
396 | + | case _: Unit => | |
397 | + | unit | |
398 | + | case _ => | |
399 | + | throw("Match error") | |
400 | + | } | |
401 | + | } | |
401 | 402 | ||
402 | 403 | ||
403 | 404 | let permissionDeniedError = throwErr("Permission denied") | |
404 | 405 | ||
405 | 406 | func mustThis (i) = if ((i.caller == this)) | |
406 | 407 | then true | |
407 | 408 | else permissionDeniedError | |
408 | 409 | ||
409 | 410 | ||
410 | 411 | func mustManager (i) = match managerPublicKeyOrUnit() { | |
411 | 412 | case pk: ByteVector => | |
412 | 413 | if ((i.callerPublicKey == pk)) | |
413 | 414 | then true | |
414 | 415 | else permissionDeniedError | |
415 | 416 | case _: Unit => | |
416 | 417 | if ((i.caller == this)) | |
417 | 418 | then true | |
418 | 419 | else permissionDeniedError | |
419 | 420 | case _ => | |
420 | 421 | throw("Match error") | |
421 | 422 | } | |
422 | 423 | ||
423 | 424 | ||
425 | + | func ensureVotingEmissionIsFinalized () = { | |
426 | + | let votingEmissionContract = addressFromStringValue(getStringValue(this, keyVotingEmissionContract())) | |
427 | + | let votingEmissionFinalizationInProgress = { | |
428 | + | let @ = invoke(votingEmissionContract, "isFinalizationInProgress", nil, nil) | |
429 | + | if ($isInstanceOf(@, "Boolean")) | |
430 | + | then @ | |
431 | + | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
432 | + | } | |
433 | + | if (!(votingEmissionFinalizationInProgress)) | |
434 | + | then true | |
435 | + | else throwErr("voting emission should be finalized") | |
436 | + | } | |
437 | + | ||
438 | + | ||
424 | 439 | func stakeActions (i,lpAssetId,poolAddress,userAddress,amount) = { | |
425 | - | let userAddressStr = toString(userAddress) | |
426 | - | let lpAssetIdStr = toBase58String(lpAssetId) | |
427 | - | let poolAddressStr = toString(poolAddress) | |
428 | - | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
429 | - | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
430 | - | let stakedByUser = readStaked(stakedByUserKEY) | |
431 | - | let refreshStakedVote = if ((stakedByUser == 0)) | |
432 | - | then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil) | |
433 | - | else unit | |
434 | - | if ((refreshStakedVote == refreshStakedVote)) | |
440 | + | let checkVotingEmissionFinalization = ensureVotingEmissionIsFinalized() | |
441 | + | if ((checkVotingEmissionFinalization == checkVotingEmissionFinalization)) | |
435 | 442 | then { | |
436 | - | let stakedTotal = readStaked(stakedTotalKEY) | |
437 | - | let $t01806418181 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
438 | - | let wxToClaimUserNew = $t01806418181._1 | |
439 | - | let integralSTATE = $t01806418181._2 | |
440 | - | let debug = $t01806418181._3 | |
441 | - | let listName = getUsersListName(lpAssetIdStr) | |
442 | - | let listActions = if (containsNode(listName, userAddressStr)) | |
443 | - | then nil | |
444 | - | else insertNodeActions(listName, userAddressStr) | |
445 | - | (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
443 | + | let userAddressStr = toString(userAddress) | |
444 | + | let lpAssetIdStr = toBase58String(lpAssetId) | |
445 | + | let poolAddressStr = toString(poolAddress) | |
446 | + | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
447 | + | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
448 | + | let stakedByUser = readStaked(stakedByUserKEY) | |
449 | + | let refreshStakedVote = if ((stakedByUser == 0)) | |
450 | + | then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil) | |
451 | + | else unit | |
452 | + | if ((refreshStakedVote == refreshStakedVote)) | |
453 | + | then { | |
454 | + | let stakedTotal = readStaked(stakedTotalKEY) | |
455 | + | let $t01859918716 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
456 | + | let wxToClaimUserNew = $t01859918716._1 | |
457 | + | let integralSTATE = $t01859918716._2 | |
458 | + | let debug = $t01859918716._3 | |
459 | + | let listName = getUsersListName(lpAssetIdStr) | |
460 | + | let listActions = if (containsNode(listName, userAddressStr)) | |
461 | + | then nil | |
462 | + | else insertNodeActions(listName, userAddressStr) | |
463 | + | (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
464 | + | } | |
465 | + | else throw("Strict value is not equal to itself.") | |
446 | 466 | } | |
447 | 467 | else throw("Strict value is not equal to itself.") | |
448 | 468 | } | |
449 | 469 | ||
450 | 470 | ||
451 | 471 | func unstakeActions (i,lpAssetId,poolAddress,userAddress,lpAssetRecipientAddress,amount) = { | |
452 | - | let userAddressStr = toString(userAddress) | |
453 | - | let lpAssetIdStr = toBase58String(lpAssetId) | |
454 | - | let poolAddressStr = toString(poolAddress) | |
455 | - | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
456 | - | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
457 | - | let stakedByUser = readStaked(stakedByUserKEY) | |
458 | - | let stakedTotal = readStaked(stakedTotalKEY) | |
459 | - | let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2 | |
460 | - | let listName = getUsersListName(lpAssetIdStr) | |
461 | - | let listActions = if (if (containsNode(listName, userAddressStr)) | |
462 | - | then (amount == stakedByUser) | |
463 | - | else false) | |
464 | - | then deleteNodeActions(listName, userAddressStr) | |
465 | - | else nil | |
466 | - | let refreshStakedVote = if ((amount == stakedByUser)) | |
467 | - | then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil) | |
468 | - | else unit | |
469 | - | if ((refreshStakedVote == refreshStakedVote)) | |
472 | + | let checkVotingEmissionFinalization = ensureVotingEmissionIsFinalized() | |
473 | + | if ((checkVotingEmissionFinalization == checkVotingEmissionFinalization)) | |
470 | 474 | then { | |
471 | - | let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)) | |
472 | - | let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1 | |
473 | - | let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward) | |
474 | - | let throwIfNothingToClaim = true | |
475 | - | let r = if ((availableToClaim > zeroBigInt)) | |
476 | - | then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil) | |
475 | + | let userAddressStr = toString(userAddress) | |
476 | + | let lpAssetIdStr = toBase58String(lpAssetId) | |
477 | + | let poolAddressStr = toString(poolAddress) | |
478 | + | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
479 | + | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
480 | + | let stakedByUser = readStaked(stakedByUserKEY) | |
481 | + | let stakedTotal = readStaked(stakedTotalKEY) | |
482 | + | let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2 | |
483 | + | let listName = getUsersListName(lpAssetIdStr) | |
484 | + | let listActions = if (if (containsNode(listName, userAddressStr)) | |
485 | + | then (amount == stakedByUser) | |
486 | + | else false) | |
487 | + | then deleteNodeActions(listName, userAddressStr) | |
488 | + | else nil | |
489 | + | let refreshStakedVote = if ((amount == stakedByUser)) | |
490 | + | then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil) | |
477 | 491 | else unit | |
478 | - | if ((r == r)) | |
479 | - | then if ((amount > stakedByUser)) | |
480 | - | then throwErr(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY)) | |
481 | - | else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
492 | + | if ((refreshStakedVote == refreshStakedVote)) | |
493 | + | then { | |
494 | + | let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)) | |
495 | + | let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1 | |
496 | + | let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward) | |
497 | + | let throwIfNothingToClaim = true | |
498 | + | let r = if ((availableToClaim > zeroBigInt)) | |
499 | + | then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil) | |
500 | + | else unit | |
501 | + | if ((r == r)) | |
502 | + | then if ((amount > stakedByUser)) | |
503 | + | then throwErr(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY)) | |
504 | + | else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
505 | + | else throw("Strict value is not equal to itself.") | |
506 | + | } | |
482 | 507 | else throw("Strict value is not equal to itself.") | |
483 | 508 | } | |
484 | 509 | else throw("Strict value is not equal to itself.") | |
485 | 510 | } | |
486 | 511 | ||
487 | 512 | ||
488 | 513 | @Callable(i) | |
489 | 514 | func constructor (factoryAddressStr) = { | |
490 | 515 | let checkCaller = mustManager(i) | |
491 | 516 | if ((checkCaller == checkCaller)) | |
492 | 517 | then [StringEntry(keyFactoryAddress(), factoryAddressStr)] | |
493 | 518 | else throw("Strict value is not equal to itself.") | |
494 | 519 | } | |
495 | 520 | ||
496 | 521 | ||
497 | 522 | ||
498 | 523 | @Callable(i) | |
499 | 524 | func constructorV2 (votingEmissionContract) = { | |
500 | 525 | let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit)) | |
501 | 526 | then true | |
502 | 527 | else "invalid voting emission contract address"] | |
503 | 528 | if ((cheks == cheks)) | |
504 | 529 | then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)] | |
505 | - | else throw("Strict value is not equal to itself.") | |
506 | - | } | |
507 | - | ||
508 | - | ||
509 | - | ||
510 | - | @Callable(i) | |
511 | - | func setManager (pendingManagerPublicKey) = { | |
512 | - | let checkCaller = mustManager(i) | |
513 | - | if ((checkCaller == checkCaller)) | |
514 | - | then { | |
515 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
516 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
517 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
518 | - | else throw("Strict value is not equal to itself.") | |
519 | - | } | |
520 | - | else throw("Strict value is not equal to itself.") | |
521 | - | } | |
522 | - | ||
523 | - | ||
524 | - | ||
525 | - | @Callable(i) | |
526 | - | func confirmManager () = { | |
527 | - | let pm = pendingManagerPublicKeyOrUnit() | |
528 | - | let hasPM = if (isDefined(pm)) | |
529 | - | then true | |
530 | - | else throwErr("No pending manager") | |
531 | - | if ((hasPM == hasPM)) | |
532 | - | then { | |
533 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
534 | - | then true | |
535 | - | else throwErr("You are not pending manager") | |
536 | - | if ((checkPM == checkPM)) | |
537 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
538 | - | else throw("Strict value is not equal to itself.") | |
539 | - | } | |
540 | 530 | else throw("Strict value is not equal to itself.") | |
541 | 531 | } | |
542 | 532 | ||
543 | 533 | ||
544 | 534 | ||
545 | 535 | @Callable(i) | |
546 | 536 | func stake () = if ((size(i.payments) != 1)) | |
547 | 537 | then throwErr("invalid payment - exact one payment must be attached") | |
548 | 538 | else { | |
549 | 539 | let pmt = i.payments[0] | |
550 | 540 | let lpAssetId = value(pmt.assetId) | |
551 | 541 | let lpAssetIdStr = toBase58String(lpAssetId) | |
552 | 542 | let amount = pmt.amount | |
553 | 543 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr))) | |
554 | 544 | let poolAddress = addressFromStringValue(poolAddressStr) | |
555 | 545 | let userAddress = if ((i.caller == poolAddress)) | |
556 | 546 | then i.originCaller | |
557 | 547 | else i.caller | |
558 | 548 | stakeActions(i, lpAssetId, poolAddress, userAddress, amount) | |
559 | 549 | } | |
560 | 550 | ||
561 | 551 | ||
562 | 552 | ||
563 | 553 | @Callable(i) | |
564 | 554 | func stakeFor (userAddressStr) = if ((size(i.payments) != 1)) | |
565 | 555 | then throwErr("invalid payment - exact one payment must be attached") | |
566 | 556 | else { | |
567 | 557 | let pmt = i.payments[0] | |
568 | 558 | let lpAssetId = value(pmt.assetId) | |
569 | 559 | let lpAssetIdStr = toBase58String(lpAssetId) | |
570 | 560 | let amount = pmt.amount | |
571 | 561 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr))) | |
572 | 562 | let poolAddress = addressFromStringValue(poolAddressStr) | |
573 | 563 | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address")) | |
574 | 564 | stakeActions(i, lpAssetId, poolAddress, userAddress, amount) | |
575 | 565 | } | |
576 | 566 | ||
577 | 567 | ||
578 | 568 | ||
579 | 569 | @Callable(i) | |
580 | 570 | func unstake (lpAssetIdStr,amount) = { | |
581 | 571 | let lpAssetId = fromBase58String(lpAssetIdStr) | |
582 | 572 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr))) | |
583 | 573 | let poolAddress = addressFromStringValue(poolAddressStr) | |
584 | 574 | let callerStr = toString(i.caller) | |
585 | 575 | let userAddress = if ((callerStr == poolAddressStr)) | |
586 | 576 | then i.originCaller | |
587 | 577 | else i.caller | |
588 | 578 | let lpAssetRecipientAddress = i.caller | |
589 | 579 | unstakeActions(i, lpAssetId, poolAddress, userAddress, lpAssetRecipientAddress, amount) | |
590 | 580 | } | |
591 | 581 | ||
592 | 582 | ||
593 | 583 | ||
594 | 584 | @Callable(i) | |
595 | 585 | func unstakeINTERNAL (lpAssetId,amount,userAddress,lpAssetRecipientAddress) = { | |
596 | 586 | let lpAssetIdStr = toBase58String(lpAssetId) | |
597 | 587 | let poolAddress = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr)))) | |
598 | 588 | let checkCaller = if ((i.caller == poolAddress)) | |
599 | 589 | then true | |
600 | 590 | else permissionDeniedError | |
601 | 591 | if ((checkCaller == checkCaller)) | |
602 | 592 | then unstakeActions(i, lpAssetId, poolAddress, Address(userAddress), Address(lpAssetRecipientAddress), amount) | |
603 | 593 | else throw("Strict value is not equal to itself.") | |
604 | 594 | } | |
605 | 595 | ||
606 | 596 | ||
607 | 597 | ||
608 | 598 | @Callable(i) | |
609 | 599 | func claimWx (lpAssetIdStr) = { | |
610 | 600 | let userAddressStr = toString(i.caller) | |
611 | 601 | let throwIfNothingToClaim = true | |
612 | 602 | let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil) | |
613 | 603 | $Tuple2(nil, result) | |
614 | 604 | } | |
615 | 605 | ||
616 | 606 | ||
617 | 607 | ||
618 | 608 | @Callable(i) | |
619 | 609 | func claimWxDoNotThrow (lpAssetIdStr) = { | |
620 | 610 | let userAddressStr = toString(i.caller) | |
621 | 611 | let throwIfNothingToClaim = false | |
622 | 612 | let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil) | |
623 | 613 | $Tuple2(nil, result) | |
624 | 614 | } | |
625 | 615 | ||
626 | 616 | ||
627 | 617 | ||
628 | 618 | @Callable(i) | |
629 | 619 | func claimWxINTERNAL (lpAssetIdStr,userAddressStr,throwIfNothingToClaim) = { | |
630 | 620 | let checkCaller = mustThis(i) | |
631 | 621 | if ((checkCaller == checkCaller)) | |
632 | 622 | then { | |
633 | 623 | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("claimWxINTERNAL: invalid user address")) | |
634 | 624 | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
635 | 625 | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
636 | 626 | let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr) | |
637 | 627 | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
638 | 628 | let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr) | |
639 | 629 | let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY) | |
640 | 630 | let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY) | |
641 | 631 | let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY) | |
642 | 632 | let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY) | |
643 | - | let $ | |
644 | - | let wxToClaimUserNew = $ | |
645 | - | let integralSTATE = $ | |
646 | - | let debug = $ | |
633 | + | let $t02598426096 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
634 | + | let wxToClaimUserNew = $t02598426096._1 | |
635 | + | let integralSTATE = $t02598426096._2 | |
636 | + | let debug = $t02598426096._3 | |
647 | 637 | let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt]) | |
648 | 638 | if ((zeroBigInt >= availableToClaim)) | |
649 | 639 | then if (throwIfNothingToClaim) | |
650 | 640 | then throwErr("nothing to claim") | |
651 | 641 | else $Tuple2(nil, 0) | |
652 | 642 | else { | |
653 | 643 | let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0]) | |
654 | 644 | let minRewardPart = availableToClaim | |
655 | 645 | let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)]) | |
656 | 646 | let totalReward = (minRewardPart + boostRewardPart) | |
657 | 647 | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0]) | |
658 | 648 | let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil)) | |
659 | 649 | if ((emitBoost == emitBoost)) | |
660 | 650 | then { | |
661 | 651 | let claimedByUserValue = ((claimedByUser + minRewardPart) + boostRewardPart) | |
662 | 652 | let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart) | |
663 | 653 | let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserBoostReward + boostRewardPart) | |
664 | 654 | let claimedTotalPlusAvailableToClaim = (claimedTotal + availableToClaim) | |
665 | 655 | $Tuple2([StringEntry(claimedByUserKEY, toString(claimedByUserValue)), StringEntry(claimedByUserMinRewardKEY, toString(claimedByUserMinRewardPlusPart)), StringEntry(claimedByUserBoostRewardKEY, toString(claimedByUserBoostRewardPlusBoostRewardPart)), StringEntry(claimedTotalKEY, toString(claimedTotalPlusAvailableToClaim)), ScriptTransfer(userAddress, toInt(minRewardPart), wxAssetId), ScriptTransfer(userAddress, toInt(boostRewardPart), wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, toInt(availableToClaim), i.transactionId)], toInt(totalReward)) | |
666 | 656 | } | |
667 | 657 | else throw("Strict value is not equal to itself.") | |
668 | 658 | } | |
669 | 659 | } | |
670 | 660 | else throw("Strict value is not equal to itself.") | |
671 | 661 | } | |
672 | 662 | ||
673 | 663 | ||
674 | 664 | ||
675 | 665 | @Callable(i) | |
676 | 666 | func claimWxBulkInternalREADONLY (currentIter,lpAssetIds,userAddressStr,resAcc) = if ((currentIter == size(lpAssetIds))) | |
677 | 667 | then $Tuple2(nil, resAcc) | |
678 | 668 | else { | |
679 | 669 | let lpAssetId = lpAssetIds[currentIter] | |
680 | 670 | let info = split({ | |
681 | 671 | let @ = invoke(this, "claimWxREADONLY", [lpAssetId, userAddressStr], nil) | |
682 | 672 | if ($isInstanceOf(@, "String")) | |
683 | 673 | then @ | |
684 | 674 | else throw(($getType(@) + " couldn't be cast to String")) | |
685 | 675 | }, SEP) | |
686 | 676 | let unclaimed = info[3] | |
687 | 677 | let claimed = info[4] | |
688 | 678 | let userVoteFinalized = { | |
689 | 679 | let @ = invoke(boostingContract, "getUserVoteFinalizedREADONLY", [lpAssetId, userAddressStr], nil) | |
690 | 680 | if ($isInstanceOf(@, "Int")) | |
691 | 681 | then @ | |
692 | 682 | else throw(($getType(@) + " couldn't be cast to Int")) | |
693 | 683 | } | |
694 | 684 | let res = (resAcc :+ makeString(["%d%d%d", unclaimed, claimed, toString(userVoteFinalized)], SEP)) | |
695 | 685 | let inv = { | |
696 | 686 | let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil) | |
697 | 687 | if ($isInstanceOf(@, "List[Any]")) | |
698 | 688 | then @ | |
699 | 689 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
700 | 690 | } | |
701 | 691 | if ((inv == inv)) | |
702 | 692 | then $Tuple2(nil, inv) | |
703 | 693 | else throw("Strict value is not equal to itself.") | |
704 | 694 | } | |
705 | 695 | ||
706 | 696 | ||
707 | 697 | ||
708 | 698 | @Callable(i) | |
709 | 699 | func claimWxBulkREADONLY (lpAssetIds,userAddressStr) = { | |
710 | 700 | let res = invoke(this, "claimWxBulkInternalREADONLY", [0, lpAssetIds, userAddressStr, nil], nil) | |
711 | 701 | $Tuple2(nil, res) | |
712 | 702 | } | |
713 | 703 | ||
714 | 704 | ||
715 | 705 | ||
716 | 706 | @Callable(i) | |
717 | 707 | func claimWxREADONLY (lpAssetIdStr,userAddressStr) = { | |
718 | 708 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
719 | 709 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
720 | 710 | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
721 | 711 | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
722 | 712 | let stakedByUser = readStaked(stakedByUserKEY) | |
723 | 713 | let stakedTotal = readStaked(stakedTotalKEY) | |
724 | 714 | let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY) | |
725 | 715 | let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY) | |
726 | 716 | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
727 | 717 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
728 | 718 | let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) | |
729 | 719 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
730 | 720 | let passedBlocks = if ((emissionStartBlock > height)) | |
731 | 721 | then 0 | |
732 | 722 | else (height - emissionStartBlock) | |
733 | 723 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
734 | 724 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
735 | - | let $ | |
736 | - | let wxToClaimUserNew = $ | |
737 | - | let integralSTATE = $ | |
738 | - | let debug = $ | |
725 | + | let $t03014730259 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
726 | + | let wxToClaimUserNew = $t03014730259._1 | |
727 | + | let integralSTATE = $t03014730259._2 | |
728 | + | let debug = $t03014730259._3 | |
739 | 729 | let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt]) | |
740 | 730 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
741 | 731 | let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0]) | |
742 | 732 | let boostDebug = asString(boostInvResult[1]) | |
743 | 733 | let minRewardPart = availableToClaim | |
744 | 734 | let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)]) | |
745 | 735 | let totalReward = (minRewardPart + boostRewardPart) | |
746 | 736 | $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP)) | |
747 | 737 | } | |
748 | 738 | ||
749 | 739 | ||
750 | 740 | ||
751 | 741 | @Callable(i) | |
752 | 742 | func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = { | |
753 | 743 | let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0) | |
754 | 744 | $Tuple2(nil, stakedByUser) | |
755 | 745 | } | |
756 | 746 | ||
757 | 747 | ||
758 | 748 | ||
759 | 749 | @Callable(i) | |
760 | 750 | func stakedTotalREADONLY (lpAssetIdStr) = { | |
761 | 751 | let stakedTotal = valueOrElse(getInteger(keyStakedTotal(lpAssetIdStr)), 0) | |
762 | 752 | $Tuple2(nil, stakedTotal) | |
763 | 753 | } | |
764 | 754 | ||
765 | 755 | ||
766 | 756 | ||
767 | 757 | @Callable(i) | |
768 | 758 | func usersListTraversal (lpAssetId) = { | |
769 | 759 | let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), ""))) | |
770 | 760 | then true | |
771 | 761 | else mustManager(i) | |
772 | 762 | if ((checkCaller == checkCaller)) | |
773 | 763 | then { | |
774 | 764 | let listName = getUsersListName(lpAssetId) | |
775 | 765 | let userOrUnit = getString(keyNextUser(lpAssetId)) | |
776 | 766 | let headOrUnit = getString(keyListHead(listName)) | |
777 | 767 | match userOrUnit { | |
778 | 768 | case _: Unit => | |
779 | 769 | match headOrUnit { | |
780 | 770 | case _: Unit => | |
781 | 771 | $Tuple2(nil, false) | |
782 | 772 | case head: String => | |
783 | 773 | $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true) | |
784 | 774 | case _ => | |
785 | 775 | throw("Match error") | |
786 | 776 | } | |
787 | 777 | case userAddress: String => | |
788 | 778 | let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetId, userAddress)) | |
789 | 779 | let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId)) | |
790 | 780 | let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1 | |
791 | 781 | let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward) | |
792 | 782 | let throwIfNothingToClaim = true | |
793 | 783 | let r = if ((availableToClaim > zeroBigInt)) | |
794 | 784 | then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress, throwIfNothingToClaim], nil) | |
795 | 785 | else unit | |
796 | 786 | if ((r == r)) | |
797 | 787 | then { | |
798 | 788 | let nextUserOrUnit = getString(keyListNext(listName, userAddress)) | |
799 | 789 | match nextUserOrUnit { | |
800 | 790 | case _: Unit => | |
801 | 791 | $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false) | |
802 | 792 | case nextUser: String => | |
803 | 793 | $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true) | |
804 | 794 | case _ => | |
805 | 795 | throw("Match error") | |
806 | 796 | } | |
807 | 797 | } | |
808 | 798 | else throw("Strict value is not equal to itself.") | |
809 | 799 | case _ => | |
810 | 800 | throw("Match error") | |
811 | 801 | } | |
812 | 802 | } | |
813 | 803 | else throw("Strict value is not equal to itself.") | |
814 | 804 | } | |
815 | 805 | ||
816 | 806 | ||
817 | 807 | ||
818 | 808 | @Callable(i) | |
819 | 809 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
820 | 810 | then throwErr("permissions denied") | |
821 | 811 | else { | |
822 | - | let $ | |
823 | - | let wxPerLpIntegralNew = $ | |
824 | - | let poolIntegralSTATE = $ | |
825 | - | let poolDEBUG = $ | |
812 | + | let $t03304933159 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
813 | + | let wxPerLpIntegralNew = $t03304933159._1 | |
814 | + | let poolIntegralSTATE = $t03304933159._2 | |
815 | + | let poolDEBUG = $t03304933159._3 | |
826 | 816 | poolIntegralSTATE | |
827 | 817 | } | |
828 | 818 | ||
829 | 819 | ||
830 | 820 | @Verifier(tx) | |
831 | 821 | func verify () = { | |
832 | 822 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
833 | 823 | case pk: ByteVector => | |
834 | 824 | pk | |
835 | 825 | case _: Unit => | |
836 | 826 | tx.senderPublicKey | |
837 | 827 | case _ => | |
838 | 828 | throw("Match error") | |
839 | 829 | } | |
840 | 830 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
841 | 831 | } | |
842 | 832 |
github/deemru/w8io/169f3d6 92.01 ms ◑