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