tx · GtacQoYKn31UnnwCikGvmvVQaB14g9sQ8qKLYpKu77em 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz: -0.03500000 Waves 2022.06.28 10:12 [2115969] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves
{ "type": 13, "id": "GtacQoYKn31UnnwCikGvmvVQaB14g9sQ8qKLYpKu77em", "fee": 3500000, "feeAssetId": null, "timestamp": 1656400404749, "version": 2, "chainId": 84, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "64XUJpXpByMPozyCEkd49nA33iMRAbufUb6HZiKMs3s3fVg4Etm6Z5kGB57S3pdmntEUKGAqLozYnF7g9zRSDPFE" ], "script": "base64:AAIFAAAAAAAAACcIAhIDCgEIEgMKAQgSABIAEgQKAggBEgMKAQgSBAoCCAgSBAoCCAgAAABPAAAAAAZTQ0FMRTgAAAAAAAAAAAgAAAAABU1VTFQ4AAAAAAAF9eEAAAAAAAdTQ0FMRTE4AAAAAAAAAAASAAAAAAZNVUxUMTgJAAE2AAAAAQAN4Lazp2QAAAAAAAADU0VQAgAAAAJfXwAAAAAOUE9PTFdFSUdIVE1VTFQFAAAABU1VTFQ4AQAAAAlhc0FueUxpc3QAAAABAAAAA3ZhbAQAAAAHJG1hdGNoMAUAAAADdmFsAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAlMaXN0W0FueV0EAAAACnZhbEFueUx5c3QFAAAAByRtYXRjaDAFAAAACnZhbEFueUx5c3QJAAACAAAAAQIAAAAbZmFpbCB0byBjYXN0IGludG8gTGlzdFtBbnldAQAAAAVhc0ludAAAAAEAAAADdmFsBAAAAAckbWF0Y2gwBQAAAAN2YWwDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAAGdmFsSW50BQAAAAckbWF0Y2gwBQAAAA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ZOdk", "height": 2115969, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BRfxWS1rqCjfKpqnQ1SD53wKa8twc6iUWjLGnK1HdyHv Next: 6MoPcRWY5NwUBySF6QGBVA5iE4gcPDiMmtuchjRjyL1x Diff:
Old | New | Differences | |
---|---|---|---|
12 | 12 | let SEP = "__" | |
13 | 13 | ||
14 | 14 | let POOLWEIGHTMULT = MULT8 | |
15 | - | ||
16 | - | let zeroBigInt = toBigInt(0) | |
17 | - | ||
18 | - | let oneBigInt = toBigInt(1) | |
19 | 15 | ||
20 | 16 | func asAnyList (val) = match val { | |
21 | 17 | case valAnyLyst: List[Any] => | |
49 | 45 | } | |
50 | 46 | ||
51 | 47 | ||
52 | - | func getStringOrFail ( | |
48 | + | func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
53 | 49 | ||
54 | 50 | ||
55 | 51 | func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
62 | 58 | ||
63 | 59 | ||
64 | 60 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
65 | - | ||
66 | - | ||
67 | - | func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0"))) | |
68 | - | ||
69 | - | ||
70 | - | func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) { | |
71 | - | case s: String => | |
72 | - | value(parseBigInt(s)) | |
73 | - | case _: Unit => | |
74 | - | defaultVal | |
75 | - | case _ => | |
76 | - | throw("Match error") | |
77 | - | } | |
78 | 61 | ||
79 | 62 | ||
80 | 63 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
172 | 155 | func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP) | |
173 | 156 | ||
174 | 157 | ||
175 | - | func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed | |
158 | + | func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed", "total", lpAssetIdStr], SEP) | |
176 | 159 | ||
177 | 160 | ||
178 | 161 | func readStaked (key) = valueOrElse(getInteger(this, key), 0) | |
226 | 209 | func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount)) | |
227 | 210 | ||
228 | 211 | ||
229 | - | let factoryAddress = getStringOrFail( | |
212 | + | let factoryAddress = getStringOrFail(keyFactoryAddress()) | |
230 | 213 | ||
231 | 214 | let factoryContract = addressFromStringValue(factoryAddress) | |
232 | 215 | ||
236 | 219 | ||
237 | 220 | let boostingContract = getBoostingAddressOrFail(factoryCfg) | |
238 | 221 | ||
239 | - | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == | |
240 | - | then (stakedByUser > | |
222 | + | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == 0)) | |
223 | + | then (stakedByUser > 0) | |
241 | 224 | else false) | |
242 | - | then | |
243 | - | else if ((stakedByUser == | |
225 | + | then 0 | |
226 | + | else if ((stakedByUser == 0)) | |
244 | 227 | then wxPerLpIntegralNew | |
245 | - | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > | |
246 | - | then (stakedByUser > | |
228 | + | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > 0)) | |
229 | + | then (stakedByUser > 0) | |
247 | 230 | else false) | |
248 | - | then | |
231 | + | then getIntOrFail(this, wxPerLpIntegralUserLastKEY) | |
249 | 232 | else throw("calcWxPerLpIntegralUserLast: unexpected state") | |
250 | 233 | ||
251 | 234 | ||
252 | 235 | func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = { | |
253 | 236 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
254 | - | let stakedTotal = toBigInt(readStaked(stakedTotalKEY)) | |
255 | - | let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt)) | |
256 | - | then oneBigInt | |
257 | - | else stakedTotal | |
237 | + | let stakedTotal = readStaked(stakedTotalKEY) | |
258 | 238 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
259 | 239 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
260 | 240 | let MULT3 = 1000 | |
264 | 244 | let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr) | |
265 | 245 | let wxPerLpKEY = keyWxPerLp(lpAssetIdStr) | |
266 | 246 | let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock) | |
267 | - | let wxPerLpIntegral = | |
247 | + | let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY) | |
268 | 248 | let wxPerLpOrZeroX3 = 0 | |
269 | 249 | let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0]) | |
270 | 250 | let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0)) | |
271 | - | then toBigInt(wxPerLpOrZeroX3) | |
272 | - | else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal) | |
273 | - | let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount)) | |
274 | - | let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt)) | |
275 | - | then oneBigInt | |
276 | - | else stakedTotalNew | |
277 | - | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh))) | |
278 | - | let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew) | |
251 | + | then wxPerLpOrZeroX3 | |
252 | + | else fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal) | |
253 | + | let stakedTotalNew = (stakedTotal + lpDeltaAmount) | |
254 | + | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * dh)) | |
255 | + | let wxPerLpX3New = (poolWxEmissionPerBlockX3 / stakedTotalNew) | |
279 | 256 | let wxPerLpIntegralLastUpdHeightNew = height | |
280 | - | let debug = makeString([toString(wxPerLpIntegralNew), | |
281 | - | $Tuple3(wxPerLpIntegralNew, [ | |
257 | + | let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::") | |
258 | + | $Tuple3(wxPerLpIntegralNew, [IntegerEntry(wxPerLpIntegralKEY, wxPerLpIntegralNew), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), IntegerEntry(wxPerLpKEY, wxPerLpX3New)], debug) | |
282 | 259 | } | |
283 | 260 | ||
284 | 261 | ||
285 | 262 | func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = { | |
286 | - | let $ | |
287 | - | let wxPerLpIntegralNew = $ | |
288 | - | let poolIntegralSTATE = $ | |
289 | - | let poolDEBUG = $ | |
263 | + | let $t01057910701 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount) | |
264 | + | let wxPerLpIntegralNew = $t01057910701._1 | |
265 | + | let poolIntegralSTATE = $t01057910701._2 | |
266 | + | let poolDEBUG = $t01057910701._3 | |
290 | 267 | let MULT3 = 1000 | |
291 | 268 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
292 | 269 | let stakedByUser = readStaked(stakedByUserKEY) | |
293 | 270 | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
294 | 271 | let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr) | |
295 | 272 | let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr) | |
296 | - | let wxToClaimUser = | |
273 | + | let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY) | |
297 | 274 | let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY) | |
298 | - | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
299 | - | let MULT11 = (MULT8 * MULT3) | |
300 | - | let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))) | |
275 | + | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(stakedByUser, wxPerLpIntegralUserLastUpdHeightOrZero, wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
276 | + | let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, (MULT8 * MULT3))) | |
301 | 277 | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
302 | 278 | let wxPerLpIntegralUserLastUpdHeightNew = height | |
303 | - | let debug = makeString([ | |
304 | - | $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [ | |
279 | + | let debug = makeString([toString(wxToClaimUserNew), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::") | |
280 | + | $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [IntegerEntry(wxToClaimUserKEY, wxToClaimUserNew), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), IntegerEntry(wxPerLpIntegralUserLastKEY, wxPerLpIntegralUserLastNew)]), debug) | |
305 | 281 | } | |
306 | 282 | ||
307 | 283 | ||
414 | 390 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
415 | 391 | let stakedByUser = readStaked(stakedByUserKEY) | |
416 | 392 | let stakedTotal = readStaked(stakedTotalKEY) | |
417 | - | let $ | |
418 | - | let wxToClaimUserNew = $ | |
419 | - | let integralSTATE = $ | |
420 | - | let debug = $ | |
393 | + | let $t01516415281 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
394 | + | let wxToClaimUserNew = $t01516415281._1 | |
395 | + | let integralSTATE = $t01516415281._2 | |
396 | + | let debug = $t01516415281._3 | |
421 | 397 | ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
422 | 398 | } | |
423 | 399 | ||
438 | 414 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
439 | 415 | let stakedByUser = readStaked(stakedByUserKEY) | |
440 | 416 | let stakedTotal = readStaked(stakedTotalKEY) | |
441 | - | let $ | |
442 | - | let wxToClaimUserNew = $ | |
443 | - | let integralSTATE = $ | |
444 | - | let debug = $ | |
417 | + | let $t01641816536 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount)) | |
418 | + | let wxToClaimUserNew = $t01641816536._1 | |
419 | + | let integralSTATE = $t01641816536._2 | |
420 | + | let debug = $t01641816536._3 | |
445 | 421 | if ((amount > stakedByUser)) | |
446 | 422 | then throw("passed amount is less then available") | |
447 | 423 | else ([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
458 | 434 | let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr) | |
459 | 435 | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
460 | 436 | let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr) | |
461 | - | let claimedByUser = | |
462 | - | let claimedByUserMinReward = | |
463 | - | let claimedByUserBoostReward = | |
464 | - | let claimedTotal = | |
465 | - | let $ | |
466 | - | let wxToClaimUserNew = $ | |
467 | - | let integralSTATE = $ | |
468 | - | let debug = $ | |
437 | + | let claimedByUser = getIntOrZero(this, claimedByUserKEY) | |
438 | + | let claimedByUserMinReward = getIntOrZero(this, claimedByUserMinRewardKEY) | |
439 | + | let claimedByUserBoostReward = getIntOrZero(this, claimedByUserBoostRewardKEY) | |
440 | + | let claimedTotal = getIntOrZero(this, claimedTotalKEY) | |
441 | + | let $t01772817840 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
442 | + | let wxToClaimUserNew = $t01772817840._1 | |
443 | + | let integralSTATE = $t01772817840._2 | |
444 | + | let debug = $t01772817840._3 | |
469 | 445 | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
470 | - | if (( | |
446 | + | if ((0 >= availableToClaim)) | |
471 | 447 | then throw("nothing to claim") | |
472 | 448 | else { | |
473 | 449 | let wxAmountBoostTotal = asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]) | |
474 | 450 | let minRewardPart = availableToClaim | |
475 | - | let boostRewardPart = min([(minRewardPart * | |
476 | - | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [ | |
477 | - | let emitBoost = asAnyList(invoke(emissionContract, "emit", [ | |
451 | + | let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal]) | |
452 | + | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [minRewardPart], nil))[0]) | |
453 | + | let emitBoost = asAnyList(invoke(emissionContract, "emit", [boostRewardPart], nil)) | |
478 | 454 | if ((emitBoost == emitBoost)) | |
479 | - | then { | |
480 | - | let claimedByUserValue = (claimedByUser + availableToClaim) | |
481 | - | let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart) | |
482 | - | let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserMinReward + minRewardPart) | |
483 | - | let claimedTotalPlusAvailableToClaim = (claimedByUserMinReward + minRewardPart) | |
484 | - | [StringEntry(claimedByUserKEY, toString(claimedByUserValue)), StringEntry(claimedByUserMinRewardKEY, toString(claimedByUserMinRewardPlusPart)), StringEntry(claimedByUserBoostRewardKEY, toString(claimedByUserBoostRewardPlusBoostRewardPart)), StringEntry(claimedTotalKEY, toString(claimedTotalPlusAvailableToClaim)), ScriptTransfer(userAddress, toInt(minRewardPart), wxAssetId), ScriptTransfer(userAddress, toInt(boostRewardPart), wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, toInt(availableToClaim), i.transactionId)] | |
485 | - | } | |
455 | + | then [IntegerEntry(claimedByUserKEY, (claimedByUser + availableToClaim)), IntegerEntry(claimedByUserMinRewardKEY, (claimedByUserMinReward + minRewardPart)), IntegerEntry(claimedByUserBoostRewardKEY, (claimedByUserBoostReward + boostRewardPart)), IntegerEntry(claimedTotalKEY, (claimedTotal + availableToClaim)), ScriptTransfer(userAddress, minRewardPart, wxAssetId), ScriptTransfer(userAddress, boostRewardPart, wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, availableToClaim, i.transactionId)] | |
486 | 456 | else throw("Strict value is not equal to itself.") | |
487 | 457 | } | |
488 | 458 | } | |
506 | 476 | else (height - emissionStartBlock) | |
507 | 477 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
508 | 478 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
509 | - | let $ | |
510 | - | let wxToClaimUserNew = $ | |
511 | - | let integralSTATE = $ | |
512 | - | let debug = $ | |
513 | - | let availableToClaim = (wxToClaimUserNew - | |
479 | + | let $t02004120153 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
480 | + | let wxToClaimUserNew = $t02004120153._1 | |
481 | + | let integralSTATE = $t02004120153._2 | |
482 | + | let debug = $t02004120153._3 | |
483 | + | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
514 | 484 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
515 | 485 | let wxAmountBoostTotal = asInt(boostInvResult[0]) | |
516 | 486 | let boostDebug = asString(boostInvResult[1]) | |
517 | 487 | let minRewardPart = availableToClaim | |
518 | - | let boostRewardPart = min([(minRewardPart * | |
488 | + | let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal]) | |
519 | 489 | let totalReward = (minRewardPart + boostRewardPart) | |
520 | 490 | $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), ((((debug + "::") + toString(userWxReward)) + "::BOOSTDEBUG::") + boostDebug)], SEP)) | |
521 | 491 | } | |
526 | 496 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
527 | 497 | then throw("permissions denied") | |
528 | 498 | else { | |
529 | - | let $ | |
530 | - | let wxPerLpIntegralNew = $ | |
531 | - | let poolIntegralSTATE = $ | |
532 | - | let poolDEBUG = $ | |
499 | + | let $t02103321143 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
500 | + | let wxPerLpIntegralNew = $t02103321143._1 | |
501 | + | let poolIntegralSTATE = $t02103321143._2 | |
502 | + | let poolDEBUG = $t02103321143._3 | |
533 | 503 | poolIntegralSTATE | |
534 | 504 | } | |
535 | 505 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
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 | - | ||
16 | - | let zeroBigInt = toBigInt(0) | |
17 | - | ||
18 | - | let oneBigInt = toBigInt(1) | |
19 | 15 | ||
20 | 16 | func asAnyList (val) = match val { | |
21 | 17 | case valAnyLyst: List[Any] => | |
22 | 18 | valAnyLyst | |
23 | 19 | case _ => | |
24 | 20 | throw("fail to cast into List[Any]") | |
25 | 21 | } | |
26 | 22 | ||
27 | 23 | ||
28 | 24 | func asInt (val) = match val { | |
29 | 25 | case valInt: Int => | |
30 | 26 | valInt | |
31 | 27 | case _ => | |
32 | 28 | throw("fail to cast into Int") | |
33 | 29 | } | |
34 | 30 | ||
35 | 31 | ||
36 | 32 | func asString (val) = match val { | |
37 | 33 | case valStr: String => | |
38 | 34 | valStr | |
39 | 35 | case _ => | |
40 | 36 | throw("fail to cast into Int") | |
41 | 37 | } | |
42 | 38 | ||
43 | 39 | ||
44 | 40 | func asByteVector (val) = match val { | |
45 | 41 | case valBin: ByteVector => | |
46 | 42 | valBin | |
47 | 43 | case _ => | |
48 | 44 | throw("fail to cast into Int") | |
49 | 45 | } | |
50 | 46 | ||
51 | 47 | ||
52 | - | func getStringOrFail ( | |
48 | + | func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
53 | 49 | ||
54 | 50 | ||
55 | 51 | func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
56 | 52 | ||
57 | 53 | ||
58 | 54 | func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0) | |
59 | 55 | ||
60 | 56 | ||
61 | 57 | func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal) | |
62 | 58 | ||
63 | 59 | ||
64 | 60 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
65 | - | ||
66 | - | ||
67 | - | func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0"))) | |
68 | - | ||
69 | - | ||
70 | - | func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) { | |
71 | - | case s: String => | |
72 | - | value(parseBigInt(s)) | |
73 | - | case _: Unit => | |
74 | - | defaultVal | |
75 | - | case _ => | |
76 | - | throw("Match error") | |
77 | - | } | |
78 | 61 | ||
79 | 62 | ||
80 | 63 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
81 | 64 | ||
82 | 65 | ||
83 | 66 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18)) | |
84 | 67 | ||
85 | 68 | ||
86 | 69 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
87 | 70 | ||
88 | 71 | ||
89 | 72 | let IdxFactoryCfgStakingDapp = 1 | |
90 | 73 | ||
91 | 74 | let IdxFactoryCfgBoostingDapp = 2 | |
92 | 75 | ||
93 | 76 | let IdxFactoryCfgIdoDapp = 3 | |
94 | 77 | ||
95 | 78 | let IdxFactoryCfgTeamDapp = 4 | |
96 | 79 | ||
97 | 80 | let IdxFactoryCfgEmissionDapp = 5 | |
98 | 81 | ||
99 | 82 | let IdxFactoryCfgRestDapp = 6 | |
100 | 83 | ||
101 | 84 | let IdxFactoryCfgSlippageDapp = 7 | |
102 | 85 | ||
103 | 86 | func keyFactoryCfg () = "%s__factoryConfig" | |
104 | 87 | ||
105 | 88 | ||
106 | 89 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
107 | 90 | ||
108 | 91 | ||
109 | 92 | func keyMigratorPublicKey () = "%s__migratorPublicKey" | |
110 | 93 | ||
111 | 94 | ||
112 | 95 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
113 | 96 | ||
114 | 97 | ||
115 | 98 | func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr" | |
116 | 99 | ||
117 | 100 | ||
118 | 101 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
119 | 102 | ||
120 | 103 | ||
121 | 104 | func keyFactoryLpList () = "%s__lpTokensList" | |
122 | 105 | ||
123 | 106 | ||
124 | 107 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
125 | 108 | ||
126 | 109 | ||
127 | 110 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
128 | 111 | ||
129 | 112 | ||
130 | 113 | func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP) | |
131 | 114 | ||
132 | 115 | ||
133 | 116 | func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP) | |
134 | 117 | ||
135 | 118 | ||
136 | 119 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
137 | 120 | ||
138 | 121 | ||
139 | 122 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
140 | 123 | ||
141 | 124 | ||
142 | 125 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
143 | 126 | ||
144 | 127 | ||
145 | 128 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
146 | 129 | ||
147 | 130 | ||
148 | 131 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
149 | 132 | ||
150 | 133 | ||
151 | 134 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
152 | 135 | ||
153 | 136 | ||
154 | 137 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
155 | 138 | ||
156 | 139 | ||
157 | 140 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
158 | 141 | ||
159 | 142 | ||
160 | 143 | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP) | |
161 | 144 | ||
162 | 145 | ||
163 | 146 | func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr) | |
164 | 147 | ||
165 | 148 | ||
166 | 149 | func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP) | |
167 | 150 | ||
168 | 151 | ||
169 | 152 | func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP) | |
170 | 153 | ||
171 | 154 | ||
172 | 155 | func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP) | |
173 | 156 | ||
174 | 157 | ||
175 | - | func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed | |
158 | + | func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed", "total", lpAssetIdStr], SEP) | |
176 | 159 | ||
177 | 160 | ||
178 | 161 | func readStaked (key) = valueOrElse(getInteger(this, key), 0) | |
179 | 162 | ||
180 | 163 | ||
181 | 164 | func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP) | |
182 | 165 | ||
183 | 166 | ||
184 | 167 | func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP) | |
185 | 168 | ||
186 | 169 | ||
187 | 170 | func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP) | |
188 | 171 | ||
189 | 172 | ||
190 | 173 | func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP) | |
191 | 174 | ||
192 | 175 | ||
193 | 176 | func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP) | |
194 | 177 | ||
195 | 178 | ||
196 | 179 | func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP) | |
197 | 180 | ||
198 | 181 | ||
199 | 182 | func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP) | |
200 | 183 | ||
201 | 184 | ||
202 | 185 | func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP) | |
203 | 186 | ||
204 | 187 | ||
205 | 188 | func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP) | |
206 | 189 | ||
207 | 190 | ||
208 | 191 | func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP) | |
209 | 192 | ||
210 | 193 | ||
211 | 194 | func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP) | |
212 | 195 | ||
213 | 196 | ||
214 | 197 | func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP) | |
215 | 198 | ||
216 | 199 | ||
217 | 200 | func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP) | |
218 | 201 | ||
219 | 202 | ||
220 | 203 | func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP) | |
221 | 204 | ||
222 | 205 | ||
223 | 206 | func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP) | |
224 | 207 | ||
225 | 208 | ||
226 | 209 | func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount)) | |
227 | 210 | ||
228 | 211 | ||
229 | - | let factoryAddress = getStringOrFail( | |
212 | + | let factoryAddress = getStringOrFail(keyFactoryAddress()) | |
230 | 213 | ||
231 | 214 | let factoryContract = addressFromStringValue(factoryAddress) | |
232 | 215 | ||
233 | 216 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
234 | 217 | ||
235 | 218 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
236 | 219 | ||
237 | 220 | let boostingContract = getBoostingAddressOrFail(factoryCfg) | |
238 | 221 | ||
239 | - | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == | |
240 | - | then (stakedByUser > | |
222 | + | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == 0)) | |
223 | + | then (stakedByUser > 0) | |
241 | 224 | else false) | |
242 | - | then | |
243 | - | else if ((stakedByUser == | |
225 | + | then 0 | |
226 | + | else if ((stakedByUser == 0)) | |
244 | 227 | then wxPerLpIntegralNew | |
245 | - | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > | |
246 | - | then (stakedByUser > | |
228 | + | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > 0)) | |
229 | + | then (stakedByUser > 0) | |
247 | 230 | else false) | |
248 | - | then | |
231 | + | then getIntOrFail(this, wxPerLpIntegralUserLastKEY) | |
249 | 232 | else throw("calcWxPerLpIntegralUserLast: unexpected state") | |
250 | 233 | ||
251 | 234 | ||
252 | 235 | func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = { | |
253 | 236 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
254 | - | let stakedTotal = toBigInt(readStaked(stakedTotalKEY)) | |
255 | - | let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt)) | |
256 | - | then oneBigInt | |
257 | - | else stakedTotal | |
237 | + | let stakedTotal = readStaked(stakedTotalKEY) | |
258 | 238 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
259 | 239 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
260 | 240 | let MULT3 = 1000 | |
261 | 241 | let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3) | |
262 | 242 | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3)) | |
263 | 243 | let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr) | |
264 | 244 | let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr) | |
265 | 245 | let wxPerLpKEY = keyWxPerLp(lpAssetIdStr) | |
266 | 246 | let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock) | |
267 | - | let wxPerLpIntegral = | |
247 | + | let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY) | |
268 | 248 | let wxPerLpOrZeroX3 = 0 | |
269 | 249 | let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0]) | |
270 | 250 | let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0)) | |
271 | - | then toBigInt(wxPerLpOrZeroX3) | |
272 | - | else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal) | |
273 | - | let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount)) | |
274 | - | let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt)) | |
275 | - | then oneBigInt | |
276 | - | else stakedTotalNew | |
277 | - | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh))) | |
278 | - | let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew) | |
251 | + | then wxPerLpOrZeroX3 | |
252 | + | else fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal) | |
253 | + | let stakedTotalNew = (stakedTotal + lpDeltaAmount) | |
254 | + | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * dh)) | |
255 | + | let wxPerLpX3New = (poolWxEmissionPerBlockX3 / stakedTotalNew) | |
279 | 256 | let wxPerLpIntegralLastUpdHeightNew = height | |
280 | - | let debug = makeString([toString(wxPerLpIntegralNew), | |
281 | - | $Tuple3(wxPerLpIntegralNew, [ | |
257 | + | let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::") | |
258 | + | $Tuple3(wxPerLpIntegralNew, [IntegerEntry(wxPerLpIntegralKEY, wxPerLpIntegralNew), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), IntegerEntry(wxPerLpKEY, wxPerLpX3New)], debug) | |
282 | 259 | } | |
283 | 260 | ||
284 | 261 | ||
285 | 262 | func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = { | |
286 | - | let $ | |
287 | - | let wxPerLpIntegralNew = $ | |
288 | - | let poolIntegralSTATE = $ | |
289 | - | let poolDEBUG = $ | |
263 | + | let $t01057910701 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount) | |
264 | + | let wxPerLpIntegralNew = $t01057910701._1 | |
265 | + | let poolIntegralSTATE = $t01057910701._2 | |
266 | + | let poolDEBUG = $t01057910701._3 | |
290 | 267 | let MULT3 = 1000 | |
291 | 268 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
292 | 269 | let stakedByUser = readStaked(stakedByUserKEY) | |
293 | 270 | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
294 | 271 | let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr) | |
295 | 272 | let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr) | |
296 | - | let wxToClaimUser = | |
273 | + | let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY) | |
297 | 274 | let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY) | |
298 | - | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
299 | - | let MULT11 = (MULT8 * MULT3) | |
300 | - | let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))) | |
275 | + | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(stakedByUser, wxPerLpIntegralUserLastUpdHeightOrZero, wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
276 | + | let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, (MULT8 * MULT3))) | |
301 | 277 | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
302 | 278 | let wxPerLpIntegralUserLastUpdHeightNew = height | |
303 | - | let debug = makeString([ | |
304 | - | $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [ | |
279 | + | let debug = makeString([toString(wxToClaimUserNew), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::") | |
280 | + | $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [IntegerEntry(wxToClaimUserKEY, wxToClaimUserNew), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), IntegerEntry(wxPerLpIntegralUserLastKEY, wxPerLpIntegralUserLastNew)]), debug) | |
305 | 281 | } | |
306 | 282 | ||
307 | 283 | ||
308 | 284 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
309 | 285 | case s: String => | |
310 | 286 | fromBase58String(s) | |
311 | 287 | case _: Unit => | |
312 | 288 | unit | |
313 | 289 | case _ => | |
314 | 290 | throw("Match error") | |
315 | 291 | } | |
316 | 292 | ||
317 | 293 | ||
318 | 294 | func migratorPublicKeyOrUnit () = match getString(keyMigratorPublicKey()) { | |
319 | 295 | case s: String => | |
320 | 296 | fromBase58String(s) | |
321 | 297 | case _: Unit => | |
322 | 298 | unit | |
323 | 299 | case _ => | |
324 | 300 | throw("Match error") | |
325 | 301 | } | |
326 | 302 | ||
327 | 303 | ||
328 | 304 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
329 | 305 | case s: String => | |
330 | 306 | fromBase58String(s) | |
331 | 307 | case _: Unit => | |
332 | 308 | unit | |
333 | 309 | case _ => | |
334 | 310 | throw("Match error") | |
335 | 311 | } | |
336 | 312 | ||
337 | 313 | ||
338 | 314 | func mustManager (i) = { | |
339 | 315 | let pd = throw("Permission denied") | |
340 | 316 | match managerPublicKeyOrUnit() { | |
341 | 317 | case pk: ByteVector => | |
342 | 318 | if ((i.callerPublicKey == pk)) | |
343 | 319 | then true | |
344 | 320 | else pd | |
345 | 321 | case _: Unit => | |
346 | 322 | if ((i.caller == this)) | |
347 | 323 | then true | |
348 | 324 | else pd | |
349 | 325 | case _ => | |
350 | 326 | throw("Match error") | |
351 | 327 | } | |
352 | 328 | } | |
353 | 329 | ||
354 | 330 | ||
355 | 331 | @Callable(i) | |
356 | 332 | func constructor (factoryAddressStr) = { | |
357 | 333 | let checkCaller = mustManager(i) | |
358 | 334 | if ((checkCaller == checkCaller)) | |
359 | 335 | then [StringEntry(keyFactoryAddress(), factoryAddressStr)] | |
360 | 336 | else throw("Strict value is not equal to itself.") | |
361 | 337 | } | |
362 | 338 | ||
363 | 339 | ||
364 | 340 | ||
365 | 341 | @Callable(i) | |
366 | 342 | func setManager (pendingManagerPublicKey) = { | |
367 | 343 | let checkCaller = mustManager(i) | |
368 | 344 | if ((checkCaller == checkCaller)) | |
369 | 345 | then { | |
370 | 346 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
371 | 347 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
372 | 348 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
373 | 349 | else throw("Strict value is not equal to itself.") | |
374 | 350 | } | |
375 | 351 | else throw("Strict value is not equal to itself.") | |
376 | 352 | } | |
377 | 353 | ||
378 | 354 | ||
379 | 355 | ||
380 | 356 | @Callable(i) | |
381 | 357 | func confirmManager () = { | |
382 | 358 | let pm = pendingManagerPublicKeyOrUnit() | |
383 | 359 | let hasPM = if (isDefined(pm)) | |
384 | 360 | then true | |
385 | 361 | else throw("No pending manager") | |
386 | 362 | if ((hasPM == hasPM)) | |
387 | 363 | then { | |
388 | 364 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
389 | 365 | then true | |
390 | 366 | else throw("You are not pending manager") | |
391 | 367 | if ((checkPM == checkPM)) | |
392 | 368 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
393 | 369 | else throw("Strict value is not equal to itself.") | |
394 | 370 | } | |
395 | 371 | else throw("Strict value is not equal to itself.") | |
396 | 372 | } | |
397 | 373 | ||
398 | 374 | ||
399 | 375 | ||
400 | 376 | @Callable(i) | |
401 | 377 | func stake () = if ((size(i.payments) != 1)) | |
402 | 378 | then throw("invalid payment - exact one payment must be attached") | |
403 | 379 | else { | |
404 | 380 | let pmt = i.payments[0] | |
405 | 381 | let lpAssetId = value(pmt.assetId) | |
406 | 382 | let lpAssetIdStr = toBase58String(lpAssetId) | |
407 | 383 | let amount = pmt.amount | |
408 | 384 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
409 | 385 | let callerStr = toString(i.caller) | |
410 | 386 | let userAddressStr = if ((callerStr == poolAddressStr)) | |
411 | 387 | then toString(i.originCaller) | |
412 | 388 | else callerStr | |
413 | 389 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
414 | 390 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
415 | 391 | let stakedByUser = readStaked(stakedByUserKEY) | |
416 | 392 | let stakedTotal = readStaked(stakedTotalKEY) | |
417 | - | let $ | |
418 | - | let wxToClaimUserNew = $ | |
419 | - | let integralSTATE = $ | |
420 | - | let debug = $ | |
393 | + | let $t01516415281 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
394 | + | let wxToClaimUserNew = $t01516415281._1 | |
395 | + | let integralSTATE = $t01516415281._2 | |
396 | + | let debug = $t01516415281._3 | |
421 | 397 | ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
422 | 398 | } | |
423 | 399 | ||
424 | 400 | ||
425 | 401 | ||
426 | 402 | @Callable(i) | |
427 | 403 | func unstake (lpAssetIdStr,amount) = { | |
428 | 404 | let lpAssetId = fromBase58String(lpAssetIdStr) | |
429 | 405 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
430 | 406 | let poolAddon = valueOrElse(getString(this, keyStablePoolAddonAddr()), poolAddressStr) | |
431 | 407 | let callerStr = toString(i.caller) | |
432 | 408 | let userAddressStr = if (if ((callerStr == poolAddressStr)) | |
433 | 409 | then true | |
434 | 410 | else (callerStr == poolAddon)) | |
435 | 411 | then toString(i.originCaller) | |
436 | 412 | else callerStr | |
437 | 413 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
438 | 414 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
439 | 415 | let stakedByUser = readStaked(stakedByUserKEY) | |
440 | 416 | let stakedTotal = readStaked(stakedTotalKEY) | |
441 | - | let $ | |
442 | - | let wxToClaimUserNew = $ | |
443 | - | let integralSTATE = $ | |
444 | - | let debug = $ | |
417 | + | let $t01641816536 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount)) | |
418 | + | let wxToClaimUserNew = $t01641816536._1 | |
419 | + | let integralSTATE = $t01641816536._2 | |
420 | + | let debug = $t01641816536._3 | |
445 | 421 | if ((amount > stakedByUser)) | |
446 | 422 | then throw("passed amount is less then available") | |
447 | 423 | else ([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
448 | 424 | } | |
449 | 425 | ||
450 | 426 | ||
451 | 427 | ||
452 | 428 | @Callable(i) | |
453 | 429 | func claimWx (lpAssetIdStr) = { | |
454 | 430 | let userAddress = i.caller | |
455 | 431 | let userAddressStr = toString(i.caller) | |
456 | 432 | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
457 | 433 | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
458 | 434 | let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr) | |
459 | 435 | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
460 | 436 | let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr) | |
461 | - | let claimedByUser = | |
462 | - | let claimedByUserMinReward = | |
463 | - | let claimedByUserBoostReward = | |
464 | - | let claimedTotal = | |
465 | - | let $ | |
466 | - | let wxToClaimUserNew = $ | |
467 | - | let integralSTATE = $ | |
468 | - | let debug = $ | |
437 | + | let claimedByUser = getIntOrZero(this, claimedByUserKEY) | |
438 | + | let claimedByUserMinReward = getIntOrZero(this, claimedByUserMinRewardKEY) | |
439 | + | let claimedByUserBoostReward = getIntOrZero(this, claimedByUserBoostRewardKEY) | |
440 | + | let claimedTotal = getIntOrZero(this, claimedTotalKEY) | |
441 | + | let $t01772817840 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
442 | + | let wxToClaimUserNew = $t01772817840._1 | |
443 | + | let integralSTATE = $t01772817840._2 | |
444 | + | let debug = $t01772817840._3 | |
469 | 445 | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
470 | - | if (( | |
446 | + | if ((0 >= availableToClaim)) | |
471 | 447 | then throw("nothing to claim") | |
472 | 448 | else { | |
473 | 449 | let wxAmountBoostTotal = asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]) | |
474 | 450 | let minRewardPart = availableToClaim | |
475 | - | let boostRewardPart = min([(minRewardPart * | |
476 | - | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [ | |
477 | - | let emitBoost = asAnyList(invoke(emissionContract, "emit", [ | |
451 | + | let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal]) | |
452 | + | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [minRewardPart], nil))[0]) | |
453 | + | let emitBoost = asAnyList(invoke(emissionContract, "emit", [boostRewardPart], nil)) | |
478 | 454 | if ((emitBoost == emitBoost)) | |
479 | - | then { | |
480 | - | let claimedByUserValue = (claimedByUser + availableToClaim) | |
481 | - | let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart) | |
482 | - | let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserMinReward + minRewardPart) | |
483 | - | let claimedTotalPlusAvailableToClaim = (claimedByUserMinReward + minRewardPart) | |
484 | - | [StringEntry(claimedByUserKEY, toString(claimedByUserValue)), StringEntry(claimedByUserMinRewardKEY, toString(claimedByUserMinRewardPlusPart)), StringEntry(claimedByUserBoostRewardKEY, toString(claimedByUserBoostRewardPlusBoostRewardPart)), StringEntry(claimedTotalKEY, toString(claimedTotalPlusAvailableToClaim)), ScriptTransfer(userAddress, toInt(minRewardPart), wxAssetId), ScriptTransfer(userAddress, toInt(boostRewardPart), wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, toInt(availableToClaim), i.transactionId)] | |
485 | - | } | |
455 | + | then [IntegerEntry(claimedByUserKEY, (claimedByUser + availableToClaim)), IntegerEntry(claimedByUserMinRewardKEY, (claimedByUserMinReward + minRewardPart)), IntegerEntry(claimedByUserBoostRewardKEY, (claimedByUserBoostReward + boostRewardPart)), IntegerEntry(claimedTotalKEY, (claimedTotal + availableToClaim)), ScriptTransfer(userAddress, minRewardPart, wxAssetId), ScriptTransfer(userAddress, boostRewardPart, wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, availableToClaim, i.transactionId)] | |
486 | 456 | else throw("Strict value is not equal to itself.") | |
487 | 457 | } | |
488 | 458 | } | |
489 | 459 | ||
490 | 460 | ||
491 | 461 | ||
492 | 462 | @Callable(i) | |
493 | 463 | func claimWxREADONLY (lpAssetIdStr,userAddressStr) = { | |
494 | 464 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
495 | 465 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
496 | 466 | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
497 | 467 | let stakedByUser = readStaked(stakedByUserKEY) | |
498 | 468 | let stakedTotal = readStaked(stakedTotalKEY) | |
499 | 469 | let claimedByUser = getIntOrZero(this, claimedByUserKEY) | |
500 | 470 | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
501 | 471 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
502 | 472 | let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) | |
503 | 473 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
504 | 474 | let passedBlocks = if ((emissionStartBlock > height)) | |
505 | 475 | then 0 | |
506 | 476 | else (height - emissionStartBlock) | |
507 | 477 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
508 | 478 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
509 | - | let $ | |
510 | - | let wxToClaimUserNew = $ | |
511 | - | let integralSTATE = $ | |
512 | - | let debug = $ | |
513 | - | let availableToClaim = (wxToClaimUserNew - | |
479 | + | let $t02004120153 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
480 | + | let wxToClaimUserNew = $t02004120153._1 | |
481 | + | let integralSTATE = $t02004120153._2 | |
482 | + | let debug = $t02004120153._3 | |
483 | + | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
514 | 484 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
515 | 485 | let wxAmountBoostTotal = asInt(boostInvResult[0]) | |
516 | 486 | let boostDebug = asString(boostInvResult[1]) | |
517 | 487 | let minRewardPart = availableToClaim | |
518 | - | let boostRewardPart = min([(minRewardPart * | |
488 | + | let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal]) | |
519 | 489 | let totalReward = (minRewardPart + boostRewardPart) | |
520 | 490 | $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), ((((debug + "::") + toString(userWxReward)) + "::BOOSTDEBUG::") + boostDebug)], SEP)) | |
521 | 491 | } | |
522 | 492 | ||
523 | 493 | ||
524 | 494 | ||
525 | 495 | @Callable(i) | |
526 | 496 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
527 | 497 | then throw("permissions denied") | |
528 | 498 | else { | |
529 | - | let $ | |
530 | - | let wxPerLpIntegralNew = $ | |
531 | - | let poolIntegralSTATE = $ | |
532 | - | let poolDEBUG = $ | |
499 | + | let $t02103321143 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
500 | + | let wxPerLpIntegralNew = $t02103321143._1 | |
501 | + | let poolIntegralSTATE = $t02103321143._2 | |
502 | + | let poolDEBUG = $t02103321143._3 | |
533 | 503 | poolIntegralSTATE | |
534 | 504 | } | |
535 | 505 | ||
536 | 506 | ||
537 | 507 | @Verifier(tx) | |
538 | 508 | func verify () = { | |
539 | 509 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
540 | 510 | case pk: ByteVector => | |
541 | 511 | pk | |
542 | 512 | case _: Unit => | |
543 | 513 | tx.senderPublicKey | |
544 | 514 | case _ => | |
545 | 515 | throw("Match error") | |
546 | 516 | } | |
547 | 517 | let migratorPublicKey = match migratorPublicKeyOrUnit() { | |
548 | 518 | case pk: ByteVector => | |
549 | 519 | pk | |
550 | 520 | case _: Unit => | |
551 | 521 | tx.senderPublicKey | |
552 | 522 | case _ => | |
553 | 523 | throw("Match error") | |
554 | 524 | } | |
555 | 525 | if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)) | |
556 | 526 | then true | |
557 | 527 | else sigVerify(tx.bodyBytes, tx.proofs[0], migratorPublicKey) | |
558 | 528 | } | |
559 | 529 |
github/deemru/w8io/fabc49c 82.08 ms ◑