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:AAIEAAAAAAAAABwIAhIDCgEIEgMKAQgSAwoBCBIECgIIARIDCgEIAAAAVAAAAAAMYWRtaW5QdWJLZXkxAQAAACAEz3XlZNDBD05nuR8TZMQaDeqEJEIxfTOQXUBYCp2TSgAAAAAMYWRtaW5QdWJLZXkyAQAAACAEz3XlZNDBD05nuR8TZMQaDeqEJEIxfTOQXUBYCp2TSgAAAAAMYWRtaW5QdWJLZXkzAQAAACAEz3XlZNDBD05nuR8TZMQaDeqEJEIxfTOQXUBYCp2TSgAAAAAUa2V5U2hhcmVUb2tlbnNMb2NrZWQCAAAAGl90b3RhbF9zaGFyZV90b2tlbnNfbG9ja2VkAAAAAAtrU2hhcmVMaW1pdAIAAAAcc2hhcmVfbGltaXRfb25fZmlyc3RfaGFydmVzdAAAAAAca2V5UmV3YXJkUG9vbEZyYWN0aW9uQ3VycmVudAIAAAAdX2N1cnJlbnRfcG9vbF9mcmFjdGlvbl9yZXdhcmQAAAAAHWtleVJld2FyZFBvb2xGcmFjdGlvblByZXZpb3VzAgAAAB5fcHJldmlvdXNfcG9vbF9mcmFjdGlvbl9yZXdhcm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ZEFtb3VudE5ldwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgUAAAAEcG9vbAIAAAABXwkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIFAAAAHGtleVVzZXJTV09QTGFzdENsYWltZWRBbW91bnQFAAAAC2NsYWltQW1vdW50CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAANYXZhaWxhYmxlRnVuZAUAAAAEU1dPUAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5JABeGA==", "height": 1560278, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HNbPDUqwjx799hmRNxZsesubPNv6KecHMdguGpUCtrje Next: 4ZzKWWxeVCpKBDFrfkRRmziHWh5aGSzhY2D3sXNst7B6 Diff:
Old | New | Differences | |
---|---|---|---|
200 | 200 | func userAvailableSWOP (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyAvailableSWOP)), 0) | |
201 | 201 | ||
202 | 202 | ||
203 | + | func isPoolUnderway (pool) = if ((pool == "3PCdNCULgjM9ZMLEt61M45qxV26ro6o48Jj")) | |
204 | + | then true | |
205 | + | else (pool == "3PMcDUBDyjNB1fkRGeLGpsz1ZQPfcmyp4r5") | |
206 | + | ||
207 | + | ||
203 | 208 | func rewardInfo (pool) = { | |
204 | 209 | let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger(governanceAddress, keyTotalRewardPerBlockCurrent), ((("No data on the key: " + keyTotalRewardPerBlockCurrent) + " at address ") + toString(governanceAddress))) | |
205 | 210 | let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger(governanceAddress, keyTotalRewardPerBlockPrevious), ((("No data on the key: " + keyTotalRewardPerBlockPrevious) + " at address ") + toString(governanceAddress))) | |
267 | 272 | let shareAssetId = getShareAssetId(pool) | |
268 | 273 | let scaleValue = calcScaleValue(SWOP, shareAssetId) | |
269 | 274 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
270 | - | let $ | |
271 | - | let lastInterestHeight = $ | |
272 | - | let lastInterest = $ | |
273 | - | let $ | |
274 | - | let currentRewardPerBlock = $ | |
275 | - | let rewardUpdateHeight = $ | |
276 | - | let previousRewardPerBlock = $ | |
277 | - | let $ | |
278 | - | let userLastInterest = $ | |
279 | - | let userShareTokensAmount = $ | |
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 | |
280 | 285 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue, pmtAmount) | |
281 | 286 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue) | |
282 | 287 | let userNewInterest = currentInterest | |
285 | 290 | ||
286 | 291 | ||
287 | 292 | func calculateProtocolReward (pool) = { | |
288 | - | let $ | |
289 | - | let lastInterestHeight = $ | |
290 | - | let lastInterest = $ | |
291 | - | let $ | |
292 | - | let currentRewardPerBlock = $ | |
293 | - | let rewardUpdateHeight = $ | |
294 | - | let previousRewardPerBlock = $ | |
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 | |
295 | 300 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
296 | 301 | if ((shareTokenLocked == 0)) | |
297 | 302 | then if ((rewardUpdateHeight > height)) | |
337 | 342 | ||
338 | 343 | ||
339 | 344 | @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") | |
342 | 362 | 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 | |
348 | 424 | } | |
349 | 425 | ||
350 | 426 | ||
351 | 427 | ||
352 | 428 | @Callable(i) | |
353 | - | func | |
354 | - | then throw(" | |
429 | + | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = if (isPoolUnderway(pool)) | |
430 | + | then throw("Work is currently underway") | |
355 | 431 | 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)] | |
366 | 447 | } | |
367 | 448 | ||
368 | 449 | ||
369 | 450 | ||
370 | 451 | @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 | + | } | |
480 | 475 | ||
481 | 476 | ||
482 | 477 | @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 | 13 | ||
14 | 14 | let keyRewardPoolFractionCurrent = "_current_pool_fraction_reward" | |
15 | 15 | ||
16 | 16 | let keyRewardPoolFractionPrevious = "_previous_pool_fraction_reward" | |
17 | 17 | ||
18 | 18 | let keyTotalRewardPerBlockCurrent = "total_reward_per_block_current" | |
19 | 19 | ||
20 | 20 | let keyTotalRewardPerBlockPrevious = "total_reward_per_block_previous" | |
21 | 21 | ||
22 | 22 | let keyRewardUpdateHeight = "reward_update_height" | |
23 | 23 | ||
24 | 24 | let keyLastInterest = "_last_interest" | |
25 | 25 | ||
26 | 26 | let keyLastInterestHeight = "_last_interest_height" | |
27 | 27 | ||
28 | 28 | let keyUserShareTokensLocked = "_share_tokens_locked" | |
29 | 29 | ||
30 | 30 | let keyUserLastInterest = "_last_interest" | |
31 | 31 | ||
32 | 32 | let keySWOPid = "SWOP_id" | |
33 | 33 | ||
34 | 34 | let keyUserSWOPClaimedAmount = "_SWOP_claimed_amount" | |
35 | 35 | ||
36 | 36 | let keyUserSWOPLastClaimedAmount = "_SWOP_last_claimed_amount" | |
37 | 37 | ||
38 | 38 | let keyAvailableSWOP = "_available_SWOP" | |
39 | 39 | ||
40 | 40 | let keyFarmingStartHeight = "farming_start_height" | |
41 | 41 | ||
42 | 42 | let keyAPY = "apy" | |
43 | 43 | ||
44 | 44 | let kPreviousTotalVoteSWOP = "previous_total_vote_SWOP" | |
45 | 45 | ||
46 | 46 | let keySwopYearEmission = "swop_year_emission" | |
47 | 47 | ||
48 | 48 | let keyBalancecpmmA = "A_asset_balance" | |
49 | 49 | ||
50 | 50 | let keyBalancecpmmB = "B_asset_balance" | |
51 | 51 | ||
52 | 52 | let kHarvestPoolActiveVoteStrucVoting = "_harvest_pool_activeVote_struc" | |
53 | 53 | ||
54 | 54 | let kHarvestUserPoolActiveVoteStrucVoting = "_harvest_user_pool_activeVote_struc" | |
55 | 55 | ||
56 | 56 | let keyLimitShareFirstHarvest = "share_limit_on_first_harvest" | |
57 | 57 | ||
58 | 58 | let keyAssetIdA = "A_asset_id" | |
59 | 59 | ||
60 | 60 | let keyAssetIdB = "B_asset_id" | |
61 | 61 | ||
62 | 62 | let keyFirstHarvestHeight = "first_harvest_height" | |
63 | 63 | ||
64 | 64 | let keyfirstHarvestCpmm = "first_harvest" | |
65 | 65 | ||
66 | 66 | let governanceAddress = Address(base58'3N5W8da2iiijVieA6qLGo7KzCJj8B19smWU') | |
67 | 67 | ||
68 | 68 | let wallet = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
69 | 69 | ||
70 | 70 | let votingAddress = Address(base58'3MrJgdL1GniipErHy44YF9idzLaUL2iX5DQ') | |
71 | 71 | ||
72 | 72 | let adminIncreaseInterestAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
73 | 73 | ||
74 | 74 | let oneWeekInBlock = 10106 | |
75 | 75 | ||
76 | 76 | let totalVoteShare = 10000000000 | |
77 | 77 | ||
78 | 78 | let scaleValue1 = 10 | |
79 | 79 | ||
80 | 80 | let scaleValue3 = 1000 | |
81 | 81 | ||
82 | 82 | let scaleValue5 = 100000 | |
83 | 83 | ||
84 | 84 | let scaleValue6 = 1000000 | |
85 | 85 | ||
86 | 86 | let scaleValue8 = 100000000 | |
87 | 87 | ||
88 | 88 | let scaleValue11 = 100000000000 | |
89 | 89 | ||
90 | 90 | func strAssetIdA (pool) = getStringValue(pool, keyAssetIdA) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func strAssetIdB (pool) = getStringValue(pool, keyAssetIdB) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func assetIdA (pool) = if ((strAssetIdA(pool) == "WAVES")) | |
97 | 97 | then unit | |
98 | 98 | else fromBase58String(strAssetIdA(pool)) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func assetIdB (pool) = if ((strAssetIdB(pool) == "WAVES")) | |
102 | 102 | then unit | |
103 | 103 | else fromBase58String(strAssetIdB(pool)) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | let kBasePeriod = "base_period" | |
107 | 107 | ||
108 | 108 | let kPeriodLength = "period_length" | |
109 | 109 | ||
110 | 110 | let kStartHeight = "start_height" | |
111 | 111 | ||
112 | 112 | let kFirstHarvestHeight = "first_harvest_height" | |
113 | 113 | ||
114 | 114 | let kDurationFullVotePower = "duration_full_vote_power" | |
115 | 115 | ||
116 | 116 | let kMinVotePower = "min_vote_power" | |
117 | 117 | ||
118 | 118 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
119 | 119 | ||
120 | 120 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
121 | 121 | ||
122 | 122 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
123 | 123 | ||
124 | 124 | let durationFullVotePower = valueOrErrorMessage(getInteger(votingAddress, kDurationFullVotePower), "Empty kDurationFullVotePower") | |
125 | 125 | ||
126 | 126 | let minVotePower = valueOrErrorMessage(getInteger(votingAddress, kMinVotePower), "Empty kMinVotePower") | |
127 | 127 | ||
128 | 128 | let currPeriod = (basePeriod + ((height - startHeight) / periodLength)) | |
129 | 129 | ||
130 | 130 | func getLimitToken (pool) = valueOrElse(getIntegerValue(pool, keyLimitShareFirstHarvest), 0) | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | let APY = getIntegerValue(this, keyAPY) | |
134 | 134 | ||
135 | 135 | let SwopYearEmission = getIntegerValue(this, keySwopYearEmission) | |
136 | 136 | ||
137 | 137 | func assetNameA (pool) = match assetIdA(pool) { | |
138 | 138 | case id: ByteVector => | |
139 | 139 | value(assetInfo(id)).name | |
140 | 140 | case waves: Unit => | |
141 | 141 | "WAVES" | |
142 | 142 | case _ => | |
143 | 143 | throw("Match error") | |
144 | 144 | } | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func assetNameB (pool) = match assetIdB(pool) { | |
148 | 148 | case id: ByteVector => | |
149 | 149 | value(assetInfo(id)).name | |
150 | 150 | case waves: Unit => | |
151 | 151 | "WAVES" | |
152 | 152 | case _ => | |
153 | 153 | throw("Match error") | |
154 | 154 | } | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | let SWOP = fromBase58String(getStringValue(this, keySWOPid)) | |
158 | 158 | ||
159 | 159 | func isFirstHarvest (pool) = valueOrElse(getBoolean(pool, keyfirstHarvestCpmm), false) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func getHeightFirstHarvest (pool) = valueOrElse(getInteger(pool, keyFirstHarvestHeight), 0) | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func getBalanceA (pool) = valueOrErrorMessage(getInteger(pool, keyBalancecpmmA), ("No data on the key: " + keyBalancecpmmA)) | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func getBalanceB (pool) = valueOrErrorMessage(getInteger(pool, keyBalancecpmmB), ("No data on the key: " + keyBalancecpmmB)) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func getShareLimitToken (pool) = valueOrErrorMessage(getInteger(pool, kShareLimit), ("No data on the key: " + kShareLimit)) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func getTotalShareTokenLocked (pool) = valueOrErrorMessage(getInteger(this, (pool + keyShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked)) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func getShareAssetId (pool) = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func getAssetInfo (assetId) = match assetId { | |
181 | 181 | case id: ByteVector => | |
182 | 182 | let stringId = toBase58String(id) | |
183 | 183 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
184 | 184 | $Tuple3(stringId, info.name, info.decimals) | |
185 | 185 | case waves: Unit => | |
186 | 186 | $Tuple3("WAVES", "WAVES", 8) | |
187 | 187 | case _ => | |
188 | 188 | throw("Match error") | |
189 | 189 | } | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | func calcScaleValue (assetId1,assetId2) = { | |
193 | 193 | let assetId1Decimals = value(assetInfo(assetId1)).decimals | |
194 | 194 | let assetId2Decimals = value(assetInfo(assetId2)).decimals | |
195 | 195 | let scaleDigits = ((assetId2Decimals - assetId1Decimals) + 8) | |
196 | 196 | pow(10, 0, scaleDigits, 0, 0, HALFDOWN) | |
197 | 197 | } | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | func userAvailableSWOP (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyAvailableSWOP)), 0) | |
201 | 201 | ||
202 | 202 | ||
203 | + | func isPoolUnderway (pool) = if ((pool == "3PCdNCULgjM9ZMLEt61M45qxV26ro6o48Jj")) | |
204 | + | then true | |
205 | + | else (pool == "3PMcDUBDyjNB1fkRGeLGpsz1ZQPfcmyp4r5") | |
206 | + | ||
207 | + | ||
203 | 208 | func rewardInfo (pool) = { | |
204 | 209 | let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger(governanceAddress, keyTotalRewardPerBlockCurrent), ((("No data on the key: " + keyTotalRewardPerBlockCurrent) + " at address ") + toString(governanceAddress))) | |
205 | 210 | let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger(governanceAddress, keyTotalRewardPerBlockPrevious), ((("No data on the key: " + keyTotalRewardPerBlockPrevious) + " at address ") + toString(governanceAddress))) | |
206 | 211 | let rewardPoolFractionCurrent = valueOrErrorMessage(getInteger(governanceAddress, (pool + keyRewardPoolFractionCurrent)), (((("No data on the key: " + pool) + keyRewardPoolFractionCurrent) + " at address ") + toString(governanceAddress))) | |
207 | 212 | let rewardUpdateHeight = valueOrErrorMessage(getInteger(governanceAddress, keyRewardUpdateHeight), ((("No data on the key: " + keyRewardUpdateHeight) + " at address ") + toString(governanceAddress))) | |
208 | 213 | let rewardPoolFractionPrevious = valueOrErrorMessage(getInteger(governanceAddress, (pool + keyRewardPoolFractionPrevious)), (((("No data on the key: " + pool) + keyRewardPoolFractionPrevious) + " at address ") + toString(governanceAddress))) | |
209 | 214 | let rewardPoolCurrent = fraction(totalRewardPerBlockCurrent, rewardPoolFractionCurrent, totalVoteShare) | |
210 | 215 | let rewardPoolPrevious = fraction(totalRewardPerBlockPrevious, rewardPoolFractionPrevious, totalVoteShare) | |
211 | 216 | if (if ((rewardPoolCurrent > totalRewardPerBlockCurrent)) | |
212 | 217 | then true | |
213 | 218 | else (rewardPoolPrevious > totalRewardPerBlockPrevious)) | |
214 | 219 | then throw("rewardPoolCurrent > totalRewardPerBlockCurrent or rewardPoolPrevious > totalRewardPerBlockPrevious") | |
215 | 220 | else $Tuple3(rewardPoolCurrent, rewardUpdateHeight, rewardPoolPrevious) | |
216 | 221 | } | |
217 | 222 | ||
218 | 223 | ||
219 | 224 | func getLastInterestInfo (pool) = { | |
220 | 225 | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (("No data on the key: " + pool) + keyLastInterest)) | |
221 | 226 | let lastInterestHeight = valueOrElse(getInteger(this, (pool + keyLastInterestHeight)), height) | |
222 | 227 | $Tuple2(lastInterestHeight, lastInterest) | |
223 | 228 | } | |
224 | 229 | ||
225 | 230 | ||
226 | 231 | func getUserInterestInfo (pool,userAddress) = { | |
227 | 232 | let userLastInterest = getInteger(this, (((pool + "_") + toString(userAddress)) + keyUserLastInterest)) | |
228 | 233 | let userShare = getInteger(this, (((pool + "_") + toString(userAddress)) + keyUserShareTokensLocked)) | |
229 | 234 | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (("No data on the key: " + pool) + keyLastInterest)) | |
230 | 235 | let userLastInterestValue = match userLastInterest { | |
231 | 236 | case userLastInterest: Int => | |
232 | 237 | userLastInterest | |
233 | 238 | case _ => | |
234 | 239 | lastInterest | |
235 | 240 | } | |
236 | 241 | let userShareTokensAmount = match userShare { | |
237 | 242 | case userShare: Int => | |
238 | 243 | userShare | |
239 | 244 | case _ => | |
240 | 245 | 0 | |
241 | 246 | } | |
242 | 247 | $Tuple2(userLastInterestValue, userShareTokensAmount) | |
243 | 248 | } | |
244 | 249 | ||
245 | 250 | ||
246 | 251 | func calcInterest (lastInterestHeight,rewardUpdateHeight,lastInterest,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,shareAssetId,scaleValue,pmtAmount) = if ((shareTokenLocked == 0)) | |
247 | 252 | then 0 | |
248 | 253 | else if ((rewardUpdateHeight > height)) | |
249 | 254 | then { | |
250 | 255 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
251 | 256 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
252 | 257 | } | |
253 | 258 | else if ((lastInterestHeight > rewardUpdateHeight)) | |
254 | 259 | then { | |
255 | 260 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
256 | 261 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
257 | 262 | } | |
258 | 263 | else { | |
259 | 264 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
260 | 265 | let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked)) | |
261 | 266 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
262 | 267 | (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked)) | |
263 | 268 | } | |
264 | 269 | ||
265 | 270 | ||
266 | 271 | func claimCalc (pool,caller,pmtAmount) = { | |
267 | 272 | let shareAssetId = getShareAssetId(pool) | |
268 | 273 | let scaleValue = calcScaleValue(SWOP, shareAssetId) | |
269 | 274 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
270 | - | let $ | |
271 | - | let lastInterestHeight = $ | |
272 | - | let lastInterest = $ | |
273 | - | let $ | |
274 | - | let currentRewardPerBlock = $ | |
275 | - | let rewardUpdateHeight = $ | |
276 | - | let previousRewardPerBlock = $ | |
277 | - | let $ | |
278 | - | let userLastInterest = $ | |
279 | - | let userShareTokensAmount = $ | |
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 | |
280 | 285 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue, pmtAmount) | |
281 | 286 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue) | |
282 | 287 | let userNewInterest = currentInterest | |
283 | 288 | $Tuple4(userNewInterest, currentInterest, claimAmount, userShareTokensAmount) | |
284 | 289 | } | |
285 | 290 | ||
286 | 291 | ||
287 | 292 | func calculateProtocolReward (pool) = { | |
288 | - | let $ | |
289 | - | let lastInterestHeight = $ | |
290 | - | let lastInterest = $ | |
291 | - | let $ | |
292 | - | let currentRewardPerBlock = $ | |
293 | - | let rewardUpdateHeight = $ | |
294 | - | let previousRewardPerBlock = $ | |
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 | |
295 | 300 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
296 | 301 | if ((shareTokenLocked == 0)) | |
297 | 302 | then if ((rewardUpdateHeight > height)) | |
298 | 303 | then { | |
299 | 304 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
300 | 305 | reward | |
301 | 306 | } | |
302 | 307 | else if ((lastInterestHeight > rewardUpdateHeight)) | |
303 | 308 | then { | |
304 | 309 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
305 | 310 | reward | |
306 | 311 | } | |
307 | 312 | else { | |
308 | 313 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
309 | 314 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
310 | 315 | (reward + rewardAfterLastInterestBeforeReawardUpdate) | |
311 | 316 | } | |
312 | 317 | else 0 | |
313 | 318 | } | |
314 | 319 | ||
315 | 320 | ||
316 | 321 | func checkPmtAssetIdCorrect (pool,pmtAssetId) = { | |
317 | 322 | let poolShareAssetId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
318 | 323 | if ((pmtAssetId == poolShareAssetId)) | |
319 | 324 | then true | |
320 | 325 | else false | |
321 | 326 | } | |
322 | 327 | ||
323 | 328 | ||
324 | 329 | func getUserSWOPClaimedAmount (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyUserSWOPClaimedAmount)), 0) | |
325 | 330 | ||
326 | 331 | ||
327 | 332 | @Callable(i) | |
328 | 333 | func init (earlyLP) = if (isDefined(getString(this, keySWOPid))) | |
329 | 334 | then throw("SWOP already initialized") | |
330 | 335 | else { | |
331 | 336 | let initAmount = 100000000000000 | |
332 | 337 | let SWOPissue = Issue("SWOP", "SWOP protocol token", initAmount, 8, true) | |
333 | 338 | let SWOPid = calculateAssetId(SWOPissue) | |
334 | 339 | [Issue("SWOP", "SWOP protocol token", initAmount, 8, true), StringEntry(keySWOPid, toBase58String(SWOPid))] | |
335 | 340 | } | |
336 | 341 | ||
337 | 342 | ||
338 | 343 | ||
339 | 344 | @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") | |
342 | 362 | 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 | |
348 | 424 | } | |
349 | 425 | ||
350 | 426 | ||
351 | 427 | ||
352 | 428 | @Callable(i) | |
353 | - | func | |
354 | - | then throw(" | |
429 | + | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = if (isPoolUnderway(pool)) | |
430 | + | then throw("Work is currently underway") | |
355 | 431 | 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)] | |
366 | 447 | } | |
367 | 448 | ||
368 | 449 | ||
369 | 450 | ||
370 | 451 | @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 | + | } | |
480 | 475 | ||
481 | 476 | ||
482 | 477 | @Verifier(tx) | |
483 | 478 | func verify () = match tx { | |
484 | 479 | case _ => | |
485 | 480 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
486 | 481 | } | |
487 | 482 |
github/deemru/w8io/169f3d6 85.46 ms ◑