tx · Cd4pK1LVmG87fzL3FZmTucckrDB6pBAUrnXXB6TSvakg

3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp:  -0.02300000 Waves

2023.03.24 14:59 [2504060] smart account 3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp > SELF 0.00000000 Waves

{ "type": 13, "id": "Cd4pK1LVmG87fzL3FZmTucckrDB6pBAUrnXXB6TSvakg", "fee": 2300000, "feeAssetId": null, "timestamp": 1679659191341, "version": 2, "chainId": 84, "sender": "3MsNhK6uve98J6DeqbuwGFBRh9GoHPGUFgp", "senderPublicKey": "86RHVxKovtU7yKnepY8wKsd8niDxGAsiwuA1XA1DNqrS", "proofs": [ "5eKWx2Z9UL5gBnZ8M1MymBrKo8STpdtcRRqvUUBju2iJRfjpQpdVUKXQwW3aMFgbJXVfx5uT6whxJ3ssXn5zBGv6" ], "script": "base64:BgKrIQgCEgMKAQgSAwoBCBIECgIICBIJCgcBERERGAgYEgcKBRERERgIEgcKBQEBAQgIEgASAwoBCBIECgIIARIECgIIARIECgIIARIDCgEIEgYKBAgBCAESBQoDARgYEgMKARgSAwoBCBIAIgZTQ0FMRTgiBU1VTFQ4IgdTQ0FMRTE4IgZNVUxUMTgiA1NFUCIOUE9PTFdFSUdIVE1VTFQiCnplcm9CaWdJbnQiDmlkeFBvb2xBZGRyZXNzIg1pZHhQb29sU3RhdHVzIhBpZHhQb29sTFBBc3NldElkIg1pZHhBbXRBc3NldElkIg9pZHhQcmljZUFzc2V0SWQiDmlkeEFtdEFzc2V0RGNtIhBpZHhQcmljZUFzc2V0RGNtIg5pZHhJQW10QXNzZXRJZCIQaWR4SVByaWNlQXNzZXRJZCINaWR4TFBBc3NldERjbSIPZ2V0U3RyaW5nT3JGYWlsIgNrZXkiGGdldFN0cmluZ0J5QWRkcmVzc09yRmFpbCIHYWRkcmVzcyIMZ2V0SW50T3JaZXJvIgxnZXRJbnRPckZhaWwiCWFzQW55TGlzdCIDdmFsIgckbWF0Y2gwIgp2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IFAXoCBFVuaXQIBQJkWA9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZFgJYm9keUJ5dGVzCQCRAwIIBQJkWAZwcm9vZnMAAAUCZFr6cd9q", "height": 2504060, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2TMrhaHAFL4qkKQvwy4vWHU3kmrS1xHW4eYYFXoLQag5 Next: 3F8svdZKqfrHECRNtLPTT2My2L9DSe5mKLDme55aQQHG Diff:
OldNewDifferences
262262 let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr))
263263 let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent())
264264 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+ }
266271 let poolWxEmissionPerBlock = (fraction(wxEmissionPerBlock, poolWeight, poolWeightMult) / boostMaxCoeff)
267272 let poolWxEmissionPerBlockMax = fraction(wxEmissionPerBlockMax, poolWeight, poolWeightMult)
268273 let maxFactor = (boostMaxCoeff * MULT8)
340345 let wxEmissionPerBlock = rewardData[0]
341346 let maxFactor = rewardData[1]
342347 let totalLpStaked = rewardData[2]
343- $Tuple2(nil, makeString(["%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked)], SEP))
348+ let votingResultStaked = {
349+ let @ = invoke(boostingDapp, "getVotingResultStakedREADONLY", [lpAssetId], nil)
350+ if ($isInstanceOf(@, "Int"))
351+ then @
352+ else throw(($getType(@) + " couldn't be cast to Int"))
353+ }
354+ $Tuple2(nil, makeString(["%d%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(votingResultStaked)], SEP))
344355 }
345356
346357
402413
403414 @Callable(i)
404415 func calcBoostREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = {
416+ let boostCoeff = {
417+ let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil)
418+ if ($isInstanceOf(@, "Int"))
419+ then @
420+ else throw(($getType(@) + " couldn't be cast to Int"))
421+ }
405422 let mathDapp = gwxRewardDapp
406423 let EMPTYSTR = "empty"
407424 let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4])
421438 let lockDurationNew = min([(remainingDuration + deltaLockPeriodInBlocks), maxLockDurationInBlocks])
422439 let userCurrgWxAmount = asInt(asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddressStr], nil))[0])
423440 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)
432441 let totalCachedGwx = {
433442 let @ = invoke(boostingDapp, "getTotalCachedGwxREADONLY", nil, nil)
434443 if ($isInstanceOf(@, "Int"))
441450 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
442451 let stakedByUser = readStaked(stakingDapp, stakedByUserKEY)
443452 let stakedTotal = readStaked(stakingDapp, stakedTotalKEY)
444- let stakedByUserNew = (stakedByUser + deltaLpAmount)
445- let stakedTotalNew = (stakedTotal + deltaLpAmount)
446453 let poolWeight = if ((lpAssetIdStr != EMPTYSTR))
447454 then {
448455 let poolAddressStr = valueOrErrorMessage(getString(factoryDapp, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
449456 getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr))
450457 }
451458 else 0
452- let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
453- let wxPerLpX3 = if ((stakedTotalNew != 0))
454- then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotalNew)
459+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff))
460+ let wxPerLpX3 = if ((stakedTotal != 0))
461+ then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal)
455462 else 0
456- let userWxPerBlockX3 = fraction(wxPerLpX3, stakedByUserNew, MULT8)
457- let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * 2)
458- let tmpUserBoostPerBlockX3 = fraction(gWxAmountStartNew, boostEmissionPerBlockX3, (totalCachedGwx + gWxAmountDiff))
459- let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * 2)])
460- let boostCoeff = if ((userWxPerBlockX3 == 0))
463+ let userWxPerBlockX3 = fraction(wxPerLpX3, stakedByUser, MULT8)
464+ let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * (boostCoeff - 1))
465+ let tmpUserBoostPerBlockX3 = fraction(userCurrgWxAmount, boostEmissionPerBlockX3, totalCachedGwx)
466+ let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * (boostCoeff - 1))])
467+ let userBoostCoeff = if ((userWxPerBlockX3 == 0))
461468 then (1 * MULT8)
462469 else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3)
463- $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(boostCoeff), "d"], SEP))
470+ $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(userBoostCoeff), "d"], SEP))
464471 }
465472
466473
559566 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18)
560567 let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil))
561568 let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil)
562- let $t02336423717 = match res {
569+ let $t02263122984 = match res {
563570 case _ =>
564571 if (if (if ($isInstanceOf($match0._1, "Int"))
565572 then if ($isInstanceOf($match0._3, "Int"))
582589 }
583590 else throw("Couldn't cast types")
584591 }
585- let calcLpAmt = $t02336423717._1
586- let curPriceCalc = $t02336423717._2
587- let amBalance = $t02336423717._3
588- let prBalance = $t02336423717._4
589- let lpEmission = $t02336423717._5
592+ let calcLpAmt = $t02263122984._1
593+ let curPriceCalc = $t02263122984._2
594+ let amBalance = $t02263122984._3
595+ let prBalance = $t02263122984._4
596+ let lpEmission = $t02263122984._5
590597 $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))
591598 }
592599
617624 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18)
618625 let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil))
619626 let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil)
620- let $t02629026643 = match res {
627+ let $t02555725910 = match res {
621628 case _ =>
622629 if (if (if ($isInstanceOf($match0._1, "Int"))
623630 then if ($isInstanceOf($match0._3, "Int"))
640647 }
641648 else throw("Couldn't cast types")
642649 }
643- let calcLpAmt = $t02629026643._1
644- let curPriceCalc = $t02629026643._2
645- let amBalance = $t02629026643._3
646- let prBalance = $t02629026643._4
647- let lpEmission = $t02629026643._5
650+ let calcLpAmt = $t02555725910._1
651+ let curPriceCalc = $t02555725910._2
652+ let amBalance = $t02555725910._3
653+ let prBalance = $t02555725910._4
654+ let lpEmission = $t02555725910._5
648655 $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))
649656 }
650657
654661 func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
655662 let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId)))
656663 let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil)
657- let $t02733827755 = match res {
664+ let $t02660527022 = match res {
658665 case _ =>
659666 if (if (if ($isInstanceOf($match0._1, "Int"))
660667 then if ($isInstanceOf($match0._2, "Int"))
683690 }
684691 else throw("Couldn't cast types")
685692 }
686- let outAmAmt = $t02733827755._1
687- let outPrAmt = $t02733827755._2
688- let amBalance = $t02733827755._3
689- let prBalance = $t02733827755._4
690- let lpEmission = $t02733827755._5
691- let curPrice = $t02733827755._6
692- let poolStatus = $t02733827755._7
693+ let outAmAmt = $t02660527022._1
694+ let outPrAmt = $t02660527022._2
695+ let amBalance = $t02660527022._3
696+ let prBalance = $t02660527022._4
697+ let lpEmission = $t02660527022._5
698+ let curPrice = $t02660527022._6
699+ let poolStatus = $t02660527022._7
693700 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP))
694701 }
695702
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
55
66 let MULT8 = 100000000
77
88 let SCALE18 = 18
99
1010 let MULT18 = toBigInt(1000000000000000000)
1111
1212 let SEP = "__"
1313
1414 let POOLWEIGHTMULT = MULT8
1515
1616 let zeroBigInt = toBigInt(0)
1717
1818 let idxPoolAddress = 1
1919
2020 let idxPoolStatus = 2
2121
2222 let idxPoolLPAssetId = 3
2323
2424 let idxAmtAssetId = 4
2525
2626 let idxPriceAssetId = 5
2727
2828 let idxAmtAssetDcm = 6
2929
3030 let idxPriceAssetDcm = 7
3131
3232 let idxIAmtAssetId = 8
3333
3434 let idxIPriceAssetId = 9
3535
3636 let idxLPAssetDcm = 10
3737
3838 func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
3939
4040
4141 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
4242
4343
4444 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
4545
4646
4747 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
4848
4949
5050 func asAnyList (val) = match val {
5151 case valAnyLyst: List[Any] =>
5252 valAnyLyst
5353 case _ =>
5454 throw("fail to cast into List[Any]")
5555 }
5656
5757
5858 func asInt (val) = match val {
5959 case valInt: Int =>
6060 valInt
6161 case _ =>
6262 throw("fail to cast into Int")
6363 }
6464
6565
6666 func asString (val) = match val {
6767 case valStr: String =>
6868 valStr
6969 case _ =>
7070 throw("fail to cast into String")
7171 }
7272
7373
7474 func keyFactoryAddress () = "%s%s__config__factoryAddress"
7575
7676
7777 func keyManagerPublicKey () = "%s__managerPublicKey"
7878
7979
8080 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
8181
8282
8383 let IdxFactoryCfgStakingDapp = 1
8484
8585 let IdxFactoryCfgBoostingDapp = 2
8686
8787 let IdxFactoryCfgIdoDapp = 3
8888
8989 let IdxFactoryCfgTeamDapp = 4
9090
9191 let IdxFactoryCfgEmissionDapp = 5
9292
9393 let IdxFactoryCfgRestDapp = 6
9494
9595 let IdxFactoryCfgSlippageDapp = 7
9696
9797 let IdxFactoryCfgGwxRewardDapp = 8
9898
9999 func keyFactoryCfg () = "%s__factoryConfig"
100100
101101
102102 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
103103
104104
105105 func keyFactoryLpList () = "%s__lpTokensList"
106106
107107
108108 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
109109
110110
111111 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
112112
113113
114114 func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(keyFactoryAddress()))
115115
116116
117117 func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
118118
119119
120120 func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
121121
122122
123123 func getBoostingAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgBoostingDapp])
124124
125125
126126 func getEmissionAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgEmissionDapp])
127127
128128
129129 func getStakingAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgStakingDapp])
130130
131131
132132 func getGwxRewardAddressOrFail (fCfg) = addressFromStringValue(fCfg[IdxFactoryCfgGwxRewardDapp])
133133
134134
135135 func keyBoostCfg () = "%s__config"
136136
137137
138138 func keyBoostingLockParamTotalAmount () = "%s%s__stats__activeTotalLocked"
139139
140140
141141 func keyBoostingStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks"
142142
143143
144144 func keyBoostingStatsLocksCount () = "%s%s__stats__locksCount"
145145
146146
147147 func keyBoostingStatsUsersCount () = "%s%s__stats__activeUsersCount"
148148
149149
150150 func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP)
151151
152152
153153 func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP)
154154
155155
156156 func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP)
157157
158158
159159 func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP)
160160
161161
162162 func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP)
163163
164164
165165 func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP)
166166
167167
168168 func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP)
169169
170170
171171 func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP)
172172
173173
174174 func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP)
175175
176176
177177 func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastInt", userNum], SEP)
178178
179179
180180 func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP)
181181
182182
183183 func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total"
184184
185185
186186 func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", userNum], SEP)
187187
188188
189189 func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", userNum], SEP)
190190
191191
192192 func keyTotalCachedGwx () = "%s%s__gwxCached__total"
193193
194194
195195 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
196196
197197
198198 func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr)
199199
200200
201201 func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP)
202202
203203
204204 func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP)
205205
206206
207207 func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP)
208208
209209
210210 func readStaked (stakingDapp,key) = valueOrElse(getInteger(stakingDapp, key), 0)
211211
212212
213213 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
214214
215215
216216 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
217217
218218
219219 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
220220
221221
222222 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
223223
224224
225225 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
226226
227227
228228 func keyAddonAddr () = "%s__addonAddr"
229229
230230
231231 let factoryDapp = readFactoryAddressOrFail()
232232
233233 let factoryCfg = readFactoryCfgOrFail(factoryDapp)
234234
235235 let emissionDapp = getEmissionAddressOrFail(factoryCfg)
236236
237237 let stakingDapp = getStakingAddressOrFail(factoryCfg)
238238
239239 let gwxRewardDapp = getGwxRewardAddressOrFail(factoryCfg)
240240
241241 let boostingDapp = getBoostingAddressOrFail(factoryCfg)
242242
243243 func getPoolInFee (poolAddress) = {
244244 let @ = invoke(factoryDapp, "getInFeeREADONLY", [toString(poolAddress)], nil)
245245 if ($isInstanceOf(@, "Int"))
246246 then @
247247 else throw(($getType(@) + " couldn't be cast to Int"))
248248 }
249249
250250
251251 func getPoolOutFee (poolAddress) = {
252252 let @ = invoke(factoryDapp, "getOutFeeREADONLY", [toString(poolAddress)], nil)
253253 if ($isInstanceOf(@, "Int"))
254254 then @
255255 else throw(($getType(@) + " couldn't be cast to Int"))
256256 }
257257
258258
259259 func internalCurrentRewardRate (lpAssetId) = {
260260 let poolAddressStr = getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAssetId))
261261 let poolWeightMult = MULT8
262262 let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr))
263263 let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent())
264264 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+ }
266271 let poolWxEmissionPerBlock = (fraction(wxEmissionPerBlock, poolWeight, poolWeightMult) / boostMaxCoeff)
267272 let poolWxEmissionPerBlockMax = fraction(wxEmissionPerBlockMax, poolWeight, poolWeightMult)
268273 let maxFactor = (boostMaxCoeff * MULT8)
269274 let totalLpStaked = getIntOrZero(stakingDapp, keyStakedTotal(lpAssetId))
270275 [poolWxEmissionPerBlock, maxFactor, totalLpStaked]
271276 }
272277
273278
274279 func calcGwxAmountStartREADONLY (lockAmount,lockDuration,maxLockDuration) = {
275280 let coeffX8 = fraction(lockDuration, MULT8, maxLockDuration)
276281 let gWxAmountStart = fraction(lockAmount, coeffX8, MULT8)
277282 [gWxAmountStart]
278283 }
279284
280285
281286 func getKey (addr,key,type) = if ((type == "string"))
282287 then getStringValue(addr, key)
283288 else if ((type == "integer"))
284289 then toString(getIntegerValue(addr, key))
285290 else if ((type == "boolean"))
286291 then toString(getBooleanValue(addr, key))
287292 else throw("unknown type. expected string/integer/boolean")
288293
289294
290295 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
291296 case s: String =>
292297 fromBase58String(s)
293298 case _: Unit =>
294299 unit
295300 case _ =>
296301 throw("Match error")
297302 }
298303
299304
300305 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
301306 case s: String =>
302307 fromBase58String(s)
303308 case _: Unit =>
304309 unit
305310 case _ =>
306311 throw("Match error")
307312 }
308313
309314
310315 func mustManager (i) = {
311316 let pd = throw("Permission denied")
312317 match managerPublicKeyOrUnit() {
313318 case pk: ByteVector =>
314319 if ((i.callerPublicKey == pk))
315320 then true
316321 else pd
317322 case _: Unit =>
318323 if ((i.caller == this))
319324 then true
320325 else pd
321326 case _ =>
322327 throw("Match error")
323328 }
324329 }
325330
326331
327332 @Callable(i)
328333 func constructor (factoryAddress) = {
329334 let checkCaller = mustManager(i)
330335 if ((checkCaller == checkCaller))
331336 then [StringEntry(keyFactoryAddress(), factoryAddress)]
332337 else throw("Strict value is not equal to itself.")
333338 }
334339
335340
336341
337342 @Callable(i)
338343 func currentRewardRateREADONLY (lpAssetId) = {
339344 let rewardData = internalCurrentRewardRate(lpAssetId)
340345 let wxEmissionPerBlock = rewardData[0]
341346 let maxFactor = rewardData[1]
342347 let totalLpStaked = rewardData[2]
343- $Tuple2(nil, makeString(["%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked)], SEP))
348+ let votingResultStaked = {
349+ let @ = invoke(boostingDapp, "getVotingResultStakedREADONLY", [lpAssetId], nil)
350+ if ($isInstanceOf(@, "Int"))
351+ then @
352+ else throw(($getType(@) + " couldn't be cast to Int"))
353+ }
354+ $Tuple2(nil, makeString(["%d%d%d%d", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(votingResultStaked)], SEP))
344355 }
345356
346357
347358
348359 @Callable(i)
349360 func currentUserRewardRateREADONLY (lpAssetId,userAddress) = {
350361 let rewardData = internalCurrentRewardRate(lpAssetId)
351362 let wxEmissionPerBlock = rewardData[0]
352363 let maxFactor = rewardData[1]
353364 let totalLpStaked = rewardData[2]
354365 let lpStakedByUser = getIntOrZero(stakingDapp, keyStakedByUser(userAddress, lpAssetId))
355366 let userClaimInfo = split(asString(invoke(stakingDapp, "claimWxREADONLY", [lpAssetId, userAddress], nil)), SEP)
356367 let minRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[5]), "couldn't parse minRewardPart")
357368 let boostRewardPart = valueOrErrorMessage(parseInt(userClaimInfo[6]), "couldn't parse boostRewardPart")
358369 let debug = userClaimInfo[7]
359370 let boostingPower = if ((boostRewardPart == 0))
360371 then (1 * MULT8)
361372 else fraction((minRewardPart + boostRewardPart), MULT8, minRewardPart)
362373 $Tuple2(nil, makeString(["%d%d%d%d%d%s", toString(wxEmissionPerBlock), toString(maxFactor), toString(totalLpStaked), toString(lpStakedByUser), toString(boostingPower), debug], SEP))
363374 }
364375
365376
366377
367378 @Callable(i)
368379 func calcBoostBulkInternalREADONLY (currentIter,deltaWxAmountBulk,deltaLockPeriodInBlocksBulk,deltaLpAmountBulk,lpAssetIdOptBulk,userAddressOpt,resAcc) = if ((currentIter == size(deltaWxAmountBulk)))
369380 then $Tuple2(nil, resAcc)
370381 else {
371382 let deltaWxAmount = deltaWxAmountBulk[currentIter]
372383 let deltaLockPeriodInBlocks = deltaLockPeriodInBlocksBulk[currentIter]
373384 let deltaLpAmount = deltaLpAmountBulk[currentIter]
374385 let lpAssetIdOpt = lpAssetIdOptBulk[currentIter]
375386 let info = {
376387 let @ = invoke(this, "calcBoostREADONLY", [deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt], nil)
377388 if ($isInstanceOf(@, "String"))
378389 then @
379390 else throw(($getType(@) + " couldn't be cast to String"))
380391 }
381392 let res = (resAcc :+ info)
382393 let inv = {
383394 let @ = invoke(this, "calcBoostBulkInternalREADONLY", [(currentIter + 1), deltaWxAmountBulk, deltaLockPeriodInBlocksBulk, deltaLpAmountBulk, lpAssetIdOptBulk, userAddressOpt, res], nil)
384395 if ($isInstanceOf(@, "List[Any]"))
385396 then @
386397 else throw(($getType(@) + " couldn't be cast to List[Any]"))
387398 }
388399 if ((inv == inv))
389400 then $Tuple2(nil, inv)
390401 else throw("Strict value is not equal to itself.")
391402 }
392403
393404
394405
395406 @Callable(i)
396407 func calcBoostBulkREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = {
397408 let res = invoke(this, "calcBoostBulkInternalREADONLY", [0, deltaWxAmount, deltaLockPeriodInBlocks, deltaLpAmount, lpAssetIdOpt, userAddressOpt, nil], nil)
398409 $Tuple2(nil, res)
399410 }
400411
401412
402413
403414 @Callable(i)
404415 func calcBoostREADONLY (deltaWxAmount,deltaLockPeriodInBlocks,deltaLpAmount,lpAssetIdOpt,userAddressOpt) = {
416+ let boostCoeff = {
417+ let @ = invoke(emissionDapp, "getBoostCoeffREADONLY", nil, nil)
418+ if ($isInstanceOf(@, "Int"))
419+ then @
420+ else throw(($getType(@) + " couldn't be cast to Int"))
421+ }
405422 let mathDapp = gwxRewardDapp
406423 let EMPTYSTR = "empty"
407424 let maxLockDurationInBlocks = parseIntValue(split(getStringByAddressOrFail(boostingDapp, keyBoostCfg()), SEP)[4])
408425 let lpAssetIdStr = if ((lpAssetIdOpt == ""))
409426 then EMPTYSTR
410427 else lpAssetIdOpt
411428 let userAddressStr = if ((userAddressOpt == ""))
412429 then EMPTYSTR
413430 else userAddressOpt
414431 let userNumStr = valueOrElse(getString(boostingDapp, keyUser2NumMapping(userAddressOpt)), EMPTYSTR)
415432 let userAmount = valueOrElse(getInteger(boostingDapp, keyLockParamUserAmount(userNumStr)), 0)
416433 let lockStart = valueOrElse(getInteger(boostingDapp, keyLockParamStartBlock(userNumStr)), height)
417434 let lockDuration = valueOrElse(getInteger(boostingDapp, keyLockParamDuration(userNumStr)), 0)
418435 let lockEnd = (lockStart + lockDuration)
419436 let remainingDuration = max([(lockEnd - height), 0])
420437 let userAmountNew = (userAmount + deltaWxAmount)
421438 let lockDurationNew = min([(remainingDuration + deltaLockPeriodInBlocks), maxLockDurationInBlocks])
422439 let userCurrgWxAmount = asInt(asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddressStr], nil))[0])
423440 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)
432441 let totalCachedGwx = {
433442 let @ = invoke(boostingDapp, "getTotalCachedGwxREADONLY", nil, nil)
434443 if ($isInstanceOf(@, "Int"))
435444 then @
436445 else throw(($getType(@) + " couldn't be cast to Int"))
437446 }
438447 let MULT3 = 1000
439448 let wxEmissionPerBlockX3 = (getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent()) * MULT3)
440449 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
441450 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
442451 let stakedByUser = readStaked(stakingDapp, stakedByUserKEY)
443452 let stakedTotal = readStaked(stakingDapp, stakedTotalKEY)
444- let stakedByUserNew = (stakedByUser + deltaLpAmount)
445- let stakedTotalNew = (stakedTotal + deltaLpAmount)
446453 let poolWeight = if ((lpAssetIdStr != EMPTYSTR))
447454 then {
448455 let poolAddressStr = valueOrErrorMessage(getString(factoryDapp, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
449456 getIntegerValue(factoryDapp, keyFactoryPoolWeight(poolAddressStr))
450457 }
451458 else 0
452- let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
453- let wxPerLpX3 = if ((stakedTotalNew != 0))
454- then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotalNew)
459+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff))
460+ let wxPerLpX3 = if ((stakedTotal != 0))
461+ then fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal)
455462 else 0
456- let userWxPerBlockX3 = fraction(wxPerLpX3, stakedByUserNew, MULT8)
457- let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * 2)
458- let tmpUserBoostPerBlockX3 = fraction(gWxAmountStartNew, boostEmissionPerBlockX3, (totalCachedGwx + gWxAmountDiff))
459- let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * 2)])
460- let boostCoeff = if ((userWxPerBlockX3 == 0))
463+ let userWxPerBlockX3 = fraction(wxPerLpX3, stakedByUser, MULT8)
464+ let boostEmissionPerBlockX3 = (poolWxEmissionPerBlockX3 * (boostCoeff - 1))
465+ let tmpUserBoostPerBlockX3 = fraction(userCurrgWxAmount, boostEmissionPerBlockX3, totalCachedGwx)
466+ let userBoostPerBlockX3 = min([tmpUserBoostPerBlockX3, (userWxPerBlockX3 * (boostCoeff - 1))])
467+ let userBoostCoeff = if ((userWxPerBlockX3 == 0))
461468 then (1 * MULT8)
462469 else fraction((userBoostPerBlockX3 + userWxPerBlockX3), MULT8, userWxPerBlockX3)
463- $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(boostCoeff), "d"], SEP))
470+ $Tuple2(nil, makeString(["%d%d%s", toString(gWxAmountStartNew), toString(userBoostCoeff), "d"], SEP))
464471 }
465472
466473
467474
468475 @Callable(i)
469476 func wxEmissionStatsREADONLY () = {
470477 let ONEMULT = toString(MULT8)
471478 let ONE = "1"
472479 let wxEmissionPerBlock = getIntOrFail(emissionDapp, keyEmissionRatePerBlockCurrent())
473480 let emissionStartBlock = getIntOrFail(emissionDapp, keyEmissionStartBlock())
474481 let passedBlocks = if ((emissionStartBlock > height))
475482 then 0
476483 else (height - emissionStartBlock)
477484 let teamEmDuration = (1440 * 365)
478485 let teamEmMax = (201000000 * MULT8)
479486 let teamEm = if ((passedBlocks > teamEmDuration))
480487 then teamEmMax
481488 else fraction(teamEmMax, passedBlocks, teamEmDuration)
482489 let totalWxReleased = ((wxEmissionPerBlock * passedBlocks) + teamEm)
483490 let totalWxLocked = getIntOrZero(boostingDapp, keyBoostingLockParamTotalAmount())
484491 let locksDurationSumInBlocks = getIntOrZero(boostingDapp, keyBoostingStatsLocksDurationSumInBlocks())
485492 let locksCount = getIntOrZero(boostingDapp, keyBoostingStatsLocksCount())
486493 $Tuple2(nil, makeString(["%d%d%d%d", toString(totalWxReleased), toString(totalWxLocked), toString(locksDurationSumInBlocks), toString(locksCount)], SEP))
487494 }
488495
489496
490497
491498 @Callable(i)
492499 func poolStatsREADONLY (lpAsset) = {
493500 let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset)))
494501 let status = {
495502 let @ = invoke(factoryDapp, "getPoolStatusREADONLY", [toString(poolAddress)], nil)
496503 if ($isInstanceOf(@, "Int"))
497504 then @
498505 else throw(($getType(@) + " couldn't be cast to Int"))
499506 }
500507 let tpl = "%d%d%d%d%d%d%d%d%d%s"
501508 if ((status == 4))
502509 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))
503510 else {
504511 let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil))
505512 let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId]))
506513 let amtAssetId = asString(cfg[idxAmtAssetId])
507514 let priceAssetId = asString(cfg[idxPriceAssetId])
508515 let iAmtAssetId = asString(cfg[idxIAmtAssetId])
509516 let iPriceAssetId = asString(cfg[idxIPriceAssetId])
510517 let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm]))
511518 let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm]))
512519 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
513520 let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amtAssetId], nil))
514521 let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [priceAssetId], nil))
515522 let pricesList = if ((poolLPBalance == 0))
516523 then [toString(zeroBigInt), toString(zeroBigInt), toString(zeroBigInt)]
517524 else asAnyList(invoke(poolAddress, "calcPricesWrapperREADONLY", [accAmtAssetBalance, accPriceAssetBalance, poolLPBalance], nil))
518525 let curPrice = 0
519526 let lpAmtAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[1], MULT8], nil))
520527 let lpPriceAssetShare = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [pricesList[2], MULT8], nil))
521528 let poolWeight = getIntegerValue(factoryDapp, keyFactoryPoolWeight(toString(poolAddress)))
522529 let inFee = getPoolInFee(poolAddress)
523530 let outFee = getPoolOutFee(poolAddress)
524531 let poolOneTokenOperationsDisabled = {
525532 let @ = invoke(factoryDapp, "isPoolOneTokenOperationsDisabledREADONLY", [toString(poolAddress)], nil)
526533 if ($isInstanceOf(@, "Boolean"))
527534 then @
528535 else throw(($getType(@) + " couldn't be cast to Boolean"))
529536 }
530537 let poolOneTokenOperationsEnabled = !(poolOneTokenOperationsDisabled)
531538 $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))
532539 }
533540 }
534541
535542
536543
537544 @Callable(i)
538545 func poolEvaluatePutByAmountAssetREADONLY (lpAsset,inAmAssetAmt) = {
539546 let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset)))
540547 let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil))
541548 let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId]))
542549 let amAssetIdStr = asString(cfg[idxAmtAssetId])
543550 let amAssetId = fromBase58String(amAssetIdStr)
544551 let prAssetIdStr = asString(cfg[idxPriceAssetId])
545552 let prAssetId = fromBase58String(prAssetIdStr)
546553 let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm]))
547554 let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm]))
548555 let poolStatus = asString(cfg[idxPoolStatus])
549556 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
550557 let accAmtAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil))
551558 let accPriceAssetBalance = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil))
552559 let amtAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accAmtAssetBalance, amtAssetDcm], nil)))
553560 let priceAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [accPriceAssetBalance, priceAssetDcm], nil)))
554561 let curPriceX18 = if ((poolLPBalance == 0))
555562 then zeroBigInt
556563 else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(priceAssetAmtX18), toString(amtAssetAmtX18)], nil)))
557564 let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil))
558565 let inAmAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inAmAssetAmt, amtAssetDcm], nil)))
559566 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, MULT18)
560567 let inPrAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inPrAssetAmtX18), priceAssetDcm], nil))
561568 let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil)
562- let $t02336423717 = match res {
569+ let $t02263122984 = match res {
563570 case _ =>
564571 if (if (if ($isInstanceOf($match0._1, "Int"))
565572 then if ($isInstanceOf($match0._3, "Int"))
566573 then if ($isInstanceOf($match0._4, "Int"))
567574 then if ($isInstanceOf($match0._5, "Int"))
568575 then $isInstanceOf($match0._6, "Int")
569576 else false
570577 else false
571578 else false
572579 else false)
573580 then (size($match0) == 13)
574581 else false)
575582 then {
576583 let calcLpAmt = $match0._1
577584 let curPriceCalc = $match0._3
578585 let amBalance = $match0._4
579586 let prBalance = $match0._5
580587 let lpEmission = $match0._6
581588 $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission)
582589 }
583590 else throw("Couldn't cast types")
584591 }
585- let calcLpAmt = $t02336423717._1
586- let curPriceCalc = $t02336423717._2
587- let amBalance = $t02336423717._3
588- let prBalance = $t02336423717._4
589- let lpEmission = $t02336423717._5
592+ let calcLpAmt = $t02263122984._1
593+ let curPriceCalc = $t02263122984._2
594+ let amBalance = $t02263122984._3
595+ let prBalance = $t02263122984._4
596+ let lpEmission = $t02263122984._5
590597 $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))
591598 }
592599
593600
594601
595602 @Callable(i)
596603 func poolEvaluatePutByPriceAssetREADONLY (lpAsset,inPrAssetAmt) = {
597604 let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(lpAsset)))
598605 let cfg = asAnyList(invoke(poolAddress, "getPoolConfigWrapperREADONLY", nil, nil))
599606 let lpAssetId = fromBase58String(asString(cfg[idxPoolLPAssetId]))
600607 let amAssetIdStr = asString(cfg[idxAmtAssetId])
601608 let amAssetId = fromBase58String(amAssetIdStr)
602609 let prAssetIdStr = asString(cfg[idxPriceAssetId])
603610 let prAssetId = fromBase58String(prAssetIdStr)
604611 let amtAssetDcm = parseIntValue(asString(cfg[idxAmtAssetDcm]))
605612 let priceAssetDcm = parseIntValue(asString(cfg[idxPriceAssetDcm]))
606613 let poolStatus = asString(cfg[idxPoolStatus])
607614 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
608615 let amBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [amAssetIdStr], nil))
609616 let prBalanceRaw = asInt(invoke(poolAddress, "getAccBalanceWrapperREADONLY", [prAssetIdStr], nil))
610617 let amBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [amBalanceRaw, amtAssetDcm], nil)))
611618 let prBalanceRawX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [prBalanceRaw, priceAssetDcm], nil)))
612619 let curPriceX18 = if ((poolLPBalance == 0))
613620 then zeroBigInt
614621 else parseBigIntValue(asString(invoke(poolAddress, "calcPriceBigIntWrapperREADONLY", [toString(prBalanceRawX18), toString(amBalanceRawX18)], nil)))
615622 let curPrice = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(curPriceX18), MULT8], nil))
616623 let inPrAssetAmtX18 = parseBigIntValue(asString(invoke(poolAddress, "toX18WrapperREADONLY", [inPrAssetAmt, priceAssetDcm], nil)))
617624 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, MULT18, curPriceX18)
618625 let inAmAssetAmt = asInt(invoke(poolAddress, "fromX18WrapperREADONLY", [toString(inAmAssetAmtX18), amtAssetDcm], nil))
619626 let res = invoke(poolAddress, "estimatePutOperationWrapperREADONLY", ["", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false], nil)
620- let $t02629026643 = match res {
627+ let $t02555725910 = match res {
621628 case _ =>
622629 if (if (if ($isInstanceOf($match0._1, "Int"))
623630 then if ($isInstanceOf($match0._3, "Int"))
624631 then if ($isInstanceOf($match0._4, "Int"))
625632 then if ($isInstanceOf($match0._5, "Int"))
626633 then $isInstanceOf($match0._6, "Int")
627634 else false
628635 else false
629636 else false
630637 else false)
631638 then (size($match0) == 13)
632639 else false)
633640 then {
634641 let calcLpAmt = $match0._1
635642 let curPriceCalc = $match0._3
636643 let amBalance = $match0._4
637644 let prBalance = $match0._5
638645 let lpEmission = $match0._6
639646 $Tuple5(calcLpAmt, curPriceCalc, amBalance, prBalance, lpEmission)
640647 }
641648 else throw("Couldn't cast types")
642649 }
643- let calcLpAmt = $t02629026643._1
644- let curPriceCalc = $t02629026643._2
645- let amBalance = $t02629026643._3
646- let prBalance = $t02629026643._4
647- let lpEmission = $t02629026643._5
650+ let calcLpAmt = $t02555725910._1
651+ let curPriceCalc = $t02555725910._2
652+ let amBalance = $t02555725910._3
653+ let prBalance = $t02555725910._4
654+ let lpEmission = $t02555725910._5
648655 $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))
649656 }
650657
651658
652659
653660 @Callable(i)
654661 func poolEvaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
655662 let poolAddress = addressFromStringValue(getStringByAddressOrFail(factoryDapp, keyFactoryLpAssetToPoolContractAddress(paymentLpAssetId)))
656663 let res = invoke(poolAddress, "estimateGetOperationWrapperREADONLY", ["", paymentLpAssetId, paymentLpAmt, toString(poolAddress)], nil)
657- let $t02733827755 = match res {
664+ let $t02660527022 = match res {
658665 case _ =>
659666 if (if (if ($isInstanceOf($match0._1, "Int"))
660667 then if ($isInstanceOf($match0._2, "Int"))
661668 then if ($isInstanceOf($match0._5, "Int"))
662669 then if ($isInstanceOf($match0._6, "Int"))
663670 then if ($isInstanceOf($match0._7, "Int"))
664671 then if ($isInstanceOf($match0._8, "String"))
665672 then $isInstanceOf($match0._9, "String")
666673 else false
667674 else false
668675 else false
669676 else false
670677 else false
671678 else false)
672679 then (size($match0) == 10)
673680 else false)
674681 then {
675682 let outAmAmt = $match0._1
676683 let outPrAmt = $match0._2
677684 let amBalance = $match0._5
678685 let prBalance = $match0._6
679686 let lpEmission = $match0._7
680687 let curPrice = $match0._8
681688 let poolStatus = $match0._9
682689 $Tuple7(outAmAmt, outPrAmt, amBalance, prBalance, lpEmission, curPrice, poolStatus)
683690 }
684691 else throw("Couldn't cast types")
685692 }
686- let outAmAmt = $t02733827755._1
687- let outPrAmt = $t02733827755._2
688- let amBalance = $t02733827755._3
689- let prBalance = $t02733827755._4
690- let lpEmission = $t02733827755._5
691- let curPrice = $t02733827755._6
692- let poolStatus = $t02733827755._7
693+ let outAmAmt = $t02660527022._1
694+ let outPrAmt = $t02660527022._2
695+ let amBalance = $t02660527022._3
696+ let prBalance = $t02660527022._4
697+ let lpEmission = $t02660527022._5
698+ let curPrice = $t02660527022._6
699+ let poolStatus = $t02660527022._7
693700 $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), curPrice, poolStatus], SEP))
694701 }
695702
696703
697704
698705 @Callable(i)
699706 func gwxUserInfoREADONLY (userAddress) = {
700707 let gwxUserInfoLIST = asAnyList(invoke(boostingDapp, "gwxUserInfoREADONLY", [userAddress], nil))
701708 let gwxAmount = asInt(gwxUserInfoLIST[0])
702709 $Tuple2(nil, makeString(["%d", toString(gwxAmount)], SEP))
703710 }
704711
705712
706713
707714 @Callable(i)
708715 func unstakeAndGetOneTknV2 (poolAddress,unstakeAmount,outAssetId,minOutAmount) = {
709716 let inv = invoke(addressFromStringValue(poolAddress), "unstakeAndGetOneTknV2", [unstakeAmount, outAssetId, minOutAmount], nil)
710717 if ((inv == inv))
711718 then $Tuple2(nil, unit)
712719 else throw("Strict value is not equal to itself.")
713720 }
714721
715722
716723
717724 @Callable(i)
718725 func getKeysBulkInternal (currentIter,keys,resAcc) = if ((currentIter == size(keys)))
719726 then $Tuple2(nil, resAcc)
720727 else {
721728 let k = split(keys[currentIter], "++")
722729 let addr = addressFromStringValue(k[0])
723730 let key = k[1]
724731 let type = k[2]
725732 let val = getKey(addr, key, type)
726733 let res = (resAcc :+ val)
727734 let inv = invoke(this, "getKeysBulkInternal", [(currentIter + 1), keys, res], nil)
728735 if ((inv == inv))
729736 then $Tuple2(nil, inv)
730737 else throw("Strict value is not equal to itself.")
731738 }
732739
733740
734741
735742 @Callable(i)
736743 func getKeysBulk (keys) = {
737744 let res = invoke(this, "getKeysBulkInternal", [0, keys, nil], nil)
738745 $Tuple2(nil, res)
739746 }
740747
741748
742749
743750 @Callable(i)
744751 func setManager (pendingManagerPublicKey) = {
745752 let checkCaller = mustManager(i)
746753 if ((checkCaller == checkCaller))
747754 then {
748755 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
749756 if ((checkManagerPublicKey == checkManagerPublicKey))
750757 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
751758 else throw("Strict value is not equal to itself.")
752759 }
753760 else throw("Strict value is not equal to itself.")
754761 }
755762
756763
757764
758765 @Callable(i)
759766 func confirmManager () = {
760767 let pm = pendingManagerPublicKeyOrUnit()
761768 let hasPM = if (isDefined(pm))
762769 then true
763770 else throw("No pending manager")
764771 if ((hasPM == hasPM))
765772 then {
766773 let checkPM = if ((i.callerPublicKey == value(pm)))
767774 then true
768775 else throw("You are not pending manager")
769776 if ((checkPM == checkPM))
770777 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
771778 else throw("Strict value is not equal to itself.")
772779 }
773780 else throw("Strict value is not equal to itself.")
774781 }
775782
776783
777784 @Verifier(tx)
778785 func verify () = {
779786 let targetPublicKey = match managerPublicKeyOrUnit() {
780787 case pk: ByteVector =>
781788 pk
782789 case _: Unit =>
783790 tx.senderPublicKey
784791 case _ =>
785792 throw("Match error")
786793 }
787794 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
788795 }
789796

github/deemru/w8io/169f3d6 
151.72 ms