tx · 2pHxveMw14hmJfcJrrecmdihZba9HyQpM71PQQ5iXarT 3MqvFUCw41yjLogcBsV8xLSrYfQu55iKXAt: -0.03000000 Waves 2023.05.04 13:13 [2562879] smart account 3MqvFUCw41yjLogcBsV8xLSrYfQu55iKXAt > SELF 0.00000000 Waves
{ "type": 13, "id": "2pHxveMw14hmJfcJrrecmdihZba9HyQpM71PQQ5iXarT", "fee": 3000000, "feeAssetId": null, "timestamp": 1683195205355, "version": 2, "chainId": 84, "sender": "3MqvFUCw41yjLogcBsV8xLSrYfQu55iKXAt", "senderPublicKey": "9TADRckYuunscUJGDH67ZaVuXftCwaXkfPixCRkLJbx5", "proofs": [ "63gCe39cVwg3ie3m6JGnG2yr97La9mJ19fAwK1Je8Bghwm5HDxnEbFiLV9e7wNPhCgNLEubbY3VzknHJJJAp3kbd" ], "script": "base64:BgJhCAISAwoBCBIDCgEIEgQKAggIEgkKBwEREREYCBgSBwoFERERGAgSBwoFAQEBCAgSABIDCgEIEgQKAggBEgQKAggBEgQKAggBEgMKAQgSBgoECAEIARIFCgMBGBgSAwoBGF0ABlNDQUxFOAAIAAVNVUxUOACAwtcvAAdTQ0FMRTE4ABIABk1VTFQxOAkAtgIBAICAkLu61q3wDQADU0VQAgJfXwAOUE9PTFdFSUdIVE1VTFQFBU1VTFQ4AAp6ZXJvQmlnSW50CQC2AgEAAAAOaWR4UG9vbEFkZHJlc3MAAQANaWR4UG9vbFN0YXR1cwACABBpZHhQb29sTFBBc3NldElkAAMADWlkeEFtdEFzc2V0SWQABAAPaWR4UHJpY2VBc3NldElkAAUADmlkeEFtdEFzc2V0RGNtAAYAEGlkeFByaWNlQXNzZXREY20ABwAOaWR4SUFtdEFzc2V0SWQACAAQaWR4SVByaWNlQXNzZXRJZAAJAA1pZHhMUEFzc2V0RGNtAAoBD2dldFN0cmluZ09yRmFpbAEDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAKIIAQUDa2V5CQCsAgIJAKwCAgIPbWFuZGF0b3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FsCQEGZ2V0S2V5AwUEYWRkcgUDa2V5BQR0eXBlBANyZXMJAM0IAgUGcmVzQWNjBQN2YWwEA2ludgkA/AcEBQR0aGlzAhNnZXRLZXlzQnVsa0ludGVybmFsCQDMCAIJAGQCBQtjdXJyZW50SXRlcgABCQDMCAIFBGtleXMJAMwIAgUDcmVzBQNuaWwFA25pbAMJAAACBQNpbnYFA2ludgkAlAoCBQNuaWwFA2ludgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFpAQtnZXRLZXlzQnVsawEEa2V5cwQDcmVzCQD8BwQFBHRoaXMCE2dldEtleXNCdWxrSW50ZXJuYWwJAMwIAgAACQDMCAIFBGtleXMJAMwIAgUDbmlsBQNuaWwFA25pbAkAlAoCBQNuaWwFA3JlcwECdHgBBnZlcmlmeQAED3RhcmdldFB1YmxpY0tleQQHJG1hdGNoMAkBFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAnBrBQckbWF0Y2gwBQJwawMJAAECBQckbWF0Y2gwAgRVbml0CAUCdHgPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFD3RhcmdldFB1YmxpY0tleSXGwXY=", "height": 2562879, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9uyTpTxW5gw1NqncDXctTCotVBvkzHNyfyBehPHZheEy Next: none Diff:
Old | New | Differences | |
---|---|---|---|
74 | 74 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
75 | 75 | ||
76 | 76 | ||
77 | - | func keyManagerPublicKey () = "%s__managerPublicKey" | |
78 | - | ||
79 | - | ||
80 | - | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
81 | - | ||
82 | - | ||
83 | 77 | let IdxFactoryCfgStakingDapp = 1 | |
84 | 78 | ||
85 | 79 | let IdxFactoryCfgBoostingDapp = 2 | |
111 | 105 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
112 | 106 | ||
113 | 107 | ||
108 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
109 | + | ||
110 | + | ||
111 | + | func keyManagerPublicKey () = "%s__managerPublicKey" | |
112 | + | ||
113 | + | ||
114 | 114 | func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress())) | |
115 | 115 | ||
116 | 116 | ||
130 | 130 | ||
131 | 131 | ||
132 | 132 | func getGwxRewardAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgGwxRewardDapp]) | |
133 | + | ||
134 | + | ||
135 | + | func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress())) | |
133 | 136 | ||
134 | 137 | ||
135 | 138 | func keyBoostCfg () = "%s__config" | |
225 | 228 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
226 | 229 | ||
227 | 230 | ||
228 | - | func keyAddonAddr () = "%s__addonAddr" | |
229 | - | ||
230 | - | ||
231 | 231 | let factoryDapp = readFactoryAddressOrFail() | |
232 | 232 | ||
233 | 233 | let factoryCfg = readFactoryCfgOrFail(factoryDapp) | |
262 | 262 | let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
263 | 263 | let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) | |
264 | 264 | let wxEmissionPerBlockMax = getIntOrFail(emissionDapp, keyEmissionRatePerBlockMaxCurrent()) | |
265 | - | let boostMaxCoeff = 3 | |
265 | + | let boostMaxCoeff = { | |
266 | + | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
267 | + | if ($isInstanceOf(@, "Int")) | |
268 | + | then @ | |
269 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
270 | + | } | |
266 | 271 | let poolWxEmissionPerBlock = (fraction(wxEmissionPerBlock, poolWeight, poolWeightMult) / boostMaxCoeff) | |
267 | 272 | let poolWxEmissionPerBlockMax = fraction(wxEmissionPerBlockMax, poolWeight, poolWeightMult) | |
268 | 273 | let maxFactor = (boostMaxCoeff * MULT8) | |
287 | 292 | else throw("unknown type. expected string/integer/boolean") | |
288 | 293 | ||
289 | 294 | ||
290 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
291 | - | case s: String => | |
292 | - | fromBase58String(s) | |
295 | + | func managerPublicKeyOrUnit () = { | |
296 | + | let managerVaultAddress = getManagerAddressOrFail() | |
297 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
298 | + | case s: String => | |
299 | + | fromBase58String(s) | |
300 | + | case _: Unit => | |
301 | + | unit | |
302 | + | case _ => | |
303 | + | throw("Match error") | |
304 | + | } | |
305 | + | } | |
306 | + | ||
307 | + | ||
308 | + | func isManager (i) = match managerPublicKeyOrUnit() { | |
309 | + | case pk: ByteVector => | |
310 | + | (i.callerPublicKey == pk) | |
293 | 311 | case _: Unit => | |
294 | - | | |
312 | + | (i.caller == this) | |
295 | 313 | case _ => | |
296 | 314 | throw("Match error") | |
297 | 315 | } | |
298 | 316 | ||
299 | 317 | ||
300 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
301 | - | case s: String => | |
302 | - | fromBase58String(s) | |
303 | - | case _: Unit => | |
304 | - | unit | |
305 | - | case _ => | |
306 | - | throw("Match error") | |
307 | - | } | |
308 | - | ||
309 | - | ||
310 | - | func mustManager (i) = { | |
311 | - | let pd = throw("Permission denied") | |
312 | - | match managerPublicKeyOrUnit() { | |
313 | - | case pk: ByteVector => | |
314 | - | if ((i.callerPublicKey == pk)) | |
315 | - | then true | |
316 | - | else pd | |
317 | - | case _: Unit => | |
318 | - | if ((i.caller == this)) | |
319 | - | then true | |
320 | - | else pd | |
321 | - | case _ => | |
322 | - | throw("Match error") | |
323 | - | } | |
324 | - | } | |
318 | + | func mustManager (i) = if (isManager(i)) | |
319 | + | then true | |
320 | + | else throw("permission denied") | |
325 | 321 | ||
326 | 322 | ||
327 | 323 | @Callable(i) | |
340 | 336 | let wxEmissionPerBlock = rewardData[0] | |
341 | 337 | let maxFactor = rewardData[1] | |
342 | 338 | let totalLpStaked = rewardData[2] | |
343 | - | $Tuple2(nil, makeString(["%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked)], SEP)) | |
339 | + | let votingResultStaked = { | |
340 | + | let @ = invoke(boostingDapp, "getVotingResultStakedREADONLY", [lpAssetId], nil) | |
341 | + | if ($isInstanceOf(@, "Int")) | |
342 | + | then @ | |
343 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
344 | + | } | |
345 | + | $Tuple2(nil, makeString(["%d%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(votingResultStaked)], SEP)) | |
344 | 346 | } | |
345 | 347 | ||
346 | 348 | ||
402 | 404 | ||
403 | 405 | @Callable(i) | |
404 | 406 | func calcBoostREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = { | |
407 | + | let boostCoeff = { | |
408 | + | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
409 | + | if ($isInstanceOf(@, "Int")) | |
410 | + | then @ | |
411 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
412 | + | } | |
405 | 413 | let mathDapp = gwxRewardDapp | |
406 | 414 | let EMPTYSTR = "empty" | |
407 | 415 | let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4]) | |
421 | 429 | let lockDurationNew = min([(remainingDuration + deltaLockPeriodInBlocks), maxLockDurationInBlocks]) | |
422 | 430 | let userCurrgWxAmount = asInt(asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddressStr], nil))[0]) | |
423 | 431 | let gWxAmountStartNew = calcGwxAmountStartREADONLY(userAmountNew, lockDurationNew, maxLockDurationInBlocks)[0] | |
424 | - | let gWxParamsResultList = asAnyList(invoke(mathDapp, "calcGwxParamsREADONLY", [gWxAmountStartNew, height, lockDurationNew], nil)) | |
425 | - | let gWxAmountDiff = (gWxAmountStartNew - userCurrgWxAmount) | |
426 | - | let k = asInt(gWxParamsResultList[0]) | |
427 | - | let b = asInt(gWxParamsResultList[1]) | |
428 | - | let period = toString(asInt(gWxParamsResultList[2])) | |
429 | - | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
430 | - | let userMaxBoostIntNew = ((gWxAmountStartNew * lockDurationNew) / 2) | |
431 | - | let totalMaxBoostInt = getIntOrZero(boostingDapp, totalMaxBoostIntegralKEY) | |
432 | 432 | let totalCachedGwx = { | |
433 | 433 | let @ = invoke(boostingDapp, "getTotalCachedGwxREADONLY", nil, nil) | |
434 | 434 | if ($isInstanceOf(@, "Int")) | |
441 | 441 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
442 | 442 | let stakedByUser = readStaked(stakingDapp, stakedByUserKEY) | |
443 | 443 | let stakedTotal = readStaked(stakingDapp, stakedTotalKEY) | |
444 | - | let stakedByUserNew = (stakedByUser + deltaLpAmount) | |
445 | - | let stakedTotalNew = (stakedTotal + deltaLpAmount) | |
446 | 444 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
447 | 445 | then { | |
448 | 446 | let poolAddressStr = valueOrErrorMessage(getString(factoryDapp, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
449 | 447 | getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
450 | 448 | } | |
451 | 449 | else 0 | |
452 | - | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * | |
453 | - | let wxPerLpX3 = if (( | |
454 | - | then fraction(poolWxEmissionPerBlockX3, MULT8, | |
450 | + | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff)) | |
451 | + | let wxPerLpX3 = if ((stakedTotal != 0)) | |
452 | + | then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal) | |
455 | 453 | else 0 | |
456 | - | let userWxPerBlockX3 = fraction(wxPerLpX3, | |
457 | - | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * | |
458 | - | let tmpUserBoostPerBlockX3 = fraction( | |
459 | - | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * | |
460 | - | let | |
454 | + | let userWxPerBlockX3 = fraction(wxPerLpX3, stakedByUser, MULT8) | |
455 | + | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * (boostCoeff - 1)) | |
456 | + | let tmpUserBoostPerBlockX3 = fraction(userCurrgWxAmount, boostEmissionPerBlockX3, totalCachedGwx) | |
457 | + | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * (boostCoeff - 1))]) | |
458 | + | let userBoostCoeff = if ((userWxPerBlockX3 == 0)) | |
461 | 459 | then (1 * MULT8) | |
462 | 460 | else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3) | |
463 | - | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString( | |
461 | + | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(userBoostCoeff), "d"], SEP)) | |
464 | 462 | } | |
465 | 463 | ||
466 | 464 | ||
559 | 557 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18) | |
560 | 558 | let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil)) | |
561 | 559 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
562 | - | let $ | |
560 | + | let $t02262722980 = match res { | |
563 | 561 | case _ => | |
564 | 562 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
565 | 563 | then if ($isInstanceOf($match0._3, "Int")) | |
582 | 580 | } | |
583 | 581 | else throw("Couldn't cast types") | |
584 | 582 | } | |
585 | - | let calcLpAmt = $ | |
586 | - | let curPriceCalc = $ | |
587 | - | let amBalance = $ | |
588 | - | let prBalance = $ | |
589 | - | let lpEmission = $ | |
583 | + | let calcLpAmt = $t02262722980._1 | |
584 | + | let curPriceCalc = $t02262722980._2 | |
585 | + | let amBalance = $t02262722980._3 | |
586 | + | let prBalance = $t02262722980._4 | |
587 | + | let lpEmission = $t02262722980._5 | |
590 | 588 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(curPrice), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
591 | 589 | } | |
592 | 590 | ||
617 | 615 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18) | |
618 | 616 | let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil)) | |
619 | 617 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
620 | - | let $ | |
618 | + | let $t02555325906 = match res { | |
621 | 619 | case _ => | |
622 | 620 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
623 | 621 | then if ($isInstanceOf($match0._3, "Int")) | |
640 | 638 | } | |
641 | 639 | else throw("Couldn't cast types") | |
642 | 640 | } | |
643 | - | let calcLpAmt = $ | |
644 | - | let curPriceCalc = $ | |
645 | - | let amBalance = $ | |
646 | - | let prBalance = $ | |
647 | - | let lpEmission = $ | |
641 | + | let calcLpAmt = $t02555325906._1 | |
642 | + | let curPriceCalc = $t02555325906._2 | |
643 | + | let amBalance = $t02555325906._3 | |
644 | + | let prBalance = $t02555325906._4 | |
645 | + | let lpEmission = $t02555325906._5 | |
648 | 646 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(curPrice), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
649 | 647 | } | |
650 | 648 | ||
654 | 652 | func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
655 | 653 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId))) | |
656 | 654 | let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil) | |
657 | - | let $ | |
655 | + | let $t02660127018 = match res { | |
658 | 656 | case _ => | |
659 | 657 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
660 | 658 | then if ($isInstanceOf($match0._2, "Int")) | |
683 | 681 | } | |
684 | 682 | else throw("Couldn't cast types") | |
685 | 683 | } | |
686 | - | let outAmAmt = $ | |
687 | - | let outPrAmt = $ | |
688 | - | let amBalance = $ | |
689 | - | let prBalance = $ | |
690 | - | let lpEmission = $ | |
691 | - | let curPrice = $ | |
692 | - | let poolStatus = $ | |
684 | + | let outAmAmt = $t02660127018._1 | |
685 | + | let outPrAmt = $t02660127018._2 | |
686 | + | let amBalance = $t02660127018._3 | |
687 | + | let prBalance = $t02660127018._4 | |
688 | + | let lpEmission = $t02660127018._5 | |
689 | + | let curPrice = $t02660127018._6 | |
690 | + | let poolStatus = $t02660127018._7 | |
693 | 691 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP)) | |
694 | 692 | } | |
695 | 693 | ||
739 | 737 | } | |
740 | 738 | ||
741 | 739 | ||
742 | - | ||
743 | - | @Callable(i) | |
744 | - | func setManager (pendingManagerPublicKey) = { | |
745 | - | let checkCaller = mustManager(i) | |
746 | - | if ((checkCaller == checkCaller)) | |
747 | - | then { | |
748 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
749 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
750 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
751 | - | else throw("Strict value is not equal to itself.") | |
752 | - | } | |
753 | - | else throw("Strict value is not equal to itself.") | |
754 | - | } | |
755 | - | ||
756 | - | ||
757 | - | ||
758 | - | @Callable(i) | |
759 | - | func confirmManager () = { | |
760 | - | let pm = pendingManagerPublicKeyOrUnit() | |
761 | - | let hasPM = if (isDefined(pm)) | |
762 | - | then true | |
763 | - | else throw("No pending manager") | |
764 | - | if ((hasPM == hasPM)) | |
765 | - | then { | |
766 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
767 | - | then true | |
768 | - | else throw("You are not pending manager") | |
769 | - | if ((checkPM == checkPM)) | |
770 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
771 | - | else throw("Strict value is not equal to itself.") | |
772 | - | } | |
773 | - | else throw("Strict value is not equal to itself.") | |
774 | - | } | |
775 | - | ||
776 | - | ||
777 | 740 | @Verifier(tx) | |
778 | 741 | func verify () = { | |
779 | 742 | let targetPublicKey = match managerPublicKeyOrUnit() { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SCALE8 = 8 | |
5 | 5 | ||
6 | 6 | let MULT8 = 100000000 | |
7 | 7 | ||
8 | 8 | let SCALE18 = 18 | |
9 | 9 | ||
10 | 10 | let MULT18 = toBigInt(1000000000000000000) | |
11 | 11 | ||
12 | 12 | let SEP = "__" | |
13 | 13 | ||
14 | 14 | let POOLWEIGHTMULT = MULT8 | |
15 | 15 | ||
16 | 16 | let zeroBigInt = toBigInt(0) | |
17 | 17 | ||
18 | 18 | let idxPoolAddress = 1 | |
19 | 19 | ||
20 | 20 | let idxPoolStatus = 2 | |
21 | 21 | ||
22 | 22 | let idxPoolLPAssetId = 3 | |
23 | 23 | ||
24 | 24 | let idxAmtAssetId = 4 | |
25 | 25 | ||
26 | 26 | let idxPriceAssetId = 5 | |
27 | 27 | ||
28 | 28 | let idxAmtAssetDcm = 6 | |
29 | 29 | ||
30 | 30 | let idxPriceAssetDcm = 7 | |
31 | 31 | ||
32 | 32 | let idxIAmtAssetId = 8 | |
33 | 33 | ||
34 | 34 | let idxIPriceAssetId = 9 | |
35 | 35 | ||
36 | 36 | let idxLPAssetDcm = 10 | |
37 | 37 | ||
38 | 38 | func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func asAnyList (val) = match val { | |
51 | 51 | case valAnyLyst: List[Any] => | |
52 | 52 | valAnyLyst | |
53 | 53 | case _ => | |
54 | 54 | throw("fail to cast into List[Any]") | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func asInt (val) = match val { | |
59 | 59 | case valInt: Int => | |
60 | 60 | valInt | |
61 | 61 | case _ => | |
62 | 62 | throw("fail to cast into Int") | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func asString (val) = match val { | |
67 | 67 | case valStr: String => | |
68 | 68 | valStr | |
69 | 69 | case _ => | |
70 | 70 | throw("fail to cast into String") | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
75 | 75 | ||
76 | 76 | ||
77 | - | func keyManagerPublicKey () = "%s__managerPublicKey" | |
78 | - | ||
79 | - | ||
80 | - | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
81 | - | ||
82 | - | ||
83 | 77 | let IdxFactoryCfgStakingDapp = 1 | |
84 | 78 | ||
85 | 79 | let IdxFactoryCfgBoostingDapp = 2 | |
86 | 80 | ||
87 | 81 | let IdxFactoryCfgIdoDapp = 3 | |
88 | 82 | ||
89 | 83 | let IdxFactoryCfgTeamDapp = 4 | |
90 | 84 | ||
91 | 85 | let IdxFactoryCfgEmissionDapp = 5 | |
92 | 86 | ||
93 | 87 | let IdxFactoryCfgRestDapp = 6 | |
94 | 88 | ||
95 | 89 | let IdxFactoryCfgSlippageDapp = 7 | |
96 | 90 | ||
97 | 91 | let IdxFactoryCfgGwxRewardDapp = 8 | |
98 | 92 | ||
99 | 93 | func keyFactoryCfg () = "%s__factoryConfig" | |
100 | 94 | ||
101 | 95 | ||
102 | 96 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
103 | 97 | ||
104 | 98 | ||
105 | 99 | func keyFactoryLpList () = "%s__lpTokensList" | |
106 | 100 | ||
107 | 101 | ||
108 | 102 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
109 | 103 | ||
110 | 104 | ||
111 | 105 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
112 | 106 | ||
113 | 107 | ||
108 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
109 | + | ||
110 | + | ||
111 | + | func keyManagerPublicKey () = "%s__managerPublicKey" | |
112 | + | ||
113 | + | ||
114 | 114 | func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress())) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func getBoostingAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgBoostingDapp]) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func getEmissionAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgEmissionDapp]) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func getStakingAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgStakingDapp]) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func getGwxRewardAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgGwxRewardDapp]) | |
133 | + | ||
134 | + | ||
135 | + | func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress())) | |
133 | 136 | ||
134 | 137 | ||
135 | 138 | func keyBoostCfg () = "%s__config" | |
136 | 139 | ||
137 | 140 | ||
138 | 141 | func keyBoostingLockParamTotalAmount () = "%s%s__stats__activeTotalLocked" | |
139 | 142 | ||
140 | 143 | ||
141 | 144 | func keyBoostingStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks" | |
142 | 145 | ||
143 | 146 | ||
144 | 147 | func keyBoostingStatsLocksCount () = "%s%s__stats__locksCount" | |
145 | 148 | ||
146 | 149 | ||
147 | 150 | func keyBoostingStatsUsersCount () = "%s%s__stats__activeUsersCount" | |
148 | 151 | ||
149 | 152 | ||
150 | 153 | func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP) | |
151 | 154 | ||
152 | 155 | ||
153 | 156 | func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP) | |
154 | 157 | ||
155 | 158 | ||
156 | 159 | func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP) | |
157 | 160 | ||
158 | 161 | ||
159 | 162 | func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP) | |
160 | 163 | ||
161 | 164 | ||
162 | 165 | func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP) | |
163 | 166 | ||
164 | 167 | ||
165 | 168 | func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP) | |
166 | 169 | ||
167 | 170 | ||
168 | 171 | func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP) | |
169 | 172 | ||
170 | 173 | ||
171 | 174 | func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP) | |
172 | 175 | ||
173 | 176 | ||
174 | 177 | func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP) | |
175 | 178 | ||
176 | 179 | ||
177 | 180 | func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastInt", userNum], SEP) | |
178 | 181 | ||
179 | 182 | ||
180 | 183 | func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP) | |
181 | 184 | ||
182 | 185 | ||
183 | 186 | func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total" | |
184 | 187 | ||
185 | 188 | ||
186 | 189 | func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", userNum], SEP) | |
187 | 190 | ||
188 | 191 | ||
189 | 192 | func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", userNum], SEP) | |
190 | 193 | ||
191 | 194 | ||
192 | 195 | func keyTotalCachedGwx () = "%s%s__gwxCached__total" | |
193 | 196 | ||
194 | 197 | ||
195 | 198 | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP) | |
196 | 199 | ||
197 | 200 | ||
198 | 201 | func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr) | |
199 | 202 | ||
200 | 203 | ||
201 | 204 | func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP) | |
202 | 205 | ||
203 | 206 | ||
204 | 207 | func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP) | |
205 | 208 | ||
206 | 209 | ||
207 | 210 | func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP) | |
208 | 211 | ||
209 | 212 | ||
210 | 213 | func readStaked (stakingDapp,key) = valueOrElse(getInteger(stakingDapp, key), 0) | |
211 | 214 | ||
212 | 215 | ||
213 | 216 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
214 | 217 | ||
215 | 218 | ||
216 | 219 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
217 | 220 | ||
218 | 221 | ||
219 | 222 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
220 | 223 | ||
221 | 224 | ||
222 | 225 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
223 | 226 | ||
224 | 227 | ||
225 | 228 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
226 | 229 | ||
227 | 230 | ||
228 | - | func keyAddonAddr () = "%s__addonAddr" | |
229 | - | ||
230 | - | ||
231 | 231 | let factoryDapp = readFactoryAddressOrFail() | |
232 | 232 | ||
233 | 233 | let factoryCfg = readFactoryCfgOrFail(factoryDapp) | |
234 | 234 | ||
235 | 235 | let emissionDapp = getEmissionAddressOrFail(factoryCfg) | |
236 | 236 | ||
237 | 237 | let stakingDapp = getStakingAddressOrFail(factoryCfg) | |
238 | 238 | ||
239 | 239 | let gwxRewardDapp = getGwxRewardAddressOrFail(factoryCfg) | |
240 | 240 | ||
241 | 241 | let boostingDapp = getBoostingAddressOrFail(factoryCfg) | |
242 | 242 | ||
243 | 243 | func getPoolInFee (poolAddress) = { | |
244 | 244 | let @ = invoke(factoryDapp, "getInFeeREADONLY", [toString(poolAddress)], nil) | |
245 | 245 | if ($isInstanceOf(@, "Int")) | |
246 | 246 | then @ | |
247 | 247 | else throw(($getType(@) + " couldn't be cast to Int")) | |
248 | 248 | } | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | func getPoolOutFee (poolAddress) = { | |
252 | 252 | let @ = invoke(factoryDapp, "getOutFeeREADONLY", [toString(poolAddress)], nil) | |
253 | 253 | if ($isInstanceOf(@, "Int")) | |
254 | 254 | then @ | |
255 | 255 | else throw(($getType(@) + " couldn't be cast to Int")) | |
256 | 256 | } | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func internalCurrentRewardRate (lpAssetId) = { | |
260 | 260 | let poolAddressStr = getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAssetId)) | |
261 | 261 | let poolWeightMult = MULT8 | |
262 | 262 | let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
263 | 263 | let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) | |
264 | 264 | let wxEmissionPerBlockMax = getIntOrFail(emissionDapp, keyEmissionRatePerBlockMaxCurrent()) | |
265 | - | let boostMaxCoeff = 3 | |
265 | + | let boostMaxCoeff = { | |
266 | + | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
267 | + | if ($isInstanceOf(@, "Int")) | |
268 | + | then @ | |
269 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
270 | + | } | |
266 | 271 | let poolWxEmissionPerBlock = (fraction(wxEmissionPerBlock, poolWeight, poolWeightMult) / boostMaxCoeff) | |
267 | 272 | let poolWxEmissionPerBlockMax = fraction(wxEmissionPerBlockMax, poolWeight, poolWeightMult) | |
268 | 273 | let maxFactor = (boostMaxCoeff * MULT8) | |
269 | 274 | let totalLpStaked = getIntOrZero(stakingDapp, keyStakedTotal(lpAssetId)) | |
270 | 275 | [poolWxEmissionPerBlock, maxFactor, totalLpStaked] | |
271 | 276 | } | |
272 | 277 | ||
273 | 278 | ||
274 | 279 | func calcGwxAmountStartREADONLY (lockAmount,lockDuration,maxLockDuration) = { | |
275 | 280 | let coeffX8 = fraction(lockDuration, MULT8, maxLockDuration) | |
276 | 281 | let gWxAmountStart = fraction(lockAmount, coeffX8, MULT8) | |
277 | 282 | [gWxAmountStart] | |
278 | 283 | } | |
279 | 284 | ||
280 | 285 | ||
281 | 286 | func getKey (addr,key,type) = if ((type == "string")) | |
282 | 287 | then getStringValue(addr, key) | |
283 | 288 | else if ((type == "integer")) | |
284 | 289 | then toString(getIntegerValue(addr, key)) | |
285 | 290 | else if ((type == "boolean")) | |
286 | 291 | then toString(getBooleanValue(addr, key)) | |
287 | 292 | else throw("unknown type. expected string/integer/boolean") | |
288 | 293 | ||
289 | 294 | ||
290 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
291 | - | case s: String => | |
292 | - | fromBase58String(s) | |
295 | + | func managerPublicKeyOrUnit () = { | |
296 | + | let managerVaultAddress = getManagerAddressOrFail() | |
297 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
298 | + | case s: String => | |
299 | + | fromBase58String(s) | |
300 | + | case _: Unit => | |
301 | + | unit | |
302 | + | case _ => | |
303 | + | throw("Match error") | |
304 | + | } | |
305 | + | } | |
306 | + | ||
307 | + | ||
308 | + | func isManager (i) = match managerPublicKeyOrUnit() { | |
309 | + | case pk: ByteVector => | |
310 | + | (i.callerPublicKey == pk) | |
293 | 311 | case _: Unit => | |
294 | - | | |
312 | + | (i.caller == this) | |
295 | 313 | case _ => | |
296 | 314 | throw("Match error") | |
297 | 315 | } | |
298 | 316 | ||
299 | 317 | ||
300 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
301 | - | case s: String => | |
302 | - | fromBase58String(s) | |
303 | - | case _: Unit => | |
304 | - | unit | |
305 | - | case _ => | |
306 | - | throw("Match error") | |
307 | - | } | |
308 | - | ||
309 | - | ||
310 | - | func mustManager (i) = { | |
311 | - | let pd = throw("Permission denied") | |
312 | - | match managerPublicKeyOrUnit() { | |
313 | - | case pk: ByteVector => | |
314 | - | if ((i.callerPublicKey == pk)) | |
315 | - | then true | |
316 | - | else pd | |
317 | - | case _: Unit => | |
318 | - | if ((i.caller == this)) | |
319 | - | then true | |
320 | - | else pd | |
321 | - | case _ => | |
322 | - | throw("Match error") | |
323 | - | } | |
324 | - | } | |
318 | + | func mustManager (i) = if (isManager(i)) | |
319 | + | then true | |
320 | + | else throw("permission denied") | |
325 | 321 | ||
326 | 322 | ||
327 | 323 | @Callable(i) | |
328 | 324 | func constructor (factoryAddress) = { | |
329 | 325 | let checkCaller = mustManager(i) | |
330 | 326 | if ((checkCaller == checkCaller)) | |
331 | 327 | then [StringEntry(keyFactoryAddress(), factoryAddress)] | |
332 | 328 | else throw("Strict value is not equal to itself.") | |
333 | 329 | } | |
334 | 330 | ||
335 | 331 | ||
336 | 332 | ||
337 | 333 | @Callable(i) | |
338 | 334 | func currentRewardRateREADONLY (lpAssetId) = { | |
339 | 335 | let rewardData = internalCurrentRewardRate(lpAssetId) | |
340 | 336 | let wxEmissionPerBlock = rewardData[0] | |
341 | 337 | let maxFactor = rewardData[1] | |
342 | 338 | let totalLpStaked = rewardData[2] | |
343 | - | $Tuple2(nil, makeString(["%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked)], SEP)) | |
339 | + | let votingResultStaked = { | |
340 | + | let @ = invoke(boostingDapp, "getVotingResultStakedREADONLY", [lpAssetId], nil) | |
341 | + | if ($isInstanceOf(@, "Int")) | |
342 | + | then @ | |
343 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
344 | + | } | |
345 | + | $Tuple2(nil, makeString(["%d%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(votingResultStaked)], SEP)) | |
344 | 346 | } | |
345 | 347 | ||
346 | 348 | ||
347 | 349 | ||
348 | 350 | @Callable(i) | |
349 | 351 | func currentUserRewardRateREADONLY (lpAssetId,userAddress) = { | |
350 | 352 | let rewardData = internalCurrentRewardRate(lpAssetId) | |
351 | 353 | let wxEmissionPerBlock = rewardData[0] | |
352 | 354 | let maxFactor = rewardData[1] | |
353 | 355 | let totalLpStaked = rewardData[2] | |
354 | 356 | let lpStakedByUser = getIntOrZero(stakingDapp, keyStakedByUser(userAddress, lpAssetId)) | |
355 | 357 | let userClaimInfo = split(asString(invoke(stakingDapp, "claimWxREADONLY", [lpAssetId, userAddress], nil)), SEP) | |
356 | 358 | let minRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[5]), "couldn't parse minRewardPart") | |
357 | 359 | let boostRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[6]), "couldn't parse boostRewardPart") | |
358 | 360 | let debug = userClaimInfo[7] | |
359 | 361 | let boostingPower = if ((boostRewardPart == 0)) | |
360 | 362 | then (1 * MULT8) | |
361 | 363 | else fraction((minRewardPart + boostRewardPart), MULT8, minRewardPart) | |
362 | 364 | $Tuple2(nil, makeString(["%d%d%d%d%d%s", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(lpStakedByUser), toString(boostingPower), debug], SEP)) | |
363 | 365 | } | |
364 | 366 | ||
365 | 367 | ||
366 | 368 | ||
367 | 369 | @Callable(i) | |
368 | 370 | func calcBoostBulkInternalREADONLY (currentIter,deltaWxAmountBulk,deltaLockPeriodInBlocksBulk,deltaLpAmountBulk,lpAssetIdOptBulk,userAddressOpt,resAcc) = if ((currentIter == size(deltaWxAmountBulk))) | |
369 | 371 | then $Tuple2(nil, resAcc) | |
370 | 372 | else { | |
371 | 373 | let deltaWxAmount = deltaWxAmountBulk[currentIter] | |
372 | 374 | let deltaLockPeriodInBlocks = deltaLockPeriodInBlocksBulk[currentIter] | |
373 | 375 | let deltaLpAmount = deltaLpAmountBulk[currentIter] | |
374 | 376 | let lpAssetIdOpt = lpAssetIdOptBulk[currentIter] | |
375 | 377 | let info = { | |
376 | 378 | let @ = invoke(this, "calcBoostREADONLY", [deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt], nil) | |
377 | 379 | if ($isInstanceOf(@, "String")) | |
378 | 380 | then @ | |
379 | 381 | else throw(($getType(@) + " couldn't be cast to String")) | |
380 | 382 | } | |
381 | 383 | let res = (resAcc :+ info) | |
382 | 384 | let inv = { | |
383 | 385 | let @ = invoke(this, "calcBoostBulkInternalREADONLY", [(currentIter + 1), deltaWxAmountBulk, deltaLockPeriodInBlocksBulk, deltaLpAmountBulk, lpAssetIdOptBulk, userAddressOpt, res], nil) | |
384 | 386 | if ($isInstanceOf(@, "List[Any]")) | |
385 | 387 | then @ | |
386 | 388 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
387 | 389 | } | |
388 | 390 | if ((inv == inv)) | |
389 | 391 | then $Tuple2(nil, inv) | |
390 | 392 | else throw("Strict value is not equal to itself.") | |
391 | 393 | } | |
392 | 394 | ||
393 | 395 | ||
394 | 396 | ||
395 | 397 | @Callable(i) | |
396 | 398 | func calcBoostBulkREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = { | |
397 | 399 | let res = invoke(this, "calcBoostBulkInternalREADONLY", [0, deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt, nil], nil) | |
398 | 400 | $Tuple2(nil, res) | |
399 | 401 | } | |
400 | 402 | ||
401 | 403 | ||
402 | 404 | ||
403 | 405 | @Callable(i) | |
404 | 406 | func calcBoostREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = { | |
407 | + | let boostCoeff = { | |
408 | + | let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil) | |
409 | + | if ($isInstanceOf(@, "Int")) | |
410 | + | then @ | |
411 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
412 | + | } | |
405 | 413 | let mathDapp = gwxRewardDapp | |
406 | 414 | let EMPTYSTR = "empty" | |
407 | 415 | let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4]) | |
408 | 416 | let lpAssetIdStr = if ((lpAssetIdOpt == "")) | |
409 | 417 | then EMPTYSTR | |
410 | 418 | else lpAssetIdOpt | |
411 | 419 | let userAddressStr = if ((userAddressOpt == "")) | |
412 | 420 | then EMPTYSTR | |
413 | 421 | else userAddressOpt | |
414 | 422 | let userNumStr = valueOrElse(getString(boostingDapp, keyUser2NumMapping(userAddressOpt)), EMPTYSTR) | |
415 | 423 | let userAmount = valueOrElse(getInteger(boostingDapp, keyLockParamUserAmount(userNumStr)), 0) | |
416 | 424 | let lockStart = valueOrElse(getInteger(boostingDapp, keyLockParamStartBlock(userNumStr)), height) | |
417 | 425 | let lockDuration = valueOrElse(getInteger(boostingDapp, keyLockParamDuration(userNumStr)), 0) | |
418 | 426 | let lockEnd = (lockStart + lockDuration) | |
419 | 427 | let remainingDuration = max([(lockEnd - height), 0]) | |
420 | 428 | let userAmountNew = (userAmount + deltaWxAmount) | |
421 | 429 | let lockDurationNew = min([(remainingDuration + deltaLockPeriodInBlocks), maxLockDurationInBlocks]) | |
422 | 430 | let userCurrgWxAmount = asInt(asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddressStr], nil))[0]) | |
423 | 431 | let gWxAmountStartNew = calcGwxAmountStartREADONLY(userAmountNew, lockDurationNew, maxLockDurationInBlocks)[0] | |
424 | - | let gWxParamsResultList = asAnyList(invoke(mathDapp, "calcGwxParamsREADONLY", [gWxAmountStartNew, height, lockDurationNew], nil)) | |
425 | - | let gWxAmountDiff = (gWxAmountStartNew - userCurrgWxAmount) | |
426 | - | let k = asInt(gWxParamsResultList[0]) | |
427 | - | let b = asInt(gWxParamsResultList[1]) | |
428 | - | let period = toString(asInt(gWxParamsResultList[2])) | |
429 | - | let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL() | |
430 | - | let userMaxBoostIntNew = ((gWxAmountStartNew * lockDurationNew) / 2) | |
431 | - | let totalMaxBoostInt = getIntOrZero(boostingDapp, totalMaxBoostIntegralKEY) | |
432 | 432 | let totalCachedGwx = { | |
433 | 433 | let @ = invoke(boostingDapp, "getTotalCachedGwxREADONLY", nil, nil) | |
434 | 434 | if ($isInstanceOf(@, "Int")) | |
435 | 435 | then @ | |
436 | 436 | else throw(($getType(@) + " couldn't be cast to Int")) | |
437 | 437 | } | |
438 | 438 | let MULT3 = 1000 | |
439 | 439 | let wxEmissionPerBlockX3 = (getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) * MULT3) | |
440 | 440 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
441 | 441 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
442 | 442 | let stakedByUser = readStaked(stakingDapp, stakedByUserKEY) | |
443 | 443 | let stakedTotal = readStaked(stakingDapp, stakedTotalKEY) | |
444 | - | let stakedByUserNew = (stakedByUser + deltaLpAmount) | |
445 | - | let stakedTotalNew = (stakedTotal + deltaLpAmount) | |
446 | 444 | let poolWeight = if ((lpAssetIdStr != EMPTYSTR)) | |
447 | 445 | then { | |
448 | 446 | let poolAddressStr = valueOrErrorMessage(getString(factoryDapp, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
449 | 447 | getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr)) | |
450 | 448 | } | |
451 | 449 | else 0 | |
452 | - | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * | |
453 | - | let wxPerLpX3 = if (( | |
454 | - | then fraction(poolWxEmissionPerBlockX3, MULT8, | |
450 | + | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff)) | |
451 | + | let wxPerLpX3 = if ((stakedTotal != 0)) | |
452 | + | then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal) | |
455 | 453 | else 0 | |
456 | - | let userWxPerBlockX3 = fraction(wxPerLpX3, | |
457 | - | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * | |
458 | - | let tmpUserBoostPerBlockX3 = fraction( | |
459 | - | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * | |
460 | - | let | |
454 | + | let userWxPerBlockX3 = fraction(wxPerLpX3, stakedByUser, MULT8) | |
455 | + | let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * (boostCoeff - 1)) | |
456 | + | let tmpUserBoostPerBlockX3 = fraction(userCurrgWxAmount, boostEmissionPerBlockX3, totalCachedGwx) | |
457 | + | let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * (boostCoeff - 1))]) | |
458 | + | let userBoostCoeff = if ((userWxPerBlockX3 == 0)) | |
461 | 459 | then (1 * MULT8) | |
462 | 460 | else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3) | |
463 | - | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString( | |
461 | + | $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(userBoostCoeff), "d"], SEP)) | |
464 | 462 | } | |
465 | 463 | ||
466 | 464 | ||
467 | 465 | ||
468 | 466 | @Callable(i) | |
469 | 467 | func wxEmissionStatsREADONLY () = { | |
470 | 468 | let ONEMULT = toString(MULT8) | |
471 | 469 | let ONE = "1" | |
472 | 470 | let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) | |
473 | 471 | let emissionStartBlock = getIntOrFail(emissionDapp, keyEmissionStartBlock()) | |
474 | 472 | let passedBlocks = if ((emissionStartBlock > height)) | |
475 | 473 | then 0 | |
476 | 474 | else (height - emissionStartBlock) | |
477 | 475 | let teamEmDuration = (1440 * 365) | |
478 | 476 | let teamEmMax = (201000000 * MULT8) | |
479 | 477 | let teamEm = if ((passedBlocks > teamEmDuration)) | |
480 | 478 | then teamEmMax | |
481 | 479 | else fraction(teamEmMax, passedBlocks, teamEmDuration) | |
482 | 480 | let totalWxReleased = ((wxEmissionPerBlock * passedBlocks) + teamEm) | |
483 | 481 | let totalWxLocked = getIntOrZero(boostingDapp, keyBoostingLockParamTotalAmount()) | |
484 | 482 | let locksDurationSumInBlocks = getIntOrZero(boostingDapp, keyBoostingStatsLocksDurationSumInBlocks()) | |
485 | 483 | let locksCount = getIntOrZero(boostingDapp, keyBoostingStatsLocksCount()) | |
486 | 484 | $Tuple2(nil, makeString(["%d%d%d%d", toString(totalWxReleased), toString(totalWxLocked), toString(locksDurationSumInBlocks), toString(locksCount)], SEP)) | |
487 | 485 | } | |
488 | 486 | ||
489 | 487 | ||
490 | 488 | ||
491 | 489 | @Callable(i) | |
492 | 490 | func poolStatsREADONLY (lpAsset) = { | |
493 | 491 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
494 | 492 | let status = { | |
495 | 493 | let @ = invoke(factoryDapp, "getPoolStatusREADONLY", [toString(poolAddress)], nil) | |
496 | 494 | if ($isInstanceOf(@, "Int")) | |
497 | 495 | then @ | |
498 | 496 | else throw(($getType(@) + " couldn't be cast to Int")) | |
499 | 497 | } | |
500 | 498 | let tpl = "%d%d%d%d%d%d%d%d%d%s" | |
501 | 499 | if ((status == 4)) | |
502 | 500 | then $Tuple2(nil, makeString([tpl, toString(0), toString(0), toString(0), toString(0), toString(0), toString(0), toString(0), toString(0), toString(0), toString(false)], SEP)) | |
503 | 501 | else { | |
504 | 502 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
505 | 503 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
506 | 504 | let amtAssetId = asString(cfg[idxAmtAssetId]) | |
507 | 505 | let priceAssetId = asString(cfg[idxPriceAssetId]) | |
508 | 506 | let iAmtAssetId = asString(cfg[idxIAmtAssetId]) | |
509 | 507 | let iPriceAssetId = asString(cfg[idxIPriceAssetId]) | |
510 | 508 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
511 | 509 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
512 | 510 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
513 | 511 | let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amtAssetId], nil)) | |
514 | 512 | let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [priceAssetId], nil)) | |
515 | 513 | let pricesList = if ((poolLPBalance == 0)) | |
516 | 514 | then [toString(zeroBigInt), toString(zeroBigInt), toString(zeroBigInt)] | |
517 | 515 | else asAnyList(invoke(poolAddress, "calcPricesWrapperREADONLY", [accAmtAssetBalance, accPriceAssetBalance, poolLPBalance], nil)) | |
518 | 516 | let curPrice = 0 | |
519 | 517 | let lpAmtAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[1], MULT8], nil)) | |
520 | 518 | let lpPriceAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[2], MULT8], nil)) | |
521 | 519 | let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(toString(poolAddress))) | |
522 | 520 | let inFee = getPoolInFee(poolAddress) | |
523 | 521 | let outFee = getPoolOutFee(poolAddress) | |
524 | 522 | let poolOneTokenOperationsDisabled = { | |
525 | 523 | let @ = invoke(factoryDapp, "isPoolOneTokenOperationsDisabledREADONLY", [toString(poolAddress)], nil) | |
526 | 524 | if ($isInstanceOf(@, "Boolean")) | |
527 | 525 | then @ | |
528 | 526 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
529 | 527 | } | |
530 | 528 | let poolOneTokenOperationsEnabled = !(poolOneTokenOperationsDisabled) | |
531 | 529 | $Tuple2(nil, makeString([tpl, toString(accAmtAssetBalance), toString(accPriceAssetBalance), toString(poolLPBalance), toString(curPrice), toString(lpAmtAssetShare), toString(lpPriceAssetShare), toString(poolWeight), toString(inFee), toString(outFee), toString(poolOneTokenOperationsEnabled)], SEP)) | |
532 | 530 | } | |
533 | 531 | } | |
534 | 532 | ||
535 | 533 | ||
536 | 534 | ||
537 | 535 | @Callable(i) | |
538 | 536 | func poolEvaluatePutByAmountAssetREADONLY (lpAsset,inAmAssetAmt) = { | |
539 | 537 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
540 | 538 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
541 | 539 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
542 | 540 | let amAssetIdStr = asString(cfg[idxAmtAssetId]) | |
543 | 541 | let amAssetId = fromBase58String(amAssetIdStr) | |
544 | 542 | let prAssetIdStr = asString(cfg[idxPriceAssetId]) | |
545 | 543 | let prAssetId = fromBase58String(prAssetIdStr) | |
546 | 544 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
547 | 545 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
548 | 546 | let poolStatus = asString(cfg[idxPoolStatus]) | |
549 | 547 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
550 | 548 | let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil)) | |
551 | 549 | let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil)) | |
552 | 550 | let amtAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accAmtAssetBalance, amtAssetDcm], nil))) | |
553 | 551 | let priceAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accPriceAssetBalance, priceAssetDcm], nil))) | |
554 | 552 | let curPriceX18 = if ((poolLPBalance == 0)) | |
555 | 553 | then zeroBigInt | |
556 | 554 | else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(priceAssetAmtX18), toString(amtAssetAmtX18)], nil))) | |
557 | 555 | let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil)) | |
558 | 556 | let inAmAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inAmAssetAmt, amtAssetDcm], nil))) | |
559 | 557 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18) | |
560 | 558 | let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil)) | |
561 | 559 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
562 | - | let $ | |
560 | + | let $t02262722980 = match res { | |
563 | 561 | case _ => | |
564 | 562 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
565 | 563 | then if ($isInstanceOf($match0._3, "Int")) | |
566 | 564 | then if ($isInstanceOf($match0._4, "Int")) | |
567 | 565 | then if ($isInstanceOf($match0._5, "Int")) | |
568 | 566 | then $isInstanceOf($match0._6, "Int") | |
569 | 567 | else false | |
570 | 568 | else false | |
571 | 569 | else false | |
572 | 570 | else false) | |
573 | 571 | then (size($match0) == 13) | |
574 | 572 | else false) | |
575 | 573 | then { | |
576 | 574 | let calcLpAmt = $match0._1 | |
577 | 575 | let curPriceCalc = $match0._3 | |
578 | 576 | let amBalance = $match0._4 | |
579 | 577 | let prBalance = $match0._5 | |
580 | 578 | let lpEmission = $match0._6 | |
581 | 579 | $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission) | |
582 | 580 | } | |
583 | 581 | else throw("Couldn't cast types") | |
584 | 582 | } | |
585 | - | let calcLpAmt = $ | |
586 | - | let curPriceCalc = $ | |
587 | - | let amBalance = $ | |
588 | - | let prBalance = $ | |
589 | - | let lpEmission = $ | |
583 | + | let calcLpAmt = $t02262722980._1 | |
584 | + | let curPriceCalc = $t02262722980._2 | |
585 | + | let amBalance = $t02262722980._3 | |
586 | + | let prBalance = $t02262722980._4 | |
587 | + | let lpEmission = $t02262722980._5 | |
590 | 588 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(curPrice), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
591 | 589 | } | |
592 | 590 | ||
593 | 591 | ||
594 | 592 | ||
595 | 593 | @Callable(i) | |
596 | 594 | func poolEvaluatePutByPriceAssetREADONLY (lpAsset,inPrAssetAmt) = { | |
597 | 595 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset))) | |
598 | 596 | let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil)) | |
599 | 597 | let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId])) | |
600 | 598 | let amAssetIdStr = asString(cfg[idxAmtAssetId]) | |
601 | 599 | let amAssetId = fromBase58String(amAssetIdStr) | |
602 | 600 | let prAssetIdStr = asString(cfg[idxPriceAssetId]) | |
603 | 601 | let prAssetId = fromBase58String(prAssetIdStr) | |
604 | 602 | let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm])) | |
605 | 603 | let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm])) | |
606 | 604 | let poolStatus = asString(cfg[idxPoolStatus]) | |
607 | 605 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
608 | 606 | let amBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil)) | |
609 | 607 | let prBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil)) | |
610 | 608 | let amBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [amBalanceRaw, amtAssetDcm], nil))) | |
611 | 609 | let prBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [prBalanceRaw, priceAssetDcm], nil))) | |
612 | 610 | let curPriceX18 = if ((poolLPBalance == 0)) | |
613 | 611 | then zeroBigInt | |
614 | 612 | else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(prBalanceRawX18), toString(amBalanceRawX18)], nil))) | |
615 | 613 | let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil)) | |
616 | 614 | let inPrAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inPrAssetAmt, priceAssetDcm], nil))) | |
617 | 615 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18) | |
618 | 616 | let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil)) | |
619 | 617 | let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil) | |
620 | - | let $ | |
618 | + | let $t02555325906 = match res { | |
621 | 619 | case _ => | |
622 | 620 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
623 | 621 | then if ($isInstanceOf($match0._3, "Int")) | |
624 | 622 | then if ($isInstanceOf($match0._4, "Int")) | |
625 | 623 | then if ($isInstanceOf($match0._5, "Int")) | |
626 | 624 | then $isInstanceOf($match0._6, "Int") | |
627 | 625 | else false | |
628 | 626 | else false | |
629 | 627 | else false | |
630 | 628 | else false) | |
631 | 629 | then (size($match0) == 13) | |
632 | 630 | else false) | |
633 | 631 | then { | |
634 | 632 | let calcLpAmt = $match0._1 | |
635 | 633 | let curPriceCalc = $match0._3 | |
636 | 634 | let amBalance = $match0._4 | |
637 | 635 | let prBalance = $match0._5 | |
638 | 636 | let lpEmission = $match0._6 | |
639 | 637 | $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission) | |
640 | 638 | } | |
641 | 639 | else throw("Couldn't cast types") | |
642 | 640 | } | |
643 | - | let calcLpAmt = $ | |
644 | - | let curPriceCalc = $ | |
645 | - | let amBalance = $ | |
646 | - | let prBalance = $ | |
647 | - | let lpEmission = $ | |
641 | + | let calcLpAmt = $t02555325906._1 | |
642 | + | let curPriceCalc = $t02555325906._2 | |
643 | + | let amBalance = $t02555325906._3 | |
644 | + | let prBalance = $t02555325906._4 | |
645 | + | let lpEmission = $t02555325906._5 | |
648 | 646 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(curPrice), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
649 | 647 | } | |
650 | 648 | ||
651 | 649 | ||
652 | 650 | ||
653 | 651 | @Callable(i) | |
654 | 652 | func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
655 | 653 | let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId))) | |
656 | 654 | let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil) | |
657 | - | let $ | |
655 | + | let $t02660127018 = match res { | |
658 | 656 | case _ => | |
659 | 657 | if (if (if ($isInstanceOf($match0._1, "Int")) | |
660 | 658 | then if ($isInstanceOf($match0._2, "Int")) | |
661 | 659 | then if ($isInstanceOf($match0._5, "Int")) | |
662 | 660 | then if ($isInstanceOf($match0._6, "Int")) | |
663 | 661 | then if ($isInstanceOf($match0._7, "Int")) | |
664 | 662 | then if ($isInstanceOf($match0._8, "String")) | |
665 | 663 | then $isInstanceOf($match0._9, "String") | |
666 | 664 | else false | |
667 | 665 | else false | |
668 | 666 | else false | |
669 | 667 | else false | |
670 | 668 | else false | |
671 | 669 | else false) | |
672 | 670 | then (size($match0) == 10) | |
673 | 671 | else false) | |
674 | 672 | then { | |
675 | 673 | let outAmAmt = $match0._1 | |
676 | 674 | let outPrAmt = $match0._2 | |
677 | 675 | let amBalance = $match0._5 | |
678 | 676 | let prBalance = $match0._6 | |
679 | 677 | let lpEmission = $match0._7 | |
680 | 678 | let curPrice = $match0._8 | |
681 | 679 | let poolStatus = $match0._9 | |
682 | 680 | $Tuple7(outAmAmt, outPrAmt, amBalance, prBalance, lpEmission, curPrice, poolStatus) | |
683 | 681 | } | |
684 | 682 | else throw("Couldn't cast types") | |
685 | 683 | } | |
686 | - | let outAmAmt = $ | |
687 | - | let outPrAmt = $ | |
688 | - | let amBalance = $ | |
689 | - | let prBalance = $ | |
690 | - | let lpEmission = $ | |
691 | - | let curPrice = $ | |
692 | - | let poolStatus = $ | |
684 | + | let outAmAmt = $t02660127018._1 | |
685 | + | let outPrAmt = $t02660127018._2 | |
686 | + | let amBalance = $t02660127018._3 | |
687 | + | let prBalance = $t02660127018._4 | |
688 | + | let lpEmission = $t02660127018._5 | |
689 | + | let curPrice = $t02660127018._6 | |
690 | + | let poolStatus = $t02660127018._7 | |
693 | 691 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP)) | |
694 | 692 | } | |
695 | 693 | ||
696 | 694 | ||
697 | 695 | ||
698 | 696 | @Callable(i) | |
699 | 697 | func gwxUserInfoREADONLY (userAddress) = { | |
700 | 698 | let gwxUserInfoLIST = asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddress], nil)) | |
701 | 699 | let gwxAmount = asInt(gwxUserInfoLIST[0]) | |
702 | 700 | $Tuple2(nil, makeString(["%d", toString(gwxAmount)], SEP)) | |
703 | 701 | } | |
704 | 702 | ||
705 | 703 | ||
706 | 704 | ||
707 | 705 | @Callable(i) | |
708 | 706 | func unstakeAndGetOneTknV2 (poolAddress,unstakeAmount,outAssetId,minOutAmount) = { | |
709 | 707 | let inv = invoke(addressFromStringValue(poolAddress), "unstakeAndGetOneTknV2", [unstakeAmount, outAssetId, minOutAmount], nil) | |
710 | 708 | if ((inv == inv)) | |
711 | 709 | then $Tuple2(nil, unit) | |
712 | 710 | else throw("Strict value is not equal to itself.") | |
713 | 711 | } | |
714 | 712 | ||
715 | 713 | ||
716 | 714 | ||
717 | 715 | @Callable(i) | |
718 | 716 | func getKeysBulkInternal (currentIter,keys,resAcc) = if ((currentIter == size(keys))) | |
719 | 717 | then $Tuple2(nil, resAcc) | |
720 | 718 | else { | |
721 | 719 | let k = split(keys[currentIter], "++") | |
722 | 720 | let addr = addressFromStringValue(k[0]) | |
723 | 721 | let key = k[1] | |
724 | 722 | let type = k[2] | |
725 | 723 | let val = getKey(addr, key, type) | |
726 | 724 | let res = (resAcc :+ val) | |
727 | 725 | let inv = invoke(this, "getKeysBulkInternal", [(currentIter + 1), keys, res], nil) | |
728 | 726 | if ((inv == inv)) | |
729 | 727 | then $Tuple2(nil, inv) | |
730 | 728 | else throw("Strict value is not equal to itself.") | |
731 | 729 | } | |
732 | 730 | ||
733 | 731 | ||
734 | 732 | ||
735 | 733 | @Callable(i) | |
736 | 734 | func getKeysBulk (keys) = { | |
737 | 735 | let res = invoke(this, "getKeysBulkInternal", [0, keys, nil], nil) | |
738 | 736 | $Tuple2(nil, res) | |
739 | 737 | } | |
740 | 738 | ||
741 | 739 | ||
742 | - | ||
743 | - | @Callable(i) | |
744 | - | func setManager (pendingManagerPublicKey) = { | |
745 | - | let checkCaller = mustManager(i) | |
746 | - | if ((checkCaller == checkCaller)) | |
747 | - | then { | |
748 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
749 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
750 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
751 | - | else throw("Strict value is not equal to itself.") | |
752 | - | } | |
753 | - | else throw("Strict value is not equal to itself.") | |
754 | - | } | |
755 | - | ||
756 | - | ||
757 | - | ||
758 | - | @Callable(i) | |
759 | - | func confirmManager () = { | |
760 | - | let pm = pendingManagerPublicKeyOrUnit() | |
761 | - | let hasPM = if (isDefined(pm)) | |
762 | - | then true | |
763 | - | else throw("No pending manager") | |
764 | - | if ((hasPM == hasPM)) | |
765 | - | then { | |
766 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
767 | - | then true | |
768 | - | else throw("You are not pending manager") | |
769 | - | if ((checkPM == checkPM)) | |
770 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
771 | - | else throw("Strict value is not equal to itself.") | |
772 | - | } | |
773 | - | else throw("Strict value is not equal to itself.") | |
774 | - | } | |
775 | - | ||
776 | - | ||
777 | 740 | @Verifier(tx) | |
778 | 741 | func verify () = { | |
779 | 742 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
780 | 743 | case pk: ByteVector => | |
781 | 744 | pk | |
782 | 745 | case _: Unit => | |
783 | 746 | tx.senderPublicKey | |
784 | 747 | case _ => | |
785 | 748 | throw("Match error") | |
786 | 749 | } | |
787 | 750 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
788 | 751 | } | |
789 | 752 |
github/deemru/w8io/169f3d6 108.07 ms ◑