tx · AMNt9ra4rKnsKcEZJ3ZRzbmRLs294rmhdeZ5wcWjWV6g 3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT: -0.01400000 Waves 2021.06.13 17:55 [1568713] smart account 3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT > SELF 0.00000000 Waves
{ "type": 13, "id": "AMNt9ra4rKnsKcEZJ3ZRzbmRLs294rmhdeZ5wcWjWV6g", "fee": 1400000, "feeAssetId": null, "timestamp": 1623596123848, "version": 2, "chainId": 84, "sender": "3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT", "senderPublicKey": "3ijdmxaYrpDFsKVbQH2kvB7i6JzHj9bep9bGWiQPra2D", "proofs": [ "62U1rEazbXRgWr8w7FhmNfr782pRU33a5tWS3xCmgxp96woJ14235wkJ6RRar8j6H8Dzwzx1wqRhBvUapYjo2QYx" ], "script": "base64:AAIEAAAAAAAAACUIAhIDCgEIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgMKAQgSABIAAAAAWwAAAAAMYWRtaW5QdWJLZXkxAQAAACAEz3XlZNDBD05nuR8TZMQaDeqEJEIxfTOQXUBYCp2TSgAAAAAMYWRtaW5QdWJLZXkyAQAAACAEz3XlZNDBD05nuR8TZMQaDeqEJEIxfTOQXUBYCp2TSgAAAAAMYWRtaW5QdWJLZXkzAQAAACAEz3XlZNDBD05nuR8TZMQaDeqEJEIxfTOQXUBYCp2TSgAAAAAUa2V5U2hhcmVUb2tlbnNMb2NrZWQCAAAAGl90b3RhbF9zaGFyZV90b2tlbnNfbG9ja2VkAAAAAAtrU2hhcmVMaW1pdAIAAAAcc2hhcmVfbGltaXRfb25fZmlyc3RfaGFydmVzdAAAAAAJa2V5QWN0aXZlAgAAAAZhY3RpdmUAAAAACGtleUNhdXNlAgAAAA5zaHV0ZG93bl9jYXVzZQAAAAAca2V5UmV3YXJkUG9vbEZyYWN0aW9uQ3VycmVudAIAAAAdX2N1cnJlbnRfcG9vbF9mcmFjdGlvbl9yZXd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WluUHViS2V5MgkABEwAAAACBQAAAAxhZG1pblB1YktleTMFAAAAA25pbAgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5CQAAAgAAAAECAAAAIU9ubHkgYWRtaW4gY2FuIGNhbGwgdGhpcyBmdW5jdGlvbgkBAAAAB3N1c3BlbmQAAAABAgAAAA9QYXVzZWQgYnkgYWRtaW4AAAABaQEAAAAIYWN0aXZhdGUAAAAAAwUAAAAIaXNBY3RpdmUJAAACAAAAAQIAAAAWREFwcCBpcyBhbHJlYWR5IGFjdGl2ZQMJAQAAAAEhAAAAAQkBAAAAD2NvbnRhaW5zRWxlbWVudAAAAAIJAARMAAAAAgUAAAAMYWRtaW5QdWJLZXkxCQAETAAAAAIFAAAADGFkbWluUHViS2V5MgkABEwAAAACBQAAAAxhZG1pblB1YktleTMFAAAAA25pbAgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5CQAAAgAAAAECAAAAIU9ubHkgYWRtaW4gY2FuIGNhbGwgdGhpcyBmdW5jdGlvbgkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgUAAAAJa2V5QWN0aXZlBgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAAhrZXlDYXVzZQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5EIPfqQ==", "height": 1568713, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J4JLXWvz1JFTHvKBTWzkQPK76jPhJmr2KPj6XcUgx3Bg Next: AH3kSBbfAF5cRt8kgjJXteHf9Y8Qjjuv1pd2iYFRyAoK Diff:
Old | New | Differences | |
---|---|---|---|
10 | 10 | let keyShareTokensLocked = "_total_share_tokens_locked" | |
11 | 11 | ||
12 | 12 | let kShareLimit = "share_limit_on_first_harvest" | |
13 | + | ||
14 | + | let keyActive = "active" | |
15 | + | ||
16 | + | let keyCause = "shutdown_cause" | |
13 | 17 | ||
14 | 18 | let keyRewardPoolFractionCurrent = "_current_pool_fraction_reward" | |
15 | 19 | ||
130 | 134 | let durationFullVotePower = valueOrErrorMessage(getInteger(votingAddress, kDurationFullVotePower), "Empty kDurationFullVotePower") | |
131 | 135 | ||
132 | 136 | let minVotePower = valueOrErrorMessage(getInteger(votingAddress, kMinVotePower), "Empty kMinVotePower") | |
137 | + | ||
138 | + | let isActive = getBooleanValue(this, keyActive) | |
133 | 139 | ||
134 | 140 | let currPeriod = (basePeriod + ((height - startHeight) / periodLength)) | |
135 | 141 | ||
314 | 320 | let shareAssetId = getShareAssetId(pool) | |
315 | 321 | let scaleValue = calcScaleValue(SWOP, shareAssetId) | |
316 | 322 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
317 | - | let $ | |
318 | - | let lastInterestHeight = $ | |
319 | - | let lastInterest = $ | |
320 | - | let $ | |
321 | - | let currentRewardPerBlock = $ | |
322 | - | let rewardUpdateHeight = $ | |
323 | - | let previousRewardPerBlock = $ | |
324 | - | let poolRewardUpdateHeight = $ | |
325 | - | let $ | |
326 | - | let userLastInterest = $ | |
327 | - | let userShareTokensAmount = $ | |
323 | + | let $t01314613211 = getLastInterestInfo(pool) | |
324 | + | let lastInterestHeight = $t01314613211._1 | |
325 | + | let lastInterest = $t01314613211._2 | |
326 | + | let $t01321613328 = rewardInfo(pool) | |
327 | + | let currentRewardPerBlock = $t01321613328._1 | |
328 | + | let rewardUpdateHeight = $t01321613328._2 | |
329 | + | let previousRewardPerBlock = $t01321613328._3 | |
330 | + | let poolRewardUpdateHeight = $t01321613328._4 | |
331 | + | let $t01333313412 = getUserInterestInfo(pool, caller) | |
332 | + | let userLastInterest = $t01333313412._1 | |
333 | + | let userShareTokensAmount = $t01333313412._2 | |
328 | 334 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, poolRewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue, pmtAmount) | |
329 | 335 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue) | |
330 | 336 | let userNewInterest = currentInterest | |
333 | 339 | ||
334 | 340 | ||
335 | 341 | func calculateProtocolReward (pool) = { | |
336 | - | let $ | |
337 | - | let lastInterestHeight = $ | |
338 | - | let lastInterest = $ | |
339 | - | let $ | |
340 | - | let currentRewardPerBlock = $ | |
341 | - | let rewardUpdateHeight = $ | |
342 | - | let previousRewardPerBlock = $ | |
343 | - | let poolRewardUpdateHeight = $ | |
342 | + | let $t01393013995 = getLastInterestInfo(pool) | |
343 | + | let lastInterestHeight = $t01393013995._1 | |
344 | + | let lastInterest = $t01393013995._2 | |
345 | + | let $t01400014111 = rewardInfo(pool) | |
346 | + | let currentRewardPerBlock = $t01400014111._1 | |
347 | + | let rewardUpdateHeight = $t01400014111._2 | |
348 | + | let previousRewardPerBlock = $t01400014111._3 | |
349 | + | let poolRewardUpdateHeight = $t01400014111._4 | |
344 | 350 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
345 | 351 | if (if ((shareTokenLocked == 0)) | |
346 | 352 | then (poolRewardUpdateHeight == 0) | |
406 | 412 | func getUserSWOPClaimedAmount (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyUserSWOPClaimedAmount)), 0) | |
407 | 413 | ||
408 | 414 | ||
415 | + | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
416 | + | ||
417 | + | ||
409 | 418 | @Callable(i) | |
410 | 419 | func init (earlyLP) = if (isDefined(getString(this, keySWOPid))) | |
411 | 420 | then throw("SWOP already initialized") | |
413 | 422 | let initAmount = 100000000000000 | |
414 | 423 | let SWOPissue = Issue("SWOP", "SWOP protocol token", initAmount, 8, true) | |
415 | 424 | let SWOPid = calculateAssetId(SWOPissue) | |
416 | - | [Issue("SWOP", "SWOP protocol token", initAmount, 8, true), StringEntry(keySWOPid, toBase58String(SWOPid))] | |
425 | + | [BooleanEntry(keyActive, true), Issue("SWOP", "SWOP protocol token", initAmount, 8, true), StringEntry(keySWOPid, toBase58String(SWOPid))] | |
417 | 426 | } | |
418 | 427 | ||
419 | 428 | ||
422 | 431 | func initPoolShareFarming (pool) = if ((i.caller != this)) | |
423 | 432 | then throw("Only the DApp itself can call this function") | |
424 | 433 | else { | |
425 | - | let $ | |
426 | - | let currentReward = $ | |
427 | - | let rewardUpdateHeight = $ | |
428 | - | let previousRewardPerBlock = $ | |
429 | - | let poolRewardUpdateHeight = $ | |
434 | + | let $t01709717200 = rewardInfo(pool) | |
435 | + | let currentReward = $t01709717200._1 | |
436 | + | let rewardUpdateHeight = $t01709717200._2 | |
437 | + | let previousRewardPerBlock = $t01709717200._3 | |
438 | + | let poolRewardUpdateHeight = $t01709717200._4 | |
430 | 439 | [IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyLastInterestHeight), height)] | |
431 | 440 | } | |
432 | 441 | ||
435 | 444 | @Callable(i) | |
436 | 445 | func updatePoolInterest (pool) = if ((i.caller != wallet)) | |
437 | 446 | then throw("Only the Admin itself can call this function") | |
438 | - | else { | |
439 | - | let $t01724217362 = claimCalc(pool, adminIncreaseInterestAddress, 0) | |
440 | - | let userNewInterest = $t01724217362._1 | |
441 | - | let currentInterest = $t01724217362._2 | |
442 | - | let claimAmount = $t01724217362._3 | |
443 | - | let userShareTokensAmount = $t01724217362._4 | |
444 | - | let $t01736717470 = rewardInfo(pool) | |
445 | - | let currentReward = $t01736717470._1 | |
446 | - | let rewardUpdateHeight = $t01736717470._2 | |
447 | - | let previousRewardPerBlock = $t01736717470._3 | |
448 | - | let poolRewardUpdateHeight = $t01736717470._4 | |
447 | + | else if (!(isActive)) | |
448 | + | then throw("DApp is inactive at this moment") | |
449 | + | else { | |
450 | + | let $t01760917729 = claimCalc(pool, adminIncreaseInterestAddress, 0) | |
451 | + | let userNewInterest = $t01760917729._1 | |
452 | + | let currentInterest = $t01760917729._2 | |
453 | + | let claimAmount = $t01760917729._3 | |
454 | + | let userShareTokensAmount = $t01760917729._4 | |
455 | + | let $t01773417837 = rewardInfo(pool) | |
456 | + | let currentReward = $t01773417837._1 | |
457 | + | let rewardUpdateHeight = $t01773417837._2 | |
458 | + | let previousRewardPerBlock = $t01773417837._3 | |
459 | + | let poolRewardUpdateHeight = $t01773417837._4 | |
449 | 460 | [IntegerEntry((pool + keyLastInterest), userNewInterest), IntegerEntry((pool + keyLastInterestHeight), height)] | |
450 | - | } | |
461 | + | } | |
451 | 462 | ||
452 | 463 | ||
453 | 464 | ||
454 | 465 | @Callable(i) | |
455 | 466 | func lockShareTokens (pool) = { | |
456 | - | let $ | |
457 | - | let pmtAmount = $ | |
458 | - | let pmtAssetId = $ | |
459 | - | let $ | |
460 | - | let pmtStrAssetId = $ | |
461 | - | let pmtAssetName = $ | |
462 | - | let pmtDecimals = $ | |
463 | - | let $ | |
464 | - | let userNewInterest = $ | |
465 | - | let currentInterest = $ | |
466 | - | let claimAmount = $ | |
467 | - | let userShareTokensAmount = $ | |
467 | + | let $t01802918104 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
468 | + | let pmtAmount = $t01802918104._1 | |
469 | + | let pmtAssetId = $t01802918104._2 | |
470 | + | let $t01810918182 = getAssetInfo(pmtAssetId) | |
471 | + | let pmtStrAssetId = $t01810918182._1 | |
472 | + | let pmtAssetName = $t01810918182._2 | |
473 | + | let pmtDecimals = $t01810918182._3 | |
474 | + | let $t01818718295 = claimCalc(pool, i.caller, pmtAmount) | |
475 | + | let userNewInterest = $t01818718295._1 | |
476 | + | let currentInterest = $t01818718295._2 | |
477 | + | let claimAmount = $t01818718295._3 | |
478 | + | let userShareTokensAmount = $t01818718295._4 | |
468 | 479 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
469 | 480 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
470 | 481 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
474 | 485 | let baseEntry = [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyShareTokensLocked), totalShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), availableFundsNew)] | |
475 | 486 | if ((0 >= pmtAmount)) | |
476 | 487 | then throw("You can't lock token") | |
477 | - | else if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
478 | - | then throw("Incorrect pmtAssetId") | |
479 | - | else if (if (isFirstHarvest(Address(fromBase58String(pool)))) | |
480 | - | then (getHeightFirstHarvest(Address(fromBase58String(pool))) > height) | |
481 | - | else false) | |
482 | - | then { | |
483 | - | let harvestPeriod = ((((getHeightFirstHarvest(Address(fromBase58String(pool))) - startHeight) + 1) / periodLength) - 1) | |
484 | - | let amountOfVoting = split(getStringValue(votingAddress, (((toString(i.caller) + "_") + pool) + "_user_pool_struc")), "_") | |
485 | - | let amountPoolStract = split(getStringValue(votingAddress, (pool + "_pool_struc")), "_") | |
486 | - | let amountActiveVoteUserPoolStract = split(valueOrElse(getString(votingAddress, (((toString(i.caller) + "_") + pool) + kHarvestUserPoolActiveVoteStrucVoting)), ""), "_") | |
487 | - | let amountPoolActiveVoteStract = split(valueOrElse(getString(votingAddress, (pool + kHarvestPoolActiveVoteStrucVoting)), ""), "_") | |
488 | - | let userShareTokenLocked = userShareTokensAmount | |
489 | - | let userPoolActiveVote = if ((toString(currPeriod) == amountOfVoting[2])) | |
490 | - | then valueOrElse(parseInt(amountActiveVoteUserPoolStract[0]), 0) | |
491 | - | else valueOrElse(parseInt(amountOfVoting[1]), 0) | |
492 | - | let poolActiveVote = if ((toString(currPeriod) == amountPoolStract[2])) | |
493 | - | then valueOrElse(parseInt(amountPoolActiveVoteStract[0]), 0) | |
494 | - | else valueOrElse(parseInt(amountPoolStract[1]), 0) | |
495 | - | let protocolReward = calculateProtocolReward(pool) | |
496 | - | if ((userPoolActiveVote != 0)) | |
497 | - | then { | |
498 | - | let limitShareToken = getShareLimitToken(addressFromStringValue(pool)) | |
499 | - | let shareToken = (fraction(limitShareToken, userPoolActiveVote, poolActiveVote) - userShareTokenLocked) | |
500 | - | if (if ((size(amountActiveVoteUserPoolStract) > 1)) | |
501 | - | then (valueOrElse(parseInt(amountActiveVoteUserPoolStract[1]), 0) >= harvestPeriod) | |
502 | - | else false) | |
503 | - | then throw("You can't share token") | |
504 | - | else if ((pmtAmount > limitShareToken)) | |
505 | - | then throw(("You can't share token more than " + toString(limitShareToken))) | |
506 | - | else if ((shareToken > 0)) | |
507 | - | then if ((fraction(99, (accountBalance(pmtAssetId) + pmtAmount), 100) > totalShareAmountNew)) | |
508 | - | then throw("Balance of share-token is greater than totalAmount") | |
509 | - | else if ((totalShareAmount == 0)) | |
510 | - | then (baseEntry ++ [Reissue(SWOP, protocolReward, true), ScriptTransfer(wallet, protocolReward, SWOP)]) | |
511 | - | else if ((shareToken >= pmtAmount)) | |
512 | - | then baseEntry | |
513 | - | else throw(("Your maximum share token is " + toString(shareToken))) | |
514 | - | else throw("You can't share token") | |
515 | - | } | |
516 | - | else throw("Your amount of token less than 0") | |
517 | - | } | |
518 | - | else baseEntry | |
488 | + | else if (!(isActive)) | |
489 | + | then throw("DApp is inactive at this moment") | |
490 | + | else if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
491 | + | then throw("Incorrect pmtAssetId") | |
492 | + | else if (if (isFirstHarvest(Address(fromBase58String(pool)))) | |
493 | + | then (getHeightFirstHarvest(Address(fromBase58String(pool))) > height) | |
494 | + | else false) | |
495 | + | then { | |
496 | + | let harvestPeriod = ((((getHeightFirstHarvest(Address(fromBase58String(pool))) - startHeight) + 1) / periodLength) - 1) | |
497 | + | let amountOfVoting = split(getStringValue(votingAddress, (((toString(i.caller) + "_") + pool) + "_user_pool_struc")), "_") | |
498 | + | let amountPoolStract = split(getStringValue(votingAddress, (pool + "_pool_struc")), "_") | |
499 | + | let amountActiveVoteUserPoolStract = split(valueOrElse(getString(votingAddress, (((toString(i.caller) + "_") + pool) + kHarvestUserPoolActiveVoteStrucVoting)), ""), "_") | |
500 | + | let amountPoolActiveVoteStract = split(valueOrElse(getString(votingAddress, (pool + kHarvestPoolActiveVoteStrucVoting)), ""), "_") | |
501 | + | let userShareTokenLocked = userShareTokensAmount | |
502 | + | let userPoolActiveVote = if ((toString(currPeriod) == amountOfVoting[2])) | |
503 | + | then valueOrElse(parseInt(amountActiveVoteUserPoolStract[0]), 0) | |
504 | + | else valueOrElse(parseInt(amountOfVoting[1]), 0) | |
505 | + | let poolActiveVote = if ((toString(currPeriod) == amountPoolStract[2])) | |
506 | + | then valueOrElse(parseInt(amountPoolActiveVoteStract[0]), 0) | |
507 | + | else valueOrElse(parseInt(amountPoolStract[1]), 0) | |
508 | + | let protocolReward = calculateProtocolReward(pool) | |
509 | + | if ((userPoolActiveVote != 0)) | |
510 | + | then { | |
511 | + | let limitShareToken = getShareLimitToken(addressFromStringValue(pool)) | |
512 | + | let shareToken = (fraction(limitShareToken, userPoolActiveVote, poolActiveVote) - userShareTokenLocked) | |
513 | + | if (if ((size(amountActiveVoteUserPoolStract) > 1)) | |
514 | + | then (valueOrElse(parseInt(amountActiveVoteUserPoolStract[1]), 0) >= harvestPeriod) | |
515 | + | else false) | |
516 | + | then throw("You can't share token") | |
517 | + | else if ((pmtAmount > limitShareToken)) | |
518 | + | then throw(("You can't share token more than " + toString(limitShareToken))) | |
519 | + | else if ((shareToken > 0)) | |
520 | + | then if ((fraction(99, (accountBalance(pmtAssetId) + pmtAmount), 100) > totalShareAmountNew)) | |
521 | + | then throw("Balance of share-token is greater than totalAmount") | |
522 | + | else if ((totalShareAmount == 0)) | |
523 | + | then (baseEntry ++ [ScriptTransfer(wallet, protocolReward, SWOP)]) | |
524 | + | else if ((shareToken >= pmtAmount)) | |
525 | + | then baseEntry | |
526 | + | else throw(("Your maximum share token is " + toString(shareToken))) | |
527 | + | else throw("You can't share token") | |
528 | + | } | |
529 | + | else throw("Your amount of token less than 0") | |
530 | + | } | |
531 | + | else baseEntry | |
519 | 532 | } | |
520 | 533 | ||
521 | 534 | ||
523 | 536 | @Callable(i) | |
524 | 537 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
525 | 538 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
526 | - | let $ | |
527 | - | let userNewInterest = $ | |
528 | - | let currentInterest = $ | |
529 | - | let claimAmount = $ | |
530 | - | let userShareTokensAmount = $ | |
539 | + | let $t02274422844 = claimCalc(pool, i.caller, 1) | |
540 | + | let userNewInterest = $t02274422844._1 | |
541 | + | let currentInterest = $t02274422844._2 | |
542 | + | let claimAmount = $t02274422844._3 | |
543 | + | let userShareTokensAmount = $t02274422844._4 | |
531 | 544 | let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount) | |
532 | 545 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
533 | 546 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
536 | 549 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
537 | 550 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
538 | 551 | then throw("Withdraw amount more then user locked amount") | |
539 | - | else if ((fraction(99, (accountBalance(shareTokensId) - shareTokensWithdrawAmount), 100) > totalShareAmountNew)) | |
540 | - | then throw("Balance of share-token is greater than totalAmount") | |
541 | - | else [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((pool + keyShareTokensLocked), totalShareAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), availableFundsNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
552 | + | else if (!(isActive)) | |
553 | + | then throw("DApp is inactive at this moment") | |
554 | + | else if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
555 | + | then throw("Withdraw amount more then user locked amount") | |
556 | + | else if ((fraction(99, (accountBalance(shareTokensId) - shareTokensWithdrawAmount), 100) > totalShareAmountNew)) | |
557 | + | then throw("Balance of share-token is greater than totalAmount") | |
558 | + | else [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((pool + keyShareTokensLocked), totalShareAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), availableFundsNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
542 | 559 | } | |
543 | 560 | ||
544 | 561 | ||
547 | 564 | func claim (pool) = { | |
548 | 565 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
549 | 566 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
550 | - | let $ | |
551 | - | let lastInterestHeight = $ | |
552 | - | let lastInterest = $ | |
553 | - | let $ | |
554 | - | let currentRewardPerBlock = $ | |
555 | - | let rewardUpdateHeight = $ | |
556 | - | let previousRewardPerBlock = $ | |
557 | - | let poolRewardUpdateHeight = $ | |
558 | - | let $ | |
559 | - | let userNewInterest = $ | |
560 | - | let currentInterest = $ | |
561 | - | let claimAmount = $ | |
562 | - | let userShareTokensAmount = $ | |
567 | + | let $t02485424919 = getLastInterestInfo(pool) | |
568 | + | let lastInterestHeight = $t02485424919._1 | |
569 | + | let lastInterest = $t02485424919._2 | |
570 | + | let $t02492425036 = rewardInfo(pool) | |
571 | + | let currentRewardPerBlock = $t02492425036._1 | |
572 | + | let rewardUpdateHeight = $t02492425036._2 | |
573 | + | let previousRewardPerBlock = $t02492425036._3 | |
574 | + | let poolRewardUpdateHeight = $t02492425036._4 | |
575 | + | let $t02504125141 = claimCalc(pool, i.caller, 1) | |
576 | + | let userNewInterest = $t02504125141._1 | |
577 | + | let currentInterest = $t02504125141._2 | |
578 | + | let claimAmount = $t02504125141._3 | |
579 | + | let userShareTokensAmount = $t02504125141._4 | |
563 | 580 | let availableFund = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
564 | 581 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
565 | 582 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
566 | 583 | if ((availableFund == 0)) | |
567 | 584 | then throw("You have 0 available SWOP") | |
568 | - | else if ((fraction(99, accountBalance(shareTokensId), 100) > shareTokenLocked)) | |
569 | - | then throw("Balance of share-token is greater than totalAmount") | |
570 | - | else [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), 0), Reissue(SWOP, availableFund, true), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), ScriptTransfer(i.caller, availableFund, SWOP)] | |
585 | + | else if (!(isActive)) | |
586 | + | then throw("DApp is inactive at this moment") | |
587 | + | else if ((availableFund == 0)) | |
588 | + | then throw("You have 0 available SWOP") | |
589 | + | else if ((fraction(99, accountBalance(shareTokensId), 100) > shareTokenLocked)) | |
590 | + | then throw("Balance of share-token is greater than totalAmount") | |
591 | + | else [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), 0), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), ScriptTransfer(i.caller, availableFund, SWOP)] | |
571 | 592 | } | |
593 | + | ||
594 | + | ||
595 | + | ||
596 | + | @Callable(i) | |
597 | + | func shutdown () = if (!(isActive)) | |
598 | + | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
599 | + | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
600 | + | then throw("Only admin can call this function") | |
601 | + | else suspend("Paused by admin") | |
602 | + | ||
603 | + | ||
604 | + | ||
605 | + | @Callable(i) | |
606 | + | func activate () = if (isActive) | |
607 | + | then throw("DApp is already active") | |
608 | + | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
609 | + | then throw("Only admin can call this function") | |
610 | + | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
572 | 611 | ||
573 | 612 | ||
574 | 613 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminPubKey1 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
5 | 5 | ||
6 | 6 | let adminPubKey2 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
7 | 7 | ||
8 | 8 | let adminPubKey3 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
9 | 9 | ||
10 | 10 | let keyShareTokensLocked = "_total_share_tokens_locked" | |
11 | 11 | ||
12 | 12 | let kShareLimit = "share_limit_on_first_harvest" | |
13 | + | ||
14 | + | let keyActive = "active" | |
15 | + | ||
16 | + | let keyCause = "shutdown_cause" | |
13 | 17 | ||
14 | 18 | let keyRewardPoolFractionCurrent = "_current_pool_fraction_reward" | |
15 | 19 | ||
16 | 20 | let keyRewardPoolFractionPrevious = "_previous_pool_fraction_reward" | |
17 | 21 | ||
18 | 22 | let keyHeightPoolFraction = "_pool_reward_update_height" | |
19 | 23 | ||
20 | 24 | let keyTotalRewardPerBlockCurrent = "total_reward_per_block_current" | |
21 | 25 | ||
22 | 26 | let keyTotalRewardPerBlockPrevious = "total_reward_per_block_previous" | |
23 | 27 | ||
24 | 28 | let keyRewardUpdateHeight = "reward_update_height" | |
25 | 29 | ||
26 | 30 | let keyLastInterest = "_last_interest" | |
27 | 31 | ||
28 | 32 | let keyLastInterestHeight = "_last_interest_height" | |
29 | 33 | ||
30 | 34 | let keyUserShareTokensLocked = "_share_tokens_locked" | |
31 | 35 | ||
32 | 36 | let keyUserLastInterest = "_last_interest" | |
33 | 37 | ||
34 | 38 | let keySWOPid = "SWOP_id" | |
35 | 39 | ||
36 | 40 | let keyUserSWOPClaimedAmount = "_SWOP_claimed_amount" | |
37 | 41 | ||
38 | 42 | let keyUserSWOPLastClaimedAmount = "_SWOP_last_claimed_amount" | |
39 | 43 | ||
40 | 44 | let keyAvailableSWOP = "_available_SWOP" | |
41 | 45 | ||
42 | 46 | let keyFarmingStartHeight = "farming_start_height" | |
43 | 47 | ||
44 | 48 | let keyAPY = "apy" | |
45 | 49 | ||
46 | 50 | let kPreviousTotalVoteSWOP = "previous_total_vote_SWOP" | |
47 | 51 | ||
48 | 52 | let keySwopYearEmission = "swop_year_emission" | |
49 | 53 | ||
50 | 54 | let keyBalancecpmmA = "A_asset_balance" | |
51 | 55 | ||
52 | 56 | let keyBalancecpmmB = "B_asset_balance" | |
53 | 57 | ||
54 | 58 | let kHarvestPoolActiveVoteStrucVoting = "_harvest_pool_activeVote_struc" | |
55 | 59 | ||
56 | 60 | let kHarvestUserPoolActiveVoteStrucVoting = "_harvest_user_pool_activeVote_struc" | |
57 | 61 | ||
58 | 62 | let keyLimitShareFirstHarvest = "share_limit_on_first_harvest" | |
59 | 63 | ||
60 | 64 | let keyAssetIdA = "A_asset_id" | |
61 | 65 | ||
62 | 66 | let keyAssetIdB = "B_asset_id" | |
63 | 67 | ||
64 | 68 | let keyFirstHarvestHeight = "first_harvest_height" | |
65 | 69 | ||
66 | 70 | let keyfirstHarvestCpmm = "first_harvest" | |
67 | 71 | ||
68 | 72 | let keyTempPrevSum = "sum_reward_previous" | |
69 | 73 | ||
70 | 74 | let keyTempCurSum = "sum_reward_current" | |
71 | 75 | ||
72 | 76 | let governanceAddress = Address(base58'3N5W8da2iiijVieA6qLGo7KzCJj8B19smWU') | |
73 | 77 | ||
74 | 78 | let wallet = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
75 | 79 | ||
76 | 80 | let votingAddress = Address(base58'3MrJgdL1GniipErHy44YF9idzLaUL2iX5DQ') | |
77 | 81 | ||
78 | 82 | let adminIncreaseInterestAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
79 | 83 | ||
80 | 84 | let oneWeekInBlock = 10106 | |
81 | 85 | ||
82 | 86 | let totalVoteShare = 10000000000 | |
83 | 87 | ||
84 | 88 | let scaleValue1 = 10 | |
85 | 89 | ||
86 | 90 | let scaleValue3 = 1000 | |
87 | 91 | ||
88 | 92 | let scaleValue5 = 100000 | |
89 | 93 | ||
90 | 94 | let scaleValue6 = 1000000 | |
91 | 95 | ||
92 | 96 | let scaleValue8 = 100000000 | |
93 | 97 | ||
94 | 98 | let scaleValue11 = 100000000000 | |
95 | 99 | ||
96 | 100 | func strAssetIdA (pool) = getStringValue(pool, keyAssetIdA) | |
97 | 101 | ||
98 | 102 | ||
99 | 103 | func strAssetIdB (pool) = getStringValue(pool, keyAssetIdB) | |
100 | 104 | ||
101 | 105 | ||
102 | 106 | func assetIdA (pool) = if ((strAssetIdA(pool) == "WAVES")) | |
103 | 107 | then unit | |
104 | 108 | else fromBase58String(strAssetIdA(pool)) | |
105 | 109 | ||
106 | 110 | ||
107 | 111 | func assetIdB (pool) = if ((strAssetIdB(pool) == "WAVES")) | |
108 | 112 | then unit | |
109 | 113 | else fromBase58String(strAssetIdB(pool)) | |
110 | 114 | ||
111 | 115 | ||
112 | 116 | let kBasePeriod = "base_period" | |
113 | 117 | ||
114 | 118 | let kPeriodLength = "period_length" | |
115 | 119 | ||
116 | 120 | let kStartHeight = "start_height" | |
117 | 121 | ||
118 | 122 | let kFirstHarvestHeight = "first_harvest_height" | |
119 | 123 | ||
120 | 124 | let kDurationFullVotePower = "duration_full_vote_power" | |
121 | 125 | ||
122 | 126 | let kMinVotePower = "min_vote_power" | |
123 | 127 | ||
124 | 128 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
125 | 129 | ||
126 | 130 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
127 | 131 | ||
128 | 132 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
129 | 133 | ||
130 | 134 | let durationFullVotePower = valueOrErrorMessage(getInteger(votingAddress, kDurationFullVotePower), "Empty kDurationFullVotePower") | |
131 | 135 | ||
132 | 136 | let minVotePower = valueOrErrorMessage(getInteger(votingAddress, kMinVotePower), "Empty kMinVotePower") | |
137 | + | ||
138 | + | let isActive = getBooleanValue(this, keyActive) | |
133 | 139 | ||
134 | 140 | let currPeriod = (basePeriod + ((height - startHeight) / periodLength)) | |
135 | 141 | ||
136 | 142 | func getLimitToken (pool) = valueOrElse(getIntegerValue(pool, keyLimitShareFirstHarvest), 0) | |
137 | 143 | ||
138 | 144 | ||
139 | 145 | let APY = getIntegerValue(this, keyAPY) | |
140 | 146 | ||
141 | 147 | let SwopYearEmission = getIntegerValue(this, keySwopYearEmission) | |
142 | 148 | ||
143 | 149 | func assetNameA (pool) = match assetIdA(pool) { | |
144 | 150 | case id: ByteVector => | |
145 | 151 | value(assetInfo(id)).name | |
146 | 152 | case waves: Unit => | |
147 | 153 | "WAVES" | |
148 | 154 | case _ => | |
149 | 155 | throw("Match error") | |
150 | 156 | } | |
151 | 157 | ||
152 | 158 | ||
153 | 159 | func assetNameB (pool) = match assetIdB(pool) { | |
154 | 160 | case id: ByteVector => | |
155 | 161 | value(assetInfo(id)).name | |
156 | 162 | case waves: Unit => | |
157 | 163 | "WAVES" | |
158 | 164 | case _ => | |
159 | 165 | throw("Match error") | |
160 | 166 | } | |
161 | 167 | ||
162 | 168 | ||
163 | 169 | let SWOP = fromBase58String(getStringValue(this, keySWOPid)) | |
164 | 170 | ||
165 | 171 | func isFirstHarvest (pool) = valueOrElse(getBoolean(pool, keyfirstHarvestCpmm), false) | |
166 | 172 | ||
167 | 173 | ||
168 | 174 | func getHeightFirstHarvest (pool) = valueOrElse(getInteger(pool, keyFirstHarvestHeight), 0) | |
169 | 175 | ||
170 | 176 | ||
171 | 177 | func getBalanceA (pool) = valueOrErrorMessage(getInteger(pool, keyBalancecpmmA), ("No data on the key: " + keyBalancecpmmA)) | |
172 | 178 | ||
173 | 179 | ||
174 | 180 | func getBalanceB (pool) = valueOrErrorMessage(getInteger(pool, keyBalancecpmmB), ("No data on the key: " + keyBalancecpmmB)) | |
175 | 181 | ||
176 | 182 | ||
177 | 183 | func getShareLimitToken (pool) = valueOrErrorMessage(getInteger(pool, kShareLimit), ("No data on the key: " + kShareLimit)) | |
178 | 184 | ||
179 | 185 | ||
180 | 186 | func getTotalShareTokenLocked (pool) = valueOrErrorMessage(getInteger(this, (pool + keyShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked)) | |
181 | 187 | ||
182 | 188 | ||
183 | 189 | func getShareAssetId (pool) = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
184 | 190 | ||
185 | 191 | ||
186 | 192 | func accountBalance (assetId) = match assetId { | |
187 | 193 | case id: ByteVector => | |
188 | 194 | assetBalance(this, id) | |
189 | 195 | case waves: Unit => | |
190 | 196 | wavesBalance(this).available | |
191 | 197 | case _ => | |
192 | 198 | throw("Match error") | |
193 | 199 | } | |
194 | 200 | ||
195 | 201 | ||
196 | 202 | func getAssetInfo (assetId) = match assetId { | |
197 | 203 | case id: ByteVector => | |
198 | 204 | let stringId = toBase58String(id) | |
199 | 205 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
200 | 206 | $Tuple3(stringId, info.name, info.decimals) | |
201 | 207 | case waves: Unit => | |
202 | 208 | $Tuple3("WAVES", "WAVES", 8) | |
203 | 209 | case _ => | |
204 | 210 | throw("Match error") | |
205 | 211 | } | |
206 | 212 | ||
207 | 213 | ||
208 | 214 | func calcScaleValue (assetId1,assetId2) = { | |
209 | 215 | let assetId1Decimals = value(assetInfo(assetId1)).decimals | |
210 | 216 | let assetId2Decimals = value(assetInfo(assetId2)).decimals | |
211 | 217 | let scaleDigits = ((assetId2Decimals - assetId1Decimals) + 8) | |
212 | 218 | pow(10, 0, scaleDigits, 0, 0, HALFDOWN) | |
213 | 219 | } | |
214 | 220 | ||
215 | 221 | ||
216 | 222 | func userAvailableSWOP (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyAvailableSWOP)), 0) | |
217 | 223 | ||
218 | 224 | ||
219 | 225 | func rewardInfo (pool) = { | |
220 | 226 | let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger(governanceAddress, keyTotalRewardPerBlockCurrent), ((("No data on the key: " + keyTotalRewardPerBlockCurrent) + " at address ") + toString(governanceAddress))) | |
221 | 227 | let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger(governanceAddress, keyTotalRewardPerBlockPrevious), ((("No data on the key: " + keyTotalRewardPerBlockPrevious) + " at address ") + toString(governanceAddress))) | |
222 | 228 | let rewardPoolFractionCurrent = valueOrErrorMessage(getInteger(governanceAddress, (pool + keyRewardPoolFractionCurrent)), (((("No data on the key: " + pool) + keyRewardPoolFractionCurrent) + " at address ") + toString(governanceAddress))) | |
223 | 229 | let rewardUpdateHeight = valueOrErrorMessage(getInteger(governanceAddress, keyRewardUpdateHeight), ((("No data on the key: " + keyRewardUpdateHeight) + " at address ") + toString(governanceAddress))) | |
224 | 230 | let poolRewardUpdateHeight = valueOrElse(getInteger(governanceAddress, (pool + keyHeightPoolFraction)), 0) | |
225 | 231 | let rewardPoolFractionPrevious = valueOrErrorMessage(getInteger(governanceAddress, (pool + keyRewardPoolFractionPrevious)), (((("No data on the key: " + pool) + keyRewardPoolFractionPrevious) + " at address ") + toString(governanceAddress))) | |
226 | 232 | let rewardPoolCurrent = fraction(totalRewardPerBlockCurrent, rewardPoolFractionCurrent, totalVoteShare) | |
227 | 233 | let rewardPoolPrevious = fraction(totalRewardPerBlockPrevious, rewardPoolFractionPrevious, totalVoteShare) | |
228 | 234 | if (if ((rewardPoolCurrent > totalRewardPerBlockCurrent)) | |
229 | 235 | then true | |
230 | 236 | else (rewardPoolPrevious > totalRewardPerBlockPrevious)) | |
231 | 237 | then throw("rewardPoolCurrent > totalRewardPerBlockCurrent or rewardPoolPrevious > totalRewardPerBlockPrevious") | |
232 | 238 | else $Tuple4(rewardPoolCurrent, rewardUpdateHeight, rewardPoolPrevious, poolRewardUpdateHeight) | |
233 | 239 | } | |
234 | 240 | ||
235 | 241 | ||
236 | 242 | func getLastInterestInfo (pool) = { | |
237 | 243 | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (("No data on the key: " + pool) + keyLastInterest)) | |
238 | 244 | let lastInterestHeight = valueOrElse(getInteger(this, (pool + keyLastInterestHeight)), height) | |
239 | 245 | $Tuple2(lastInterestHeight, lastInterest) | |
240 | 246 | } | |
241 | 247 | ||
242 | 248 | ||
243 | 249 | func getUserInterestInfo (pool,userAddress) = { | |
244 | 250 | let userLastInterest = getInteger(this, (((pool + "_") + toString(userAddress)) + keyUserLastInterest)) | |
245 | 251 | let userShare = getInteger(this, (((pool + "_") + toString(userAddress)) + keyUserShareTokensLocked)) | |
246 | 252 | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (("No data on the key: " + pool) + keyLastInterest)) | |
247 | 253 | let userLastInterestValue = match userLastInterest { | |
248 | 254 | case userLastInterest: Int => | |
249 | 255 | userLastInterest | |
250 | 256 | case _ => | |
251 | 257 | lastInterest | |
252 | 258 | } | |
253 | 259 | let userShareTokensAmount = match userShare { | |
254 | 260 | case userShare: Int => | |
255 | 261 | userShare | |
256 | 262 | case _ => | |
257 | 263 | 0 | |
258 | 264 | } | |
259 | 265 | $Tuple2(userLastInterestValue, userShareTokensAmount) | |
260 | 266 | } | |
261 | 267 | ||
262 | 268 | ||
263 | 269 | func calcInterest (lastInterestHeight,rewardUpdateHeight,poolRewardUpdateHeight,lastInterest,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,shareAssetId,scaleValue,pmtAmount) = if ((shareTokenLocked == 0)) | |
264 | 270 | then 0 | |
265 | 271 | else if ((poolRewardUpdateHeight != 0)) | |
266 | 272 | then if (if ((rewardUpdateHeight > height)) | |
267 | 273 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
268 | 274 | else false) | |
269 | 275 | then { | |
270 | 276 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
271 | 277 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
272 | 278 | } | |
273 | 279 | else if (if ((height > rewardUpdateHeight)) | |
274 | 280 | then (rewardUpdateHeight != poolRewardUpdateHeight) | |
275 | 281 | else false) | |
276 | 282 | then { | |
277 | 283 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
278 | 284 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
279 | 285 | } | |
280 | 286 | else if (if (if ((height > rewardUpdateHeight)) | |
281 | 287 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
282 | 288 | else false) | |
283 | 289 | then (lastInterestHeight > rewardUpdateHeight) | |
284 | 290 | else false) | |
285 | 291 | then { | |
286 | 292 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
287 | 293 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
288 | 294 | } | |
289 | 295 | else { | |
290 | 296 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
291 | 297 | let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked)) | |
292 | 298 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
293 | 299 | (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked)) | |
294 | 300 | } | |
295 | 301 | else if ((rewardUpdateHeight > height)) | |
296 | 302 | then { | |
297 | 303 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
298 | 304 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
299 | 305 | } | |
300 | 306 | else if ((lastInterestHeight > rewardUpdateHeight)) | |
301 | 307 | then { | |
302 | 308 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
303 | 309 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
304 | 310 | } | |
305 | 311 | else { | |
306 | 312 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
307 | 313 | let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked)) | |
308 | 314 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
309 | 315 | (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked)) | |
310 | 316 | } | |
311 | 317 | ||
312 | 318 | ||
313 | 319 | func claimCalc (pool,caller,pmtAmount) = { | |
314 | 320 | let shareAssetId = getShareAssetId(pool) | |
315 | 321 | let scaleValue = calcScaleValue(SWOP, shareAssetId) | |
316 | 322 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
317 | - | let $ | |
318 | - | let lastInterestHeight = $ | |
319 | - | let lastInterest = $ | |
320 | - | let $ | |
321 | - | let currentRewardPerBlock = $ | |
322 | - | let rewardUpdateHeight = $ | |
323 | - | let previousRewardPerBlock = $ | |
324 | - | let poolRewardUpdateHeight = $ | |
325 | - | let $ | |
326 | - | let userLastInterest = $ | |
327 | - | let userShareTokensAmount = $ | |
323 | + | let $t01314613211 = getLastInterestInfo(pool) | |
324 | + | let lastInterestHeight = $t01314613211._1 | |
325 | + | let lastInterest = $t01314613211._2 | |
326 | + | let $t01321613328 = rewardInfo(pool) | |
327 | + | let currentRewardPerBlock = $t01321613328._1 | |
328 | + | let rewardUpdateHeight = $t01321613328._2 | |
329 | + | let previousRewardPerBlock = $t01321613328._3 | |
330 | + | let poolRewardUpdateHeight = $t01321613328._4 | |
331 | + | let $t01333313412 = getUserInterestInfo(pool, caller) | |
332 | + | let userLastInterest = $t01333313412._1 | |
333 | + | let userShareTokensAmount = $t01333313412._2 | |
328 | 334 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, poolRewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue, pmtAmount) | |
329 | 335 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue) | |
330 | 336 | let userNewInterest = currentInterest | |
331 | 337 | $Tuple4(userNewInterest, currentInterest, claimAmount, userShareTokensAmount) | |
332 | 338 | } | |
333 | 339 | ||
334 | 340 | ||
335 | 341 | func calculateProtocolReward (pool) = { | |
336 | - | let $ | |
337 | - | let lastInterestHeight = $ | |
338 | - | let lastInterest = $ | |
339 | - | let $ | |
340 | - | let currentRewardPerBlock = $ | |
341 | - | let rewardUpdateHeight = $ | |
342 | - | let previousRewardPerBlock = $ | |
343 | - | let poolRewardUpdateHeight = $ | |
342 | + | let $t01393013995 = getLastInterestInfo(pool) | |
343 | + | let lastInterestHeight = $t01393013995._1 | |
344 | + | let lastInterest = $t01393013995._2 | |
345 | + | let $t01400014111 = rewardInfo(pool) | |
346 | + | let currentRewardPerBlock = $t01400014111._1 | |
347 | + | let rewardUpdateHeight = $t01400014111._2 | |
348 | + | let previousRewardPerBlock = $t01400014111._3 | |
349 | + | let poolRewardUpdateHeight = $t01400014111._4 | |
344 | 350 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
345 | 351 | if (if ((shareTokenLocked == 0)) | |
346 | 352 | then (poolRewardUpdateHeight == 0) | |
347 | 353 | else false) | |
348 | 354 | then if ((rewardUpdateHeight > height)) | |
349 | 355 | then { | |
350 | 356 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
351 | 357 | reward | |
352 | 358 | } | |
353 | 359 | else if ((lastInterestHeight > rewardUpdateHeight)) | |
354 | 360 | then { | |
355 | 361 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
356 | 362 | reward | |
357 | 363 | } | |
358 | 364 | else { | |
359 | 365 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
360 | 366 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
361 | 367 | (reward + rewardAfterLastInterestBeforeReawardUpdate) | |
362 | 368 | } | |
363 | 369 | else if (if ((shareTokenLocked == 0)) | |
364 | 370 | then (poolRewardUpdateHeight != 0) | |
365 | 371 | else false) | |
366 | 372 | then if (if ((rewardUpdateHeight > height)) | |
367 | 373 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
368 | 374 | else false) | |
369 | 375 | then { | |
370 | 376 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
371 | 377 | reward | |
372 | 378 | } | |
373 | 379 | else if (if ((height > rewardUpdateHeight)) | |
374 | 380 | then (rewardUpdateHeight != poolRewardUpdateHeight) | |
375 | 381 | else false) | |
376 | 382 | then { | |
377 | 383 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
378 | 384 | reward | |
379 | 385 | } | |
380 | 386 | else if (if (if ((height > rewardUpdateHeight)) | |
381 | 387 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
382 | 388 | else false) | |
383 | 389 | then (lastInterestHeight > rewardUpdateHeight) | |
384 | 390 | else false) | |
385 | 391 | then { | |
386 | 392 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
387 | 393 | reward | |
388 | 394 | } | |
389 | 395 | else { | |
390 | 396 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
391 | 397 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
392 | 398 | (reward + rewardAfterLastInterestBeforeReawardUpdate) | |
393 | 399 | } | |
394 | 400 | else 0 | |
395 | 401 | } | |
396 | 402 | ||
397 | 403 | ||
398 | 404 | func checkPmtAssetIdCorrect (pool,pmtAssetId) = { | |
399 | 405 | let poolShareAssetId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
400 | 406 | if ((pmtAssetId == poolShareAssetId)) | |
401 | 407 | then true | |
402 | 408 | else false | |
403 | 409 | } | |
404 | 410 | ||
405 | 411 | ||
406 | 412 | func getUserSWOPClaimedAmount (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyUserSWOPClaimedAmount)), 0) | |
407 | 413 | ||
408 | 414 | ||
415 | + | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
416 | + | ||
417 | + | ||
409 | 418 | @Callable(i) | |
410 | 419 | func init (earlyLP) = if (isDefined(getString(this, keySWOPid))) | |
411 | 420 | then throw("SWOP already initialized") | |
412 | 421 | else { | |
413 | 422 | let initAmount = 100000000000000 | |
414 | 423 | let SWOPissue = Issue("SWOP", "SWOP protocol token", initAmount, 8, true) | |
415 | 424 | let SWOPid = calculateAssetId(SWOPissue) | |
416 | - | [Issue("SWOP", "SWOP protocol token", initAmount, 8, true), StringEntry(keySWOPid, toBase58String(SWOPid))] | |
425 | + | [BooleanEntry(keyActive, true), Issue("SWOP", "SWOP protocol token", initAmount, 8, true), StringEntry(keySWOPid, toBase58String(SWOPid))] | |
417 | 426 | } | |
418 | 427 | ||
419 | 428 | ||
420 | 429 | ||
421 | 430 | @Callable(i) | |
422 | 431 | func initPoolShareFarming (pool) = if ((i.caller != this)) | |
423 | 432 | then throw("Only the DApp itself can call this function") | |
424 | 433 | else { | |
425 | - | let $ | |
426 | - | let currentReward = $ | |
427 | - | let rewardUpdateHeight = $ | |
428 | - | let previousRewardPerBlock = $ | |
429 | - | let poolRewardUpdateHeight = $ | |
434 | + | let $t01709717200 = rewardInfo(pool) | |
435 | + | let currentReward = $t01709717200._1 | |
436 | + | let rewardUpdateHeight = $t01709717200._2 | |
437 | + | let previousRewardPerBlock = $t01709717200._3 | |
438 | + | let poolRewardUpdateHeight = $t01709717200._4 | |
430 | 439 | [IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyLastInterestHeight), height)] | |
431 | 440 | } | |
432 | 441 | ||
433 | 442 | ||
434 | 443 | ||
435 | 444 | @Callable(i) | |
436 | 445 | func updatePoolInterest (pool) = if ((i.caller != wallet)) | |
437 | 446 | then throw("Only the Admin itself can call this function") | |
438 | - | else { | |
439 | - | let $t01724217362 = claimCalc(pool, adminIncreaseInterestAddress, 0) | |
440 | - | let userNewInterest = $t01724217362._1 | |
441 | - | let currentInterest = $t01724217362._2 | |
442 | - | let claimAmount = $t01724217362._3 | |
443 | - | let userShareTokensAmount = $t01724217362._4 | |
444 | - | let $t01736717470 = rewardInfo(pool) | |
445 | - | let currentReward = $t01736717470._1 | |
446 | - | let rewardUpdateHeight = $t01736717470._2 | |
447 | - | let previousRewardPerBlock = $t01736717470._3 | |
448 | - | let poolRewardUpdateHeight = $t01736717470._4 | |
447 | + | else if (!(isActive)) | |
448 | + | then throw("DApp is inactive at this moment") | |
449 | + | else { | |
450 | + | let $t01760917729 = claimCalc(pool, adminIncreaseInterestAddress, 0) | |
451 | + | let userNewInterest = $t01760917729._1 | |
452 | + | let currentInterest = $t01760917729._2 | |
453 | + | let claimAmount = $t01760917729._3 | |
454 | + | let userShareTokensAmount = $t01760917729._4 | |
455 | + | let $t01773417837 = rewardInfo(pool) | |
456 | + | let currentReward = $t01773417837._1 | |
457 | + | let rewardUpdateHeight = $t01773417837._2 | |
458 | + | let previousRewardPerBlock = $t01773417837._3 | |
459 | + | let poolRewardUpdateHeight = $t01773417837._4 | |
449 | 460 | [IntegerEntry((pool + keyLastInterest), userNewInterest), IntegerEntry((pool + keyLastInterestHeight), height)] | |
450 | - | } | |
461 | + | } | |
451 | 462 | ||
452 | 463 | ||
453 | 464 | ||
454 | 465 | @Callable(i) | |
455 | 466 | func lockShareTokens (pool) = { | |
456 | - | let $ | |
457 | - | let pmtAmount = $ | |
458 | - | let pmtAssetId = $ | |
459 | - | let $ | |
460 | - | let pmtStrAssetId = $ | |
461 | - | let pmtAssetName = $ | |
462 | - | let pmtDecimals = $ | |
463 | - | let $ | |
464 | - | let userNewInterest = $ | |
465 | - | let currentInterest = $ | |
466 | - | let claimAmount = $ | |
467 | - | let userShareTokensAmount = $ | |
467 | + | let $t01802918104 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
468 | + | let pmtAmount = $t01802918104._1 | |
469 | + | let pmtAssetId = $t01802918104._2 | |
470 | + | let $t01810918182 = getAssetInfo(pmtAssetId) | |
471 | + | let pmtStrAssetId = $t01810918182._1 | |
472 | + | let pmtAssetName = $t01810918182._2 | |
473 | + | let pmtDecimals = $t01810918182._3 | |
474 | + | let $t01818718295 = claimCalc(pool, i.caller, pmtAmount) | |
475 | + | let userNewInterest = $t01818718295._1 | |
476 | + | let currentInterest = $t01818718295._2 | |
477 | + | let claimAmount = $t01818718295._3 | |
478 | + | let userShareTokensAmount = $t01818718295._4 | |
468 | 479 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
469 | 480 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
470 | 481 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
471 | 482 | let totalShareAmountNew = (totalShareAmount + pmtAmount) | |
472 | 483 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
473 | 484 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
474 | 485 | let baseEntry = [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyShareTokensLocked), totalShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), availableFundsNew)] | |
475 | 486 | if ((0 >= pmtAmount)) | |
476 | 487 | then throw("You can't lock token") | |
477 | - | else if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
478 | - | then throw("Incorrect pmtAssetId") | |
479 | - | else if (if (isFirstHarvest(Address(fromBase58String(pool)))) | |
480 | - | then (getHeightFirstHarvest(Address(fromBase58String(pool))) > height) | |
481 | - | else false) | |
482 | - | then { | |
483 | - | let harvestPeriod = ((((getHeightFirstHarvest(Address(fromBase58String(pool))) - startHeight) + 1) / periodLength) - 1) | |
484 | - | let amountOfVoting = split(getStringValue(votingAddress, (((toString(i.caller) + "_") + pool) + "_user_pool_struc")), "_") | |
485 | - | let amountPoolStract = split(getStringValue(votingAddress, (pool + "_pool_struc")), "_") | |
486 | - | let amountActiveVoteUserPoolStract = split(valueOrElse(getString(votingAddress, (((toString(i.caller) + "_") + pool) + kHarvestUserPoolActiveVoteStrucVoting)), ""), "_") | |
487 | - | let amountPoolActiveVoteStract = split(valueOrElse(getString(votingAddress, (pool + kHarvestPoolActiveVoteStrucVoting)), ""), "_") | |
488 | - | let userShareTokenLocked = userShareTokensAmount | |
489 | - | let userPoolActiveVote = if ((toString(currPeriod) == amountOfVoting[2])) | |
490 | - | then valueOrElse(parseInt(amountActiveVoteUserPoolStract[0]), 0) | |
491 | - | else valueOrElse(parseInt(amountOfVoting[1]), 0) | |
492 | - | let poolActiveVote = if ((toString(currPeriod) == amountPoolStract[2])) | |
493 | - | then valueOrElse(parseInt(amountPoolActiveVoteStract[0]), 0) | |
494 | - | else valueOrElse(parseInt(amountPoolStract[1]), 0) | |
495 | - | let protocolReward = calculateProtocolReward(pool) | |
496 | - | if ((userPoolActiveVote != 0)) | |
497 | - | then { | |
498 | - | let limitShareToken = getShareLimitToken(addressFromStringValue(pool)) | |
499 | - | let shareToken = (fraction(limitShareToken, userPoolActiveVote, poolActiveVote) - userShareTokenLocked) | |
500 | - | if (if ((size(amountActiveVoteUserPoolStract) > 1)) | |
501 | - | then (valueOrElse(parseInt(amountActiveVoteUserPoolStract[1]), 0) >= harvestPeriod) | |
502 | - | else false) | |
503 | - | then throw("You can't share token") | |
504 | - | else if ((pmtAmount > limitShareToken)) | |
505 | - | then throw(("You can't share token more than " + toString(limitShareToken))) | |
506 | - | else if ((shareToken > 0)) | |
507 | - | then if ((fraction(99, (accountBalance(pmtAssetId) + pmtAmount), 100) > totalShareAmountNew)) | |
508 | - | then throw("Balance of share-token is greater than totalAmount") | |
509 | - | else if ((totalShareAmount == 0)) | |
510 | - | then (baseEntry ++ [Reissue(SWOP, protocolReward, true), ScriptTransfer(wallet, protocolReward, SWOP)]) | |
511 | - | else if ((shareToken >= pmtAmount)) | |
512 | - | then baseEntry | |
513 | - | else throw(("Your maximum share token is " + toString(shareToken))) | |
514 | - | else throw("You can't share token") | |
515 | - | } | |
516 | - | else throw("Your amount of token less than 0") | |
517 | - | } | |
518 | - | else baseEntry | |
488 | + | else if (!(isActive)) | |
489 | + | then throw("DApp is inactive at this moment") | |
490 | + | else if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
491 | + | then throw("Incorrect pmtAssetId") | |
492 | + | else if (if (isFirstHarvest(Address(fromBase58String(pool)))) | |
493 | + | then (getHeightFirstHarvest(Address(fromBase58String(pool))) > height) | |
494 | + | else false) | |
495 | + | then { | |
496 | + | let harvestPeriod = ((((getHeightFirstHarvest(Address(fromBase58String(pool))) - startHeight) + 1) / periodLength) - 1) | |
497 | + | let amountOfVoting = split(getStringValue(votingAddress, (((toString(i.caller) + "_") + pool) + "_user_pool_struc")), "_") | |
498 | + | let amountPoolStract = split(getStringValue(votingAddress, (pool + "_pool_struc")), "_") | |
499 | + | let amountActiveVoteUserPoolStract = split(valueOrElse(getString(votingAddress, (((toString(i.caller) + "_") + pool) + kHarvestUserPoolActiveVoteStrucVoting)), ""), "_") | |
500 | + | let amountPoolActiveVoteStract = split(valueOrElse(getString(votingAddress, (pool + kHarvestPoolActiveVoteStrucVoting)), ""), "_") | |
501 | + | let userShareTokenLocked = userShareTokensAmount | |
502 | + | let userPoolActiveVote = if ((toString(currPeriod) == amountOfVoting[2])) | |
503 | + | then valueOrElse(parseInt(amountActiveVoteUserPoolStract[0]), 0) | |
504 | + | else valueOrElse(parseInt(amountOfVoting[1]), 0) | |
505 | + | let poolActiveVote = if ((toString(currPeriod) == amountPoolStract[2])) | |
506 | + | then valueOrElse(parseInt(amountPoolActiveVoteStract[0]), 0) | |
507 | + | else valueOrElse(parseInt(amountPoolStract[1]), 0) | |
508 | + | let protocolReward = calculateProtocolReward(pool) | |
509 | + | if ((userPoolActiveVote != 0)) | |
510 | + | then { | |
511 | + | let limitShareToken = getShareLimitToken(addressFromStringValue(pool)) | |
512 | + | let shareToken = (fraction(limitShareToken, userPoolActiveVote, poolActiveVote) - userShareTokenLocked) | |
513 | + | if (if ((size(amountActiveVoteUserPoolStract) > 1)) | |
514 | + | then (valueOrElse(parseInt(amountActiveVoteUserPoolStract[1]), 0) >= harvestPeriod) | |
515 | + | else false) | |
516 | + | then throw("You can't share token") | |
517 | + | else if ((pmtAmount > limitShareToken)) | |
518 | + | then throw(("You can't share token more than " + toString(limitShareToken))) | |
519 | + | else if ((shareToken > 0)) | |
520 | + | then if ((fraction(99, (accountBalance(pmtAssetId) + pmtAmount), 100) > totalShareAmountNew)) | |
521 | + | then throw("Balance of share-token is greater than totalAmount") | |
522 | + | else if ((totalShareAmount == 0)) | |
523 | + | then (baseEntry ++ [ScriptTransfer(wallet, protocolReward, SWOP)]) | |
524 | + | else if ((shareToken >= pmtAmount)) | |
525 | + | then baseEntry | |
526 | + | else throw(("Your maximum share token is " + toString(shareToken))) | |
527 | + | else throw("You can't share token") | |
528 | + | } | |
529 | + | else throw("Your amount of token less than 0") | |
530 | + | } | |
531 | + | else baseEntry | |
519 | 532 | } | |
520 | 533 | ||
521 | 534 | ||
522 | 535 | ||
523 | 536 | @Callable(i) | |
524 | 537 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
525 | 538 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
526 | - | let $ | |
527 | - | let userNewInterest = $ | |
528 | - | let currentInterest = $ | |
529 | - | let claimAmount = $ | |
530 | - | let userShareTokensAmount = $ | |
539 | + | let $t02274422844 = claimCalc(pool, i.caller, 1) | |
540 | + | let userNewInterest = $t02274422844._1 | |
541 | + | let currentInterest = $t02274422844._2 | |
542 | + | let claimAmount = $t02274422844._3 | |
543 | + | let userShareTokensAmount = $t02274422844._4 | |
531 | 544 | let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount) | |
532 | 545 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
533 | 546 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
534 | 547 | let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount) | |
535 | 548 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
536 | 549 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
537 | 550 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
538 | 551 | then throw("Withdraw amount more then user locked amount") | |
539 | - | else if ((fraction(99, (accountBalance(shareTokensId) - shareTokensWithdrawAmount), 100) > totalShareAmountNew)) | |
540 | - | then throw("Balance of share-token is greater than totalAmount") | |
541 | - | else [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((pool + keyShareTokensLocked), totalShareAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), availableFundsNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
552 | + | else if (!(isActive)) | |
553 | + | then throw("DApp is inactive at this moment") | |
554 | + | else if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
555 | + | then throw("Withdraw amount more then user locked amount") | |
556 | + | else if ((fraction(99, (accountBalance(shareTokensId) - shareTokensWithdrawAmount), 100) > totalShareAmountNew)) | |
557 | + | then throw("Balance of share-token is greater than totalAmount") | |
558 | + | else [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((pool + keyShareTokensLocked), totalShareAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), availableFundsNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
542 | 559 | } | |
543 | 560 | ||
544 | 561 | ||
545 | 562 | ||
546 | 563 | @Callable(i) | |
547 | 564 | func claim (pool) = { | |
548 | 565 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
549 | 566 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
550 | - | let $ | |
551 | - | let lastInterestHeight = $ | |
552 | - | let lastInterest = $ | |
553 | - | let $ | |
554 | - | let currentRewardPerBlock = $ | |
555 | - | let rewardUpdateHeight = $ | |
556 | - | let previousRewardPerBlock = $ | |
557 | - | let poolRewardUpdateHeight = $ | |
558 | - | let $ | |
559 | - | let userNewInterest = $ | |
560 | - | let currentInterest = $ | |
561 | - | let claimAmount = $ | |
562 | - | let userShareTokensAmount = $ | |
567 | + | let $t02485424919 = getLastInterestInfo(pool) | |
568 | + | let lastInterestHeight = $t02485424919._1 | |
569 | + | let lastInterest = $t02485424919._2 | |
570 | + | let $t02492425036 = rewardInfo(pool) | |
571 | + | let currentRewardPerBlock = $t02492425036._1 | |
572 | + | let rewardUpdateHeight = $t02492425036._2 | |
573 | + | let previousRewardPerBlock = $t02492425036._3 | |
574 | + | let poolRewardUpdateHeight = $t02492425036._4 | |
575 | + | let $t02504125141 = claimCalc(pool, i.caller, 1) | |
576 | + | let userNewInterest = $t02504125141._1 | |
577 | + | let currentInterest = $t02504125141._2 | |
578 | + | let claimAmount = $t02504125141._3 | |
579 | + | let userShareTokensAmount = $t02504125141._4 | |
563 | 580 | let availableFund = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
564 | 581 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
565 | 582 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
566 | 583 | if ((availableFund == 0)) | |
567 | 584 | then throw("You have 0 available SWOP") | |
568 | - | else if ((fraction(99, accountBalance(shareTokensId), 100) > shareTokenLocked)) | |
569 | - | then throw("Balance of share-token is greater than totalAmount") | |
570 | - | else [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), 0), Reissue(SWOP, availableFund, true), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), ScriptTransfer(i.caller, availableFund, SWOP)] | |
585 | + | else if (!(isActive)) | |
586 | + | then throw("DApp is inactive at this moment") | |
587 | + | else if ((availableFund == 0)) | |
588 | + | then throw("You have 0 available SWOP") | |
589 | + | else if ((fraction(99, accountBalance(shareTokensId), 100) > shareTokenLocked)) | |
590 | + | then throw("Balance of share-token is greater than totalAmount") | |
591 | + | else [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), 0), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), ScriptTransfer(i.caller, availableFund, SWOP)] | |
571 | 592 | } | |
593 | + | ||
594 | + | ||
595 | + | ||
596 | + | @Callable(i) | |
597 | + | func shutdown () = if (!(isActive)) | |
598 | + | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
599 | + | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
600 | + | then throw("Only admin can call this function") | |
601 | + | else suspend("Paused by admin") | |
602 | + | ||
603 | + | ||
604 | + | ||
605 | + | @Callable(i) | |
606 | + | func activate () = if (isActive) | |
607 | + | then throw("DApp is already active") | |
608 | + | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
609 | + | then throw("Only admin can call this function") | |
610 | + | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
572 | 611 | ||
573 | 612 | ||
574 | 613 | @Verifier(tx) | |
575 | 614 | func verify () = match tx { | |
576 | 615 | case _ => | |
577 | 616 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
578 | 617 | } | |
579 | 618 |
github/deemru/w8io/026f985 88.73 ms ◑