tx · 4ja9B4yvtWjQSx7fWucT3m5KYMRU4g5Mj9ffigvmEpAc 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz: -0.02900000 Waves 2022.06.29 14:50 [2117692] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves
{ "type": 13, "id": "4ja9B4yvtWjQSx7fWucT3m5KYMRU4g5Mj9ffigvmEpAc", "fee": 2900000, "feeAssetId": null, "timestamp": 1656503532908, "version": 1, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "t46KRagzEZUXFVPKMC71HaL4DB5s9coApZ2ML8qUKsMt6MdCRAXAtUmdSo8iPViQ3vBR1f8UQHG8r97JHwgSTN9" ], "script": "base64:BgI3CAISAwoBCBIDCgEIEgMKAQgSABIAEgQKAggBEgMKAQgSBAoCCAgSBAoCCAgSAwoBCBIECgIICF8ABlNDQUxFOAAIAAVNVUxUOACAwtcvAAdTQ0FMRTE4ABIABk1VTFQxOAkAtgIBAICAkLu61q3wDQADU0VQAgJfXwAOUE9PTFdFSUdIVE1VTFQFBU1VTFQ4AAp6ZXJvQmlnSW50CQC2AgEAAAAJb25lQmlnSW50CQC2AgEAAQEJYXNBbnlMaXN0AQN2YWwEByRtYXRjaDAFA3ZhbAMJAAECBQckbWF0Y2gwAglMaXN0W0FueV0ECnZhbEFueUx5c3QFByRtYXRjaDAFCnZhbEFueUx5c3QJAAIBAhtmYWlsIHRvIGNhc3QgaW50byBMaXN0W0FueV0BBWFzSW50AQN2YWwEByRtYXRjaDAFA3ZhbAMJAAECBQckbWF0Y2gwAgNJbnQEBnZhbEludAUHJG1hdGNoMAUGdmFsSW50CQACAQIVZmFpbCB0byBjYXN0IGludG8gSW50AQhhc1N0cmluZwEDdmFsBAckbWF0Y2gwBQN2YWwDCQABAgUHJG1hdGNoMAIGU3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RjaDAJARZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAJwawUHJG1hdGNoMAUCcGsDCQABAgUHJG1hdGNoMAIEVW5pdAgFAnR4D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yBBFtaWdyYXRvclB1YmxpY0tleQQHJG1hdGNoMAkBF21pZ3JhdG9yUHVibGljS2V5T3JVbml0AAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAJwawUHJG1hdGNoMAUCcGsDCQABAgUHJG1hdGNoMAIEVW5pdAgFAnR4D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUPdGFyZ2V0UHVibGljS2V5BgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAURbWlncmF0b3JQdWJsaWNLZXlrWUR6", "chainId": 84, "height": 2117692, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FvUiXeu4R36wBiUWerVothmY9PBWMpXxBDie2ZJAk4rG Next: HBJhyaqdBX29ChSrFq8PSCKyas9biTXsWa2EA3sGdtXo Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SCALE8 = 8 | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
87 | + | ||
88 | + | ||
89 | + | func keyVotingEmissionContract () = "%s__votingEmissionContract" | |
87 | 90 | ||
88 | 91 | ||
89 | 92 | let IdxFactoryCfgStakingDapp = 1 | |
236 | 239 | ||
237 | 240 | let boostingContract = getBoostingAddressOrFail(factoryCfg) | |
238 | 241 | ||
242 | + | func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP) | |
243 | + | ||
244 | + | ||
245 | + | func getUsersListName (lpAssetId) = makeString(["users", lpAssetId], SEP) | |
246 | + | ||
247 | + | ||
248 | + | func keyListHead (listName) = makeString(["%s%s%s", listName, "head"], SEP) | |
249 | + | ||
250 | + | ||
251 | + | func keyListSize (listName) = makeString(["%s%s%s", listName, "size"], SEP) | |
252 | + | ||
253 | + | ||
254 | + | func keyListPrev (listName,id) = makeString(["%s%s%s%s", listName, id, "prev"], SEP) | |
255 | + | ||
256 | + | ||
257 | + | func keyListNext (listName,id) = makeString(["%s%s%s%s", listName, id, "next"], SEP) | |
258 | + | ||
259 | + | ||
260 | + | func containsNode (listName,id) = { | |
261 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
262 | + | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
263 | + | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
264 | + | if (if ((id == valueOrElse(headOrUnit, ""))) | |
265 | + | then true | |
266 | + | else (prevOrUnit != unit)) | |
267 | + | then true | |
268 | + | else (nextOrUnit != unit) | |
269 | + | } | |
270 | + | ||
271 | + | ||
272 | + | func insertNodeActions (listName,id) = { | |
273 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
274 | + | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
275 | + | let checkNode = if (!(containsNode(listName, id))) | |
276 | + | then true | |
277 | + | else throw("Node exists") | |
278 | + | if ((checkNode == checkNode)) | |
279 | + | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit)) | |
280 | + | then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)] | |
281 | + | else nil)) ++ [StringEntry(keyListHead(listName), id)]) | |
282 | + | else throw("Strict value is not equal to itself.") | |
283 | + | } | |
284 | + | ||
285 | + | ||
286 | + | func deleteNodeActions (listName,id) = { | |
287 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
288 | + | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
289 | + | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
290 | + | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
291 | + | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit)) | |
292 | + | then (nextOrUnit != unit) | |
293 | + | else false) | |
294 | + | then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))] | |
295 | + | else if ((nextOrUnit != unit)) | |
296 | + | then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))] | |
297 | + | else if ((prevOrUnit != unit)) | |
298 | + | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))] | |
299 | + | else if ((id == valueOrElse(headOrUnit, ""))) | |
300 | + | then [DeleteEntry(keyListHead(listName))] | |
301 | + | else throw(((("invalid node: " + listName) + ".") + id)))) | |
302 | + | } | |
303 | + | ||
304 | + | ||
239 | 305 | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt)) | |
240 | 306 | then (stakedByUser > zeroBigInt) | |
241 | 307 | else false) | |
277 | 343 | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh))) | |
278 | 344 | let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew) | |
279 | 345 | let wxPerLpIntegralLastUpdHeightNew = height | |
280 | - | let debug = makeString([toString(wxPerLpIntegralNew), | |
346 | + | let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::") | |
281 | 347 | $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug) | |
282 | 348 | } | |
283 | 349 | ||
284 | 350 | ||
285 | 351 | func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = { | |
286 | - | let $ | |
287 | - | let wxPerLpIntegralNew = $ | |
288 | - | let poolIntegralSTATE = $ | |
289 | - | let poolDEBUG = $ | |
352 | + | let $t01430214424 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount) | |
353 | + | let wxPerLpIntegralNew = $t01430214424._1 | |
354 | + | let poolIntegralSTATE = $t01430214424._2 | |
355 | + | let poolDEBUG = $t01430214424._3 | |
290 | 356 | let MULT3 = 1000 | |
291 | 357 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
292 | 358 | let stakedByUser = readStaked(stakedByUserKEY) | |
300 | 366 | let wxToClaimUserNew = max([(wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))), zeroBigInt]) | |
301 | 367 | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
302 | 368 | let wxPerLpIntegralUserLastUpdHeightNew = height | |
303 | - | let debug = makeString([ | |
369 | + | let debug = makeString([toString(wxToClaimUser), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::") | |
304 | 370 | $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug) | |
305 | 371 | } | |
306 | 372 | ||
335 | 401 | } | |
336 | 402 | ||
337 | 403 | ||
338 | - | func mustManager (i) = { | |
339 | - | let pd = throw("Permission denied") | |
340 | - | match managerPublicKeyOrUnit() { | |
341 | - | case pk: ByteVector => | |
342 | - | if ((i.callerPublicKey == pk)) | |
343 | - | then true | |
344 | - | else pd | |
345 | - | case _: Unit => | |
346 | - | if ((i.caller == this)) | |
347 | - | then true | |
348 | - | else pd | |
349 | - | case _ => | |
350 | - | throw("Match error") | |
351 | - | } | |
352 | - | } | |
404 | + | let permissionDeniedError = throw("Permission denied") | |
405 | + | ||
406 | + | func mustThis (i) = if ((i.caller == this)) | |
407 | + | then true | |
408 | + | else permissionDeniedError | |
409 | + | ||
410 | + | ||
411 | + | func mustManager (i) = match managerPublicKeyOrUnit() { | |
412 | + | case pk: ByteVector => | |
413 | + | if ((i.callerPublicKey == pk)) | |
414 | + | then true | |
415 | + | else permissionDeniedError | |
416 | + | case _: Unit => | |
417 | + | if ((i.caller == this)) | |
418 | + | then true | |
419 | + | else permissionDeniedError | |
420 | + | case _ => | |
421 | + | throw("Match error") | |
422 | + | } | |
353 | 423 | ||
354 | 424 | ||
355 | 425 | @Callable(i) | |
357 | 427 | let checkCaller = mustManager(i) | |
358 | 428 | if ((checkCaller == checkCaller)) | |
359 | 429 | then [StringEntry(keyFactoryAddress(), factoryAddressStr)] | |
430 | + | else throw("Strict value is not equal to itself.") | |
431 | + | } | |
432 | + | ||
433 | + | ||
434 | + | ||
435 | + | @Callable(i) | |
436 | + | func constructorV2 (votingEmissionContract) = { | |
437 | + | let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit)) | |
438 | + | then true | |
439 | + | else "invalid voting emission contract address"] | |
440 | + | if ((cheks == cheks)) | |
441 | + | then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)] | |
360 | 442 | else throw("Strict value is not equal to itself.") | |
361 | 443 | } | |
362 | 444 | ||
414 | 496 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
415 | 497 | let stakedByUser = readStaked(stakedByUserKEY) | |
416 | 498 | let stakedTotal = readStaked(stakedTotalKEY) | |
417 | - | let $t01619616313 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
418 | - | let wxToClaimUserNew = $t01619616313._1 | |
419 | - | let integralSTATE = $t01619616313._2 | |
420 | - | let debug = $t01619616313._3 | |
421 | - | ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
499 | + | let $t01903419151 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
500 | + | let wxToClaimUserNew = $t01903419151._1 | |
501 | + | let integralSTATE = $t01903419151._2 | |
502 | + | let debug = $t01903419151._3 | |
503 | + | let listName = getUsersListName(lpAssetIdStr) | |
504 | + | let listActions = if (containsNode(listName, userAddressStr)) | |
505 | + | then nil | |
506 | + | else insertNodeActions(listName, userAddressStr) | |
507 | + | (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
422 | 508 | } | |
423 | 509 | ||
424 | 510 | ||
438 | 524 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
439 | 525 | let stakedByUser = readStaked(stakedByUserKEY) | |
440 | 526 | let stakedTotal = readStaked(stakedTotalKEY) | |
441 | - | let $t01745017568 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount)) | |
442 | - | let wxToClaimUserNew = $t01745017568._1 | |
443 | - | let integralSTATE = $t01745017568._2 | |
444 | - | let debug = $t01745017568._3 | |
527 | + | let $t02048620604 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount)) | |
528 | + | let wxToClaimUserNew = $t02048620604._1 | |
529 | + | let integralSTATE = $t02048620604._2 | |
530 | + | let debug = $t02048620604._3 | |
531 | + | let listName = getUsersListName(lpAssetIdStr) | |
532 | + | let listActions = if (containsNode(listName, userAddressStr)) | |
533 | + | then deleteNodeActions(listName, userAddressStr) | |
534 | + | else nil | |
445 | 535 | if ((amount > stakedByUser)) | |
446 | 536 | then throw("passed amount is less then available") | |
447 | - | else ([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
537 | + | else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
448 | 538 | } | |
449 | 539 | ||
450 | 540 | ||
451 | 541 | ||
452 | 542 | @Callable(i) | |
453 | 543 | func claimWx (lpAssetIdStr) = { | |
454 | - | let userAddress = i.caller | |
455 | 544 | let userAddressStr = toString(i.caller) | |
456 | - | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
457 | - | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
458 | - | let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr) | |
459 | - | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
460 | - | let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr) | |
461 | - | let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY) | |
462 | - | let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY) | |
463 | - | let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY) | |
464 | - | let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY) | |
465 | - | let $t01881218924 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
466 | - | let wxToClaimUserNew = $t01881218924._1 | |
467 | - | let integralSTATE = $t01881218924._2 | |
468 | - | let debug = $t01881218924._3 | |
469 | - | let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt]) | |
470 | - | if ((zeroBigInt >= availableToClaim)) | |
471 | - | then throw("nothing to claim") | |
472 | - | else { | |
473 | - | let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0]) | |
474 | - | let minRewardPart = availableToClaim | |
475 | - | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
476 | - | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0]) | |
477 | - | let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil)) | |
478 | - | 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) | |
545 | + | let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr], nil) | |
546 | + | $Tuple2(nil, result) | |
547 | + | } | |
548 | + | ||
549 | + | ||
550 | + | ||
551 | + | @Callable(i) | |
552 | + | func claimWxINTERNAL (lpAssetIdStr,userAddressStr) = { | |
553 | + | let checkCaller = mustThis(i) | |
554 | + | if ((checkCaller == checkCaller)) | |
555 | + | then { | |
556 | + | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), "claimWxINTERNAL: invalid user address") | |
557 | + | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
558 | + | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
559 | + | let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr) | |
560 | + | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
561 | + | let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr) | |
562 | + | let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY) | |
563 | + | let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY) | |
564 | + | let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY) | |
565 | + | let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY) | |
566 | + | let $t02235222464 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
567 | + | let wxToClaimUserNew = $t02235222464._1 | |
568 | + | let integralSTATE = $t02235222464._2 | |
569 | + | let debug = $t02235222464._3 | |
570 | + | let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt]) | |
571 | + | if ((zeroBigInt >= availableToClaim)) | |
572 | + | then throw("nothing to claim") | |
573 | + | else { | |
574 | + | let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0]) | |
575 | + | let minRewardPart = availableToClaim | |
576 | + | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
577 | + | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0]) | |
578 | + | let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil)) | |
579 | + | if ((emitBoost == emitBoost)) | |
580 | + | then { | |
581 | + | let claimedByUserValue = (claimedByUser + availableToClaim) | |
582 | + | let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart) | |
583 | + | let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserMinReward + minRewardPart) | |
584 | + | let claimedTotalPlusAvailableToClaim = (claimedByUserMinReward + minRewardPart) | |
484 | 585 | [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)] | |
586 | + | } | |
587 | + | else throw("Strict value is not equal to itself.") | |
485 | 588 | } | |
486 | - | else throw("Strict value is not equal to itself.") | |
487 | 589 | } | |
590 | + | else throw("Strict value is not equal to itself.") | |
488 | 591 | } | |
489 | 592 | ||
490 | 593 | ||
506 | 609 | else (height - emissionStartBlock) | |
507 | 610 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
508 | 611 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
509 | - | let $ | |
510 | - | let wxToClaimUserNew = $ | |
511 | - | let integralSTATE = $ | |
512 | - | let debug = $ | |
612 | + | let $t02510625218 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
613 | + | let wxToClaimUserNew = $t02510625218._1 | |
614 | + | let integralSTATE = $t02510625218._2 | |
615 | + | let debug = $t02510625218._3 | |
513 | 616 | let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt]) | |
514 | 617 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
515 | 618 | let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0]) | |
517 | 620 | let minRewardPart = availableToClaim | |
518 | 621 | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
519 | 622 | let totalReward = (minRewardPart + boostRewardPart) | |
520 | - | $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)) | |
623 | + | $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), ((((debug + "::") + toString(userWxReward)) + "::BOOST::") + boostDebug)], SEP)) | |
624 | + | } | |
625 | + | ||
626 | + | ||
627 | + | ||
628 | + | @Callable(i) | |
629 | + | func usersListTraversal (lpAssetId) = { | |
630 | + | let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), ""))) | |
631 | + | then true | |
632 | + | else mustManager(i) | |
633 | + | if ((checkCaller == checkCaller)) | |
634 | + | then { | |
635 | + | let listName = getUsersListName(lpAssetId) | |
636 | + | let userOrUnit = getString(keyNextUser(lpAssetId)) | |
637 | + | let headOrUnit = getString(keyListHead(listName)) | |
638 | + | match userOrUnit { | |
639 | + | case _: Unit => | |
640 | + | match headOrUnit { | |
641 | + | case _: Unit => | |
642 | + | $Tuple2(nil, false) | |
643 | + | case head: String => | |
644 | + | $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true) | |
645 | + | case _ => | |
646 | + | throw("Match error") | |
647 | + | } | |
648 | + | case userAddress: String => | |
649 | + | let claimedByUser = getBigIntFromStringOrZero(this, keyClaimedByUser(lpAssetId, userAddress)) | |
650 | + | let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId)) | |
651 | + | let $t02681326916 = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0) | |
652 | + | let wxToClaimUserNew = $t02681326916._1 | |
653 | + | let integralSTATE = $t02681326916._2 | |
654 | + | let debug = $t02681326916._3 | |
655 | + | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
656 | + | let r = if ((availableToClaim > zeroBigInt)) | |
657 | + | then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress], nil) | |
658 | + | else unit | |
659 | + | if ((r == r)) | |
660 | + | then { | |
661 | + | let nextUserOrUnit = getString(keyListNext(listName, userAddress)) | |
662 | + | match nextUserOrUnit { | |
663 | + | case _: Unit => | |
664 | + | $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false) | |
665 | + | case nextUser: String => | |
666 | + | $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true) | |
667 | + | case _ => | |
668 | + | throw("Match error") | |
669 | + | } | |
670 | + | } | |
671 | + | else throw("Strict value is not equal to itself.") | |
672 | + | case _ => | |
673 | + | throw("Match error") | |
674 | + | } | |
675 | + | } | |
676 | + | else throw("Strict value is not equal to itself.") | |
521 | 677 | } | |
522 | 678 | ||
523 | 679 | ||
526 | 682 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
527 | 683 | then throw("permissions denied") | |
528 | 684 | else { | |
529 | - | let $ | |
530 | - | let wxPerLpIntegralNew = $ | |
531 | - | let poolIntegralSTATE = $ | |
532 | - | let poolDEBUG = $ | |
685 | + | let $t02759027700 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
686 | + | let wxPerLpIntegralNew = $t02759027700._1 | |
687 | + | let poolIntegralSTATE = $t02759027700._2 | |
688 | + | let poolDEBUG = $t02759027700._3 | |
533 | 689 | poolIntegralSTATE | |
534 | 690 | } | |
535 | 691 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SCALE8 = 8 | |
5 | 5 | ||
6 | 6 | let MULT8 = 100000000 | |
7 | 7 | ||
8 | 8 | let SCALE18 = 18 | |
9 | 9 | ||
10 | 10 | let MULT18 = toBigInt(1000000000000000000) | |
11 | 11 | ||
12 | 12 | let SEP = "__" | |
13 | 13 | ||
14 | 14 | let POOLWEIGHTMULT = MULT8 | |
15 | 15 | ||
16 | 16 | let zeroBigInt = toBigInt(0) | |
17 | 17 | ||
18 | 18 | let oneBigInt = toBigInt(1) | |
19 | 19 | ||
20 | 20 | func asAnyList (val) = match val { | |
21 | 21 | case valAnyLyst: List[Any] => | |
22 | 22 | valAnyLyst | |
23 | 23 | case _ => | |
24 | 24 | throw("fail to cast into List[Any]") | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func asInt (val) = match val { | |
29 | 29 | case valInt: Int => | |
30 | 30 | valInt | |
31 | 31 | case _ => | |
32 | 32 | throw("fail to cast into Int") | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func asString (val) = match val { | |
37 | 37 | case valStr: String => | |
38 | 38 | valStr | |
39 | 39 | case _ => | |
40 | 40 | throw("fail to cast into Int") | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func asByteVector (val) = match val { | |
45 | 45 | case valBin: ByteVector => | |
46 | 46 | valBin | |
47 | 47 | case _ => | |
48 | 48 | throw("fail to cast into Int") | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined")) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined")) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0"))) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) { | |
71 | 71 | case s: String => | |
72 | 72 | value(parseBigInt(s)) | |
73 | 73 | case _: Unit => | |
74 | 74 | defaultVal | |
75 | 75 | case _ => | |
76 | 76 | throw("Match error") | |
77 | 77 | } | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult)) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18)) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func keyFactoryAddress () = "%s%s__config__factoryAddress" | |
87 | + | ||
88 | + | ||
89 | + | func keyVotingEmissionContract () = "%s__votingEmissionContract" | |
87 | 90 | ||
88 | 91 | ||
89 | 92 | let IdxFactoryCfgStakingDapp = 1 | |
90 | 93 | ||
91 | 94 | let IdxFactoryCfgBoostingDapp = 2 | |
92 | 95 | ||
93 | 96 | let IdxFactoryCfgIdoDapp = 3 | |
94 | 97 | ||
95 | 98 | let IdxFactoryCfgTeamDapp = 4 | |
96 | 99 | ||
97 | 100 | let IdxFactoryCfgEmissionDapp = 5 | |
98 | 101 | ||
99 | 102 | let IdxFactoryCfgRestDapp = 6 | |
100 | 103 | ||
101 | 104 | let IdxFactoryCfgSlippageDapp = 7 | |
102 | 105 | ||
103 | 106 | func keyFactoryCfg () = "%s__factoryConfig" | |
104 | 107 | ||
105 | 108 | ||
106 | 109 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
107 | 110 | ||
108 | 111 | ||
109 | 112 | func keyMigratorPublicKey () = "%s__migratorPublicKey" | |
110 | 113 | ||
111 | 114 | ||
112 | 115 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
113 | 116 | ||
114 | 117 | ||
115 | 118 | func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr" | |
116 | 119 | ||
117 | 120 | ||
118 | 121 | func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
119 | 122 | ||
120 | 123 | ||
121 | 124 | func keyFactoryLpList () = "%s__lpTokensList" | |
122 | 125 | ||
123 | 126 | ||
124 | 127 | func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP) | |
125 | 128 | ||
126 | 129 | ||
127 | 130 | func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP) | |
128 | 131 | ||
129 | 132 | ||
130 | 133 | func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP) | |
131 | 134 | ||
132 | 135 | ||
133 | 136 | func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP) | |
134 | 137 | ||
135 | 138 | ||
136 | 139 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
137 | 140 | ||
138 | 141 | ||
139 | 142 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
140 | 143 | ||
141 | 144 | ||
142 | 145 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
143 | 146 | ||
144 | 147 | ||
145 | 148 | func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current" | |
146 | 149 | ||
147 | 150 | ||
148 | 151 | func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current" | |
149 | 152 | ||
150 | 153 | ||
151 | 154 | func keyEmissionStartBlock () = "%s%s__emission__startBlock" | |
152 | 155 | ||
153 | 156 | ||
154 | 157 | func keyEmissionDurationInBlocks () = "%s%s__emission__duration" | |
155 | 158 | ||
156 | 159 | ||
157 | 160 | func keyEmissionEndBlock () = "%s%s__emission__endBlock" | |
158 | 161 | ||
159 | 162 | ||
160 | 163 | func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP) | |
161 | 164 | ||
162 | 165 | ||
163 | 166 | func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr) | |
164 | 167 | ||
165 | 168 | ||
166 | 169 | func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP) | |
167 | 170 | ||
168 | 171 | ||
169 | 172 | func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP) | |
170 | 173 | ||
171 | 174 | ||
172 | 175 | func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP) | |
173 | 176 | ||
174 | 177 | ||
175 | 178 | func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed__total", lpAssetIdStr], SEP) | |
176 | 179 | ||
177 | 180 | ||
178 | 181 | func readStaked (key) = valueOrElse(getInteger(this, key), 0) | |
179 | 182 | ||
180 | 183 | ||
181 | 184 | func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP) | |
182 | 185 | ||
183 | 186 | ||
184 | 187 | func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP) | |
185 | 188 | ||
186 | 189 | ||
187 | 190 | func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP) | |
188 | 191 | ||
189 | 192 | ||
190 | 193 | func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP) | |
191 | 194 | ||
192 | 195 | ||
193 | 196 | func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP) | |
194 | 197 | ||
195 | 198 | ||
196 | 199 | func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP) | |
197 | 200 | ||
198 | 201 | ||
199 | 202 | func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP) | |
200 | 203 | ||
201 | 204 | ||
202 | 205 | func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP) | |
203 | 206 | ||
204 | 207 | ||
205 | 208 | func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP) | |
206 | 209 | ||
207 | 210 | ||
208 | 211 | func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP) | |
209 | 212 | ||
210 | 213 | ||
211 | 214 | func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP) | |
212 | 215 | ||
213 | 216 | ||
214 | 217 | func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP) | |
215 | 218 | ||
216 | 219 | ||
217 | 220 | func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP) | |
218 | 221 | ||
219 | 222 | ||
220 | 223 | func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP) | |
221 | 224 | ||
222 | 225 | ||
223 | 226 | 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 | 227 | ||
225 | 228 | ||
226 | 229 | func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount)) | |
227 | 230 | ||
228 | 231 | ||
229 | 232 | let factoryAddress = getStringOrFail(this, keyFactoryAddress()) | |
230 | 233 | ||
231 | 234 | let factoryContract = addressFromStringValue(factoryAddress) | |
232 | 235 | ||
233 | 236 | let factoryCfg = readFactoryCfgOrFail(factoryContract) | |
234 | 237 | ||
235 | 238 | let emissionContract = getEmissionAddressOrFail(factoryCfg) | |
236 | 239 | ||
237 | 240 | let boostingContract = getBoostingAddressOrFail(factoryCfg) | |
238 | 241 | ||
242 | + | func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP) | |
243 | + | ||
244 | + | ||
245 | + | func getUsersListName (lpAssetId) = makeString(["users", lpAssetId], SEP) | |
246 | + | ||
247 | + | ||
248 | + | func keyListHead (listName) = makeString(["%s%s%s", listName, "head"], SEP) | |
249 | + | ||
250 | + | ||
251 | + | func keyListSize (listName) = makeString(["%s%s%s", listName, "size"], SEP) | |
252 | + | ||
253 | + | ||
254 | + | func keyListPrev (listName,id) = makeString(["%s%s%s%s", listName, id, "prev"], SEP) | |
255 | + | ||
256 | + | ||
257 | + | func keyListNext (listName,id) = makeString(["%s%s%s%s", listName, id, "next"], SEP) | |
258 | + | ||
259 | + | ||
260 | + | func containsNode (listName,id) = { | |
261 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
262 | + | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
263 | + | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
264 | + | if (if ((id == valueOrElse(headOrUnit, ""))) | |
265 | + | then true | |
266 | + | else (prevOrUnit != unit)) | |
267 | + | then true | |
268 | + | else (nextOrUnit != unit) | |
269 | + | } | |
270 | + | ||
271 | + | ||
272 | + | func insertNodeActions (listName,id) = { | |
273 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
274 | + | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
275 | + | let checkNode = if (!(containsNode(listName, id))) | |
276 | + | then true | |
277 | + | else throw("Node exists") | |
278 | + | if ((checkNode == checkNode)) | |
279 | + | then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit)) | |
280 | + | then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)] | |
281 | + | else nil)) ++ [StringEntry(keyListHead(listName), id)]) | |
282 | + | else throw("Strict value is not equal to itself.") | |
283 | + | } | |
284 | + | ||
285 | + | ||
286 | + | func deleteNodeActions (listName,id) = { | |
287 | + | let headOrUnit = getString(this, keyListHead(listName)) | |
288 | + | let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0) | |
289 | + | let prevOrUnit = getString(this, keyListPrev(listName, id)) | |
290 | + | let nextOrUnit = getString(this, keyListNext(listName, id)) | |
291 | + | ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit)) | |
292 | + | then (nextOrUnit != unit) | |
293 | + | else false) | |
294 | + | then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))] | |
295 | + | else if ((nextOrUnit != unit)) | |
296 | + | then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))] | |
297 | + | else if ((prevOrUnit != unit)) | |
298 | + | then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))] | |
299 | + | else if ((id == valueOrElse(headOrUnit, ""))) | |
300 | + | then [DeleteEntry(keyListHead(listName))] | |
301 | + | else throw(((("invalid node: " + listName) + ".") + id)))) | |
302 | + | } | |
303 | + | ||
304 | + | ||
239 | 305 | func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt)) | |
240 | 306 | then (stakedByUser > zeroBigInt) | |
241 | 307 | else false) | |
242 | 308 | then zeroBigInt | |
243 | 309 | else if ((stakedByUser == zeroBigInt)) | |
244 | 310 | then wxPerLpIntegralNew | |
245 | 311 | else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt)) | |
246 | 312 | then (stakedByUser > zeroBigInt) | |
247 | 313 | else false) | |
248 | 314 | then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY))) | |
249 | 315 | else throw("calcWxPerLpIntegralUserLast: unexpected state") | |
250 | 316 | ||
251 | 317 | ||
252 | 318 | func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = { | |
253 | 319 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
254 | 320 | let stakedTotal = toBigInt(readStaked(stakedTotalKEY)) | |
255 | 321 | let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt)) | |
256 | 322 | then oneBigInt | |
257 | 323 | else stakedTotal | |
258 | 324 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
259 | 325 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
260 | 326 | let MULT3 = 1000 | |
261 | 327 | let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3) | |
262 | 328 | let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3)) | |
263 | 329 | let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr) | |
264 | 330 | let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr) | |
265 | 331 | let wxPerLpKEY = keyWxPerLp(lpAssetIdStr) | |
266 | 332 | let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock) | |
267 | 333 | let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY) | |
268 | 334 | let wxPerLpOrZeroX3 = 0 | |
269 | 335 | let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0]) | |
270 | 336 | let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0)) | |
271 | 337 | then toBigInt(wxPerLpOrZeroX3) | |
272 | 338 | else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal) | |
273 | 339 | let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount)) | |
274 | 340 | let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt)) | |
275 | 341 | then oneBigInt | |
276 | 342 | else stakedTotalNew | |
277 | 343 | let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh))) | |
278 | 344 | let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew) | |
279 | 345 | let wxPerLpIntegralLastUpdHeightNew = height | |
280 | - | let debug = makeString([toString(wxPerLpIntegralNew), | |
346 | + | let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::") | |
281 | 347 | $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug) | |
282 | 348 | } | |
283 | 349 | ||
284 | 350 | ||
285 | 351 | func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = { | |
286 | - | let $ | |
287 | - | let wxPerLpIntegralNew = $ | |
288 | - | let poolIntegralSTATE = $ | |
289 | - | let poolDEBUG = $ | |
352 | + | let $t01430214424 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount) | |
353 | + | let wxPerLpIntegralNew = $t01430214424._1 | |
354 | + | let poolIntegralSTATE = $t01430214424._2 | |
355 | + | let poolDEBUG = $t01430214424._3 | |
290 | 356 | let MULT3 = 1000 | |
291 | 357 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
292 | 358 | let stakedByUser = readStaked(stakedByUserKEY) | |
293 | 359 | let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr) | |
294 | 360 | let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr) | |
295 | 361 | let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr) | |
296 | 362 | let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY) | |
297 | 363 | let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY) | |
298 | 364 | let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY) | |
299 | 365 | let MULT11 = (MULT8 * MULT3) | |
300 | 366 | let wxToClaimUserNew = max([(wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))), zeroBigInt]) | |
301 | 367 | let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew | |
302 | 368 | let wxPerLpIntegralUserLastUpdHeightNew = height | |
303 | - | let debug = makeString([ | |
369 | + | let debug = makeString([toString(wxToClaimUser), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::") | |
304 | 370 | $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug) | |
305 | 371 | } | |
306 | 372 | ||
307 | 373 | ||
308 | 374 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
309 | 375 | case s: String => | |
310 | 376 | fromBase58String(s) | |
311 | 377 | case _: Unit => | |
312 | 378 | unit | |
313 | 379 | case _ => | |
314 | 380 | throw("Match error") | |
315 | 381 | } | |
316 | 382 | ||
317 | 383 | ||
318 | 384 | func migratorPublicKeyOrUnit () = match getString(keyMigratorPublicKey()) { | |
319 | 385 | case s: String => | |
320 | 386 | fromBase58String(s) | |
321 | 387 | case _: Unit => | |
322 | 388 | unit | |
323 | 389 | case _ => | |
324 | 390 | throw("Match error") | |
325 | 391 | } | |
326 | 392 | ||
327 | 393 | ||
328 | 394 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
329 | 395 | case s: String => | |
330 | 396 | fromBase58String(s) | |
331 | 397 | case _: Unit => | |
332 | 398 | unit | |
333 | 399 | case _ => | |
334 | 400 | throw("Match error") | |
335 | 401 | } | |
336 | 402 | ||
337 | 403 | ||
338 | - | func mustManager (i) = { | |
339 | - | let pd = throw("Permission denied") | |
340 | - | match managerPublicKeyOrUnit() { | |
341 | - | case pk: ByteVector => | |
342 | - | if ((i.callerPublicKey == pk)) | |
343 | - | then true | |
344 | - | else pd | |
345 | - | case _: Unit => | |
346 | - | if ((i.caller == this)) | |
347 | - | then true | |
348 | - | else pd | |
349 | - | case _ => | |
350 | - | throw("Match error") | |
351 | - | } | |
352 | - | } | |
404 | + | let permissionDeniedError = throw("Permission denied") | |
405 | + | ||
406 | + | func mustThis (i) = if ((i.caller == this)) | |
407 | + | then true | |
408 | + | else permissionDeniedError | |
409 | + | ||
410 | + | ||
411 | + | func mustManager (i) = match managerPublicKeyOrUnit() { | |
412 | + | case pk: ByteVector => | |
413 | + | if ((i.callerPublicKey == pk)) | |
414 | + | then true | |
415 | + | else permissionDeniedError | |
416 | + | case _: Unit => | |
417 | + | if ((i.caller == this)) | |
418 | + | then true | |
419 | + | else permissionDeniedError | |
420 | + | case _ => | |
421 | + | throw("Match error") | |
422 | + | } | |
353 | 423 | ||
354 | 424 | ||
355 | 425 | @Callable(i) | |
356 | 426 | func constructor (factoryAddressStr) = { | |
357 | 427 | let checkCaller = mustManager(i) | |
358 | 428 | if ((checkCaller == checkCaller)) | |
359 | 429 | then [StringEntry(keyFactoryAddress(), factoryAddressStr)] | |
430 | + | else throw("Strict value is not equal to itself.") | |
431 | + | } | |
432 | + | ||
433 | + | ||
434 | + | ||
435 | + | @Callable(i) | |
436 | + | func constructorV2 (votingEmissionContract) = { | |
437 | + | let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit)) | |
438 | + | then true | |
439 | + | else "invalid voting emission contract address"] | |
440 | + | if ((cheks == cheks)) | |
441 | + | then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)] | |
360 | 442 | else throw("Strict value is not equal to itself.") | |
361 | 443 | } | |
362 | 444 | ||
363 | 445 | ||
364 | 446 | ||
365 | 447 | @Callable(i) | |
366 | 448 | func setManager (pendingManagerPublicKey) = { | |
367 | 449 | let checkCaller = mustManager(i) | |
368 | 450 | if ((checkCaller == checkCaller)) | |
369 | 451 | then { | |
370 | 452 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
371 | 453 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
372 | 454 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
373 | 455 | else throw("Strict value is not equal to itself.") | |
374 | 456 | } | |
375 | 457 | else throw("Strict value is not equal to itself.") | |
376 | 458 | } | |
377 | 459 | ||
378 | 460 | ||
379 | 461 | ||
380 | 462 | @Callable(i) | |
381 | 463 | func confirmManager () = { | |
382 | 464 | let pm = pendingManagerPublicKeyOrUnit() | |
383 | 465 | let hasPM = if (isDefined(pm)) | |
384 | 466 | then true | |
385 | 467 | else throw("No pending manager") | |
386 | 468 | if ((hasPM == hasPM)) | |
387 | 469 | then { | |
388 | 470 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
389 | 471 | then true | |
390 | 472 | else throw("You are not pending manager") | |
391 | 473 | if ((checkPM == checkPM)) | |
392 | 474 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
393 | 475 | else throw("Strict value is not equal to itself.") | |
394 | 476 | } | |
395 | 477 | else throw("Strict value is not equal to itself.") | |
396 | 478 | } | |
397 | 479 | ||
398 | 480 | ||
399 | 481 | ||
400 | 482 | @Callable(i) | |
401 | 483 | func stake () = if ((size(i.payments) != 1)) | |
402 | 484 | then throw("invalid payment - exact one payment must be attached") | |
403 | 485 | else { | |
404 | 486 | let pmt = i.payments[0] | |
405 | 487 | let lpAssetId = value(pmt.assetId) | |
406 | 488 | let lpAssetIdStr = toBase58String(lpAssetId) | |
407 | 489 | let amount = pmt.amount | |
408 | 490 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
409 | 491 | let callerStr = toString(i.caller) | |
410 | 492 | let userAddressStr = if ((callerStr == poolAddressStr)) | |
411 | 493 | then toString(i.originCaller) | |
412 | 494 | else callerStr | |
413 | 495 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
414 | 496 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
415 | 497 | let stakedByUser = readStaked(stakedByUserKEY) | |
416 | 498 | let stakedTotal = readStaked(stakedTotalKEY) | |
417 | - | let $t01619616313 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
418 | - | let wxToClaimUserNew = $t01619616313._1 | |
419 | - | let integralSTATE = $t01619616313._2 | |
420 | - | let debug = $t01619616313._3 | |
421 | - | ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
499 | + | let $t01903419151 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount) | |
500 | + | let wxToClaimUserNew = $t01903419151._1 | |
501 | + | let integralSTATE = $t01903419151._2 | |
502 | + | let debug = $t01903419151._3 | |
503 | + | let listName = getUsersListName(lpAssetIdStr) | |
504 | + | let listActions = if (containsNode(listName, userAddressStr)) | |
505 | + | then nil | |
506 | + | else insertNodeActions(listName, userAddressStr) | |
507 | + | (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
422 | 508 | } | |
423 | 509 | ||
424 | 510 | ||
425 | 511 | ||
426 | 512 | @Callable(i) | |
427 | 513 | func unstake (lpAssetIdStr,amount) = { | |
428 | 514 | let lpAssetId = fromBase58String(lpAssetIdStr) | |
429 | 515 | let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)) | |
430 | 516 | let poolAddon = valueOrElse(getString(this, keyStablePoolAddonAddr()), poolAddressStr) | |
431 | 517 | let callerStr = toString(i.caller) | |
432 | 518 | let userAddressStr = if (if ((callerStr == poolAddressStr)) | |
433 | 519 | then true | |
434 | 520 | else (callerStr == poolAddon)) | |
435 | 521 | then toString(i.originCaller) | |
436 | 522 | else callerStr | |
437 | 523 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
438 | 524 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
439 | 525 | let stakedByUser = readStaked(stakedByUserKEY) | |
440 | 526 | let stakedTotal = readStaked(stakedTotalKEY) | |
441 | - | let $t01745017568 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount)) | |
442 | - | let wxToClaimUserNew = $t01745017568._1 | |
443 | - | let integralSTATE = $t01745017568._2 | |
444 | - | let debug = $t01745017568._3 | |
527 | + | let $t02048620604 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount)) | |
528 | + | let wxToClaimUserNew = $t02048620604._1 | |
529 | + | let integralSTATE = $t02048620604._2 | |
530 | + | let debug = $t02048620604._3 | |
531 | + | let listName = getUsersListName(lpAssetIdStr) | |
532 | + | let listActions = if (containsNode(listName, userAddressStr)) | |
533 | + | then deleteNodeActions(listName, userAddressStr) | |
534 | + | else nil | |
445 | 535 | if ((amount > stakedByUser)) | |
446 | 536 | then throw("passed amount is less then available") | |
447 | - | else ([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) | |
537 | + | else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions) | |
448 | 538 | } | |
449 | 539 | ||
450 | 540 | ||
451 | 541 | ||
452 | 542 | @Callable(i) | |
453 | 543 | func claimWx (lpAssetIdStr) = { | |
454 | - | let userAddress = i.caller | |
455 | 544 | let userAddressStr = toString(i.caller) | |
456 | - | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
457 | - | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
458 | - | let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr) | |
459 | - | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
460 | - | let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr) | |
461 | - | let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY) | |
462 | - | let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY) | |
463 | - | let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY) | |
464 | - | let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY) | |
465 | - | let $t01881218924 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
466 | - | let wxToClaimUserNew = $t01881218924._1 | |
467 | - | let integralSTATE = $t01881218924._2 | |
468 | - | let debug = $t01881218924._3 | |
469 | - | let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt]) | |
470 | - | if ((zeroBigInt >= availableToClaim)) | |
471 | - | then throw("nothing to claim") | |
472 | - | else { | |
473 | - | let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0]) | |
474 | - | let minRewardPart = availableToClaim | |
475 | - | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
476 | - | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0]) | |
477 | - | let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil)) | |
478 | - | 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) | |
545 | + | let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr], nil) | |
546 | + | $Tuple2(nil, result) | |
547 | + | } | |
548 | + | ||
549 | + | ||
550 | + | ||
551 | + | @Callable(i) | |
552 | + | func claimWxINTERNAL (lpAssetIdStr,userAddressStr) = { | |
553 | + | let checkCaller = mustThis(i) | |
554 | + | if ((checkCaller == checkCaller)) | |
555 | + | then { | |
556 | + | let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), "claimWxINTERNAL: invalid user address") | |
557 | + | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
558 | + | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
559 | + | let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr) | |
560 | + | let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr) | |
561 | + | let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr) | |
562 | + | let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY) | |
563 | + | let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY) | |
564 | + | let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY) | |
565 | + | let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY) | |
566 | + | let $t02235222464 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
567 | + | let wxToClaimUserNew = $t02235222464._1 | |
568 | + | let integralSTATE = $t02235222464._2 | |
569 | + | let debug = $t02235222464._3 | |
570 | + | let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt]) | |
571 | + | if ((zeroBigInt >= availableToClaim)) | |
572 | + | then throw("nothing to claim") | |
573 | + | else { | |
574 | + | let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0]) | |
575 | + | let minRewardPart = availableToClaim | |
576 | + | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
577 | + | let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0]) | |
578 | + | let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil)) | |
579 | + | if ((emitBoost == emitBoost)) | |
580 | + | then { | |
581 | + | let claimedByUserValue = (claimedByUser + availableToClaim) | |
582 | + | let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart) | |
583 | + | let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserMinReward + minRewardPart) | |
584 | + | let claimedTotalPlusAvailableToClaim = (claimedByUserMinReward + minRewardPart) | |
484 | 585 | [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)] | |
586 | + | } | |
587 | + | else throw("Strict value is not equal to itself.") | |
485 | 588 | } | |
486 | - | else throw("Strict value is not equal to itself.") | |
487 | 589 | } | |
590 | + | else throw("Strict value is not equal to itself.") | |
488 | 591 | } | |
489 | 592 | ||
490 | 593 | ||
491 | 594 | ||
492 | 595 | @Callable(i) | |
493 | 596 | func claimWxREADONLY (lpAssetIdStr,userAddressStr) = { | |
494 | 597 | let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr) | |
495 | 598 | let stakedTotalKEY = keyStakedTotal(lpAssetIdStr) | |
496 | 599 | let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr) | |
497 | 600 | let stakedByUser = readStaked(stakedByUserKEY) | |
498 | 601 | let stakedTotal = readStaked(stakedTotalKEY) | |
499 | 602 | let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY) | |
500 | 603 | let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)) | |
501 | 604 | let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr)) | |
502 | 605 | let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) | |
503 | 606 | let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock()) | |
504 | 607 | let passedBlocks = if ((emissionStartBlock > height)) | |
505 | 608 | then 0 | |
506 | 609 | else (height - emissionStartBlock) | |
507 | 610 | let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT) | |
508 | 611 | let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal) | |
509 | - | let $ | |
510 | - | let wxToClaimUserNew = $ | |
511 | - | let integralSTATE = $ | |
512 | - | let debug = $ | |
612 | + | let $t02510625218 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0) | |
613 | + | let wxToClaimUserNew = $t02510625218._1 | |
614 | + | let integralSTATE = $t02510625218._2 | |
615 | + | let debug = $t02510625218._3 | |
513 | 616 | let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt]) | |
514 | 617 | let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil)) | |
515 | 618 | let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0]) | |
516 | 619 | let boostDebug = asString(boostInvResult[1]) | |
517 | 620 | let minRewardPart = availableToClaim | |
518 | 621 | let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)]) | |
519 | 622 | let totalReward = (minRewardPart + boostRewardPart) | |
520 | - | $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)) | |
623 | + | $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), ((((debug + "::") + toString(userWxReward)) + "::BOOST::") + boostDebug)], SEP)) | |
624 | + | } | |
625 | + | ||
626 | + | ||
627 | + | ||
628 | + | @Callable(i) | |
629 | + | func usersListTraversal (lpAssetId) = { | |
630 | + | let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), ""))) | |
631 | + | then true | |
632 | + | else mustManager(i) | |
633 | + | if ((checkCaller == checkCaller)) | |
634 | + | then { | |
635 | + | let listName = getUsersListName(lpAssetId) | |
636 | + | let userOrUnit = getString(keyNextUser(lpAssetId)) | |
637 | + | let headOrUnit = getString(keyListHead(listName)) | |
638 | + | match userOrUnit { | |
639 | + | case _: Unit => | |
640 | + | match headOrUnit { | |
641 | + | case _: Unit => | |
642 | + | $Tuple2(nil, false) | |
643 | + | case head: String => | |
644 | + | $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true) | |
645 | + | case _ => | |
646 | + | throw("Match error") | |
647 | + | } | |
648 | + | case userAddress: String => | |
649 | + | let claimedByUser = getBigIntFromStringOrZero(this, keyClaimedByUser(lpAssetId, userAddress)) | |
650 | + | let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId)) | |
651 | + | let $t02681326916 = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0) | |
652 | + | let wxToClaimUserNew = $t02681326916._1 | |
653 | + | let integralSTATE = $t02681326916._2 | |
654 | + | let debug = $t02681326916._3 | |
655 | + | let availableToClaim = (wxToClaimUserNew - claimedByUser) | |
656 | + | let r = if ((availableToClaim > zeroBigInt)) | |
657 | + | then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress], nil) | |
658 | + | else unit | |
659 | + | if ((r == r)) | |
660 | + | then { | |
661 | + | let nextUserOrUnit = getString(keyListNext(listName, userAddress)) | |
662 | + | match nextUserOrUnit { | |
663 | + | case _: Unit => | |
664 | + | $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false) | |
665 | + | case nextUser: String => | |
666 | + | $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true) | |
667 | + | case _ => | |
668 | + | throw("Match error") | |
669 | + | } | |
670 | + | } | |
671 | + | else throw("Strict value is not equal to itself.") | |
672 | + | case _ => | |
673 | + | throw("Match error") | |
674 | + | } | |
675 | + | } | |
676 | + | else throw("Strict value is not equal to itself.") | |
521 | 677 | } | |
522 | 678 | ||
523 | 679 | ||
524 | 680 | ||
525 | 681 | @Callable(i) | |
526 | 682 | func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract)) | |
527 | 683 | then throw("permissions denied") | |
528 | 684 | else { | |
529 | - | let $ | |
530 | - | let wxPerLpIntegralNew = $ | |
531 | - | let poolIntegralSTATE = $ | |
532 | - | let poolDEBUG = $ | |
685 | + | let $t02759027700 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0) | |
686 | + | let wxPerLpIntegralNew = $t02759027700._1 | |
687 | + | let poolIntegralSTATE = $t02759027700._2 | |
688 | + | let poolDEBUG = $t02759027700._3 | |
533 | 689 | poolIntegralSTATE | |
534 | 690 | } | |
535 | 691 | ||
536 | 692 | ||
537 | 693 | @Verifier(tx) | |
538 | 694 | func verify () = { | |
539 | 695 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
540 | 696 | case pk: ByteVector => | |
541 | 697 | pk | |
542 | 698 | case _: Unit => | |
543 | 699 | tx.senderPublicKey | |
544 | 700 | case _ => | |
545 | 701 | throw("Match error") | |
546 | 702 | } | |
547 | 703 | let migratorPublicKey = match migratorPublicKeyOrUnit() { | |
548 | 704 | case pk: ByteVector => | |
549 | 705 | pk | |
550 | 706 | case _: Unit => | |
551 | 707 | tx.senderPublicKey | |
552 | 708 | case _ => | |
553 | 709 | throw("Match error") | |
554 | 710 | } | |
555 | 711 | if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)) | |
556 | 712 | then true | |
557 | 713 | else sigVerify(tx.bodyBytes, tx.proofs[0], migratorPublicKey) | |
558 | 714 | } | |
559 | 715 |
github/deemru/w8io/026f985 93.13 ms ◑