tx · 8apwSkDMttUUEx6axjrXFJ8VtmNXfk8oTPRi6cR1JDkf 3MsXpzisJAwnzUr7XrEoW1BZo4U6rw4tsYK: -0.14000000 Waves 2023.01.19 15:56 [2411841] smart account 3MsXpzisJAwnzUr7XrEoW1BZo4U6rw4tsYK > SELF 0.00000000 Waves
{ "type": 13, "id": "8apwSkDMttUUEx6axjrXFJ8VtmNXfk8oTPRi6cR1JDkf", "fee": 14000000, "feeAssetId": null, "timestamp": 1674132988321, "version": 2, "chainId": 84, "sender": "3MsXpzisJAwnzUr7XrEoW1BZo4U6rw4tsYK", "senderPublicKey": "FFdBua5rzzMkZebvsvmN7sAdU7XhFK8QNJ3hiwwxAYRA", "proofs": [ "2v6dvsCFKm1GniKzHL6ChVCWyXue9MdG49qMukXS56cZUEVWcsS6CCfSX5rtwJKzWpX7owkMP1ybYsfaYrcxVoxg", "5HTjgHU6i6oGdTwSuZvqYBpTtcDKJNK8gyVRrZ7wFR8ZY2xku5xPKpoj8kX9qPy1cWruQsaPFndRdSYMxfR4VNsn" ], "script": "base64:BgJiCAISAwoBCBIDCgEIEgMKAQgSBAoCCAESBQoDAggBEgUKAwgBARIECgIICBIECgIICBIECgIIARIFCgMCCAESAwoBCBIECgIIAhIDCgEIEgMKARgSAwoBGBIECgIICBIAEgBgAAdrQWN0aXZlAgZhY3RpdmUAC2tBY3RpdmVHbG9iAhRhY3RpdmVfYWxsX2NvbnRyYWN0cwAPa0RlcHJlY2F0ZWRQb29sAgtkZXByZWNhdGVkXwAGa0NhdXNlAg5zaHV0ZG93bl9jYXVzZQAaa1Jld2FyZFBvb2xGcmFjdGlvbkN1cnJlbnQCHV9jdXJyZW50X3Bvb2xfZnJhY3Rpb25fcmV3YXJkABtrUmV3YXJkUG9vbEZyYWN0aW9uUHJldmlvdXMCHl9wcmV2aW91c19wb29sX2ZyYWN0aW9uX3Jld2FyZAATa0hlaWdodFBvb2xGcmFjdGlvbgIaX3Bvb2xfcmV3YXJkX3VwZGF0ZV9oZW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HViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAK3mBkS", "height": 2411841, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2zQmk5sL4QGGFAhn9BuaN4tH2uzF88oby1x3jBTPfxcL Next: 6td6NtM3MYnWxeNWtf1n4AT1kYJwgpMPsDqiWCsM3hCM Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | let kActive = "active" | |
5 | 5 | ||
6 | 6 | let kActiveGlob = "active_all_contracts" | |
7 | + | ||
8 | + | let kDeprecatedPool = "deprecated_" | |
7 | 9 | ||
8 | 10 | let kCause = "shutdown_cause" | |
9 | 11 | ||
216 | 218 | ||
217 | 219 | ||
218 | 220 | func calcInterest (pool,lastInterestHeight,rewardUpdateHeight,poolRewardUpdateHeight,farmInterest,boostInterest,poolVoted,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,scaleValue) = { | |
219 | - | let $ | |
221 | + | let $t0951610689 = if (if (if ((rewardUpdateHeight > height)) | |
220 | 222 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
221 | 223 | else false) | |
222 | 224 | then true | |
245 | 247 | let rwd = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
246 | 248 | $Tuple3(rwd, fBfrUp, bBfrUp) | |
247 | 249 | } | |
248 | - | let reward = $ | |
249 | - | let farmIntrBefore = $ | |
250 | - | let boostIntrBefore = $ | |
250 | + | let reward = $t0951610689._1 | |
251 | + | let farmIntrBefore = $t0951610689._2 | |
252 | + | let boostIntrBefore = $t0951610689._3 | |
251 | 253 | let newFarmInterest = (farmIntrBefore + fraction(calcFarmRwd(pool, reward), scaleValue, shareTokenLocked)) | |
252 | 254 | let newBoostInterest = (boostIntrBefore + (if ((poolVoted > 0)) | |
253 | 255 | then fraction(calcBoostRwd(pool, reward), scaleValue8, poolVoted) | |
263 | 265 | let shareToken = getTotalShareToken(pool) | |
264 | 266 | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), shareToken) | |
265 | 267 | let stratBFarmInterest = valueOrElse(getInteger(this, (pool + kStratBFarmInterest)), 0) | |
266 | - | let $ | |
267 | - | let lastInterestHeight = $ | |
268 | - | let farmInterest = $ | |
269 | - | let boostInterest = $ | |
270 | - | let $ | |
271 | - | let currentRewardPerBlock = $ | |
272 | - | let rewardUpdateHeight = $ | |
273 | - | let previousRewardPerBlock = $ | |
274 | - | let poolRewardUpdateHeight = $ | |
268 | + | let $t01152711608 = getLastInterestInfo(pool) | |
269 | + | let lastInterestHeight = $t01152711608._1 | |
270 | + | let farmInterest = $t01152711608._2 | |
271 | + | let boostInterest = $t01152711608._3 | |
272 | + | let $t01161311727 = rewardInfo(pool) | |
273 | + | let currentRewardPerBlock = $t01161311727._1 | |
274 | + | let rewardUpdateHeight = $t01161311727._2 | |
275 | + | let previousRewardPerBlock = $t01161311727._3 | |
276 | + | let poolRewardUpdateHeight = $t01161311727._4 | |
275 | 277 | let uFarmInterest = valueOrElse(getInteger(this, (((pool + "_") + user) + kFarmUserLastInterest)), farmInterest) | |
276 | 278 | let uBoostInterest = valueOrElse(getInteger(this, (((pool + "_") + user) + kBoostUserLastInterest)), if (if ((stratBFarmInterest > uFarmInterest)) | |
277 | 279 | then (uPoolVoted > 0) | |
282 | 284 | let uShareTokensVirt = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), uShareTokensStaked) | |
283 | 285 | if ((totalShareVirtual == 0)) | |
284 | 286 | then { | |
285 | - | let toTreasury = if ((farmInterest == 0)) | |
286 | - | then (currentRewardPerBlock * (height - lastInterestHeight)) | |
287 | - | else 0 | |
287 | + | let toTreasury = (currentRewardPerBlock * (height - lastInterestHeight)) | |
288 | 288 | $Tuple4(farmInterest, boostInterest, 0, toTreasury) | |
289 | 289 | } | |
290 | 290 | else { | |
291 | - | let $ | |
292 | - | let newFarmInterest = $ | |
293 | - | let newBoostInterest = $ | |
291 | + | let $t01244012832 = calcInterest(pool, lastInterestHeight, rewardUpdateHeight, poolRewardUpdateHeight, farmInterest, boostInterest, poolVoted, currentRewardPerBlock, totalShareVirtual, previousRewardPerBlock, scaleValue) | |
292 | + | let newFarmInterest = $t01244012832._1 | |
293 | + | let newBoostInterest = $t01244012832._2 | |
294 | 294 | let farmRwd = fraction(uShareTokensVirt, (newFarmInterest - uFarmInterest), scaleValue) | |
295 | 295 | let poolBoostCoef = valueOrElse(getInteger(this, (pool + kPoolBoostCoef)), defPoolBoostCoef) | |
296 | 296 | let boostRwdMax = fraction(fraction(uShareTokensVirt, (newFarmInterest - max([uFarmInterest, stratBFarmInterest])), scaleValue), poolBoostCoef, lockBoostCoefScale) | |
306 | 306 | ||
307 | 307 | func availableClaimCalcAllByUser (pools,user) = { | |
308 | 308 | func calcAvailable (acc,pool) = { | |
309 | - | let $ | |
310 | - | let newPools = $ | |
311 | - | let amounts = $ | |
312 | - | let $ | |
313 | - | let fi = $ | |
314 | - | let bi = $ | |
315 | - | let claimAmount = $ | |
316 | - | let tt = $ | |
309 | + | let $t01370113730 = acc | |
310 | + | let newPools = $t01370113730._1 | |
311 | + | let amounts = $t01370113730._2 | |
312 | + | let $t01373913792 = claimCalc(pool, user) | |
313 | + | let fi = $t01373913792._1 | |
314 | + | let bi = $t01373913792._2 | |
315 | + | let claimAmount = $t01373913792._3 | |
316 | + | let tt = $t01373913792._4 | |
317 | 317 | let availableFund = (userAvailableSWOP(pool, user) + claimAmount) | |
318 | 318 | $Tuple2((newPools :+ pool), (amounts :+ availableFund)) | |
319 | 319 | } | |
378 | 378 | else throw("Only pool can call this function") | |
379 | 379 | ||
380 | 380 | ||
381 | + | func getDeprecatedPool (pool) = valueOrElse(getBoolean(oracle, (kDeprecatedPool + pool)), false) | |
382 | + | ||
383 | + | ||
384 | + | func isDeprecatedPool (pool) = if (!(getDeprecatedPool(pool))) | |
385 | + | then unit | |
386 | + | else throw("Pool is deprecated. Only unlock action allowed.") | |
387 | + | ||
388 | + | ||
381 | 389 | func isSelfCall (i) = if ((i.caller == this)) | |
382 | 390 | then unit | |
383 | 391 | else throw("Only contract itself can call this function") | |
393 | 401 | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
394 | 402 | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
395 | 403 | let totalUserShareTokens = ((userStakedAmount + userLockedAmount) + i.payments[0].amount) | |
396 | - | let $ | |
397 | - | let lockPeriod = $ | |
398 | - | let lockCoef = $ | |
404 | + | let $t01684116893 = getLockParams(lockType) | |
405 | + | let lockPeriod = $t01684116893._1 | |
406 | + | let lockCoef = $t01684116893._2 | |
399 | 407 | let lockWavesFee = getIntegerValue(this, kLockWavesFee) | |
400 | 408 | if ((i.payments[0].assetId != shareAssetId)) | |
401 | 409 | then throw("Wrong sharetoken in payment") | |
407 | 415 | let shareTokensChangeOnFH = canLockInFirstHarvest(pool, user, userStakedAmount, i.payments[0].amount, lockType) | |
408 | 416 | if ((shareTokensChangeOnFH == shareTokensChangeOnFH)) | |
409 | 417 | then { | |
410 | - | let $ | |
418 | + | let $t01732019254 = if ((lockType == 0)) | |
411 | 419 | then { | |
412 | 420 | let userAmountVirtualNew = ((userAmountVirtual + i.payments[0].amount) - shareTokensChangeOnFH) | |
413 | 421 | $Tuple2([IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), ((userStakedAmount + i.payments[0].amount) - shareTokensChangeOnFH)), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual + i.payments[0].amount) - shareTokensChangeOnFH)), ScriptTransfer(caller, shareTokensChangeOnFH, i.payments[0].assetId)], ((totalShare + i.payments[0].amount) - shareTokensChangeOnFH)) | |
428 | 436 | let userAmountVirtualNew = (fraction(userLockedAmountNew, lockCoef, lockBoostCoefScale) + userStakedAmount) | |
429 | 437 | $Tuple2([IntegerEntry((((pool + "_") + user) + kUserShareTokensLocked), userLockedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedHeight), userLockedHeigtNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedType), lockType), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userAmountVirtualNew))], (totalShare + i.payments[0].amount)) | |
430 | 438 | } | |
431 | - | let lockEntries = $ | |
432 | - | let totalShareNew = $ | |
439 | + | let lockEntries = $t01732019254._1 | |
440 | + | let totalShareNew = $t01732019254._2 | |
433 | 441 | if ((accountBalance(shareAssetId) > totalShareNew)) | |
434 | 442 | then throw("Balance of share-token is lower than totalAmount") | |
435 | 443 | else { | |
436 | - | let $ | |
437 | - | let farmInterest = $ | |
438 | - | let boostInterest = $ | |
439 | - | let claimAmount = $ | |
440 | - | let toTreasure = $ | |
444 | + | let $t01937919461 = claimCalc(pool, user) | |
445 | + | let farmInterest = $t01937919461._1 | |
446 | + | let boostInterest = $t01937919461._2 | |
447 | + | let claimAmount = $t01937919461._3 | |
448 | + | let toTreasure = $t01937919461._4 | |
441 | 449 | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
442 | 450 | let uplp = if ((getString(Address(fromBase58String(pool)), "version") == "3.0.0")) | |
443 | 451 | then invoke(lpFarmingAddress, "updateUserInterest", [user, pool, totalUserShareTokens], nil) | |
452 | 460 | } | |
453 | 461 | ||
454 | 462 | ||
455 | - | func calcWithdrawShareTokens (i,caller,pool,shareTokensWithdrawAmount) = valueOrElse(isActive(), { | |
456 | - | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
457 | - | let user = toString(caller) | |
458 | - | let $t02040720489 = claimCalc(pool, user) | |
459 | - | let farmInterest = $t02040720489._1 | |
460 | - | let boostInterest = $t02040720489._2 | |
461 | - | let claimAmount = $t02040720489._3 | |
462 | - | let toTreasure = $t02040720489._4 | |
463 | - | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
464 | - | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
465 | - | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
466 | - | let userStakedAmountNew = (userStakedAmount - shareTokensWithdrawAmount) | |
467 | - | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
468 | - | let totalShareAmount = getTotalShareToken(pool) | |
469 | - | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), totalShareAmount) | |
470 | - | let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount) | |
471 | - | let totalShareVirtualNew = (totalShareVirtual - shareTokensWithdrawAmount) | |
472 | - | let userAmountVirtualNew = (userAmountVirtual - shareTokensWithdrawAmount) | |
473 | - | if ((shareTokensWithdrawAmount > userStakedAmount)) | |
474 | - | then throw("Withdraw amount more then user locked amount") | |
475 | - | else if ((accountBalance(shareTokensId) > totalShareAmount)) | |
476 | - | then throw("Balance of share-token is lower than totalAmount") | |
477 | - | else { | |
478 | - | let uplp = if ((getString(Address(fromBase58String(pool)), "version") == "3.0.0")) | |
479 | - | then invoke(lpFarmingAddress, "updateUserInterest", [user, pool, (userStakedAmount + userLockedAmount)], nil) | |
480 | - | else 0 | |
481 | - | if ((uplp == uplp)) | |
482 | - | then [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTotalShareTokens), totalShareAmountNew), IntegerEntry((pool + kShareTokensVirtual), totalShareVirtualNew), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
483 | - | else throw("Strict value is not equal to itself.") | |
484 | - | } | |
485 | - | }) | |
463 | + | func calcWithdrawShareTokens (i,caller,pool,shareTokensWithdrawAmount) = { | |
464 | + | let inv = if (getDeprecatedPool(pool)) | |
465 | + | then invoke(this, "unlockUserLockDeprecated", [pool, toString(caller)], nil) | |
466 | + | else 0 | |
467 | + | if ((inv == inv)) | |
468 | + | then { | |
469 | + | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
470 | + | let user = toString(caller) | |
471 | + | let $t02075820840 = claimCalc(pool, user) | |
472 | + | let farmInterest = $t02075820840._1 | |
473 | + | let boostInterest = $t02075820840._2 | |
474 | + | let claimAmount = $t02075820840._3 | |
475 | + | let toTreasure = $t02075820840._4 | |
476 | + | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
477 | + | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
478 | + | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
479 | + | let userStakedAmountNew = (userStakedAmount - shareTokensWithdrawAmount) | |
480 | + | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
481 | + | let totalShareAmount = getTotalShareToken(pool) | |
482 | + | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), totalShareAmount) | |
483 | + | let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount) | |
484 | + | let totalShareVirtualNew = (totalShareVirtual - shareTokensWithdrawAmount) | |
485 | + | let userAmountVirtualNew = (userAmountVirtual - shareTokensWithdrawAmount) | |
486 | + | if ((shareTokensWithdrawAmount > userStakedAmount)) | |
487 | + | then throw("Withdraw amount more then user locked amount") | |
488 | + | else if ((accountBalance(shareTokensId) > totalShareAmount)) | |
489 | + | then throw("Balance of share-token is lower than totalAmount") | |
490 | + | else { | |
491 | + | let uplp = if ((getString(Address(fromBase58String(pool)), "version") == "3.0.0")) | |
492 | + | then invoke(lpFarmingAddress, "updateUserInterest", [user, pool, (userStakedAmount + userLockedAmount)], nil) | |
493 | + | else 0 | |
494 | + | if ((uplp == uplp)) | |
495 | + | then [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTotalShareTokens), totalShareAmountNew), IntegerEntry((pool + kShareTokensVirtual), totalShareVirtualNew), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
496 | + | else throw("Strict value is not equal to itself.") | |
497 | + | } | |
498 | + | } | |
499 | + | else throw("Strict value is not equal to itself.") | |
500 | + | } | |
486 | 501 | ||
487 | 502 | ||
488 | 503 | func calcClaim (i,pool,caller) = { | |
489 | 504 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
490 | 505 | let user = toString(caller) | |
491 | 506 | let shareTokenLocked = getTotalShareToken(pool) | |
492 | - | let $ | |
493 | - | let farmInterest = $ | |
494 | - | let boostInterest = $ | |
495 | - | let claimAmount = $ | |
496 | - | let toTreasure = $ | |
507 | + | let $t02335123433 = claimCalc(pool, user) | |
508 | + | let farmInterest = $t02335123433._1 | |
509 | + | let boostInterest = $t02335123433._2 | |
510 | + | let claimAmount = $t02335123433._3 | |
511 | + | let toTreasure = $t02335123433._4 | |
497 | 512 | let availableFund = (userAvailableSWOP(pool, user) + claimAmount) | |
498 | 513 | if ((accountBalance(shareTokensId) > shareTokenLocked)) | |
499 | 514 | then throw("Balance of share-token is lower than totalAmount") | |
503 | 518 | else nil | |
504 | 519 | $Tuple2(([IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), 0), Reissue(SWOP, (toTreasure + availableFund), true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] ++ uTrans), availableFund) | |
505 | 520 | } | |
521 | + | } | |
522 | + | ||
523 | + | ||
524 | + | func unlockUserLockCalc (i,pool,user) = { | |
525 | + | let totalShareVirtual = getIntegerValue(this, (pool + kShareTokensVirtual)) | |
526 | + | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
527 | + | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
528 | + | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
529 | + | let userStakedAmountNew = (userStakedAmount + userLockedAmount) | |
530 | + | let $t02483624918 = claimCalc(pool, user) | |
531 | + | let farmInterest = $t02483624918._1 | |
532 | + | let boostInterest = $t02483624918._2 | |
533 | + | let claimAmount = $t02483624918._3 | |
534 | + | let toTreasure = $t02483624918._4 | |
535 | + | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
536 | + | [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userStakedAmountNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userStakedAmountNew)), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), DeleteEntry((((pool + "_") + user) + kUserShareTokensLocked)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedHeight)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedType)), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] | |
506 | 537 | } | |
507 | 538 | ||
508 | 539 | ||
528 | 559 | then throw("Only Governance can call this function") | |
529 | 560 | else { | |
530 | 561 | let user = toString(addressFromPublicKey(adminInvokePubKey)) | |
531 | - | let $ | |
532 | - | let farmInterest = $ | |
533 | - | let boostInterest = $ | |
534 | - | let boostLPinterest = $ | |
562 | + | let $t02708427158 = claimCalc(pool, user) | |
563 | + | let farmInterest = $t02708427158._1 | |
564 | + | let boostInterest = $t02708427158._2 | |
565 | + | let boostLPinterest = $t02708427158._3 | |
535 | 566 | [IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height)] | |
536 | 567 | }) | |
537 | 568 | ||
538 | 569 | ||
539 | 570 | ||
540 | 571 | @Callable(i) | |
541 | - | func lockShareTokens (pool,lockType) = valueOrElse(isActive(), calcLockShareTokens(i, i.caller, pool, lockType)) | |
572 | + | func lockShareTokens (pool,lockType) = valueOrElse(isDeprecatedPool(pool), valueOrElse(isActive(), calcLockShareTokens(i, i.caller, pool, lockType))) | |
542 | 573 | ||
543 | 574 | ||
544 | 575 | ||
545 | 576 | @Callable(i) | |
546 | - | func lockShareTokensFromPool (callerBytes,pool,lockType) = valueOrElse(isActive(), valueOrElse(isPoolCall(i, pool), calcLockShareTokens(i, Address(callerBytes), pool, lockType))) | |
577 | + | func lockShareTokensFromPool (callerBytes,pool,lockType) = valueOrElse(isDeprecatedPool(pool), valueOrElse(isActive(), valueOrElse(isPoolCall(i, pool), calcLockShareTokens(i, Address(callerBytes), pool, lockType)))) | |
547 | 578 | ||
548 | 579 | ||
549 | 580 | ||
550 | 581 | @Callable(i) | |
551 | - | func lockStakedShareTokens (pool,lockType,lockAmount) = valueOrElse(isActive(), { | |
582 | + | func lockStakedShareTokens (pool,lockType,lockAmount) = valueOrElse(isDeprecatedPool(pool), valueOrElse(isActive(), { | |
552 | 583 | let shareAssetId = getShareAssetId(pool) | |
553 | 584 | let user = toString(i.caller) | |
554 | 585 | let totalShare = getTotalShareToken(pool) | |
558 | 589 | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
559 | 590 | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
560 | 591 | let totalUserShareTokens = (userStakedAmount + userLockedAmount) | |
561 | - | let $ | |
562 | - | let lockPeriod = $ | |
563 | - | let lockCoef = $ | |
592 | + | let $t02878728839 = getLockParams(lockType) | |
593 | + | let lockPeriod = $t02878728839._1 | |
594 | + | let lockCoef = $t02878728839._2 | |
564 | 595 | let lockWavesFee = getIntegerValue(this, kLockWavesFee) | |
565 | 596 | if ((getHeightFirstHarvest(pool) > height)) | |
566 | 597 | then throw("You can't lock shareTokens till first harvest end.") | |
591 | 622 | let userStakedAmountNew = (userStakedAmount - lockAmount) | |
592 | 623 | let userLockedHeigtNew = (height + lockPeriod) | |
593 | 624 | let userAmountVirtualNew = (fraction(userLockedAmountNew, lockCoef, lockBoostCoefScale) + userStakedAmountNew) | |
594 | - | let $ | |
595 | - | let farmInterest = $ | |
596 | - | let boostInterest = $ | |
597 | - | let claimAmount = $ | |
598 | - | let toTreasure = $ | |
625 | + | let $t03018530267 = claimCalc(pool, user) | |
626 | + | let farmInterest = $t03018530267._1 | |
627 | + | let boostInterest = $t03018530267._2 | |
628 | + | let claimAmount = $t03018530267._3 | |
629 | + | let toTreasure = $t03018530267._4 | |
599 | 630 | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
600 | 631 | [IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLocked), userLockedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedHeight), userLockedHeigtNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedType), lockType), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userAmountVirtualNew)), IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] | |
601 | 632 | } | |
633 | + | })) | |
634 | + | ||
635 | + | ||
636 | + | ||
637 | + | @Callable(i) | |
638 | + | func unlockUserLock (pool,user) = valueOrElse(isActive(), { | |
639 | + | let userLockedHeigt = valueOrErrorMessage(getInteger(this, (((pool + "_") + user) + kUserShareTokensLockedHeight)), (((("There is no pool " + pool) + " or user ") + user) + "with lock")) | |
640 | + | if ((userLockedHeigt > height)) | |
641 | + | then throw(("You can't unlock sharetokens till " + toString(userLockedHeigt))) | |
642 | + | else (unlockUserLockCalc(i, pool, user) ++ [ScriptTransfer(i.caller, getIntegerValue(this, kLockWavesFee), unit)]) | |
602 | 643 | }) | |
603 | 644 | ||
604 | 645 | ||
605 | 646 | ||
606 | 647 | @Callable(i) | |
607 | - | func unlockUserLock (pool,user) = valueOrElse(isActive(), { | |
608 | - | let lockWavesFee = getIntegerValue(this, kLockWavesFee) | |
609 | - | let userLockedHeigt = valueOrErrorMessage(getInteger(this, (((pool + "_") + user) + kUserShareTokensLockedHeight)), (((("There is no pool " + pool) + " or user ") + user) + "with lock")) | |
610 | - | let totalShareVirtual = getIntegerValue(this, (pool + kShareTokensVirtual)) | |
611 | - | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
612 | - | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
613 | - | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
614 | - | if ((userLockedHeigt > height)) | |
615 | - | then throw(("You can't unlock sharetokens till " + toString(userLockedHeigt))) | |
616 | - | else { | |
617 | - | let userStakedAmountNew = (userStakedAmount + userLockedAmount) | |
618 | - | let $t02995530037 = claimCalc(pool, user) | |
619 | - | let farmInterest = $t02995530037._1 | |
620 | - | let boostInterest = $t02995530037._2 | |
621 | - | let claimAmount = $t02995530037._3 | |
622 | - | let toTreasure = $t02995530037._4 | |
623 | - | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
624 | - | [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userStakedAmountNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userStakedAmountNew)), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), DeleteEntry((((pool + "_") + user) + kUserShareTokensLocked)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedHeight)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedType)), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP), ScriptTransfer(i.caller, lockWavesFee, unit)] | |
625 | - | } | |
626 | - | }) | |
627 | - | ||
628 | - | ||
629 | - | ||
630 | - | @Callable(i) | |
631 | - | func unlockStableLock (user) = valueOrElse(isActive(), { | |
632 | - | let allowedCaller = Address(base58'3MpNDxa2QpcAzbaLaV6qacbuASgtH7wcric') | |
633 | - | let stablePools = ["3MpygN8qm376tUAHB6mhC5BxG5NKYortiyX", "3MvMXhKFMPz4BuZj9Jr9UysuxbWFKRJZgb3"] | |
634 | - | let lockWavesFee = getIntegerValue(this, kLockWavesFee) | |
635 | - | if ((i.caller != allowedCaller)) | |
636 | - | then throw((("Only " + toString(allowedCaller)) + "can call this function")) | |
637 | - | else { | |
638 | - | func unlock (a,pool) = { | |
639 | - | let $t03178531826 = a | |
640 | - | let entries = $t03178531826._1 | |
641 | - | let toTreasureSum = $t03178531826._2 | |
642 | - | let feesSum = $t03178531826._3 | |
643 | - | let userLockedHeigt = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLockedHeight)), 0) | |
644 | - | if ((userLockedHeigt == 0)) | |
645 | - | then a | |
646 | - | else { | |
647 | - | let totalShareVirtual = getIntegerValue(this, (pool + kShareTokensVirtual)) | |
648 | - | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
649 | - | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
650 | - | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
651 | - | let userStakedAmountNew = (userStakedAmount + userLockedAmount) | |
652 | - | let $t03246732549 = claimCalc(pool, user) | |
653 | - | let farmInterest = $t03246732549._1 | |
654 | - | let boostInterest = $t03246732549._2 | |
655 | - | let claimAmount = $t03246732549._3 | |
656 | - | let toTreasure = $t03246732549._4 | |
657 | - | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
658 | - | $Tuple3((entries ++ [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userStakedAmountNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userStakedAmountNew)), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), DeleteEntry((((pool + "_") + user) + kUserShareTokensLocked)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedHeight)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedType))]), (toTreasureSum + toTreasure), (feesSum + lockWavesFee)) | |
659 | - | } | |
660 | - | } | |
661 | - | ||
662 | - | let $t03368433757 = { | |
663 | - | let $l = stablePools | |
664 | - | let $s = size($l) | |
665 | - | let $acc0 = $Tuple3(nil, 0, 0) | |
666 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
667 | - | then $a | |
668 | - | else unlock($a, $l[$i]) | |
669 | - | ||
670 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
671 | - | then $a | |
672 | - | else throw("List size exceeds 2") | |
673 | - | ||
674 | - | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
675 | - | } | |
676 | - | let entries = $t03368433757._1 | |
677 | - | let toTresure = $t03368433757._2 | |
678 | - | let fees = $t03368433757._3 | |
679 | - | if ((size(entries) == 0)) | |
680 | - | then throw("Nothing to unlock") | |
681 | - | else ([Reissue(SWOP, toTresure, true), ScriptTransfer(farmingTreasureAddr, toTresure, SWOP), ScriptTransfer(moneyBoxAddress, fees, unit)] ++ entries) | |
682 | - | } | |
683 | - | }) | |
648 | + | func unlockUserLockDeprecated (pool,user) = valueOrElse(isActive(), valueOrElse(isSelfCall(i), valueOrElse(isDeprecatedPool(pool), (unlockUserLockCalc(i, pool, user) ++ [ScriptTransfer(moneyBoxAddress, getIntegerValue(this, kLockWavesFee), unit)])))) | |
684 | 649 | ||
685 | 650 | ||
686 | 651 | ||
810 | 775 | func updateUserBoostInterest (pool,user) = valueOrElse(isActive(), if ((i.caller != votingAddress)) | |
811 | 776 | then throw("Only voiting can call this function") | |
812 | 777 | else { | |
813 | - | let $ | |
814 | - | let farmInterest = $ | |
815 | - | let boostInterest = $ | |
816 | - | let claimAmount = $ | |
817 | - | let toTreasure = $ | |
778 | + | let $t03484634928 = claimCalc(pool, user) | |
779 | + | let farmInterest = $t03484634928._1 | |
780 | + | let boostInterest = $t03484634928._2 | |
781 | + | let claimAmount = $t03484634928._3 | |
782 | + | let toTreasure = $t03484634928._4 | |
818 | 783 | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
819 | 784 | [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] | |
820 | 785 | }) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kActive = "active" | |
5 | 5 | ||
6 | 6 | let kActiveGlob = "active_all_contracts" | |
7 | + | ||
8 | + | let kDeprecatedPool = "deprecated_" | |
7 | 9 | ||
8 | 10 | let kCause = "shutdown_cause" | |
9 | 11 | ||
10 | 12 | let kRewardPoolFractionCurrent = "_current_pool_fraction_reward" | |
11 | 13 | ||
12 | 14 | let kRewardPoolFractionPrevious = "_previous_pool_fraction_reward" | |
13 | 15 | ||
14 | 16 | let kHeightPoolFraction = "_pool_reward_update_height" | |
15 | 17 | ||
16 | 18 | let kTotalRewardPerBlockCurrent = "total_reward_per_block_current" | |
17 | 19 | ||
18 | 20 | let kTotalRewardPerBlockPrevious = "total_reward_per_block_previous" | |
19 | 21 | ||
20 | 22 | let kRewardUpdateHeight = "reward_update_height" | |
21 | 23 | ||
22 | 24 | let kUserShareTokensStaked = "_share_tokens_locked" | |
23 | 25 | ||
24 | 26 | let kUserShareTokensLocked = "_share_tokens_blocked" | |
25 | 27 | ||
26 | 28 | let kUserShareTokensLockedType = "_share_tokens_blocked_type" | |
27 | 29 | ||
28 | 30 | let kUserShareTokensLockedHeight = "_share_tokens_blocked_height" | |
29 | 31 | ||
30 | 32 | let kUserShareTokensVirtual = "_share_tokens_virtual" | |
31 | 33 | ||
32 | 34 | let kShareTotalShareTokens = "_total_share_tokens_locked" | |
33 | 35 | ||
34 | 36 | let kShareTokensVirtual = "_total_share_tokens_virtual" | |
35 | 37 | ||
36 | 38 | let kLockParams = "_lock_params" | |
37 | 39 | ||
38 | 40 | let kLockWavesFee = "lock_waves_fee" | |
39 | 41 | ||
40 | 42 | let kPoolBoostCoef = "_boost_coef" | |
41 | 43 | ||
42 | 44 | let kFarmLastInterest = "_last_interest" | |
43 | 45 | ||
44 | 46 | let kFarmUserLastInterest = "_last_interest" | |
45 | 47 | ||
46 | 48 | let kBoostLastInterest = "_last_interest_b" | |
47 | 49 | ||
48 | 50 | let kBoostUserLastInterest = "_last_interest_u_b" | |
49 | 51 | ||
50 | 52 | let kLastInterestHeight = "_last_interest_height" | |
51 | 53 | ||
52 | 54 | let kSWOPid = "SWOP_id" | |
53 | 55 | ||
54 | 56 | let kAvailableSWOP = "_available_SWOP" | |
55 | 57 | ||
56 | 58 | let kSwopYearEmission = "swop_year_emission" | |
57 | 59 | ||
58 | 60 | let kHarvestPoolVote = "_harvest_pool_vote_gSWOP" | |
59 | 61 | ||
60 | 62 | let kPoolVote = "_pool_vote_gSWOP" | |
61 | 63 | ||
62 | 64 | let kUserPoolVote = "_user_vote_gSWOP" | |
63 | 65 | ||
64 | 66 | let kPoolStruc = "_pool_struc" | |
65 | 67 | ||
66 | 68 | let kUserPoolStruc = "_user_pool_struc" | |
67 | 69 | ||
68 | 70 | let kHarvestUserPoolVote = "_harvest_user_pool_vote_gSWOP" | |
69 | 71 | ||
70 | 72 | let kFirstHarvestHeight = "first_harvest_height" | |
71 | 73 | ||
72 | 74 | let kShareLimitFH = "share_limit_on_first_harvest" | |
73 | 75 | ||
74 | 76 | let kStratBFarmInterest = "_strat_b_farm_interest" | |
75 | 77 | ||
76 | 78 | let kCpmmContract = "cpmm_contract" | |
77 | 79 | ||
78 | 80 | let kAdminPubKey1 = "admin_pub_1" | |
79 | 81 | ||
80 | 82 | let kAdminPubKey2 = "admin_pub_2" | |
81 | 83 | ||
82 | 84 | let kAdminPubKey3 = "admin_pub_3" | |
83 | 85 | ||
84 | 86 | let kAdminInvokePubKey = "admin_invoke_pub" | |
85 | 87 | ||
86 | 88 | let kMoneyBoxAddress = "money_box_address" | |
87 | 89 | ||
88 | 90 | let kVotingAddress = "voting_address" | |
89 | 91 | ||
90 | 92 | let kGovAddress = "governance_address" | |
91 | 93 | ||
92 | 94 | let kLPFarmingAddress = "lp_farming" | |
93 | 95 | ||
94 | 96 | let kFarmingTreasureAddr = "farming_treasure" | |
95 | 97 | ||
96 | 98 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
97 | 99 | ||
98 | 100 | let totalVoteShare = 10000000000 | |
99 | 101 | ||
100 | 102 | let scaleValue8 = 100000000 | |
101 | 103 | ||
102 | 104 | let lockBoostCoefScale = 1000 | |
103 | 105 | ||
104 | 106 | let defPoolBoostCoef = 500 | |
105 | 107 | ||
106 | 108 | let bStartH = 3397850 | |
107 | 109 | ||
108 | 110 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
109 | 111 | case string: String => | |
110 | 112 | fromBase58String(string) | |
111 | 113 | case nothing => | |
112 | 114 | throw((key + "is empty")) | |
113 | 115 | } | |
114 | 116 | ||
115 | 117 | ||
116 | 118 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
117 | 119 | ||
118 | 120 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
119 | 121 | ||
120 | 122 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
121 | 123 | ||
122 | 124 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
123 | 125 | ||
124 | 126 | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
125 | 127 | ||
126 | 128 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
127 | 129 | ||
128 | 130 | let adminInvokePubKey = getBase58FromOracle(kAdminInvokePubKey) | |
129 | 131 | ||
130 | 132 | let lpFarmingAddress = Address(getBase58FromOracle(kLPFarmingAddress)) | |
131 | 133 | ||
132 | 134 | let farmingTreasureAddr = Address(getBase58FromOracle(kFarmingTreasureAddr)) | |
133 | 135 | ||
134 | 136 | let cpmmContract = Address(getBase58FromOracle(kCpmmContract)) | |
135 | 137 | ||
136 | 138 | let active = getBooleanValue(this, kActive) | |
137 | 139 | ||
138 | 140 | let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true) | |
139 | 141 | ||
140 | 142 | let SWOP = fromBase58String(getStringValue(this, kSWOPid)) | |
141 | 143 | ||
142 | 144 | func getHeightFirstHarvest (pool) = valueOrElse(getInteger(Address(fromBase58String(pool)), kFirstHarvestHeight), 0) | |
143 | 145 | ||
144 | 146 | ||
145 | 147 | func getFHShareLimitToken (pool) = valueOrErrorMessage(getInteger(pool, kShareLimitFH), ("No data on the key: " + kShareLimitFH)) | |
146 | 148 | ||
147 | 149 | ||
148 | 150 | func getTotalShareToken (pool) = valueOrErrorMessage(getInteger(this, (pool + kShareTotalShareTokens)), (("No data on the key: " + pool) + kShareTotalShareTokens)) | |
149 | 151 | ||
150 | 152 | ||
151 | 153 | func getPoolVoted (pool) = valueOrElse(getInteger(votingAddress, (pool + kPoolVote)), valueOrElse(parseInt(split(valueOrElse(getString(votingAddress, (pool + kPoolStruc)), ""), "_")[0]), 0)) | |
152 | 154 | ||
153 | 155 | ||
154 | 156 | func getUserPoolVoted (pool,user) = valueOrElse(getInteger(votingAddress, (((user + "_") + pool) + kUserPoolVote)), valueOrElse(parseInt(split(valueOrElse(getString(votingAddress, (((user + "_") + pool) + kUserPoolStruc)), ""), "_")[0]), 0)) | |
155 | 157 | ||
156 | 158 | ||
157 | 159 | func getShareAssetId (pool) = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
158 | 160 | ||
159 | 161 | ||
160 | 162 | func accountBalance (assetId) = match assetId { | |
161 | 163 | case id: ByteVector => | |
162 | 164 | assetBalance(this, id) | |
163 | 165 | case waves: Unit => | |
164 | 166 | wavesBalance(this).available | |
165 | 167 | case _ => | |
166 | 168 | throw("Match error") | |
167 | 169 | } | |
168 | 170 | ||
169 | 171 | ||
170 | 172 | func calcScaleValue (assetId1,assetId2) = { | |
171 | 173 | let assetId1Decimals = value(assetInfo(assetId1)).decimals | |
172 | 174 | let assetId2Decimals = value(assetInfo(assetId2)).decimals | |
173 | 175 | let scaleDigits = ((assetId2Decimals - assetId1Decimals) + 8) | |
174 | 176 | pow(10, 0, scaleDigits, 0, 0, DOWN) | |
175 | 177 | } | |
176 | 178 | ||
177 | 179 | ||
178 | 180 | func userAvailableSWOP (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + user) + kAvailableSWOP)), 0) | |
179 | 181 | ||
180 | 182 | ||
181 | 183 | func rewardInfo (pool) = { | |
182 | 184 | let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger(govAddress, kTotalRewardPerBlockCurrent), ((("No data on the key: " + kTotalRewardPerBlockCurrent) + " at address ") + toString(govAddress))) | |
183 | 185 | let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger(govAddress, kTotalRewardPerBlockPrevious), ((("No data on the key: " + kTotalRewardPerBlockPrevious) + " at address ") + toString(govAddress))) | |
184 | 186 | let rewardPoolFractionCurrent = valueOrErrorMessage(getInteger(govAddress, (pool + kRewardPoolFractionCurrent)), (((("No data on the key: " + pool) + kRewardPoolFractionCurrent) + " at address ") + toString(govAddress))) | |
185 | 187 | let rewardUpdateHeight = valueOrErrorMessage(getInteger(govAddress, kRewardUpdateHeight), ((("No data on the key: " + kRewardUpdateHeight) + " at address ") + toString(govAddress))) | |
186 | 188 | let poolRewardUpdateHeight = valueOrElse(getInteger(govAddress, (pool + kHeightPoolFraction)), rewardUpdateHeight) | |
187 | 189 | let rewardPoolFractionPrevious = valueOrErrorMessage(getInteger(govAddress, (pool + kRewardPoolFractionPrevious)), (((("No data on the key: " + pool) + kRewardPoolFractionPrevious) + " at address ") + toString(govAddress))) | |
188 | 190 | let rewardPoolCurrent = fraction(totalRewardPerBlockCurrent, rewardPoolFractionCurrent, totalVoteShare) | |
189 | 191 | let rewardPoolPrevious = fraction(totalRewardPerBlockCurrent, rewardPoolFractionPrevious, totalVoteShare) | |
190 | 192 | if (if ((rewardPoolCurrent > totalRewardPerBlockCurrent)) | |
191 | 193 | then true | |
192 | 194 | else (rewardPoolPrevious > totalRewardPerBlockPrevious)) | |
193 | 195 | then throw("rewardPoolCurrent > totalRewardPerBlockCurrent or rewardPoolPrevious > totalRewardPerBlockPrevious") | |
194 | 196 | else $Tuple4(rewardPoolCurrent, rewardUpdateHeight, rewardPoolPrevious, poolRewardUpdateHeight) | |
195 | 197 | } | |
196 | 198 | ||
197 | 199 | ||
198 | 200 | func getLastInterestInfo (pool) = { | |
199 | 201 | let farmInterest = valueOrErrorMessage(getInteger(this, (pool + kFarmLastInterest)), (("No data on the key: " + pool) + kFarmLastInterest)) | |
200 | 202 | let boostInterest = valueOrElse(getInteger(this, (pool + kBoostLastInterest)), 0) | |
201 | 203 | let lastInterestHeight = valueOrElse(getInteger(this, (pool + kLastInterestHeight)), height) | |
202 | 204 | $Tuple3(lastInterestHeight, farmInterest, boostInterest) | |
203 | 205 | } | |
204 | 206 | ||
205 | 207 | ||
206 | 208 | func calcFarmRwd (pool,curTotalReward) = { | |
207 | 209 | let poolBoostCoef = valueOrElse(getInteger(this, (pool + kPoolBoostCoef)), defPoolBoostCoef) | |
208 | 210 | fraction(curTotalReward, lockBoostCoefScale, (poolBoostCoef + lockBoostCoefScale)) | |
209 | 211 | } | |
210 | 212 | ||
211 | 213 | ||
212 | 214 | func calcBoostRwd (pool,curTotalReward) = { | |
213 | 215 | let poolBoostCoef = valueOrElse(getInteger(this, (pool + kPoolBoostCoef)), defPoolBoostCoef) | |
214 | 216 | fraction(curTotalReward, poolBoostCoef, (poolBoostCoef + lockBoostCoefScale)) | |
215 | 217 | } | |
216 | 218 | ||
217 | 219 | ||
218 | 220 | func calcInterest (pool,lastInterestHeight,rewardUpdateHeight,poolRewardUpdateHeight,farmInterest,boostInterest,poolVoted,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,scaleValue) = { | |
219 | - | let $ | |
221 | + | let $t0951610689 = if (if (if ((rewardUpdateHeight > height)) | |
220 | 222 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
221 | 223 | else false) | |
222 | 224 | then true | |
223 | 225 | else if ((height > rewardUpdateHeight)) | |
224 | 226 | then (rewardUpdateHeight != poolRewardUpdateHeight) | |
225 | 227 | else false) | |
226 | 228 | then { | |
227 | 229 | let r = (previousRewardPerBlock * (height - lastInterestHeight)) | |
228 | 230 | $Tuple3(r, farmInterest, boostInterest) | |
229 | 231 | } | |
230 | 232 | else if (if (if ((height > rewardUpdateHeight)) | |
231 | 233 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
232 | 234 | else false) | |
233 | 235 | then (lastInterestHeight > rewardUpdateHeight) | |
234 | 236 | else false) | |
235 | 237 | then { | |
236 | 238 | let r = (currentRewardPerBlock * (height - lastInterestHeight)) | |
237 | 239 | $Tuple3(r, farmInterest, boostInterest) | |
238 | 240 | } | |
239 | 241 | else { | |
240 | 242 | let rwdBfrUpd = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
241 | 243 | let fBfrUp = (farmInterest + fraction(calcFarmRwd(pool, rwdBfrUpd), scaleValue, shareTokenLocked)) | |
242 | 244 | let bBfrUp = (boostInterest + (if ((poolVoted > 0)) | |
243 | 245 | then fraction(calcBoostRwd(pool, rwdBfrUpd), scaleValue8, poolVoted) | |
244 | 246 | else 0)) | |
245 | 247 | let rwd = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
246 | 248 | $Tuple3(rwd, fBfrUp, bBfrUp) | |
247 | 249 | } | |
248 | - | let reward = $ | |
249 | - | let farmIntrBefore = $ | |
250 | - | let boostIntrBefore = $ | |
250 | + | let reward = $t0951610689._1 | |
251 | + | let farmIntrBefore = $t0951610689._2 | |
252 | + | let boostIntrBefore = $t0951610689._3 | |
251 | 253 | let newFarmInterest = (farmIntrBefore + fraction(calcFarmRwd(pool, reward), scaleValue, shareTokenLocked)) | |
252 | 254 | let newBoostInterest = (boostIntrBefore + (if ((poolVoted > 0)) | |
253 | 255 | then fraction(calcBoostRwd(pool, reward), scaleValue8, poolVoted) | |
254 | 256 | else 0)) | |
255 | 257 | $Tuple2(newFarmInterest, newBoostInterest) | |
256 | 258 | } | |
257 | 259 | ||
258 | 260 | ||
259 | 261 | func claimCalc (pool,user) = { | |
260 | 262 | let scaleValue = calcScaleValue(SWOP, getShareAssetId(pool)) | |
261 | 263 | let poolVoted = getPoolVoted(pool) | |
262 | 264 | let uPoolVoted = getUserPoolVoted(pool, user) | |
263 | 265 | let shareToken = getTotalShareToken(pool) | |
264 | 266 | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), shareToken) | |
265 | 267 | let stratBFarmInterest = valueOrElse(getInteger(this, (pool + kStratBFarmInterest)), 0) | |
266 | - | let $ | |
267 | - | let lastInterestHeight = $ | |
268 | - | let farmInterest = $ | |
269 | - | let boostInterest = $ | |
270 | - | let $ | |
271 | - | let currentRewardPerBlock = $ | |
272 | - | let rewardUpdateHeight = $ | |
273 | - | let previousRewardPerBlock = $ | |
274 | - | let poolRewardUpdateHeight = $ | |
268 | + | let $t01152711608 = getLastInterestInfo(pool) | |
269 | + | let lastInterestHeight = $t01152711608._1 | |
270 | + | let farmInterest = $t01152711608._2 | |
271 | + | let boostInterest = $t01152711608._3 | |
272 | + | let $t01161311727 = rewardInfo(pool) | |
273 | + | let currentRewardPerBlock = $t01161311727._1 | |
274 | + | let rewardUpdateHeight = $t01161311727._2 | |
275 | + | let previousRewardPerBlock = $t01161311727._3 | |
276 | + | let poolRewardUpdateHeight = $t01161311727._4 | |
275 | 277 | let uFarmInterest = valueOrElse(getInteger(this, (((pool + "_") + user) + kFarmUserLastInterest)), farmInterest) | |
276 | 278 | let uBoostInterest = valueOrElse(getInteger(this, (((pool + "_") + user) + kBoostUserLastInterest)), if (if ((stratBFarmInterest > uFarmInterest)) | |
277 | 279 | then (uPoolVoted > 0) | |
278 | 280 | else false) | |
279 | 281 | then 0 | |
280 | 282 | else boostInterest) | |
281 | 283 | let uShareTokensStaked = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
282 | 284 | let uShareTokensVirt = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), uShareTokensStaked) | |
283 | 285 | if ((totalShareVirtual == 0)) | |
284 | 286 | then { | |
285 | - | let toTreasury = if ((farmInterest == 0)) | |
286 | - | then (currentRewardPerBlock * (height - lastInterestHeight)) | |
287 | - | else 0 | |
287 | + | let toTreasury = (currentRewardPerBlock * (height - lastInterestHeight)) | |
288 | 288 | $Tuple4(farmInterest, boostInterest, 0, toTreasury) | |
289 | 289 | } | |
290 | 290 | else { | |
291 | - | let $ | |
292 | - | let newFarmInterest = $ | |
293 | - | let newBoostInterest = $ | |
291 | + | let $t01244012832 = calcInterest(pool, lastInterestHeight, rewardUpdateHeight, poolRewardUpdateHeight, farmInterest, boostInterest, poolVoted, currentRewardPerBlock, totalShareVirtual, previousRewardPerBlock, scaleValue) | |
292 | + | let newFarmInterest = $t01244012832._1 | |
293 | + | let newBoostInterest = $t01244012832._2 | |
294 | 294 | let farmRwd = fraction(uShareTokensVirt, (newFarmInterest - uFarmInterest), scaleValue) | |
295 | 295 | let poolBoostCoef = valueOrElse(getInteger(this, (pool + kPoolBoostCoef)), defPoolBoostCoef) | |
296 | 296 | let boostRwdMax = fraction(fraction(uShareTokensVirt, (newFarmInterest - max([uFarmInterest, stratBFarmInterest])), scaleValue), poolBoostCoef, lockBoostCoefScale) | |
297 | 297 | let curBoostRwd = fraction((newBoostInterest - uBoostInterest), uPoolVoted, scaleValue8) | |
298 | 298 | let boostRwd = min([boostRwdMax, curBoostRwd]) | |
299 | 299 | let toTreasury = (boostRwdMax - boostRwd) | |
300 | 300 | if ((0 > toTreasury)) | |
301 | 301 | then throw("toTreasury < 0") | |
302 | 302 | else $Tuple4(newFarmInterest, newBoostInterest, (farmRwd + boostRwd), toTreasury) | |
303 | 303 | } | |
304 | 304 | } | |
305 | 305 | ||
306 | 306 | ||
307 | 307 | func availableClaimCalcAllByUser (pools,user) = { | |
308 | 308 | func calcAvailable (acc,pool) = { | |
309 | - | let $ | |
310 | - | let newPools = $ | |
311 | - | let amounts = $ | |
312 | - | let $ | |
313 | - | let fi = $ | |
314 | - | let bi = $ | |
315 | - | let claimAmount = $ | |
316 | - | let tt = $ | |
309 | + | let $t01370113730 = acc | |
310 | + | let newPools = $t01370113730._1 | |
311 | + | let amounts = $t01370113730._2 | |
312 | + | let $t01373913792 = claimCalc(pool, user) | |
313 | + | let fi = $t01373913792._1 | |
314 | + | let bi = $t01373913792._2 | |
315 | + | let claimAmount = $t01373913792._3 | |
316 | + | let tt = $t01373913792._4 | |
317 | 317 | let availableFund = (userAvailableSWOP(pool, user) + claimAmount) | |
318 | 318 | $Tuple2((newPools :+ pool), (amounts :+ availableFund)) | |
319 | 319 | } | |
320 | 320 | ||
321 | 321 | let $l = pools | |
322 | 322 | let $s = size($l) | |
323 | 323 | let $acc0 = $Tuple2(nil, nil) | |
324 | 324 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
325 | 325 | then $a | |
326 | 326 | else calcAvailable($a, $l[$i]) | |
327 | 327 | ||
328 | 328 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
329 | 329 | then $a | |
330 | 330 | else throw("List size exceeds 60") | |
331 | 331 | ||
332 | 332 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60) | |
333 | 333 | } | |
334 | 334 | ||
335 | 335 | ||
336 | 336 | func canLockInFirstHarvest (pool,user,userShareTokensStaked,pmtAmount,lockType) = if ((getHeightFirstHarvest(pool) > height)) | |
337 | 337 | then { | |
338 | 338 | let totalVoteAmount = valueOrElse(getInteger(votingAddress, (pool + kHarvestPoolVote)), 0) | |
339 | 339 | let userVoteAmount = valueOrElse(getInteger(votingAddress, (((user + "_") + pool) + kHarvestUserPoolVote)), 0) | |
340 | 340 | let FHShareTokenLimit = getFHShareLimitToken(addressFromStringValue(pool)) | |
341 | 341 | let FHShareTokenUserLimit = (fraction(FHShareTokenLimit, userVoteAmount, totalVoteAmount) - userShareTokensStaked) | |
342 | 342 | if ((lockType > 0)) | |
343 | 343 | then throw("You can't lock shareTokens till first harvest end.") | |
344 | 344 | else if ((userVoteAmount == 0)) | |
345 | 345 | then 0 | |
346 | 346 | else if ((pmtAmount >= FHShareTokenUserLimit)) | |
347 | 347 | then (pmtAmount - FHShareTokenUserLimit) | |
348 | 348 | else 0 | |
349 | 349 | } | |
350 | 350 | else 0 | |
351 | 351 | ||
352 | 352 | ||
353 | 353 | func getLockParams (type) = { | |
354 | 354 | let lockParams = split(valueOrErrorMessage(getString(this, (toString(type) + kLockParams)), ("There are no key for lock type" + toString(type))), "_") | |
355 | 355 | $Tuple2(parseIntValue(lockParams[0]), parseIntValue(lockParams[1])) | |
356 | 356 | } | |
357 | 357 | ||
358 | 358 | ||
359 | 359 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
360 | 360 | ||
361 | 361 | ||
362 | 362 | func isActive () = if (if (active) | |
363 | 363 | then activeGlob | |
364 | 364 | else false) | |
365 | 365 | then unit | |
366 | 366 | else throw("DApp is inactive at this moment") | |
367 | 367 | ||
368 | 368 | ||
369 | 369 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
370 | 370 | then unit | |
371 | 371 | else throw("Only admin can call this function") | |
372 | 372 | ||
373 | 373 | ||
374 | 374 | func isPoolCall (i,pool) = if (if ((toString(i.caller) == pool)) | |
375 | 375 | then true | |
376 | 376 | else (i.caller == cpmmContract)) | |
377 | 377 | then unit | |
378 | 378 | else throw("Only pool can call this function") | |
379 | 379 | ||
380 | 380 | ||
381 | + | func getDeprecatedPool (pool) = valueOrElse(getBoolean(oracle, (kDeprecatedPool + pool)), false) | |
382 | + | ||
383 | + | ||
384 | + | func isDeprecatedPool (pool) = if (!(getDeprecatedPool(pool))) | |
385 | + | then unit | |
386 | + | else throw("Pool is deprecated. Only unlock action allowed.") | |
387 | + | ||
388 | + | ||
381 | 389 | func isSelfCall (i) = if ((i.caller == this)) | |
382 | 390 | then unit | |
383 | 391 | else throw("Only contract itself can call this function") | |
384 | 392 | ||
385 | 393 | ||
386 | 394 | func calcLockShareTokens (i,caller,pool,lockType) = { | |
387 | 395 | let shareAssetId = getShareAssetId(pool) | |
388 | 396 | let user = toString(caller) | |
389 | 397 | let totalShare = getTotalShareToken(pool) | |
390 | 398 | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), totalShare) | |
391 | 399 | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
392 | 400 | let userLockedHeigt = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLockedHeight)), 0) | |
393 | 401 | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
394 | 402 | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
395 | 403 | let totalUserShareTokens = ((userStakedAmount + userLockedAmount) + i.payments[0].amount) | |
396 | - | let $ | |
397 | - | let lockPeriod = $ | |
398 | - | let lockCoef = $ | |
404 | + | let $t01684116893 = getLockParams(lockType) | |
405 | + | let lockPeriod = $t01684116893._1 | |
406 | + | let lockCoef = $t01684116893._2 | |
399 | 407 | let lockWavesFee = getIntegerValue(this, kLockWavesFee) | |
400 | 408 | if ((i.payments[0].assetId != shareAssetId)) | |
401 | 409 | then throw("Wrong sharetoken in payment") | |
402 | 410 | else if ((0 >= i.payments[0].amount)) | |
403 | 411 | then throw("Payment amount must be greater than 0") | |
404 | 412 | else if ((0 > lockType)) | |
405 | 413 | then throw("lockType must be >= 0") | |
406 | 414 | else { | |
407 | 415 | let shareTokensChangeOnFH = canLockInFirstHarvest(pool, user, userStakedAmount, i.payments[0].amount, lockType) | |
408 | 416 | if ((shareTokensChangeOnFH == shareTokensChangeOnFH)) | |
409 | 417 | then { | |
410 | - | let $ | |
418 | + | let $t01732019254 = if ((lockType == 0)) | |
411 | 419 | then { | |
412 | 420 | let userAmountVirtualNew = ((userAmountVirtual + i.payments[0].amount) - shareTokensChangeOnFH) | |
413 | 421 | $Tuple2([IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), ((userStakedAmount + i.payments[0].amount) - shareTokensChangeOnFH)), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual + i.payments[0].amount) - shareTokensChangeOnFH)), ScriptTransfer(caller, shareTokensChangeOnFH, i.payments[0].assetId)], ((totalShare + i.payments[0].amount) - shareTokensChangeOnFH)) | |
414 | 422 | } | |
415 | 423 | else if (if ((userLockedHeigt == 0)) | |
416 | 424 | then if (if ((2 > size(i.payments))) | |
417 | 425 | then true | |
418 | 426 | else (i.payments[1].assetId != unit)) | |
419 | 427 | then true | |
420 | 428 | else (lockWavesFee > i.payments[1].amount) | |
421 | 429 | else false) | |
422 | 430 | then throw((("You need to pay additional waves comission " + toString(lockWavesFee)) + "WAVES")) | |
423 | 431 | else if ((userLockedHeigt > (height + lockPeriod))) | |
424 | 432 | then throw("You cannot lock sharetokens for a period less than what you have already locked") | |
425 | 433 | else { | |
426 | 434 | let userLockedAmountNew = (userLockedAmount + i.payments[0].amount) | |
427 | 435 | let userLockedHeigtNew = (height + lockPeriod) | |
428 | 436 | let userAmountVirtualNew = (fraction(userLockedAmountNew, lockCoef, lockBoostCoefScale) + userStakedAmount) | |
429 | 437 | $Tuple2([IntegerEntry((((pool + "_") + user) + kUserShareTokensLocked), userLockedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedHeight), userLockedHeigtNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedType), lockType), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userAmountVirtualNew))], (totalShare + i.payments[0].amount)) | |
430 | 438 | } | |
431 | - | let lockEntries = $ | |
432 | - | let totalShareNew = $ | |
439 | + | let lockEntries = $t01732019254._1 | |
440 | + | let totalShareNew = $t01732019254._2 | |
433 | 441 | if ((accountBalance(shareAssetId) > totalShareNew)) | |
434 | 442 | then throw("Balance of share-token is lower than totalAmount") | |
435 | 443 | else { | |
436 | - | let $ | |
437 | - | let farmInterest = $ | |
438 | - | let boostInterest = $ | |
439 | - | let claimAmount = $ | |
440 | - | let toTreasure = $ | |
444 | + | let $t01937919461 = claimCalc(pool, user) | |
445 | + | let farmInterest = $t01937919461._1 | |
446 | + | let boostInterest = $t01937919461._2 | |
447 | + | let claimAmount = $t01937919461._3 | |
448 | + | let toTreasure = $t01937919461._4 | |
441 | 449 | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
442 | 450 | let uplp = if ((getString(Address(fromBase58String(pool)), "version") == "3.0.0")) | |
443 | 451 | then invoke(lpFarmingAddress, "updateUserInterest", [user, pool, totalUserShareTokens], nil) | |
444 | 452 | else 0 | |
445 | 453 | if ((uplp == uplp)) | |
446 | 454 | then ([IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((pool + kShareTotalShareTokens), totalShareNew), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] ++ lockEntries) | |
447 | 455 | else throw("Strict value is not equal to itself.") | |
448 | 456 | } | |
449 | 457 | } | |
450 | 458 | else throw("Strict value is not equal to itself.") | |
451 | 459 | } | |
452 | 460 | } | |
453 | 461 | ||
454 | 462 | ||
455 | - | func calcWithdrawShareTokens (i,caller,pool,shareTokensWithdrawAmount) = valueOrElse(isActive(), { | |
456 | - | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
457 | - | let user = toString(caller) | |
458 | - | let $t02040720489 = claimCalc(pool, user) | |
459 | - | let farmInterest = $t02040720489._1 | |
460 | - | let boostInterest = $t02040720489._2 | |
461 | - | let claimAmount = $t02040720489._3 | |
462 | - | let toTreasure = $t02040720489._4 | |
463 | - | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
464 | - | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
465 | - | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
466 | - | let userStakedAmountNew = (userStakedAmount - shareTokensWithdrawAmount) | |
467 | - | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
468 | - | let totalShareAmount = getTotalShareToken(pool) | |
469 | - | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), totalShareAmount) | |
470 | - | let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount) | |
471 | - | let totalShareVirtualNew = (totalShareVirtual - shareTokensWithdrawAmount) | |
472 | - | let userAmountVirtualNew = (userAmountVirtual - shareTokensWithdrawAmount) | |
473 | - | if ((shareTokensWithdrawAmount > userStakedAmount)) | |
474 | - | then throw("Withdraw amount more then user locked amount") | |
475 | - | else if ((accountBalance(shareTokensId) > totalShareAmount)) | |
476 | - | then throw("Balance of share-token is lower than totalAmount") | |
477 | - | else { | |
478 | - | let uplp = if ((getString(Address(fromBase58String(pool)), "version") == "3.0.0")) | |
479 | - | then invoke(lpFarmingAddress, "updateUserInterest", [user, pool, (userStakedAmount + userLockedAmount)], nil) | |
480 | - | else 0 | |
481 | - | if ((uplp == uplp)) | |
482 | - | then [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTotalShareTokens), totalShareAmountNew), IntegerEntry((pool + kShareTokensVirtual), totalShareVirtualNew), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
483 | - | else throw("Strict value is not equal to itself.") | |
484 | - | } | |
485 | - | }) | |
463 | + | func calcWithdrawShareTokens (i,caller,pool,shareTokensWithdrawAmount) = { | |
464 | + | let inv = if (getDeprecatedPool(pool)) | |
465 | + | then invoke(this, "unlockUserLockDeprecated", [pool, toString(caller)], nil) | |
466 | + | else 0 | |
467 | + | if ((inv == inv)) | |
468 | + | then { | |
469 | + | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
470 | + | let user = toString(caller) | |
471 | + | let $t02075820840 = claimCalc(pool, user) | |
472 | + | let farmInterest = $t02075820840._1 | |
473 | + | let boostInterest = $t02075820840._2 | |
474 | + | let claimAmount = $t02075820840._3 | |
475 | + | let toTreasure = $t02075820840._4 | |
476 | + | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
477 | + | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
478 | + | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
479 | + | let userStakedAmountNew = (userStakedAmount - shareTokensWithdrawAmount) | |
480 | + | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
481 | + | let totalShareAmount = getTotalShareToken(pool) | |
482 | + | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), totalShareAmount) | |
483 | + | let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount) | |
484 | + | let totalShareVirtualNew = (totalShareVirtual - shareTokensWithdrawAmount) | |
485 | + | let userAmountVirtualNew = (userAmountVirtual - shareTokensWithdrawAmount) | |
486 | + | if ((shareTokensWithdrawAmount > userStakedAmount)) | |
487 | + | then throw("Withdraw amount more then user locked amount") | |
488 | + | else if ((accountBalance(shareTokensId) > totalShareAmount)) | |
489 | + | then throw("Balance of share-token is lower than totalAmount") | |
490 | + | else { | |
491 | + | let uplp = if ((getString(Address(fromBase58String(pool)), "version") == "3.0.0")) | |
492 | + | then invoke(lpFarmingAddress, "updateUserInterest", [user, pool, (userStakedAmount + userLockedAmount)], nil) | |
493 | + | else 0 | |
494 | + | if ((uplp == uplp)) | |
495 | + | then [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTotalShareTokens), totalShareAmountNew), IntegerEntry((pool + kShareTokensVirtual), totalShareVirtualNew), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
496 | + | else throw("Strict value is not equal to itself.") | |
497 | + | } | |
498 | + | } | |
499 | + | else throw("Strict value is not equal to itself.") | |
500 | + | } | |
486 | 501 | ||
487 | 502 | ||
488 | 503 | func calcClaim (i,pool,caller) = { | |
489 | 504 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
490 | 505 | let user = toString(caller) | |
491 | 506 | let shareTokenLocked = getTotalShareToken(pool) | |
492 | - | let $ | |
493 | - | let farmInterest = $ | |
494 | - | let boostInterest = $ | |
495 | - | let claimAmount = $ | |
496 | - | let toTreasure = $ | |
507 | + | let $t02335123433 = claimCalc(pool, user) | |
508 | + | let farmInterest = $t02335123433._1 | |
509 | + | let boostInterest = $t02335123433._2 | |
510 | + | let claimAmount = $t02335123433._3 | |
511 | + | let toTreasure = $t02335123433._4 | |
497 | 512 | let availableFund = (userAvailableSWOP(pool, user) + claimAmount) | |
498 | 513 | if ((accountBalance(shareTokensId) > shareTokenLocked)) | |
499 | 514 | then throw("Balance of share-token is lower than totalAmount") | |
500 | 515 | else { | |
501 | 516 | let uTrans = if ((i.caller != this)) | |
502 | 517 | then [ScriptTransfer(i.caller, availableFund, SWOP)] | |
503 | 518 | else nil | |
504 | 519 | $Tuple2(([IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), 0), Reissue(SWOP, (toTreasure + availableFund), true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] ++ uTrans), availableFund) | |
505 | 520 | } | |
521 | + | } | |
522 | + | ||
523 | + | ||
524 | + | func unlockUserLockCalc (i,pool,user) = { | |
525 | + | let totalShareVirtual = getIntegerValue(this, (pool + kShareTokensVirtual)) | |
526 | + | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
527 | + | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
528 | + | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
529 | + | let userStakedAmountNew = (userStakedAmount + userLockedAmount) | |
530 | + | let $t02483624918 = claimCalc(pool, user) | |
531 | + | let farmInterest = $t02483624918._1 | |
532 | + | let boostInterest = $t02483624918._2 | |
533 | + | let claimAmount = $t02483624918._3 | |
534 | + | let toTreasure = $t02483624918._4 | |
535 | + | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
536 | + | [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userStakedAmountNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userStakedAmountNew)), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), DeleteEntry((((pool + "_") + user) + kUserShareTokensLocked)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedHeight)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedType)), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] | |
506 | 537 | } | |
507 | 538 | ||
508 | 539 | ||
509 | 540 | @Callable(i) | |
510 | 541 | func init (earlyLP) = if (isDefined(getString(this, kSWOPid))) | |
511 | 542 | then throw("SWOP already initialized") | |
512 | 543 | else { | |
513 | 544 | let initAmount = 100000000000000 | |
514 | 545 | let SWOPissue = Issue("SWOP", "SWOP protocol token", initAmount, 8, true) | |
515 | 546 | let SWOPid = calculateAssetId(SWOPissue) | |
516 | 547 | [BooleanEntry(kActive, true), Issue("SWOP", "SWOP protocol token", initAmount, 8, true), StringEntry(kSWOPid, toBase58String(SWOPid))] | |
517 | 548 | } | |
518 | 549 | ||
519 | 550 | ||
520 | 551 | ||
521 | 552 | @Callable(i) | |
522 | 553 | func initPoolShareFarming (pool) = valueOrElse(isAdminCall(i), [IntegerEntry((pool + kShareTotalShareTokens), 0), IntegerEntry((pool + kFarmLastInterest), 0), IntegerEntry((pool + kBoostLastInterest), 0), IntegerEntry((pool + kLastInterestHeight), height)]) | |
523 | 554 | ||
524 | 555 | ||
525 | 556 | ||
526 | 557 | @Callable(i) | |
527 | 558 | func updatePoolInterest (pool) = valueOrElse(isActive(), if ((i.caller != govAddress)) | |
528 | 559 | then throw("Only Governance can call this function") | |
529 | 560 | else { | |
530 | 561 | let user = toString(addressFromPublicKey(adminInvokePubKey)) | |
531 | - | let $ | |
532 | - | let farmInterest = $ | |
533 | - | let boostInterest = $ | |
534 | - | let boostLPinterest = $ | |
562 | + | let $t02708427158 = claimCalc(pool, user) | |
563 | + | let farmInterest = $t02708427158._1 | |
564 | + | let boostInterest = $t02708427158._2 | |
565 | + | let boostLPinterest = $t02708427158._3 | |
535 | 566 | [IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height)] | |
536 | 567 | }) | |
537 | 568 | ||
538 | 569 | ||
539 | 570 | ||
540 | 571 | @Callable(i) | |
541 | - | func lockShareTokens (pool,lockType) = valueOrElse(isActive(), calcLockShareTokens(i, i.caller, pool, lockType)) | |
572 | + | func lockShareTokens (pool,lockType) = valueOrElse(isDeprecatedPool(pool), valueOrElse(isActive(), calcLockShareTokens(i, i.caller, pool, lockType))) | |
542 | 573 | ||
543 | 574 | ||
544 | 575 | ||
545 | 576 | @Callable(i) | |
546 | - | func lockShareTokensFromPool (callerBytes,pool,lockType) = valueOrElse(isActive(), valueOrElse(isPoolCall(i, pool), calcLockShareTokens(i, Address(callerBytes), pool, lockType))) | |
577 | + | func lockShareTokensFromPool (callerBytes,pool,lockType) = valueOrElse(isDeprecatedPool(pool), valueOrElse(isActive(), valueOrElse(isPoolCall(i, pool), calcLockShareTokens(i, Address(callerBytes), pool, lockType)))) | |
547 | 578 | ||
548 | 579 | ||
549 | 580 | ||
550 | 581 | @Callable(i) | |
551 | - | func lockStakedShareTokens (pool,lockType,lockAmount) = valueOrElse(isActive(), { | |
582 | + | func lockStakedShareTokens (pool,lockType,lockAmount) = valueOrElse(isDeprecatedPool(pool), valueOrElse(isActive(), { | |
552 | 583 | let shareAssetId = getShareAssetId(pool) | |
553 | 584 | let user = toString(i.caller) | |
554 | 585 | let totalShare = getTotalShareToken(pool) | |
555 | 586 | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), totalShare) | |
556 | 587 | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
557 | 588 | let userLockedHeigt = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLockedHeight)), 0) | |
558 | 589 | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
559 | 590 | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
560 | 591 | let totalUserShareTokens = (userStakedAmount + userLockedAmount) | |
561 | - | let $ | |
562 | - | let lockPeriod = $ | |
563 | - | let lockCoef = $ | |
592 | + | let $t02878728839 = getLockParams(lockType) | |
593 | + | let lockPeriod = $t02878728839._1 | |
594 | + | let lockCoef = $t02878728839._2 | |
564 | 595 | let lockWavesFee = getIntegerValue(this, kLockWavesFee) | |
565 | 596 | if ((getHeightFirstHarvest(pool) > height)) | |
566 | 597 | then throw("You can't lock shareTokens till first harvest end.") | |
567 | 598 | else if ((0 >= lockType)) | |
568 | 599 | then throw("lockType must be > 0") | |
569 | 600 | else if ((lockAmount > userStakedAmount)) | |
570 | 601 | then throw(("You can't lock more than " + toString(userStakedAmount))) | |
571 | 602 | else if ((accountBalance(shareAssetId) > totalShare)) | |
572 | 603 | then throw("Balance of share-token is lower than totalAmount") | |
573 | 604 | else if (if ((userLockedHeigt == 0)) | |
574 | 605 | then if (if ((1 > size(i.payments))) | |
575 | 606 | then true | |
576 | 607 | else (i.payments[0].assetId != unit)) | |
577 | 608 | then true | |
578 | 609 | else (lockWavesFee > i.payments[0].amount) | |
579 | 610 | else false) | |
580 | 611 | then throw((("You need to pay additional waves comission " + toString(lockWavesFee)) + "WAVES")) | |
581 | 612 | else if (if ((userLockedHeigt == 0)) | |
582 | 613 | then (0 >= lockAmount) | |
583 | 614 | else false) | |
584 | 615 | then throw("lockAmount must be greater than 0") | |
585 | 616 | else if ((0 > lockAmount)) | |
586 | 617 | then throw("lockAmount must be positive") | |
587 | 618 | else if ((userLockedHeigt > (height + lockPeriod))) | |
588 | 619 | then throw("You cannot lock sharetokens for a period less than what you have already locked") | |
589 | 620 | else { | |
590 | 621 | let userLockedAmountNew = (userLockedAmount + lockAmount) | |
591 | 622 | let userStakedAmountNew = (userStakedAmount - lockAmount) | |
592 | 623 | let userLockedHeigtNew = (height + lockPeriod) | |
593 | 624 | let userAmountVirtualNew = (fraction(userLockedAmountNew, lockCoef, lockBoostCoefScale) + userStakedAmountNew) | |
594 | - | let $ | |
595 | - | let farmInterest = $ | |
596 | - | let boostInterest = $ | |
597 | - | let claimAmount = $ | |
598 | - | let toTreasure = $ | |
625 | + | let $t03018530267 = claimCalc(pool, user) | |
626 | + | let farmInterest = $t03018530267._1 | |
627 | + | let boostInterest = $t03018530267._2 | |
628 | + | let claimAmount = $t03018530267._3 | |
629 | + | let toTreasure = $t03018530267._4 | |
599 | 630 | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
600 | 631 | [IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLocked), userLockedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedHeight), userLockedHeigtNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedType), lockType), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userAmountVirtualNew)), IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] | |
601 | 632 | } | |
633 | + | })) | |
634 | + | ||
635 | + | ||
636 | + | ||
637 | + | @Callable(i) | |
638 | + | func unlockUserLock (pool,user) = valueOrElse(isActive(), { | |
639 | + | let userLockedHeigt = valueOrErrorMessage(getInteger(this, (((pool + "_") + user) + kUserShareTokensLockedHeight)), (((("There is no pool " + pool) + " or user ") + user) + "with lock")) | |
640 | + | if ((userLockedHeigt > height)) | |
641 | + | then throw(("You can't unlock sharetokens till " + toString(userLockedHeigt))) | |
642 | + | else (unlockUserLockCalc(i, pool, user) ++ [ScriptTransfer(i.caller, getIntegerValue(this, kLockWavesFee), unit)]) | |
602 | 643 | }) | |
603 | 644 | ||
604 | 645 | ||
605 | 646 | ||
606 | 647 | @Callable(i) | |
607 | - | func unlockUserLock (pool,user) = valueOrElse(isActive(), { | |
608 | - | let lockWavesFee = getIntegerValue(this, kLockWavesFee) | |
609 | - | let userLockedHeigt = valueOrErrorMessage(getInteger(this, (((pool + "_") + user) + kUserShareTokensLockedHeight)), (((("There is no pool " + pool) + " or user ") + user) + "with lock")) | |
610 | - | let totalShareVirtual = getIntegerValue(this, (pool + kShareTokensVirtual)) | |
611 | - | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
612 | - | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
613 | - | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
614 | - | if ((userLockedHeigt > height)) | |
615 | - | then throw(("You can't unlock sharetokens till " + toString(userLockedHeigt))) | |
616 | - | else { | |
617 | - | let userStakedAmountNew = (userStakedAmount + userLockedAmount) | |
618 | - | let $t02995530037 = claimCalc(pool, user) | |
619 | - | let farmInterest = $t02995530037._1 | |
620 | - | let boostInterest = $t02995530037._2 | |
621 | - | let claimAmount = $t02995530037._3 | |
622 | - | let toTreasure = $t02995530037._4 | |
623 | - | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
624 | - | [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userStakedAmountNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userStakedAmountNew)), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), DeleteEntry((((pool + "_") + user) + kUserShareTokensLocked)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedHeight)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedType)), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP), ScriptTransfer(i.caller, lockWavesFee, unit)] | |
625 | - | } | |
626 | - | }) | |
627 | - | ||
628 | - | ||
629 | - | ||
630 | - | @Callable(i) | |
631 | - | func unlockStableLock (user) = valueOrElse(isActive(), { | |
632 | - | let allowedCaller = Address(base58'3MpNDxa2QpcAzbaLaV6qacbuASgtH7wcric') | |
633 | - | let stablePools = ["3MpygN8qm376tUAHB6mhC5BxG5NKYortiyX", "3MvMXhKFMPz4BuZj9Jr9UysuxbWFKRJZgb3"] | |
634 | - | let lockWavesFee = getIntegerValue(this, kLockWavesFee) | |
635 | - | if ((i.caller != allowedCaller)) | |
636 | - | then throw((("Only " + toString(allowedCaller)) + "can call this function")) | |
637 | - | else { | |
638 | - | func unlock (a,pool) = { | |
639 | - | let $t03178531826 = a | |
640 | - | let entries = $t03178531826._1 | |
641 | - | let toTreasureSum = $t03178531826._2 | |
642 | - | let feesSum = $t03178531826._3 | |
643 | - | let userLockedHeigt = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLockedHeight)), 0) | |
644 | - | if ((userLockedHeigt == 0)) | |
645 | - | then a | |
646 | - | else { | |
647 | - | let totalShareVirtual = getIntegerValue(this, (pool + kShareTokensVirtual)) | |
648 | - | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
649 | - | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
650 | - | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
651 | - | let userStakedAmountNew = (userStakedAmount + userLockedAmount) | |
652 | - | let $t03246732549 = claimCalc(pool, user) | |
653 | - | let farmInterest = $t03246732549._1 | |
654 | - | let boostInterest = $t03246732549._2 | |
655 | - | let claimAmount = $t03246732549._3 | |
656 | - | let toTreasure = $t03246732549._4 | |
657 | - | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
658 | - | $Tuple3((entries ++ [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userStakedAmountNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userStakedAmountNew)), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), DeleteEntry((((pool + "_") + user) + kUserShareTokensLocked)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedHeight)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedType))]), (toTreasureSum + toTreasure), (feesSum + lockWavesFee)) | |
659 | - | } | |
660 | - | } | |
661 | - | ||
662 | - | let $t03368433757 = { | |
663 | - | let $l = stablePools | |
664 | - | let $s = size($l) | |
665 | - | let $acc0 = $Tuple3(nil, 0, 0) | |
666 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
667 | - | then $a | |
668 | - | else unlock($a, $l[$i]) | |
669 | - | ||
670 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
671 | - | then $a | |
672 | - | else throw("List size exceeds 2") | |
673 | - | ||
674 | - | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
675 | - | } | |
676 | - | let entries = $t03368433757._1 | |
677 | - | let toTresure = $t03368433757._2 | |
678 | - | let fees = $t03368433757._3 | |
679 | - | if ((size(entries) == 0)) | |
680 | - | then throw("Nothing to unlock") | |
681 | - | else ([Reissue(SWOP, toTresure, true), ScriptTransfer(farmingTreasureAddr, toTresure, SWOP), ScriptTransfer(moneyBoxAddress, fees, unit)] ++ entries) | |
682 | - | } | |
683 | - | }) | |
648 | + | func unlockUserLockDeprecated (pool,user) = valueOrElse(isActive(), valueOrElse(isSelfCall(i), valueOrElse(isDeprecatedPool(pool), (unlockUserLockCalc(i, pool, user) ++ [ScriptTransfer(moneyBoxAddress, getIntegerValue(this, kLockWavesFee), unit)])))) | |
684 | 649 | ||
685 | 650 | ||
686 | 651 | ||
687 | 652 | @Callable(i) | |
688 | 653 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = valueOrElse(isActive(), calcWithdrawShareTokens(i, i.caller, pool, shareTokensWithdrawAmount)) | |
689 | 654 | ||
690 | 655 | ||
691 | 656 | ||
692 | 657 | @Callable(i) | |
693 | 658 | func withdrawShareTokensFromPool (callerBytes,pool,shareTokensWithdrawAmount) = valueOrElse(isActive(), valueOrElse(isPoolCall(i, pool), calcWithdrawShareTokens(i, Address(callerBytes), pool, shareTokensWithdrawAmount))) | |
694 | 659 | ||
695 | 660 | ||
696 | 661 | ||
697 | 662 | @Callable(i) | |
698 | 663 | func claim (pool) = valueOrElse(isActive(), { | |
699 | 664 | let r = calcClaim(i, pool, i.caller) | |
700 | 665 | if ((r._2 == 0)) | |
701 | 666 | then throw("You have 0 available SWOP") | |
702 | 667 | else r | |
703 | 668 | }) | |
704 | 669 | ||
705 | 670 | ||
706 | 671 | ||
707 | 672 | @Callable(i) | |
708 | 673 | func claimInternal (pool,caller) = valueOrElse(isActive(), valueOrElse(isSelfCall(i), calcClaim(i, pool, Address(caller)))) | |
709 | 674 | ||
710 | 675 | ||
711 | 676 | ||
712 | 677 | @Callable(i) | |
713 | 678 | func claimAndStake (pool) = valueOrElse(isActive(), { | |
714 | 679 | let claimAmount = { | |
715 | 680 | let @ = invoke(this, "claimInternal", [pool, i.caller.bytes], nil) | |
716 | 681 | if ($isInstanceOf(@, "Int")) | |
717 | 682 | then @ | |
718 | 683 | else throw(($getType(@) + " couldn't be cast to Int")) | |
719 | 684 | } | |
720 | 685 | if ((claimAmount == claimAmount)) | |
721 | 686 | then if ((claimAmount == 0)) | |
722 | 687 | then throw("You have 0 available SWOP") | |
723 | 688 | else { | |
724 | 689 | let stakeToGov = invoke(govAddress, "lockSWOPFromFarming", nil, [AttachedPayment(SWOP, claimAmount)]) | |
725 | 690 | if ((stakeToGov == stakeToGov)) | |
726 | 691 | then nil | |
727 | 692 | else throw("Strict value is not equal to itself.") | |
728 | 693 | } | |
729 | 694 | else throw("Strict value is not equal to itself.") | |
730 | 695 | }) | |
731 | 696 | ||
732 | 697 | ||
733 | 698 | ||
734 | 699 | @Callable(i) | |
735 | 700 | func claimAll (pools) = valueOrElse(isActive(), { | |
736 | 701 | func claimInv (claimTotal,pool) = { | |
737 | 702 | let claimAmount = { | |
738 | 703 | let @ = invoke(this, "claimInternal", [pool, i.caller.bytes], nil) | |
739 | 704 | if ($isInstanceOf(@, "Int")) | |
740 | 705 | then @ | |
741 | 706 | else throw(($getType(@) + " couldn't be cast to Int")) | |
742 | 707 | } | |
743 | 708 | if ((claimAmount == claimAmount)) | |
744 | 709 | then (claimTotal + claimAmount) | |
745 | 710 | else throw("Strict value is not equal to itself.") | |
746 | 711 | } | |
747 | 712 | ||
748 | 713 | let claimTotal = { | |
749 | 714 | let $l = pools | |
750 | 715 | let $s = size($l) | |
751 | 716 | let $acc0 = 0 | |
752 | 717 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
753 | 718 | then $a | |
754 | 719 | else claimInv($a, $l[$i]) | |
755 | 720 | ||
756 | 721 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
757 | 722 | then $a | |
758 | 723 | else throw("List size exceeds 60") | |
759 | 724 | ||
760 | 725 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60) | |
761 | 726 | } | |
762 | 727 | if ((claimTotal == 0)) | |
763 | 728 | then throw("You have 0 available SWOP") | |
764 | 729 | else [ScriptTransfer(i.caller, claimTotal, SWOP)] | |
765 | 730 | }) | |
766 | 731 | ||
767 | 732 | ||
768 | 733 | ||
769 | 734 | @Callable(i) | |
770 | 735 | func claimAllAndStake (pools) = valueOrElse(isActive(), { | |
771 | 736 | func claimInv (claimTotal,pool) = { | |
772 | 737 | let claimAmount = { | |
773 | 738 | let @ = invoke(this, "claimInternal", [pool, i.caller.bytes], nil) | |
774 | 739 | if ($isInstanceOf(@, "Int")) | |
775 | 740 | then @ | |
776 | 741 | else throw(($getType(@) + " couldn't be cast to Int")) | |
777 | 742 | } | |
778 | 743 | if ((claimAmount == claimAmount)) | |
779 | 744 | then (claimTotal + claimAmount) | |
780 | 745 | else throw("Strict value is not equal to itself.") | |
781 | 746 | } | |
782 | 747 | ||
783 | 748 | let claimTotal = { | |
784 | 749 | let $l = pools | |
785 | 750 | let $s = size($l) | |
786 | 751 | let $acc0 = 0 | |
787 | 752 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
788 | 753 | then $a | |
789 | 754 | else claimInv($a, $l[$i]) | |
790 | 755 | ||
791 | 756 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
792 | 757 | then $a | |
793 | 758 | else throw("List size exceeds 60") | |
794 | 759 | ||
795 | 760 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60) | |
796 | 761 | } | |
797 | 762 | if ((claimTotal == 0)) | |
798 | 763 | then throw("You have 0 available SWOP") | |
799 | 764 | else { | |
800 | 765 | let stakeToGov = invoke(govAddress, "lockSWOPFromFarming", nil, [AttachedPayment(SWOP, claimTotal)]) | |
801 | 766 | if ((stakeToGov == stakeToGov)) | |
802 | 767 | then nil | |
803 | 768 | else throw("Strict value is not equal to itself.") | |
804 | 769 | } | |
805 | 770 | }) | |
806 | 771 | ||
807 | 772 | ||
808 | 773 | ||
809 | 774 | @Callable(i) | |
810 | 775 | func updateUserBoostInterest (pool,user) = valueOrElse(isActive(), if ((i.caller != votingAddress)) | |
811 | 776 | then throw("Only voiting can call this function") | |
812 | 777 | else { | |
813 | - | let $ | |
814 | - | let farmInterest = $ | |
815 | - | let boostInterest = $ | |
816 | - | let claimAmount = $ | |
817 | - | let toTreasure = $ | |
778 | + | let $t03484634928 = claimCalc(pool, user) | |
779 | + | let farmInterest = $t03484634928._1 | |
780 | + | let boostInterest = $t03484634928._2 | |
781 | + | let claimAmount = $t03484634928._3 | |
782 | + | let toTreasure = $t03484634928._4 | |
818 | 783 | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
819 | 784 | [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] | |
820 | 785 | }) | |
821 | 786 | ||
822 | 787 | ||
823 | 788 | ||
824 | 789 | @Callable(i) | |
825 | 790 | func shutdown () = valueOrElse(isAdminCall(i), if (!(active)) | |
826 | 791 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
827 | 792 | else suspend("Paused by admin")) | |
828 | 793 | ||
829 | 794 | ||
830 | 795 | ||
831 | 796 | @Callable(i) | |
832 | 797 | func activate () = valueOrElse(isAdminCall(i), if (active) | |
833 | 798 | then throw("DApp is already active") | |
834 | 799 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
835 | 800 | ||
836 | 801 | ||
837 | 802 | @Verifier(tx) | |
838 | 803 | func verify () = match tx { | |
839 | 804 | case _ => | |
840 | 805 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
841 | 806 | then 1 | |
842 | 807 | else 0 | |
843 | 808 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
844 | 809 | then 1 | |
845 | 810 | else 0 | |
846 | 811 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
847 | 812 | then 1 | |
848 | 813 | else 0 | |
849 | 814 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
850 | 815 | } | |
851 | 816 |
github/deemru/w8io/026f985 119.57 ms ◑