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