tx · D1KSoMS8xTczkowcuS4f3nwAtd3weNs2GevxnBKRU9h8

3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT:  -0.01400000 Waves

2021.06.07 21:09 [1560278] smart account 3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT > SELF 0.00000000 Waves

{ "type": 13, "id": "D1KSoMS8xTczkowcuS4f3nwAtd3weNs2GevxnBKRU9h8", "fee": 1400000, "feeAssetId": null, "timestamp": 1623089390442, "version": 2, "chainId": 84, "sender": "3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT", "senderPublicKey": "3ijdmxaYrpDFsKVbQH2kvB7i6JzHj9bep9bGWiQPra2D", "proofs": [ "4gk1szWEdbEKmRHQnHTSezU8DbavQQfGJiL8jnx8dVXybFdFNVWZgDKCpvBDfg2TLAwKuKNepwdiNgjZ6ZdJXQvF" ], "script": "base64:AAIEAAAAAAAAABwIAhIDCgEIEgMKAQgSAwoBCBIECgIIARIDCgEIAAAAVAAAAAAMYWRtaW5QdWJLZXkxAQAAACAEz3XlZNDBD05nuR8TZMQaDeqEJEIxfTOQXUBYCp2TSgAAAAAMYWRtaW5QdWJLZXkyAQAAACAEz3XlZNDBD05nuR8TZMQaDeqEJEIxfTOQXUBYCp2TSgAAAAAMYWRtaW5QdWJLZXkzAQAAACAEz3XlZNDBD05nuR8TZMQaDeqEJEIxfTOQXUBYCp2TSgAAAAAUa2V5U2hhcmVUb2tlbnNMb2NrZWQCAAAAGl90b3RhbF9zaGFyZV90b2tlbnNfbG9ja2VkAAAAAAtrU2hhcmVMaW1pdAIAAAAcc2hhcmVfbGltaXRfb25fZmlyc3RfaGFydmVzdAAAAAAca2V5UmV3YXJkUG9vbEZyYWN0aW9uQ3VycmVudAIAAAAdX2N1cnJlbnRfcG9vbF9mcmFjdGlvbl9yZXdhcmQAAAAAHWtleVJld2FyZFBvb2xGcmFjdGlvblByZXZpb3VzAgAAAB5fcHJldmlvdXNfcG9vbF9mcmFjdGlvbl9yZXdhc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lZEFtb3VudE5ldwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgUAAAAEcG9vbAIAAAABXwkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIFAAAAHGtleVVzZXJTV09QTGFzdENsYWltZWRBbW91bnQFAAAAC2NsYWltQW1vdW50CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAANYXZhaWxhYmxlRnVuZAUAAAAEU1dPUAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5JABeGA==", "height": 1560278, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HNbPDUqwjx799hmRNxZsesubPNv6KecHMdguGpUCtrje Next: 4ZzKWWxeVCpKBDFrfkRRmziHWh5aGSzhY2D3sXNst7B6 Diff:
OldNewDifferences
200200 func userAvailableSWOP (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyAvailableSWOP)), 0)
201201
202202
203+func isPoolUnderway (pool) = if ((pool == "3PCdNCULgjM9ZMLEt61M45qxV26ro6o48Jj"))
204+ then true
205+ else (pool == "3PMcDUBDyjNB1fkRGeLGpsz1ZQPfcmyp4r5")
206+
207+
203208 func rewardInfo (pool) = {
204209 let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger(governanceAddress, keyTotalRewardPerBlockCurrent), ((("No data on the key: " + keyTotalRewardPerBlockCurrent) + " at address ") + toString(governanceAddress)))
205210 let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger(governanceAddress, keyTotalRewardPerBlockPrevious), ((("No data on the key: " + keyTotalRewardPerBlockPrevious) + " at address ") + toString(governanceAddress)))
267272 let shareAssetId = getShareAssetId(pool)
268273 let scaleValue = calcScaleValue(SWOP, shareAssetId)
269274 let shareTokenLocked = getTotalShareTokenLocked(pool)
270- let $t01085710922 = getLastInterestInfo(pool)
271- let lastInterestHeight = $t01085710922._1
272- let lastInterest = $t01085710922._2
273- let $t01092711015 = rewardInfo(pool)
274- let currentRewardPerBlock = $t01092711015._1
275- let rewardUpdateHeight = $t01092711015._2
276- let previousRewardPerBlock = $t01092711015._3
277- let $t01102011099 = getUserInterestInfo(pool, caller)
278- let userLastInterest = $t01102011099._1
279- let userShareTokensAmount = $t01102011099._2
275+ let $t01099411059 = getLastInterestInfo(pool)
276+ let lastInterestHeight = $t01099411059._1
277+ let lastInterest = $t01099411059._2
278+ let $t01106411152 = rewardInfo(pool)
279+ let currentRewardPerBlock = $t01106411152._1
280+ let rewardUpdateHeight = $t01106411152._2
281+ let previousRewardPerBlock = $t01106411152._3
282+ let $t01115711236 = getUserInterestInfo(pool, caller)
283+ let userLastInterest = $t01115711236._1
284+ let userShareTokensAmount = $t01115711236._2
280285 let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue, pmtAmount)
281286 let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue)
282287 let userNewInterest = currentInterest
285290
286291
287292 func calculateProtocolReward (pool) = {
288- let $t01157211637 = getLastInterestInfo(pool)
289- let lastInterestHeight = $t01157211637._1
290- let lastInterest = $t01157211637._2
291- let $t01164211730 = rewardInfo(pool)
292- let currentRewardPerBlock = $t01164211730._1
293- let rewardUpdateHeight = $t01164211730._2
294- let previousRewardPerBlock = $t01164211730._3
293+ let $t01170911774 = getLastInterestInfo(pool)
294+ let lastInterestHeight = $t01170911774._1
295+ let lastInterest = $t01170911774._2
296+ let $t01177911867 = rewardInfo(pool)
297+ let currentRewardPerBlock = $t01177911867._1
298+ let rewardUpdateHeight = $t01177911867._2
299+ let previousRewardPerBlock = $t01177911867._3
295300 let shareTokenLocked = getTotalShareTokenLocked(pool)
296301 if ((shareTokenLocked == 0))
297302 then if ((rewardUpdateHeight > height))
337342
338343
339344 @Callable(i)
340-func initPoolShareFarming (pool) = if ((i.caller != this))
341- then throw("Only the DApp itself can call this function")
345+func initPoolShareFarming (pool) = if (isPoolUnderway(pool))
346+ then throw("Work is currently underway")
347+ else if ((i.caller != this))
348+ then throw("Only the DApp itself can call this function")
349+ else {
350+ let $t01372613806 = rewardInfo(pool)
351+ let currentReward = $t01372613806._1
352+ let rewardUpdateHeight = $t01372613806._2
353+ let previousRewardPerBlock = $t01372613806._3
354+[IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyLastInterestHeight), height)]
355+ }
356+
357+
358+
359+@Callable(i)
360+func lockShareTokens (pool) = if (isPoolUnderway(pool))
361+ then throw("Work is currently underway")
342362 else {
343- let $t01348413564 = rewardInfo(pool)
344- let currentReward = $t01348413564._1
345- let rewardUpdateHeight = $t01348413564._2
346- let previousRewardPerBlock = $t01348413564._3
347-[IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyLastInterestHeight), height)]
363+ let $t01483214907 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
364+ let pmtAmount = $t01483214907._1
365+ let pmtAssetId = $t01483214907._2
366+ let $t01491614989 = getAssetInfo(pmtAssetId)
367+ let pmtStrAssetId = $t01491614989._1
368+ let pmtAssetName = $t01491614989._2
369+ let pmtDecimals = $t01491614989._3
370+ let $t01499815106 = claimCalc(pool, i.caller, pmtAmount)
371+ let userNewInterest = $t01499815106._1
372+ let currentInterest = $t01499815106._2
373+ let claimAmount = $t01499815106._3
374+ let userShareTokensAmount = $t01499815106._4
375+ let userShareAmountNew = (userShareTokensAmount + pmtAmount)
376+ let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount)
377+ let totalShareAmount = getTotalShareTokenLocked(pool)
378+ let totalShareAmountNew = (totalShareAmount + pmtAmount)
379+ let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller)
380+ let userClaimedAmountNew = (userClaimedAmount + claimAmount)
381+ 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)]
382+ if ((0 >= pmtAmount))
383+ then throw("You can't lock token")
384+ else if (!(checkPmtAssetIdCorrect(pool, pmtAssetId)))
385+ then throw("Incorrect pmtAssetId")
386+ else if (if (isFirstHarvest(Address(fromBase58String(pool))))
387+ then (getHeightFirstHarvest(Address(fromBase58String(pool))) > height)
388+ else false)
389+ then {
390+ let harvestPeriod = ((((getHeightFirstHarvest(Address(fromBase58String(pool))) - startHeight) + 1) / periodLength) - 1)
391+ let amountOfVoting = split(getStringValue(votingAddress, (((toString(i.caller) + "_") + pool) + "_user_pool_struc")), "_")
392+ let amountPoolStract = split(getStringValue(votingAddress, (pool + "_pool_struc")), "_")
393+ let amountActiveVoteUserPoolStract = split(valueOrElse(getString(votingAddress, (((toString(i.caller) + "_") + pool) + kHarvestUserPoolActiveVoteStrucVoting)), ""), "_")
394+ let amountPoolActiveVoteStract = split(valueOrElse(getString(votingAddress, (pool + kHarvestPoolActiveVoteStrucVoting)), ""), "_")
395+ let userShareTokenLocked = userShareTokensAmount
396+ let userPoolActiveVote = if ((toString(currPeriod) == amountOfVoting[2]))
397+ then valueOrElse(parseInt(amountActiveVoteUserPoolStract[0]), 0)
398+ else valueOrElse(parseInt(amountOfVoting[1]), 0)
399+ let poolActiveVote = if ((toString(currPeriod) == amountPoolStract[2]))
400+ then valueOrElse(parseInt(amountPoolActiveVoteStract[0]), 0)
401+ else valueOrElse(parseInt(amountPoolStract[1]), 0)
402+ let protocolReward = calculateProtocolReward(pool)
403+ if ((userPoolActiveVote != 0))
404+ then {
405+ let limitShareToken = getShareLimitToken(addressFromStringValue(pool))
406+ let shareToken = (fraction(limitShareToken, userPoolActiveVote, poolActiveVote) - userShareTokenLocked)
407+ if (if ((size(amountActiveVoteUserPoolStract) > 1))
408+ then (valueOrElse(parseInt(amountActiveVoteUserPoolStract[1]), 0) >= harvestPeriod)
409+ else false)
410+ then throw("You can't share token")
411+ else if ((pmtAmount > limitShareToken))
412+ then throw(("You can't share token more than " + toString(limitShareToken)))
413+ else if ((shareToken > 0))
414+ then if ((totalShareAmount == 0))
415+ then (baseEntry ++ [ScriptTransfer(wallet, protocolReward, SWOP)])
416+ else if ((shareToken >= pmtAmount))
417+ then baseEntry
418+ else throw(("Your maximum share token is " + toString(shareToken)))
419+ else throw("You can't share token")
420+ }
421+ else throw("Your amount of token less than 0")
422+ }
423+ else baseEntry
348424 }
349425
350426
351427
352428 @Callable(i)
353-func updatePoolInterest (pool) = if ((i.caller != wallet))
354- then throw("Only the Admin itself can call this function")
429+func withdrawShareTokens (pool,shareTokensWithdrawAmount) = if (isPoolUnderway(pool))
430+ then throw("Work is currently underway")
355431 else {
356- let $t01390214022 = claimCalc(pool, adminIncreaseInterestAddress, 0)
357- let userNewInterest = $t01390214022._1
358- let currentInterest = $t01390214022._2
359- let claimAmount = $t01390214022._3
360- let userShareTokensAmount = $t01390214022._4
361- let $t01402714107 = rewardInfo(pool)
362- let currentReward = $t01402714107._1
363- let rewardUpdateHeight = $t01402714107._2
364- let previousRewardPerBlock = $t01402714107._3
365-[IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), userNewInterest), IntegerEntry((pool + keyLastInterestHeight), height)]
432+ let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id"))
433+ let $t01971519815 = claimCalc(pool, i.caller, 1)
434+ let userNewInterest = $t01971519815._1
435+ let currentInterest = $t01971519815._2
436+ let claimAmount = $t01971519815._3
437+ let userShareTokensAmount = $t01971519815._4
438+ let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount)
439+ let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount)
440+ let totalShareAmount = getTotalShareTokenLocked(pool)
441+ let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount)
442+ let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller)
443+ let userClaimedAmountNew = (userClaimedAmount + claimAmount)
444+ if ((shareTokensWithdrawAmount > userShareTokensAmount))
445+ then throw("Withdraw amount more then user locked amount")
446+ 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)]
366447 }
367448
368449
369450
370451 @Callable(i)
371-func lockShareTokens (pool) = {
372- let $t01435314428 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
373- let pmtAmount = $t01435314428._1
374- let pmtAssetId = $t01435314428._2
375- let $t01443314506 = getAssetInfo(pmtAssetId)
376- let pmtStrAssetId = $t01443314506._1
377- let pmtAssetName = $t01443314506._2
378- let pmtDecimals = $t01443314506._3
379- let $t01451114619 = claimCalc(pool, i.caller, pmtAmount)
380- let userNewInterest = $t01451114619._1
381- let currentInterest = $t01451114619._2
382- let claimAmount = $t01451114619._3
383- let userShareTokensAmount = $t01451114619._4
384- let userShareAmountNew = (userShareTokensAmount + pmtAmount)
385- let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount)
386- let totalShareAmount = getTotalShareTokenLocked(pool)
387- let totalShareAmountNew = (totalShareAmount + pmtAmount)
388- let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller)
389- let userClaimedAmountNew = (userClaimedAmount + claimAmount)
390- 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)]
391- if ((0 >= pmtAmount))
392- then throw("You can't lock token")
393- else if (!(checkPmtAssetIdCorrect(pool, pmtAssetId)))
394- then throw("Incorrect pmtAssetId")
395- else if (if (isFirstHarvest(Address(fromBase58String(pool))))
396- then (getHeightFirstHarvest(Address(fromBase58String(pool))) > height)
397- else false)
398- then {
399- let harvestPeriod = ((((getHeightFirstHarvest(Address(fromBase58String(pool))) - startHeight) + 1) / periodLength) - 1)
400- let amountOfVoting = split(getStringValue(votingAddress, (((toString(i.caller) + "_") + pool) + "_user_pool_struc")), "_")
401- let amountPoolStract = split(getStringValue(votingAddress, (pool + "_pool_struc")), "_")
402- let amountActiveVoteUserPoolStract = split(valueOrElse(getString(votingAddress, (((toString(i.caller) + "_") + pool) + kHarvestUserPoolActiveVoteStrucVoting)), ""), "_")
403- let amountPoolActiveVoteStract = split(valueOrElse(getString(votingAddress, (pool + kHarvestPoolActiveVoteStrucVoting)), ""), "_")
404- let userShareTokenLocked = userShareTokensAmount
405- let userPoolActiveVote = if ((toString(currPeriod) == amountOfVoting[2]))
406- then valueOrElse(parseInt(amountActiveVoteUserPoolStract[0]), 0)
407- else valueOrElse(parseInt(amountOfVoting[1]), 0)
408- let poolActiveVote = if ((toString(currPeriod) == amountPoolStract[2]))
409- then valueOrElse(parseInt(amountPoolActiveVoteStract[0]), 0)
410- else valueOrElse(parseInt(amountPoolStract[1]), 0)
411- let protocolReward = calculateProtocolReward(pool)
412- if ((userPoolActiveVote != 0))
413- then {
414- let limitShareToken = getShareLimitToken(addressFromStringValue(pool))
415- let shareToken = (fraction(limitShareToken, userPoolActiveVote, poolActiveVote) - userShareTokenLocked)
416- if (if ((size(amountActiveVoteUserPoolStract) > 1))
417- then (valueOrElse(parseInt(amountActiveVoteUserPoolStract[1]), 0) >= harvestPeriod)
418- else false)
419- then throw("You can't share token")
420- else if ((pmtAmount > limitShareToken))
421- then throw(("You can't share token more than " + toString(limitShareToken)))
422- else if ((shareToken > 0))
423- then if ((totalShareAmount == 0))
424- then (baseEntry ++ [ScriptTransfer(wallet, protocolReward, SWOP)])
425- else if ((shareToken >= pmtAmount))
426- then baseEntry
427- else throw(("Your maximum share token is " + toString(shareToken)))
428- else throw("You can't share token")
429- }
430- else throw("Your amount of token less than 0")
431- }
432- else baseEntry
433- }
434-
435-
436-
437-@Callable(i)
438-func withdrawShareTokens (pool,shareTokensWithdrawAmount) = {
439- let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id"))
440- let $t01873818838 = claimCalc(pool, i.caller, 1)
441- let userNewInterest = $t01873818838._1
442- let currentInterest = $t01873818838._2
443- let claimAmount = $t01873818838._3
444- let userShareTokensAmount = $t01873818838._4
445- let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount)
446- let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount)
447- let totalShareAmount = getTotalShareTokenLocked(pool)
448- let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount)
449- let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller)
450- let userClaimedAmountNew = (userClaimedAmount + claimAmount)
451- if ((shareTokensWithdrawAmount > userShareTokensAmount))
452- then throw("Withdraw amount more then user locked amount")
453- 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)]
454- }
455-
456-
457-
458-@Callable(i)
459-func claim (pool) = {
460- let shareTokenLocked = getTotalShareTokenLocked(pool)
461- let $t02035320418 = getLastInterestInfo(pool)
462- let lastInterestHeight = $t02035320418._1
463- let lastInterest = $t02035320418._2
464- let $t02042320512 = rewardInfo(pool)
465- let currentRewardPerBlock = $t02042320512._1
466- let rewardUpdateHeight = $t02042320512._2
467- let previousRewardPerBlock = $t02042320512._3
468- let $t02051720617 = claimCalc(pool, i.caller, 1)
469- let userNewInterest = $t02051720617._1
470- let currentInterest = $t02051720617._2
471- let claimAmount = $t02051720617._3
472- let userShareTokensAmount = $t02051720617._4
473- let availableFund = (userAvailableSWOP(pool, i.caller) + claimAmount)
474- let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller)
475- let userClaimedAmountNew = (userClaimedAmount + claimAmount)
476- if ((availableFund == 0))
477- then throw("You have 0 available SWOP")
478- 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)]
479- }
452+func claim (pool) = if (isPoolUnderway(pool))
453+ then throw("Work is currently underway")
454+ else {
455+ let shareTokenLocked = getTotalShareTokenLocked(pool)
456+ let $t02143121496 = getLastInterestInfo(pool)
457+ let lastInterestHeight = $t02143121496._1
458+ let lastInterest = $t02143121496._2
459+ let $t02150521594 = rewardInfo(pool)
460+ let currentRewardPerBlock = $t02150521594._1
461+ let rewardUpdateHeight = $t02150521594._2
462+ let previousRewardPerBlock = $t02150521594._3
463+ let $t02160321703 = claimCalc(pool, i.caller, 1)
464+ let userNewInterest = $t02160321703._1
465+ let currentInterest = $t02160321703._2
466+ let claimAmount = $t02160321703._3
467+ let userShareTokensAmount = $t02160321703._4
468+ let availableFund = (userAvailableSWOP(pool, i.caller) + claimAmount)
469+ let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller)
470+ let userClaimedAmountNew = (userClaimedAmount + claimAmount)
471+ if ((availableFund == 0))
472+ then throw("You have 0 available SWOP")
473+ 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)]
474+ }
480475
481476
482477 @Verifier(tx)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let adminPubKey1 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK'
55
66 let adminPubKey2 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK'
77
88 let adminPubKey3 = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK'
99
1010 let keyShareTokensLocked = "_total_share_tokens_locked"
1111
1212 let kShareLimit = "share_limit_on_first_harvest"
1313
1414 let keyRewardPoolFractionCurrent = "_current_pool_fraction_reward"
1515
1616 let keyRewardPoolFractionPrevious = "_previous_pool_fraction_reward"
1717
1818 let keyTotalRewardPerBlockCurrent = "total_reward_per_block_current"
1919
2020 let keyTotalRewardPerBlockPrevious = "total_reward_per_block_previous"
2121
2222 let keyRewardUpdateHeight = "reward_update_height"
2323
2424 let keyLastInterest = "_last_interest"
2525
2626 let keyLastInterestHeight = "_last_interest_height"
2727
2828 let keyUserShareTokensLocked = "_share_tokens_locked"
2929
3030 let keyUserLastInterest = "_last_interest"
3131
3232 let keySWOPid = "SWOP_id"
3333
3434 let keyUserSWOPClaimedAmount = "_SWOP_claimed_amount"
3535
3636 let keyUserSWOPLastClaimedAmount = "_SWOP_last_claimed_amount"
3737
3838 let keyAvailableSWOP = "_available_SWOP"
3939
4040 let keyFarmingStartHeight = "farming_start_height"
4141
4242 let keyAPY = "apy"
4343
4444 let kPreviousTotalVoteSWOP = "previous_total_vote_SWOP"
4545
4646 let keySwopYearEmission = "swop_year_emission"
4747
4848 let keyBalancecpmmA = "A_asset_balance"
4949
5050 let keyBalancecpmmB = "B_asset_balance"
5151
5252 let kHarvestPoolActiveVoteStrucVoting = "_harvest_pool_activeVote_struc"
5353
5454 let kHarvestUserPoolActiveVoteStrucVoting = "_harvest_user_pool_activeVote_struc"
5555
5656 let keyLimitShareFirstHarvest = "share_limit_on_first_harvest"
5757
5858 let keyAssetIdA = "A_asset_id"
5959
6060 let keyAssetIdB = "B_asset_id"
6161
6262 let keyFirstHarvestHeight = "first_harvest_height"
6363
6464 let keyfirstHarvestCpmm = "first_harvest"
6565
6666 let governanceAddress = Address(base58'3N5W8da2iiijVieA6qLGo7KzCJj8B19smWU')
6767
6868 let wallet = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4')
6969
7070 let votingAddress = Address(base58'3MrJgdL1GniipErHy44YF9idzLaUL2iX5DQ')
7171
7272 let adminIncreaseInterestAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4')
7373
7474 let oneWeekInBlock = 10106
7575
7676 let totalVoteShare = 10000000000
7777
7878 let scaleValue1 = 10
7979
8080 let scaleValue3 = 1000
8181
8282 let scaleValue5 = 100000
8383
8484 let scaleValue6 = 1000000
8585
8686 let scaleValue8 = 100000000
8787
8888 let scaleValue11 = 100000000000
8989
9090 func strAssetIdA (pool) = getStringValue(pool, keyAssetIdA)
9191
9292
9393 func strAssetIdB (pool) = getStringValue(pool, keyAssetIdB)
9494
9595
9696 func assetIdA (pool) = if ((strAssetIdA(pool) == "WAVES"))
9797 then unit
9898 else fromBase58String(strAssetIdA(pool))
9999
100100
101101 func assetIdB (pool) = if ((strAssetIdB(pool) == "WAVES"))
102102 then unit
103103 else fromBase58String(strAssetIdB(pool))
104104
105105
106106 let kBasePeriod = "base_period"
107107
108108 let kPeriodLength = "period_length"
109109
110110 let kStartHeight = "start_height"
111111
112112 let kFirstHarvestHeight = "first_harvest_height"
113113
114114 let kDurationFullVotePower = "duration_full_vote_power"
115115
116116 let kMinVotePower = "min_vote_power"
117117
118118 let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod")
119119
120120 let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight")
121121
122122 let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength")
123123
124124 let durationFullVotePower = valueOrErrorMessage(getInteger(votingAddress, kDurationFullVotePower), "Empty kDurationFullVotePower")
125125
126126 let minVotePower = valueOrErrorMessage(getInteger(votingAddress, kMinVotePower), "Empty kMinVotePower")
127127
128128 let currPeriod = (basePeriod + ((height - startHeight) / periodLength))
129129
130130 func getLimitToken (pool) = valueOrElse(getIntegerValue(pool, keyLimitShareFirstHarvest), 0)
131131
132132
133133 let APY = getIntegerValue(this, keyAPY)
134134
135135 let SwopYearEmission = getIntegerValue(this, keySwopYearEmission)
136136
137137 func assetNameA (pool) = match assetIdA(pool) {
138138 case id: ByteVector =>
139139 value(assetInfo(id)).name
140140 case waves: Unit =>
141141 "WAVES"
142142 case _ =>
143143 throw("Match error")
144144 }
145145
146146
147147 func assetNameB (pool) = match assetIdB(pool) {
148148 case id: ByteVector =>
149149 value(assetInfo(id)).name
150150 case waves: Unit =>
151151 "WAVES"
152152 case _ =>
153153 throw("Match error")
154154 }
155155
156156
157157 let SWOP = fromBase58String(getStringValue(this, keySWOPid))
158158
159159 func isFirstHarvest (pool) = valueOrElse(getBoolean(pool, keyfirstHarvestCpmm), false)
160160
161161
162162 func getHeightFirstHarvest (pool) = valueOrElse(getInteger(pool, keyFirstHarvestHeight), 0)
163163
164164
165165 func getBalanceA (pool) = valueOrErrorMessage(getInteger(pool, keyBalancecpmmA), ("No data on the key: " + keyBalancecpmmA))
166166
167167
168168 func getBalanceB (pool) = valueOrErrorMessage(getInteger(pool, keyBalancecpmmB), ("No data on the key: " + keyBalancecpmmB))
169169
170170
171171 func getShareLimitToken (pool) = valueOrErrorMessage(getInteger(pool, kShareLimit), ("No data on the key: " + kShareLimit))
172172
173173
174174 func getTotalShareTokenLocked (pool) = valueOrErrorMessage(getInteger(this, (pool + keyShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked))
175175
176176
177177 func getShareAssetId (pool) = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id"))
178178
179179
180180 func getAssetInfo (assetId) = match assetId {
181181 case id: ByteVector =>
182182 let stringId = toBase58String(id)
183183 let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist"))
184184 $Tuple3(stringId, info.name, info.decimals)
185185 case waves: Unit =>
186186 $Tuple3("WAVES", "WAVES", 8)
187187 case _ =>
188188 throw("Match error")
189189 }
190190
191191
192192 func calcScaleValue (assetId1,assetId2) = {
193193 let assetId1Decimals = value(assetInfo(assetId1)).decimals
194194 let assetId2Decimals = value(assetInfo(assetId2)).decimals
195195 let scaleDigits = ((assetId2Decimals - assetId1Decimals) + 8)
196196 pow(10, 0, scaleDigits, 0, 0, HALFDOWN)
197197 }
198198
199199
200200 func userAvailableSWOP (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyAvailableSWOP)), 0)
201201
202202
203+func isPoolUnderway (pool) = if ((pool == "3PCdNCULgjM9ZMLEt61M45qxV26ro6o48Jj"))
204+ then true
205+ else (pool == "3PMcDUBDyjNB1fkRGeLGpsz1ZQPfcmyp4r5")
206+
207+
203208 func rewardInfo (pool) = {
204209 let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger(governanceAddress, keyTotalRewardPerBlockCurrent), ((("No data on the key: " + keyTotalRewardPerBlockCurrent) + " at address ") + toString(governanceAddress)))
205210 let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger(governanceAddress, keyTotalRewardPerBlockPrevious), ((("No data on the key: " + keyTotalRewardPerBlockPrevious) + " at address ") + toString(governanceAddress)))
206211 let rewardPoolFractionCurrent = valueOrErrorMessage(getInteger(governanceAddress, (pool + keyRewardPoolFractionCurrent)), (((("No data on the key: " + pool) + keyRewardPoolFractionCurrent) + " at address ") + toString(governanceAddress)))
207212 let rewardUpdateHeight = valueOrErrorMessage(getInteger(governanceAddress, keyRewardUpdateHeight), ((("No data on the key: " + keyRewardUpdateHeight) + " at address ") + toString(governanceAddress)))
208213 let rewardPoolFractionPrevious = valueOrErrorMessage(getInteger(governanceAddress, (pool + keyRewardPoolFractionPrevious)), (((("No data on the key: " + pool) + keyRewardPoolFractionPrevious) + " at address ") + toString(governanceAddress)))
209214 let rewardPoolCurrent = fraction(totalRewardPerBlockCurrent, rewardPoolFractionCurrent, totalVoteShare)
210215 let rewardPoolPrevious = fraction(totalRewardPerBlockPrevious, rewardPoolFractionPrevious, totalVoteShare)
211216 if (if ((rewardPoolCurrent > totalRewardPerBlockCurrent))
212217 then true
213218 else (rewardPoolPrevious > totalRewardPerBlockPrevious))
214219 then throw("rewardPoolCurrent > totalRewardPerBlockCurrent or rewardPoolPrevious > totalRewardPerBlockPrevious")
215220 else $Tuple3(rewardPoolCurrent, rewardUpdateHeight, rewardPoolPrevious)
216221 }
217222
218223
219224 func getLastInterestInfo (pool) = {
220225 let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (("No data on the key: " + pool) + keyLastInterest))
221226 let lastInterestHeight = valueOrElse(getInteger(this, (pool + keyLastInterestHeight)), height)
222227 $Tuple2(lastInterestHeight, lastInterest)
223228 }
224229
225230
226231 func getUserInterestInfo (pool,userAddress) = {
227232 let userLastInterest = getInteger(this, (((pool + "_") + toString(userAddress)) + keyUserLastInterest))
228233 let userShare = getInteger(this, (((pool + "_") + toString(userAddress)) + keyUserShareTokensLocked))
229234 let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (("No data on the key: " + pool) + keyLastInterest))
230235 let userLastInterestValue = match userLastInterest {
231236 case userLastInterest: Int =>
232237 userLastInterest
233238 case _ =>
234239 lastInterest
235240 }
236241 let userShareTokensAmount = match userShare {
237242 case userShare: Int =>
238243 userShare
239244 case _ =>
240245 0
241246 }
242247 $Tuple2(userLastInterestValue, userShareTokensAmount)
243248 }
244249
245250
246251 func calcInterest (lastInterestHeight,rewardUpdateHeight,lastInterest,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,shareAssetId,scaleValue,pmtAmount) = if ((shareTokenLocked == 0))
247252 then 0
248253 else if ((rewardUpdateHeight > height))
249254 then {
250255 let reward = (previousRewardPerBlock * (height - lastInterestHeight))
251256 (lastInterest + fraction(reward, scaleValue, shareTokenLocked))
252257 }
253258 else if ((lastInterestHeight > rewardUpdateHeight))
254259 then {
255260 let reward = (currentRewardPerBlock * (height - lastInterestHeight))
256261 (lastInterest + fraction(reward, scaleValue, shareTokenLocked))
257262 }
258263 else {
259264 let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight))
260265 let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked))
261266 let reward = (currentRewardPerBlock * (height - rewardUpdateHeight))
262267 (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked))
263268 }
264269
265270
266271 func claimCalc (pool,caller,pmtAmount) = {
267272 let shareAssetId = getShareAssetId(pool)
268273 let scaleValue = calcScaleValue(SWOP, shareAssetId)
269274 let shareTokenLocked = getTotalShareTokenLocked(pool)
270- let $t01085710922 = getLastInterestInfo(pool)
271- let lastInterestHeight = $t01085710922._1
272- let lastInterest = $t01085710922._2
273- let $t01092711015 = rewardInfo(pool)
274- let currentRewardPerBlock = $t01092711015._1
275- let rewardUpdateHeight = $t01092711015._2
276- let previousRewardPerBlock = $t01092711015._3
277- let $t01102011099 = getUserInterestInfo(pool, caller)
278- let userLastInterest = $t01102011099._1
279- let userShareTokensAmount = $t01102011099._2
275+ let $t01099411059 = getLastInterestInfo(pool)
276+ let lastInterestHeight = $t01099411059._1
277+ let lastInterest = $t01099411059._2
278+ let $t01106411152 = rewardInfo(pool)
279+ let currentRewardPerBlock = $t01106411152._1
280+ let rewardUpdateHeight = $t01106411152._2
281+ let previousRewardPerBlock = $t01106411152._3
282+ let $t01115711236 = getUserInterestInfo(pool, caller)
283+ let userLastInterest = $t01115711236._1
284+ let userShareTokensAmount = $t01115711236._2
280285 let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue, pmtAmount)
281286 let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue)
282287 let userNewInterest = currentInterest
283288 $Tuple4(userNewInterest, currentInterest, claimAmount, userShareTokensAmount)
284289 }
285290
286291
287292 func calculateProtocolReward (pool) = {
288- let $t01157211637 = getLastInterestInfo(pool)
289- let lastInterestHeight = $t01157211637._1
290- let lastInterest = $t01157211637._2
291- let $t01164211730 = rewardInfo(pool)
292- let currentRewardPerBlock = $t01164211730._1
293- let rewardUpdateHeight = $t01164211730._2
294- let previousRewardPerBlock = $t01164211730._3
293+ let $t01170911774 = getLastInterestInfo(pool)
294+ let lastInterestHeight = $t01170911774._1
295+ let lastInterest = $t01170911774._2
296+ let $t01177911867 = rewardInfo(pool)
297+ let currentRewardPerBlock = $t01177911867._1
298+ let rewardUpdateHeight = $t01177911867._2
299+ let previousRewardPerBlock = $t01177911867._3
295300 let shareTokenLocked = getTotalShareTokenLocked(pool)
296301 if ((shareTokenLocked == 0))
297302 then if ((rewardUpdateHeight > height))
298303 then {
299304 let reward = (previousRewardPerBlock * (height - lastInterestHeight))
300305 reward
301306 }
302307 else if ((lastInterestHeight > rewardUpdateHeight))
303308 then {
304309 let reward = (currentRewardPerBlock * (height - lastInterestHeight))
305310 reward
306311 }
307312 else {
308313 let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight))
309314 let reward = (currentRewardPerBlock * (height - rewardUpdateHeight))
310315 (reward + rewardAfterLastInterestBeforeReawardUpdate)
311316 }
312317 else 0
313318 }
314319
315320
316321 func checkPmtAssetIdCorrect (pool,pmtAssetId) = {
317322 let poolShareAssetId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id"))
318323 if ((pmtAssetId == poolShareAssetId))
319324 then true
320325 else false
321326 }
322327
323328
324329 func getUserSWOPClaimedAmount (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyUserSWOPClaimedAmount)), 0)
325330
326331
327332 @Callable(i)
328333 func init (earlyLP) = if (isDefined(getString(this, keySWOPid)))
329334 then throw("SWOP already initialized")
330335 else {
331336 let initAmount = 100000000000000
332337 let SWOPissue = Issue("SWOP", "SWOP protocol token", initAmount, 8, true)
333338 let SWOPid = calculateAssetId(SWOPissue)
334339 [Issue("SWOP", "SWOP protocol token", initAmount, 8, true), StringEntry(keySWOPid, toBase58String(SWOPid))]
335340 }
336341
337342
338343
339344 @Callable(i)
340-func initPoolShareFarming (pool) = if ((i.caller != this))
341- then throw("Only the DApp itself can call this function")
345+func initPoolShareFarming (pool) = if (isPoolUnderway(pool))
346+ then throw("Work is currently underway")
347+ else if ((i.caller != this))
348+ then throw("Only the DApp itself can call this function")
349+ else {
350+ let $t01372613806 = rewardInfo(pool)
351+ let currentReward = $t01372613806._1
352+ let rewardUpdateHeight = $t01372613806._2
353+ let previousRewardPerBlock = $t01372613806._3
354+[IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyLastInterestHeight), height)]
355+ }
356+
357+
358+
359+@Callable(i)
360+func lockShareTokens (pool) = if (isPoolUnderway(pool))
361+ then throw("Work is currently underway")
342362 else {
343- let $t01348413564 = rewardInfo(pool)
344- let currentReward = $t01348413564._1
345- let rewardUpdateHeight = $t01348413564._2
346- let previousRewardPerBlock = $t01348413564._3
347-[IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyLastInterestHeight), height)]
363+ let $t01483214907 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
364+ let pmtAmount = $t01483214907._1
365+ let pmtAssetId = $t01483214907._2
366+ let $t01491614989 = getAssetInfo(pmtAssetId)
367+ let pmtStrAssetId = $t01491614989._1
368+ let pmtAssetName = $t01491614989._2
369+ let pmtDecimals = $t01491614989._3
370+ let $t01499815106 = claimCalc(pool, i.caller, pmtAmount)
371+ let userNewInterest = $t01499815106._1
372+ let currentInterest = $t01499815106._2
373+ let claimAmount = $t01499815106._3
374+ let userShareTokensAmount = $t01499815106._4
375+ let userShareAmountNew = (userShareTokensAmount + pmtAmount)
376+ let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount)
377+ let totalShareAmount = getTotalShareTokenLocked(pool)
378+ let totalShareAmountNew = (totalShareAmount + pmtAmount)
379+ let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller)
380+ let userClaimedAmountNew = (userClaimedAmount + claimAmount)
381+ 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)]
382+ if ((0 >= pmtAmount))
383+ then throw("You can't lock token")
384+ else if (!(checkPmtAssetIdCorrect(pool, pmtAssetId)))
385+ then throw("Incorrect pmtAssetId")
386+ else if (if (isFirstHarvest(Address(fromBase58String(pool))))
387+ then (getHeightFirstHarvest(Address(fromBase58String(pool))) > height)
388+ else false)
389+ then {
390+ let harvestPeriod = ((((getHeightFirstHarvest(Address(fromBase58String(pool))) - startHeight) + 1) / periodLength) - 1)
391+ let amountOfVoting = split(getStringValue(votingAddress, (((toString(i.caller) + "_") + pool) + "_user_pool_struc")), "_")
392+ let amountPoolStract = split(getStringValue(votingAddress, (pool + "_pool_struc")), "_")
393+ let amountActiveVoteUserPoolStract = split(valueOrElse(getString(votingAddress, (((toString(i.caller) + "_") + pool) + kHarvestUserPoolActiveVoteStrucVoting)), ""), "_")
394+ let amountPoolActiveVoteStract = split(valueOrElse(getString(votingAddress, (pool + kHarvestPoolActiveVoteStrucVoting)), ""), "_")
395+ let userShareTokenLocked = userShareTokensAmount
396+ let userPoolActiveVote = if ((toString(currPeriod) == amountOfVoting[2]))
397+ then valueOrElse(parseInt(amountActiveVoteUserPoolStract[0]), 0)
398+ else valueOrElse(parseInt(amountOfVoting[1]), 0)
399+ let poolActiveVote = if ((toString(currPeriod) == amountPoolStract[2]))
400+ then valueOrElse(parseInt(amountPoolActiveVoteStract[0]), 0)
401+ else valueOrElse(parseInt(amountPoolStract[1]), 0)
402+ let protocolReward = calculateProtocolReward(pool)
403+ if ((userPoolActiveVote != 0))
404+ then {
405+ let limitShareToken = getShareLimitToken(addressFromStringValue(pool))
406+ let shareToken = (fraction(limitShareToken, userPoolActiveVote, poolActiveVote) - userShareTokenLocked)
407+ if (if ((size(amountActiveVoteUserPoolStract) > 1))
408+ then (valueOrElse(parseInt(amountActiveVoteUserPoolStract[1]), 0) >= harvestPeriod)
409+ else false)
410+ then throw("You can't share token")
411+ else if ((pmtAmount > limitShareToken))
412+ then throw(("You can't share token more than " + toString(limitShareToken)))
413+ else if ((shareToken > 0))
414+ then if ((totalShareAmount == 0))
415+ then (baseEntry ++ [ScriptTransfer(wallet, protocolReward, SWOP)])
416+ else if ((shareToken >= pmtAmount))
417+ then baseEntry
418+ else throw(("Your maximum share token is " + toString(shareToken)))
419+ else throw("You can't share token")
420+ }
421+ else throw("Your amount of token less than 0")
422+ }
423+ else baseEntry
348424 }
349425
350426
351427
352428 @Callable(i)
353-func updatePoolInterest (pool) = if ((i.caller != wallet))
354- then throw("Only the Admin itself can call this function")
429+func withdrawShareTokens (pool,shareTokensWithdrawAmount) = if (isPoolUnderway(pool))
430+ then throw("Work is currently underway")
355431 else {
356- let $t01390214022 = claimCalc(pool, adminIncreaseInterestAddress, 0)
357- let userNewInterest = $t01390214022._1
358- let currentInterest = $t01390214022._2
359- let claimAmount = $t01390214022._3
360- let userShareTokensAmount = $t01390214022._4
361- let $t01402714107 = rewardInfo(pool)
362- let currentReward = $t01402714107._1
363- let rewardUpdateHeight = $t01402714107._2
364- let previousRewardPerBlock = $t01402714107._3
365-[IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), userNewInterest), IntegerEntry((pool + keyLastInterestHeight), height)]
432+ let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id"))
433+ let $t01971519815 = claimCalc(pool, i.caller, 1)
434+ let userNewInterest = $t01971519815._1
435+ let currentInterest = $t01971519815._2
436+ let claimAmount = $t01971519815._3
437+ let userShareTokensAmount = $t01971519815._4
438+ let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount)
439+ let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount)
440+ let totalShareAmount = getTotalShareTokenLocked(pool)
441+ let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount)
442+ let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller)
443+ let userClaimedAmountNew = (userClaimedAmount + claimAmount)
444+ if ((shareTokensWithdrawAmount > userShareTokensAmount))
445+ then throw("Withdraw amount more then user locked amount")
446+ 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)]
366447 }
367448
368449
369450
370451 @Callable(i)
371-func lockShareTokens (pool) = {
372- let $t01435314428 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
373- let pmtAmount = $t01435314428._1
374- let pmtAssetId = $t01435314428._2
375- let $t01443314506 = getAssetInfo(pmtAssetId)
376- let pmtStrAssetId = $t01443314506._1
377- let pmtAssetName = $t01443314506._2
378- let pmtDecimals = $t01443314506._3
379- let $t01451114619 = claimCalc(pool, i.caller, pmtAmount)
380- let userNewInterest = $t01451114619._1
381- let currentInterest = $t01451114619._2
382- let claimAmount = $t01451114619._3
383- let userShareTokensAmount = $t01451114619._4
384- let userShareAmountNew = (userShareTokensAmount + pmtAmount)
385- let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount)
386- let totalShareAmount = getTotalShareTokenLocked(pool)
387- let totalShareAmountNew = (totalShareAmount + pmtAmount)
388- let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller)
389- let userClaimedAmountNew = (userClaimedAmount + claimAmount)
390- 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)]
391- if ((0 >= pmtAmount))
392- then throw("You can't lock token")
393- else if (!(checkPmtAssetIdCorrect(pool, pmtAssetId)))
394- then throw("Incorrect pmtAssetId")
395- else if (if (isFirstHarvest(Address(fromBase58String(pool))))
396- then (getHeightFirstHarvest(Address(fromBase58String(pool))) > height)
397- else false)
398- then {
399- let harvestPeriod = ((((getHeightFirstHarvest(Address(fromBase58String(pool))) - startHeight) + 1) / periodLength) - 1)
400- let amountOfVoting = split(getStringValue(votingAddress, (((toString(i.caller) + "_") + pool) + "_user_pool_struc")), "_")
401- let amountPoolStract = split(getStringValue(votingAddress, (pool + "_pool_struc")), "_")
402- let amountActiveVoteUserPoolStract = split(valueOrElse(getString(votingAddress, (((toString(i.caller) + "_") + pool) + kHarvestUserPoolActiveVoteStrucVoting)), ""), "_")
403- let amountPoolActiveVoteStract = split(valueOrElse(getString(votingAddress, (pool + kHarvestPoolActiveVoteStrucVoting)), ""), "_")
404- let userShareTokenLocked = userShareTokensAmount
405- let userPoolActiveVote = if ((toString(currPeriod) == amountOfVoting[2]))
406- then valueOrElse(parseInt(amountActiveVoteUserPoolStract[0]), 0)
407- else valueOrElse(parseInt(amountOfVoting[1]), 0)
408- let poolActiveVote = if ((toString(currPeriod) == amountPoolStract[2]))
409- then valueOrElse(parseInt(amountPoolActiveVoteStract[0]), 0)
410- else valueOrElse(parseInt(amountPoolStract[1]), 0)
411- let protocolReward = calculateProtocolReward(pool)
412- if ((userPoolActiveVote != 0))
413- then {
414- let limitShareToken = getShareLimitToken(addressFromStringValue(pool))
415- let shareToken = (fraction(limitShareToken, userPoolActiveVote, poolActiveVote) - userShareTokenLocked)
416- if (if ((size(amountActiveVoteUserPoolStract) > 1))
417- then (valueOrElse(parseInt(amountActiveVoteUserPoolStract[1]), 0) >= harvestPeriod)
418- else false)
419- then throw("You can't share token")
420- else if ((pmtAmount > limitShareToken))
421- then throw(("You can't share token more than " + toString(limitShareToken)))
422- else if ((shareToken > 0))
423- then if ((totalShareAmount == 0))
424- then (baseEntry ++ [ScriptTransfer(wallet, protocolReward, SWOP)])
425- else if ((shareToken >= pmtAmount))
426- then baseEntry
427- else throw(("Your maximum share token is " + toString(shareToken)))
428- else throw("You can't share token")
429- }
430- else throw("Your amount of token less than 0")
431- }
432- else baseEntry
433- }
434-
435-
436-
437-@Callable(i)
438-func withdrawShareTokens (pool,shareTokensWithdrawAmount) = {
439- let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id"))
440- let $t01873818838 = claimCalc(pool, i.caller, 1)
441- let userNewInterest = $t01873818838._1
442- let currentInterest = $t01873818838._2
443- let claimAmount = $t01873818838._3
444- let userShareTokensAmount = $t01873818838._4
445- let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount)
446- let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount)
447- let totalShareAmount = getTotalShareTokenLocked(pool)
448- let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount)
449- let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller)
450- let userClaimedAmountNew = (userClaimedAmount + claimAmount)
451- if ((shareTokensWithdrawAmount > userShareTokensAmount))
452- then throw("Withdraw amount more then user locked amount")
453- 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)]
454- }
455-
456-
457-
458-@Callable(i)
459-func claim (pool) = {
460- let shareTokenLocked = getTotalShareTokenLocked(pool)
461- let $t02035320418 = getLastInterestInfo(pool)
462- let lastInterestHeight = $t02035320418._1
463- let lastInterest = $t02035320418._2
464- let $t02042320512 = rewardInfo(pool)
465- let currentRewardPerBlock = $t02042320512._1
466- let rewardUpdateHeight = $t02042320512._2
467- let previousRewardPerBlock = $t02042320512._3
468- let $t02051720617 = claimCalc(pool, i.caller, 1)
469- let userNewInterest = $t02051720617._1
470- let currentInterest = $t02051720617._2
471- let claimAmount = $t02051720617._3
472- let userShareTokensAmount = $t02051720617._4
473- let availableFund = (userAvailableSWOP(pool, i.caller) + claimAmount)
474- let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller)
475- let userClaimedAmountNew = (userClaimedAmount + claimAmount)
476- if ((availableFund == 0))
477- then throw("You have 0 available SWOP")
478- 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)]
479- }
452+func claim (pool) = if (isPoolUnderway(pool))
453+ then throw("Work is currently underway")
454+ else {
455+ let shareTokenLocked = getTotalShareTokenLocked(pool)
456+ let $t02143121496 = getLastInterestInfo(pool)
457+ let lastInterestHeight = $t02143121496._1
458+ let lastInterest = $t02143121496._2
459+ let $t02150521594 = rewardInfo(pool)
460+ let currentRewardPerBlock = $t02150521594._1
461+ let rewardUpdateHeight = $t02150521594._2
462+ let previousRewardPerBlock = $t02150521594._3
463+ let $t02160321703 = claimCalc(pool, i.caller, 1)
464+ let userNewInterest = $t02160321703._1
465+ let currentInterest = $t02160321703._2
466+ let claimAmount = $t02160321703._3
467+ let userShareTokensAmount = $t02160321703._4
468+ let availableFund = (userAvailableSWOP(pool, i.caller) + claimAmount)
469+ let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller)
470+ let userClaimedAmountNew = (userClaimedAmount + claimAmount)
471+ if ((availableFund == 0))
472+ then throw("You have 0 available SWOP")
473+ 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)]
474+ }
480475
481476
482477 @Verifier(tx)
483478 func verify () = match tx {
484479 case _ =>
485480 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
486481 }
487482

github/deemru/w8io/169f3d6 
85.46 ms