tx · 3ApXhpEpzLnhPGWfd1jugwrzbuBTBak5LamfMd5T58g3 3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy: -0.04000000 Waves 2022.08.09 19:47 [2177184] smart account 3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy > SELF 0.00000000 Waves
{ "type": 13, "id": "3ApXhpEpzLnhPGWfd1jugwrzbuBTBak5LamfMd5T58g3", "fee": 4000000, "feeAssetId": null, "timestamp": 1660063677878, "version": 1, "sender": "3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy", "senderPublicKey": "FK9j3YFWVChXKESTn33fMZz1JseCNMMqHhfB7smxJo4e", "proofs": [ "m9Z2CiWcrXN8aWLQ6U4faC9bZAXFwnD4i6JCxPuqW8Hp3vfP44pZKz8UM2HEMxp9iNshtvHkud8JLMsnP1ad84v" ], "script": "base64:BgIqCAISBQoDAQgIEgASABIDCgEBEgASABIAEgMKAQgSBAoCCAESAwoBARIAUAAJc2VwYXJhdG9yAgJfXwADU0VQAgJfXwAFTVVMVDYAwIQ9AAVNVUxUOACAwtcvAAZNVUxUWDYJALYCAQUFTVVMVDYABk1VTFRYOAkAtgIBBQVNVUxUOAAHTVVMVFgxOAkAtgIBAICAkLu61q3wDQAKV0FWRVNJRFNUUgIFV0FWRVMAB1dBVkVTSUQJANkEAQUKV0FWRVNJRFNUUgAZSWR4Q29udHJvbENmZ05ldXRyaW5vRGFwcAABABhJZHhDb250cm9sQ2ZnQXVjdGlvbkRhcHAAAgAUSWR4Q29udHJvbENmZ1JwZERhcHAAAwAVSWR4Q29udHJvbENmZ01hdGhEYXBwAAQAHElkeENvbnRyb2xDZmdMaXF1aWRhdGlvbkRhcHAABQAVSWR4Q29udHJvbENmZ1Jlc3REYXBwAAYAHUlkeENvbnRyb2xDZmdOb2RlUmVnaXN0cnlEYXBwAAcAHElkeENvbnRyb2xDZmdOc2J0U3Rha2luZ0RhcHAACAAZSWR4Q29udHJvbENmZ01lZGlhdG9yRGFwcAAJABxJZH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kVXBQNuaWwBaQEYZ25zYnRGcm9tU3VyZlNZU1JFQURPTkxZAQdzdXJmQW10CQCUCgIFA25pbAkBC3N1cmZUb0duc2J0AQUHc3VyZkFtdAFpARFjb25maWdTWVNSRUFET05MWQAECm1pbkxvY2tBbXQJARFAZXh0ck5hdGl2ZSgxMDU1KQEJARBrZXlNaW5Mb2NrQW1vdW50AAQgc3VyZlZvdGluZ1Bvd2VyUmVzdHJpY3RpdmVQZXJpb2QJAGgCAKALAA4EG2JyVG9TdGFydFN1cmZUcmFuc2Zvcm1hdGlvbgCwmEYJAJQKAgUDbmlsCQDMCAIFCm1pbkxvY2tBbXQJAMwIAgkAaAIFEmduc2J0RnJvbVN1cmZDb2VmZgUFTVVMVDYJAMwIAgUgc3VyZlZvdGluZ1Bvd2VyUmVzdHJpY3RpdmVQZXJpb2QJAMwIAgUbYnJUb1N0YXJ0U3VyZlRyYW5zZm9ybWF0aW9uBQNuaWwAZRiZyQ==", "chainId": 84, "height": 2177184, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GFD3midDb5GQmYzmU1e1UhA3DVBCZJiHoRYw2dZaGe6b Next: 2UYAH4ZPNW5g4fQtxyKBtSWvgRJwXpEbWG1k3BUafkJA Diff:
Old | New | Differences | |
---|---|---|---|
50 | 50 | func keyControlCfg () = "%s__controlConfig" | |
51 | 51 | ||
52 | 52 | ||
53 | + | func keyGnsbtFromSurfCoeff () = "%s%s__cfg__gnsbtFromSurfCoeff" | |
54 | + | ||
55 | + | ||
53 | 56 | func readControlCfgOrFail (control) = split(getStringOrFail(control, keyControlCfg()), SEP) | |
54 | 57 | ||
55 | 58 | ||
65 | 68 | let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp) | |
66 | 69 | ||
67 | 70 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
71 | + | ||
72 | + | let gnsbtFromSurfCoeff = valueOrElse(getInteger(this, keyGnsbtFromSurfCoeff()), 300) | |
68 | 73 | ||
69 | 74 | func keyBondAsset () = "bond_asset_id" | |
70 | 75 | ||
154 | 159 | } | |
155 | 160 | ||
156 | 161 | ||
162 | + | func asSwapParamsSTRUCT (v) = match v { | |
163 | + | case struct: (Int, Int, Int, Int, Int) => | |
164 | + | struct | |
165 | + | case _ => | |
166 | + | throw("fail to cast into Int") | |
167 | + | } | |
168 | + | ||
169 | + | ||
157 | 170 | func formatHistoryRecord (oldAmount,oldStart,newAmount,newStart) = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(oldAmount), toString(oldStart), toString(newAmount), toString(newStart)], separator) | |
158 | 171 | ||
159 | 172 | ||
213 | 226 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
214 | 227 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
215 | 228 | func forEachAssetCacheUserReward (accum,asset) = { | |
216 | - | let $ | |
217 | - | let rewardTotal = $ | |
218 | - | let cached = $ | |
219 | - | let dynamic = $ | |
220 | - | let rewardCachedPartKEY = $ | |
229 | + | let $t089429077 = calcReward(userAddress, asset, stakedAmountX, depositNumUser, depositNumLast) | |
230 | + | let rewardTotal = $t089429077._1 | |
231 | + | let cached = $t089429077._2 | |
232 | + | let dynamic = $t089429077._3 | |
233 | + | let rewardCachedPartKEY = $t089429077._4 | |
221 | 234 | (accum :+ IntegerEntry(rewardCachedPartKEY, rewardTotal)) | |
222 | 235 | } | |
223 | 236 | ||
259 | 272 | } | |
260 | 273 | ||
261 | 274 | ||
262 | - | func surfToGnsbt (surfAmt) = (surfAmt / | |
275 | + | func surfToGnsbt (surfAmt) = (surfAmt / gnsbtFromSurfCoeff) | |
263 | 276 | ||
264 | 277 | ||
265 | 278 | func mergeVotingPowerEffectiveHeight (quarantinePeriod,vpEffectiveHeight,stakedAmt,stakedAmtNEW) = { | |
277 | 290 | ||
278 | 291 | ||
279 | 292 | func mergeStake (userAddress,amountToAdd) = { | |
280 | - | let $ | |
281 | - | let isNewUser = $ | |
282 | - | let stakedAmount = $ | |
283 | - | let vpEffectiveHeight = $ | |
293 | + | let $t01273012840 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
294 | + | let isNewUser = $t01273012840._1 | |
295 | + | let stakedAmount = $t01273012840._2 | |
296 | + | let vpEffectiveHeight = $t01273012840._3 | |
284 | 297 | let stakedAmountNEW = if (isNewUser) | |
285 | 298 | then amountToAdd | |
286 | 299 | else (amountToAdd + stakedAmount) | |
293 | 306 | ||
294 | 307 | ||
295 | 308 | func commonStake (userAddress,i) = { | |
296 | - | let $ | |
297 | - | let stakedAssetId = $ | |
298 | - | let minLockAmount = $ | |
309 | + | let $t01332613380 = getParamsOrFail() | |
310 | + | let stakedAssetId = $t01332613380._1 | |
311 | + | let minLockAmount = $t01332613380._2 | |
299 | 312 | if ((size(i.payments) != 1)) | |
300 | 313 | then throw("Invalid payments size") | |
301 | 314 | else { | |
316 | 329 | if ((minLockAmount > stakedAmountNEW)) | |
317 | 330 | then throw(("Min lock amount is " + toString(minLockAmount))) | |
318 | 331 | else { | |
319 | - | let $ | |
332 | + | let $t01417914281 = StatsResult(amount, 1, if (isNewUser) | |
320 | 333 | then 1 | |
321 | 334 | else 0) | |
322 | - | let statsEntries = $ | |
323 | - | let totalStaked = $ | |
324 | - | let totalStakedNew = $ | |
335 | + | let statsEntries = $t01417914281._1 | |
336 | + | let totalStaked = $t01417914281._2 | |
337 | + | let totalStakedNew = $t01417914281._3 | |
325 | 338 | ((([HistoryRecordEntry("stake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeightNEW)] ++ RewardEntries(isNewUser, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeightNEW)) ++ statsEntries) | |
326 | 339 | } | |
327 | 340 | } | |
334 | 347 | if ((size(i.payments) > 0)) | |
335 | 348 | then throw("payments are not accepted") | |
336 | 349 | else { | |
337 | - | let $ | |
338 | - | let isNewUser = $ | |
339 | - | let stakedAmount = $ | |
340 | - | let stakingStart = $ | |
350 | + | let $t01476014865 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
351 | + | let isNewUser = $t01476014865._1 | |
352 | + | let stakedAmount = $t01476014865._2 | |
353 | + | let stakingStart = $t01476014865._3 | |
341 | 354 | let stakedAmountX = toBigInt(stakedAmount) | |
342 | 355 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
343 | 356 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
344 | 357 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
345 | 358 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
346 | - | let $ | |
347 | - | let rewardTotal = $ | |
348 | - | let cached = $ | |
349 | - | let dynamic = $ | |
350 | - | let rewardCachedPartKEY = $ | |
359 | + | let $t01523615374 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
360 | + | let rewardTotal = $t01523615374._1 | |
361 | + | let cached = $t01523615374._2 | |
362 | + | let dynamic = $t01523615374._3 | |
363 | + | let rewardCachedPartKEY = $t01523615374._4 | |
351 | 364 | let claimedKEY = keyClaimed(userAddressStr, asset) | |
352 | - | let $ | |
353 | - | let data = $ | |
354 | - | let claimedAmtByAsset = $ | |
365 | + | let $t01543415471 = accum | |
366 | + | let data = $t01543415471._1 | |
367 | + | let claimedAmtByAsset = $t01543415471._2 | |
355 | 368 | let newPart = makeString([asset, toString(rewardTotal)], ":") | |
356 | 369 | let claimedAmtByAssetNew = makeString([claimedAmtByAsset, newPart], "_") | |
357 | 370 | if ((0 >= rewardTotal)) | |
359 | 372 | else $Tuple2((((data :+ ScriptTransfer(userAddress, rewardTotal, toAssetVect(asset))) :+ IntegerEntry(claimedKEY, (valueOrElse(getInteger(claimedKEY), 0) + rewardTotal))) :+ IntegerEntry(rewardCachedPartKEY, 0)), claimedAmtByAssetNew) | |
360 | 373 | } | |
361 | 374 | ||
362 | - | let $ | |
375 | + | let $t01593116045 = { | |
363 | 376 | let $l = supportedAssetsList | |
364 | 377 | let $s = size($l) | |
365 | 378 | let $acc0 = $Tuple2(nil, "") | |
373 | 386 | ||
374 | 387 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
375 | 388 | } | |
376 | - | let transfers = $ | |
377 | - | let claimedAmtByAssetResult = $ | |
389 | + | let transfers = $t01593116045._1 | |
390 | + | let claimedAmtByAssetResult = $t01593116045._2 | |
378 | 391 | if ((0 >= size(transfers))) | |
379 | 392 | then nil | |
380 | 393 | else ((transfers :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) :+ ClaimHistoryEntry(userAddress, i.transactionId, drop(claimedAmtByAssetResult, 1))) | |
405 | 418 | else { | |
406 | 419 | let userAddress = i.caller | |
407 | 420 | let userAddressStr = toString(userAddress) | |
408 | - | let $t01664316697 = getParamsOrFail() | |
409 | - | let stakedAssetId = $t01664316697._1 | |
410 | - | let minLockAmount = $t01664316697._2 | |
411 | - | let $t01670016784 = getUserParamsOrFail(userAddress) | |
412 | - | let isNewUser = $t01670016784._1 | |
413 | - | let stakedAmount = $t01670016784._2 | |
414 | - | let vpEffectiveHeight = $t01670016784._3 | |
415 | - | if ((0 >= stakedAmount)) | |
416 | - | then throw("Nothing to unstake") | |
417 | - | else if ((amount > stakedAmount)) | |
418 | - | then throw(((("Requested " + toString(amount)) + ", but staked only ") + toString(stakedAmount))) | |
419 | - | else { | |
420 | - | let stakedAmountNEW = (stakedAmount - amount) | |
421 | - | let $t01702617184 = StatsResult(-(amount), if ((amount == stakedAmount)) | |
422 | - | then -1 | |
423 | - | else 0, if ((amount == stakedAmount)) | |
424 | - | then -1 | |
425 | - | else 0) | |
426 | - | let statsEntries = $t01702617184._1 | |
427 | - | let totalStaked = $t01702617184._2 | |
428 | - | let totalStakedNew = $t01702617184._3 | |
429 | - | ((([ScriptTransfer(userAddress, amount, stakedAssetId), HistoryRecordEntry("unstake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeight)] ++ RewardEntries(false, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeight)) ++ statsEntries) | |
430 | - | } | |
421 | + | let $t01695417008 = getParamsOrFail() | |
422 | + | let stakedAssetId = $t01695417008._1 | |
423 | + | let minLockAmount = $t01695417008._2 | |
424 | + | let $t01701117095 = getUserParamsOrFail(userAddress) | |
425 | + | let isNewUser = $t01701117095._1 | |
426 | + | let stakedAmount = $t01701117095._2 | |
427 | + | let vpEffectiveHeight = $t01701117095._3 | |
428 | + | let swapParamsSTRUCT = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddress, 0], nil)) | |
429 | + | let swapLimitMax = swapParamsSTRUCT._1 | |
430 | + | let swapLimitSpent = swapParamsSTRUCT._2 | |
431 | + | let blcks2LmtReset = swapParamsSTRUCT._3 | |
432 | + | if ((swapLimitSpent > 0)) | |
433 | + | then throw((("You have already made a swap operation. Wait " + toString((height + blcks2LmtReset))) + " height to unstake")) | |
434 | + | else if ((0 >= stakedAmount)) | |
435 | + | then throw("Nothing to unstake") | |
436 | + | else if ((amount > stakedAmount)) | |
437 | + | then throw(((("Requested " + toString(amount)) + ", but staked only ") + toString(stakedAmount))) | |
438 | + | else { | |
439 | + | let stakedAmountNEW = (stakedAmount - amount) | |
440 | + | let $t01775317911 = StatsResult(-(amount), if ((amount == stakedAmount)) | |
441 | + | then -1 | |
442 | + | else 0, if ((amount == stakedAmount)) | |
443 | + | then -1 | |
444 | + | else 0) | |
445 | + | let statsEntries = $t01775317911._1 | |
446 | + | let totalStaked = $t01775317911._2 | |
447 | + | let totalStakedNew = $t01775317911._3 | |
448 | + | ((([ScriptTransfer(userAddress, amount, stakedAssetId), HistoryRecordEntry("unstake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeight)] ++ RewardEntries(false, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeight)) ++ statsEntries) | |
449 | + | } | |
431 | 450 | } | |
432 | 451 | ||
433 | 452 | ||
517 | 536 | } | |
518 | 537 | else { | |
519 | 538 | let userAddress = addressFromStringValue(userAddressStr) | |
520 | - | let $ | |
521 | - | let isNewUser = $ | |
522 | - | let stakedAmount = $ | |
523 | - | let stakingStart = $ | |
539 | + | let $t02048520590 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
540 | + | let isNewUser = $t02048520590._1 | |
541 | + | let stakedAmount = $t02048520590._2 | |
542 | + | let stakingStart = $t02048520590._3 | |
524 | 543 | let stakedAmountX = toBigInt(stakedAmount) | |
525 | 544 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
526 | 545 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
527 | 546 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
528 | 547 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
529 | - | let $ | |
530 | - | let rewardTotal = $ | |
531 | - | let cached = $ | |
532 | - | let dynamic = $ | |
533 | - | let rewardCachedPartKEY = $ | |
548 | + | let $t02093621074 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
549 | + | let rewardTotal = $t02093621074._1 | |
550 | + | let cached = $t02093621074._2 | |
551 | + | let dynamic = $t02093621074._3 | |
552 | + | let rewardCachedPartKEY = $t02093621074._4 | |
534 | 553 | let claimed = valueOrElse(getInteger(keyClaimed(userAddressStr, asset)), 0) | |
535 | 554 | ((accum + makeString([asset, toString(rewardTotal), toString(claimed)], ":")) + "_") | |
536 | 555 | } | |
576 | 595 | ||
577 | 596 | ||
578 | 597 | @Callable(i) | |
598 | + | func gnsbtFromSurfSYSREADONLY (surfAmt) = $Tuple2(nil, surfToGnsbt(surfAmt)) | |
599 | + | ||
600 | + | ||
601 | + | ||
602 | + | @Callable(i) | |
579 | 603 | func configSYSREADONLY () = { | |
580 | 604 | let minLockAmt = getIntegerValue(keyMinLockAmount()) | |
581 | - | let gnsbtFromSurfCoeff = (300 * MULT6) | |
582 | 605 | let surfVotingPowerRestrictivePeriod = (1440 * 14) | |
583 | 606 | let brToStartSurfTransformation = 1150000 | |
584 | - | $Tuple2(nil, [minLockAmt, gnsbtFromSurfCoeff, surfVotingPowerRestrictivePeriod, brToStartSurfTransformation]) | |
607 | + | $Tuple2(nil, [minLockAmt, (gnsbtFromSurfCoeff * MULT6), surfVotingPowerRestrictivePeriod, brToStartSurfTransformation]) | |
585 | 608 | } | |
586 | 609 | ||
587 | 610 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | let MULT6 = 1000000 | |
9 | 9 | ||
10 | 10 | let MULT8 = 100000000 | |
11 | 11 | ||
12 | 12 | let MULTX6 = toBigInt(MULT6) | |
13 | 13 | ||
14 | 14 | let MULTX8 = toBigInt(MULT8) | |
15 | 15 | ||
16 | 16 | let MULTX18 = toBigInt(1000000000000000000) | |
17 | 17 | ||
18 | 18 | let WAVESIDSTR = "WAVES" | |
19 | 19 | ||
20 | 20 | let WAVESID = fromBase58String(WAVESIDSTR) | |
21 | 21 | ||
22 | 22 | let IdxControlCfgNeutrinoDapp = 1 | |
23 | 23 | ||
24 | 24 | let IdxControlCfgAuctionDapp = 2 | |
25 | 25 | ||
26 | 26 | let IdxControlCfgRpdDapp = 3 | |
27 | 27 | ||
28 | 28 | let IdxControlCfgMathDapp = 4 | |
29 | 29 | ||
30 | 30 | let IdxControlCfgLiquidationDapp = 5 | |
31 | 31 | ||
32 | 32 | let IdxControlCfgRestDapp = 6 | |
33 | 33 | ||
34 | 34 | let IdxControlCfgNodeRegistryDapp = 7 | |
35 | 35 | ||
36 | 36 | let IdxControlCfgNsbtStakingDapp = 8 | |
37 | 37 | ||
38 | 38 | let IdxControlCfgMediatorDapp = 9 | |
39 | 39 | ||
40 | 40 | let IdxControlCfgSurfStakingDapp = 10 | |
41 | 41 | ||
42 | 42 | let IdxControlCfgGnsbtControllerDapp = 11 | |
43 | 43 | ||
44 | 44 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func keyControlAddress () = "%s%s__config__controlAddress" | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func keyControlCfg () = "%s__controlConfig" | |
51 | 51 | ||
52 | 52 | ||
53 | + | func keyGnsbtFromSurfCoeff () = "%s%s__cfg__gnsbtFromSurfCoeff" | |
54 | + | ||
55 | + | ||
53 | 56 | func readControlCfgOrFail (control) = split(getStringOrFail(control, keyControlCfg()), SEP) | |
54 | 57 | ||
55 | 58 | ||
56 | 59 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
57 | 60 | ||
58 | 61 | ||
59 | 62 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
60 | 63 | ||
61 | 64 | let controlCfg = readControlCfgOrFail(controlContract) | |
62 | 65 | ||
63 | 66 | let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp) | |
64 | 67 | ||
65 | 68 | let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp) | |
66 | 69 | ||
67 | 70 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
71 | + | ||
72 | + | let gnsbtFromSurfCoeff = valueOrElse(getInteger(this, keyGnsbtFromSurfCoeff()), 300) | |
68 | 73 | ||
69 | 74 | func keyBondAsset () = "bond_asset_id" | |
70 | 75 | ||
71 | 76 | ||
72 | 77 | func keyAuctionContractAddress () = "auction_contract" | |
73 | 78 | ||
74 | 79 | ||
75 | 80 | func keyMinLockAmount () = "%s__minLockAmount" | |
76 | 81 | ||
77 | 82 | ||
78 | 83 | func keyStakedAssetId () = "%s__stakedAssetId" | |
79 | 84 | ||
80 | 85 | ||
81 | 86 | func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "amount"], separator) | |
82 | 87 | ||
83 | 88 | ||
84 | 89 | func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "start"], separator) | |
85 | 90 | ||
86 | 91 | ||
87 | 92 | func keyLockParamVotingPowerEffectiveHeight (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "vpEffectiveHeight"], separator) | |
88 | 93 | ||
89 | 94 | ||
90 | 95 | func keyHistoryRecord (type,userAddress,txId) = makeString(["%s%s%s%s", "history", type, toString(userAddress), toBase58String(txId)], separator) | |
91 | 96 | ||
92 | 97 | ||
93 | 98 | func keyLockParamTotalAmount () = makeString(["%s%s", "stats", "activeTotalLocked"], separator) | |
94 | 99 | ||
95 | 100 | ||
96 | 101 | func keyStatsLocksCount () = makeString(["%s%s", "stats", "locksCount"], separator) | |
97 | 102 | ||
98 | 103 | ||
99 | 104 | func keyStatsUsersCount () = makeString(["%s%s", "stats", "activeUsersCount"], separator) | |
100 | 105 | ||
101 | 106 | ||
102 | 107 | func keyNextPeriod () = "%s__nextPeriod" | |
103 | 108 | ||
104 | 109 | ||
105 | 110 | func keySupportedRewardAssets () = "supportedRewardAssets" | |
106 | 111 | ||
107 | 112 | ||
108 | 113 | func keyDepositNumLast () = makeString(["%s%s%s", "dep", "lastNum"], separator) | |
109 | 114 | ||
110 | 115 | ||
111 | 116 | func keyUserRewardFromDepositNum (userAddress) = makeString(["%s%s%s", "userRwdFromDepNum", userAddress], separator) | |
112 | 117 | ||
113 | 118 | ||
114 | 119 | func keyRewardPerNsbtSumAt (depositNum,tkn) = makeString(["%s%d", "rwdPerNsbtSumByDepNum", toString(depositNum), tkn], separator) | |
115 | 120 | ||
116 | 121 | ||
117 | 122 | func keyReward (userAddress,tkn) = makeString(["%s%s%s", "rwd", userAddress, tkn], separator) | |
118 | 123 | ||
119 | 124 | ||
120 | 125 | func keyClaimed (userAddress,tkn) = makeString(["%s%s%s", "clm", userAddress, tkn], separator) | |
121 | 126 | ||
122 | 127 | ||
123 | 128 | func keyNotDistributedReward (tkn) = makeString(["%s%s", "notDistributed", tkn], separator) | |
124 | 129 | ||
125 | 130 | ||
126 | 131 | func toX18 (origVal,origMult) = fraction(toBigInt(origVal), MULTX18, origMult) | |
127 | 132 | ||
128 | 133 | ||
129 | 134 | func getIntOrZero (key) = valueOrElse(getInteger(this, key), 0) | |
130 | 135 | ||
131 | 136 | ||
132 | 137 | func getIntOrElse (key,defaultVal) = valueOrElse(getInteger(this, key), defaultVal) | |
133 | 138 | ||
134 | 139 | ||
135 | 140 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("Mandatory this." + key) + " is not defined")) | |
136 | 141 | ||
137 | 142 | ||
138 | 143 | func getStrOrElse (key,defaultVal) = valueOrElse(getString(this, key), defaultVal) | |
139 | 144 | ||
140 | 145 | ||
141 | 146 | func toAddressOrFail (addressStr) = valueOrErrorMessage(addressFromString(addressStr), ("couldn't parse passed addressStr=" + addressStr)) | |
142 | 147 | ||
143 | 148 | ||
144 | 149 | func toAssetVect (assetStr) = if ((assetStr == WAVESIDSTR)) | |
145 | 150 | then unit | |
146 | 151 | else fromBase58String(assetStr) | |
147 | 152 | ||
148 | 153 | ||
149 | 154 | func asInt (val) = match val { | |
150 | 155 | case valInt: Int => | |
151 | 156 | valInt | |
152 | 157 | case _ => | |
153 | 158 | throw("fail to cast into Int") | |
154 | 159 | } | |
155 | 160 | ||
156 | 161 | ||
162 | + | func asSwapParamsSTRUCT (v) = match v { | |
163 | + | case struct: (Int, Int, Int, Int, Int) => | |
164 | + | struct | |
165 | + | case _ => | |
166 | + | throw("fail to cast into Int") | |
167 | + | } | |
168 | + | ||
169 | + | ||
157 | 170 | func formatHistoryRecord (oldAmount,oldStart,newAmount,newStart) = makeString(["%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(oldAmount), toString(oldStart), toString(newAmount), toString(newStart)], separator) | |
158 | 171 | ||
159 | 172 | ||
160 | 173 | func formatClaimHistoryRecord (user,claimedRewards) = makeString(["%s%d%d%s", user, toString(lastBlock.height), toString(lastBlock.timestamp), claimedRewards], separator) | |
161 | 174 | ||
162 | 175 | ||
163 | 176 | func HistoryRecordEntry (type,userAddress,txId,oldAmount,oldStart,newAmount,newStart) = StringEntry(keyHistoryRecord(type, userAddress, txId), formatHistoryRecord(oldAmount, oldStart, newAmount, newStart)) | |
164 | 177 | ||
165 | 178 | ||
166 | 179 | func ClaimHistoryEntry (userAddress,txId,claimedRewards) = StringEntry(keyHistoryRecord("claim", userAddress, txId), formatClaimHistoryRecord(toString(userAddress), claimedRewards)) | |
167 | 180 | ||
168 | 181 | ||
169 | 182 | func StatsResult (totalLockedInc,lockCountInc,usersCountInc) = { | |
170 | 183 | let locksCount = getIntOrZero(keyStatsLocksCount()) | |
171 | 184 | let usersCount = getIntOrZero(keyStatsUsersCount()) | |
172 | 185 | let totalAmount = getIntOrZero(keyLockParamTotalAmount()) | |
173 | 186 | let totalAmountNew = (totalAmount + totalLockedInc) | |
174 | 187 | $Tuple3([IntegerEntry(keyStatsLocksCount(), (locksCount + lockCountInc)), IntegerEntry(keyStatsUsersCount(), (usersCount + usersCountInc)), IntegerEntry(keyLockParamTotalAmount(), totalAmountNew)], totalAmount, totalAmountNew) | |
175 | 188 | } | |
176 | 189 | ||
177 | 190 | ||
178 | 191 | func LockParamsEntry (userAddress,amount,votingPowerEffectiveHeight) = [IntegerEntry(keyLockParamUserAmount(userAddress), amount), IntegerEntry(keyLockParamStartBlock(userAddress), votingPowerEffectiveHeight)] | |
179 | 192 | ||
180 | 193 | ||
181 | 194 | func getParamsOrFail () = $Tuple2(fromBase58String(getStringOrFail(this, keyStakedAssetId())), getIntOrFail(keyMinLockAmount())) | |
182 | 195 | ||
183 | 196 | ||
184 | 197 | func isActiveUser (userAddress) = (getIntOrElse(keyLockParamUserAmount(userAddress), 0) > 0) | |
185 | 198 | ||
186 | 199 | ||
187 | 200 | func getUserParamsOrUnit (userAddress) = if (isActiveUser(userAddress)) | |
188 | 201 | then $Tuple3(false, getIntOrFail(keyLockParamUserAmount(userAddress)), getIntOrFail(keyLockParamStartBlock(userAddress))) | |
189 | 202 | else unit | |
190 | 203 | ||
191 | 204 | ||
192 | 205 | func getUserParamsOrFail (userAddress) = valueOrErrorMessage(getUserParamsOrUnit(userAddress), (("User " + toString(userAddress)) + " is not defined")) | |
193 | 206 | ||
194 | 207 | ||
195 | 208 | let supportedAssetsStr = getStrOrElse(keySupportedRewardAssets(), "") | |
196 | 209 | ||
197 | 210 | let supportedAssetsList = split(supportedAssetsStr, "_") | |
198 | 211 | ||
199 | 212 | func calcReward (userAddress,assetId,stakedAmountX,depositNumUser,depositNumLast) = { | |
200 | 213 | let rewardPerNsbtSumLastKEY = keyRewardPerNsbtSumAt(depositNumLast, assetId) | |
201 | 214 | let sumLastX18 = parseBigIntValue(getStrOrElse(keyRewardPerNsbtSumAt(depositNumLast, assetId), "0")) | |
202 | 215 | let sumUserX18 = parseBigIntValue(getStrOrElse(keyRewardPerNsbtSumAt(depositNumUser, assetId), "0")) | |
203 | 216 | let rewardDynamicPart = toInt(fraction((sumLastX18 - sumUserX18), stakedAmountX, MULTX18)) | |
204 | 217 | let rewardCachedPartKEY = keyReward(userAddress, assetId) | |
205 | 218 | let rewardCachedPart = getIntOrElse(rewardCachedPartKEY, 0) | |
206 | 219 | $Tuple4((rewardCachedPart + rewardDynamicPart), rewardCachedPart, rewardDynamicPart, rewardCachedPartKEY) | |
207 | 220 | } | |
208 | 221 | ||
209 | 222 | ||
210 | 223 | func RewardEntries (isNewUser,userAddress,stakedAmount) = { | |
211 | 224 | let stakedAmountX = toBigInt(stakedAmount) | |
212 | 225 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddress) | |
213 | 226 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
214 | 227 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
215 | 228 | func forEachAssetCacheUserReward (accum,asset) = { | |
216 | - | let $ | |
217 | - | let rewardTotal = $ | |
218 | - | let cached = $ | |
219 | - | let dynamic = $ | |
220 | - | let rewardCachedPartKEY = $ | |
229 | + | let $t089429077 = calcReward(userAddress, asset, stakedAmountX, depositNumUser, depositNumLast) | |
230 | + | let rewardTotal = $t089429077._1 | |
231 | + | let cached = $t089429077._2 | |
232 | + | let dynamic = $t089429077._3 | |
233 | + | let rewardCachedPartKEY = $t089429077._4 | |
221 | 234 | (accum :+ IntegerEntry(rewardCachedPartKEY, rewardTotal)) | |
222 | 235 | } | |
223 | 236 | ||
224 | 237 | if (if ((depositNumLast == -1)) | |
225 | 238 | then (depositNumUser == -1) | |
226 | 239 | else false) | |
227 | 240 | then nil | |
228 | 241 | else if (if ((depositNumLast == -1)) | |
229 | 242 | then (depositNumUser > -1) | |
230 | 243 | else false) | |
231 | 244 | then throw("invalid depositNumLast and depositNumUser state") | |
232 | 245 | else if (if ((depositNumLast > -1)) | |
233 | 246 | then (depositNumUser >= -1) | |
234 | 247 | else false) | |
235 | 248 | then if (isNewUser) | |
236 | 249 | then [IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)] | |
237 | 250 | else ({ | |
238 | 251 | let $l = supportedAssetsList | |
239 | 252 | let $s = size($l) | |
240 | 253 | let $acc0 = nil | |
241 | 254 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
242 | 255 | then $a | |
243 | 256 | else forEachAssetCacheUserReward($a, $l[$i]) | |
244 | 257 | ||
245 | 258 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
246 | 259 | then $a | |
247 | 260 | else throw("List size exceeds 10") | |
248 | 261 | ||
249 | 262 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
250 | 263 | } :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) | |
251 | 264 | else throw(((("uncovered condition: depositNumLast=" + toString(depositNumLast)) + " depositNumUser=") + toString(depositNumUser))) | |
252 | 265 | } | |
253 | 266 | ||
254 | 267 | ||
255 | 268 | func IncrementNotDistributedRewardEntry (tkn,amountInc) = { | |
256 | 269 | let notDistributedRewardKEY = keyNotDistributedReward(tkn) | |
257 | 270 | let notDistributedReward = getIntOrElse(notDistributedRewardKEY, 0) | |
258 | 271 | [IntegerEntry(notDistributedRewardKEY, (notDistributedReward + amountInc))] | |
259 | 272 | } | |
260 | 273 | ||
261 | 274 | ||
262 | - | func surfToGnsbt (surfAmt) = (surfAmt / | |
275 | + | func surfToGnsbt (surfAmt) = (surfAmt / gnsbtFromSurfCoeff) | |
263 | 276 | ||
264 | 277 | ||
265 | 278 | func mergeVotingPowerEffectiveHeight (quarantinePeriod,vpEffectiveHeight,stakedAmt,stakedAmtNEW) = { | |
266 | 279 | let remainingToWait = (vpEffectiveHeight - height) | |
267 | 280 | if ((0 >= remainingToWait)) | |
268 | 281 | then (height + quarantinePeriod) | |
269 | 282 | else { | |
270 | 283 | let alreadyWaited = (quarantinePeriod - remainingToWait) | |
271 | 284 | let kX8 = if ((stakedAmtNEW != 0)) | |
272 | 285 | then fraction(stakedAmt, MULT8, stakedAmtNEW) | |
273 | 286 | else vpEffectiveHeight | |
274 | 287 | ((quarantinePeriod + height) - fraction(alreadyWaited, kX8, MULT8)) | |
275 | 288 | } | |
276 | 289 | } | |
277 | 290 | ||
278 | 291 | ||
279 | 292 | func mergeStake (userAddress,amountToAdd) = { | |
280 | - | let $ | |
281 | - | let isNewUser = $ | |
282 | - | let stakedAmount = $ | |
283 | - | let vpEffectiveHeight = $ | |
293 | + | let $t01273012840 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
294 | + | let isNewUser = $t01273012840._1 | |
295 | + | let stakedAmount = $t01273012840._2 | |
296 | + | let vpEffectiveHeight = $t01273012840._3 | |
284 | 297 | let stakedAmountNEW = if (isNewUser) | |
285 | 298 | then amountToAdd | |
286 | 299 | else (amountToAdd + stakedAmount) | |
287 | 300 | let quarantinePeriod = (1440 * 14) | |
288 | 301 | let vpEffectiveHeightNEW = if (isNewUser) | |
289 | 302 | then (quarantinePeriod + height) | |
290 | 303 | else mergeVotingPowerEffectiveHeight(quarantinePeriod, vpEffectiveHeight, stakedAmount, stakedAmountNEW) | |
291 | 304 | $Tuple5(isNewUser, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeightNEW) | |
292 | 305 | } | |
293 | 306 | ||
294 | 307 | ||
295 | 308 | func commonStake (userAddress,i) = { | |
296 | - | let $ | |
297 | - | let stakedAssetId = $ | |
298 | - | let minLockAmount = $ | |
309 | + | let $t01332613380 = getParamsOrFail() | |
310 | + | let stakedAssetId = $t01332613380._1 | |
311 | + | let minLockAmount = $t01332613380._2 | |
299 | 312 | if ((size(i.payments) != 1)) | |
300 | 313 | then throw("Invalid payments size") | |
301 | 314 | else { | |
302 | 315 | let payment = i.payments[0] | |
303 | 316 | let amount = payment.amount | |
304 | 317 | let invalidAssetMessage = (("Invalid asset. " + toBase58String(stakedAssetId)) + " is expected") | |
305 | 318 | let assetId = valueOrErrorMessage(payment.assetId, invalidAssetMessage) | |
306 | 319 | if ((assetId != stakedAssetId)) | |
307 | 320 | then throw(invalidAssetMessage) | |
308 | 321 | else { | |
309 | 322 | let userAddressStr = toString(userAddress) | |
310 | 323 | let mergedData = mergeStake(userAddress, amount) | |
311 | 324 | let isNewUser = mergedData._1 | |
312 | 325 | let stakedAmount = mergedData._2 | |
313 | 326 | let vpEffectiveHeight = mergedData._3 | |
314 | 327 | let stakedAmountNEW = mergedData._4 | |
315 | 328 | let vpEffectiveHeightNEW = mergedData._5 | |
316 | 329 | if ((minLockAmount > stakedAmountNEW)) | |
317 | 330 | then throw(("Min lock amount is " + toString(minLockAmount))) | |
318 | 331 | else { | |
319 | - | let $ | |
332 | + | let $t01417914281 = StatsResult(amount, 1, if (isNewUser) | |
320 | 333 | then 1 | |
321 | 334 | else 0) | |
322 | - | let statsEntries = $ | |
323 | - | let totalStaked = $ | |
324 | - | let totalStakedNew = $ | |
335 | + | let statsEntries = $t01417914281._1 | |
336 | + | let totalStaked = $t01417914281._2 | |
337 | + | let totalStakedNew = $t01417914281._3 | |
325 | 338 | ((([HistoryRecordEntry("stake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeightNEW)] ++ RewardEntries(isNewUser, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeightNEW)) ++ statsEntries) | |
326 | 339 | } | |
327 | 340 | } | |
328 | 341 | } | |
329 | 342 | } | |
330 | 343 | ||
331 | 344 | ||
332 | 345 | func commonClaim (userAddress,i) = { | |
333 | 346 | let userAddressStr = toString(userAddress) | |
334 | 347 | if ((size(i.payments) > 0)) | |
335 | 348 | then throw("payments are not accepted") | |
336 | 349 | else { | |
337 | - | let $ | |
338 | - | let isNewUser = $ | |
339 | - | let stakedAmount = $ | |
340 | - | let stakingStart = $ | |
350 | + | let $t01476014865 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
351 | + | let isNewUser = $t01476014865._1 | |
352 | + | let stakedAmount = $t01476014865._2 | |
353 | + | let stakingStart = $t01476014865._3 | |
341 | 354 | let stakedAmountX = toBigInt(stakedAmount) | |
342 | 355 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
343 | 356 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
344 | 357 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
345 | 358 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
346 | - | let $ | |
347 | - | let rewardTotal = $ | |
348 | - | let cached = $ | |
349 | - | let dynamic = $ | |
350 | - | let rewardCachedPartKEY = $ | |
359 | + | let $t01523615374 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
360 | + | let rewardTotal = $t01523615374._1 | |
361 | + | let cached = $t01523615374._2 | |
362 | + | let dynamic = $t01523615374._3 | |
363 | + | let rewardCachedPartKEY = $t01523615374._4 | |
351 | 364 | let claimedKEY = keyClaimed(userAddressStr, asset) | |
352 | - | let $ | |
353 | - | let data = $ | |
354 | - | let claimedAmtByAsset = $ | |
365 | + | let $t01543415471 = accum | |
366 | + | let data = $t01543415471._1 | |
367 | + | let claimedAmtByAsset = $t01543415471._2 | |
355 | 368 | let newPart = makeString([asset, toString(rewardTotal)], ":") | |
356 | 369 | let claimedAmtByAssetNew = makeString([claimedAmtByAsset, newPart], "_") | |
357 | 370 | if ((0 >= rewardTotal)) | |
358 | 371 | then $Tuple2(data, claimedAmtByAssetNew) | |
359 | 372 | else $Tuple2((((data :+ ScriptTransfer(userAddress, rewardTotal, toAssetVect(asset))) :+ IntegerEntry(claimedKEY, (valueOrElse(getInteger(claimedKEY), 0) + rewardTotal))) :+ IntegerEntry(rewardCachedPartKEY, 0)), claimedAmtByAssetNew) | |
360 | 373 | } | |
361 | 374 | ||
362 | - | let $ | |
375 | + | let $t01593116045 = { | |
363 | 376 | let $l = supportedAssetsList | |
364 | 377 | let $s = size($l) | |
365 | 378 | let $acc0 = $Tuple2(nil, "") | |
366 | 379 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
367 | 380 | then $a | |
368 | 381 | else forEachAssetCalcUnclaimedReward($a, $l[$i]) | |
369 | 382 | ||
370 | 383 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
371 | 384 | then $a | |
372 | 385 | else throw("List size exceeds 10") | |
373 | 386 | ||
374 | 387 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
375 | 388 | } | |
376 | - | let transfers = $ | |
377 | - | let claimedAmtByAssetResult = $ | |
389 | + | let transfers = $t01593116045._1 | |
390 | + | let claimedAmtByAssetResult = $t01593116045._2 | |
378 | 391 | if ((0 >= size(transfers))) | |
379 | 392 | then nil | |
380 | 393 | else ((transfers :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) :+ ClaimHistoryEntry(userAddress, i.transactionId, drop(claimedAmtByAssetResult, 1))) | |
381 | 394 | } | |
382 | 395 | } | |
383 | 396 | ||
384 | 397 | ||
385 | 398 | @Callable(i) | |
386 | 399 | func constructor (minLockAmount,supportedRewardAssets,stakedAssetId) = if ((i.caller != this)) | |
387 | 400 | then throw("Permission denied") | |
388 | 401 | else [IntegerEntry(keyMinLockAmount(), minLockAmount), StringEntry(keySupportedRewardAssets(), supportedRewardAssets), StringEntry(keyStakedAssetId(), stakedAssetId)] | |
389 | 402 | ||
390 | 403 | ||
391 | 404 | ||
392 | 405 | @Callable(i) | |
393 | 406 | func stake () = commonStake(i.caller, i) | |
394 | 407 | ||
395 | 408 | ||
396 | 409 | ||
397 | 410 | @Callable(i) | |
398 | 411 | func stakeByOriginCaller () = commonStake(i.originCaller, i) | |
399 | 412 | ||
400 | 413 | ||
401 | 414 | ||
402 | 415 | @Callable(i) | |
403 | 416 | func unstake (amount) = if ((size(i.payments) != 0)) | |
404 | 417 | then throw("unstake doesn't require any payment") | |
405 | 418 | else { | |
406 | 419 | let userAddress = i.caller | |
407 | 420 | let userAddressStr = toString(userAddress) | |
408 | - | let $t01664316697 = getParamsOrFail() | |
409 | - | let stakedAssetId = $t01664316697._1 | |
410 | - | let minLockAmount = $t01664316697._2 | |
411 | - | let $t01670016784 = getUserParamsOrFail(userAddress) | |
412 | - | let isNewUser = $t01670016784._1 | |
413 | - | let stakedAmount = $t01670016784._2 | |
414 | - | let vpEffectiveHeight = $t01670016784._3 | |
415 | - | if ((0 >= stakedAmount)) | |
416 | - | then throw("Nothing to unstake") | |
417 | - | else if ((amount > stakedAmount)) | |
418 | - | then throw(((("Requested " + toString(amount)) + ", but staked only ") + toString(stakedAmount))) | |
419 | - | else { | |
420 | - | let stakedAmountNEW = (stakedAmount - amount) | |
421 | - | let $t01702617184 = StatsResult(-(amount), if ((amount == stakedAmount)) | |
422 | - | then -1 | |
423 | - | else 0, if ((amount == stakedAmount)) | |
424 | - | then -1 | |
425 | - | else 0) | |
426 | - | let statsEntries = $t01702617184._1 | |
427 | - | let totalStaked = $t01702617184._2 | |
428 | - | let totalStakedNew = $t01702617184._3 | |
429 | - | ((([ScriptTransfer(userAddress, amount, stakedAssetId), HistoryRecordEntry("unstake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeight)] ++ RewardEntries(false, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeight)) ++ statsEntries) | |
430 | - | } | |
421 | + | let $t01695417008 = getParamsOrFail() | |
422 | + | let stakedAssetId = $t01695417008._1 | |
423 | + | let minLockAmount = $t01695417008._2 | |
424 | + | let $t01701117095 = getUserParamsOrFail(userAddress) | |
425 | + | let isNewUser = $t01701117095._1 | |
426 | + | let stakedAmount = $t01701117095._2 | |
427 | + | let vpEffectiveHeight = $t01701117095._3 | |
428 | + | let swapParamsSTRUCT = asSwapParamsSTRUCT(invoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddress, 0], nil)) | |
429 | + | let swapLimitMax = swapParamsSTRUCT._1 | |
430 | + | let swapLimitSpent = swapParamsSTRUCT._2 | |
431 | + | let blcks2LmtReset = swapParamsSTRUCT._3 | |
432 | + | if ((swapLimitSpent > 0)) | |
433 | + | then throw((("You have already made a swap operation. Wait " + toString((height + blcks2LmtReset))) + " height to unstake")) | |
434 | + | else if ((0 >= stakedAmount)) | |
435 | + | then throw("Nothing to unstake") | |
436 | + | else if ((amount > stakedAmount)) | |
437 | + | then throw(((("Requested " + toString(amount)) + ", but staked only ") + toString(stakedAmount))) | |
438 | + | else { | |
439 | + | let stakedAmountNEW = (stakedAmount - amount) | |
440 | + | let $t01775317911 = StatsResult(-(amount), if ((amount == stakedAmount)) | |
441 | + | then -1 | |
442 | + | else 0, if ((amount == stakedAmount)) | |
443 | + | then -1 | |
444 | + | else 0) | |
445 | + | let statsEntries = $t01775317911._1 | |
446 | + | let totalStaked = $t01775317911._2 | |
447 | + | let totalStakedNew = $t01775317911._3 | |
448 | + | ((([ScriptTransfer(userAddress, amount, stakedAssetId), HistoryRecordEntry("unstake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeight)] ++ RewardEntries(false, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeight)) ++ statsEntries) | |
449 | + | } | |
431 | 450 | } | |
432 | 451 | ||
433 | 452 | ||
434 | 453 | ||
435 | 454 | @Callable(i) | |
436 | 455 | func deposit () = if ((size(i.payments) != 1)) | |
437 | 456 | then throw("exact 1 payment is allowed only") | |
438 | 457 | else { | |
439 | 458 | let pmt = i.payments[0] | |
440 | 459 | let amount = pmt.amount | |
441 | 460 | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
442 | 461 | let pmtAssetIdStr = toBase58String(pmtAssetId) | |
443 | 462 | let pmtMultX = if ((pmtAssetId == WAVESID)) | |
444 | 463 | then MULTX8 | |
445 | 464 | else MULTX6 | |
446 | 465 | let amountX = toBigInt(amount) | |
447 | 466 | let totalStaked = getIntOrElse(keyLockParamTotalAmount(), 0) | |
448 | 467 | let totalStakedX = toBigInt(totalStaked) | |
449 | 468 | if ((0 > totalStaked)) | |
450 | 469 | then throw("TODO: case is not supported") | |
451 | 470 | else if ((totalStaked == 0)) | |
452 | 471 | then IncrementNotDistributedRewardEntry(pmtAssetIdStr, amount) | |
453 | 472 | else { | |
454 | 473 | let rewardPerNsbtX18 = fraction(amountX, MULTX18, totalStakedX) | |
455 | 474 | let depositNumLastKEY = keyDepositNumLast() | |
456 | 475 | let depositNumLast = getIntOrElse(depositNumLastKEY, -1) | |
457 | 476 | let depositNumNew = (depositNumLast + 1) | |
458 | 477 | if (!(contains(supportedAssetsStr, pmtAssetIdStr))) | |
459 | 478 | then throw(((supportedAssetsStr + " doesn't contain ") + pmtAssetIdStr)) | |
460 | 479 | else { | |
461 | 480 | func refreshRewardPerNsbtSUM (accum,nextAsset) = { | |
462 | 481 | let rewardPerNsbtSumNewKEY = keyRewardPerNsbtSumAt(depositNumNew, nextAsset) | |
463 | 482 | let sumLastStr = getStrOrElse(keyRewardPerNsbtSumAt(depositNumLast, nextAsset), "0") | |
464 | 483 | (accum :+ (if ((nextAsset == pmtAssetIdStr)) | |
465 | 484 | then StringEntry(rewardPerNsbtSumNewKEY, toString((parseBigIntValue(sumLastStr) + rewardPerNsbtX18))) | |
466 | 485 | else StringEntry(rewardPerNsbtSumNewKEY, sumLastStr))) | |
467 | 486 | } | |
468 | 487 | ||
469 | 488 | ({ | |
470 | 489 | let $l = supportedAssetsList | |
471 | 490 | let $s = size($l) | |
472 | 491 | let $acc0 = nil | |
473 | 492 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
474 | 493 | then $a | |
475 | 494 | else refreshRewardPerNsbtSUM($a, $l[$i]) | |
476 | 495 | ||
477 | 496 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
478 | 497 | then $a | |
479 | 498 | else throw("List size exceeds 10") | |
480 | 499 | ||
481 | 500 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
482 | 501 | } :+ IntegerEntry(depositNumLastKEY, depositNumNew)) | |
483 | 502 | } | |
484 | 503 | } | |
485 | 504 | } | |
486 | 505 | ||
487 | 506 | ||
488 | 507 | ||
489 | 508 | @Callable(i) | |
490 | 509 | func claimRewards () = commonClaim(i.caller, i) | |
491 | 510 | ||
492 | 511 | ||
493 | 512 | ||
494 | 513 | @Callable(i) | |
495 | 514 | func claimRewardsByOriginCaller () = commonClaim(i.originCaller, i) | |
496 | 515 | ||
497 | 516 | ||
498 | 517 | ||
499 | 518 | @Callable(i) | |
500 | 519 | func unclaimedRewardsREADONLY (userAddressStr) = { | |
501 | 520 | func forEachAssetZeroReward (accum,asset) = ((accum + makeString([asset, "0", "0"], ":")) + "_") | |
502 | 521 | ||
503 | 522 | let unclaimedRewardStr = if ((userAddressStr == "")) | |
504 | 523 | then { | |
505 | 524 | let $l = supportedAssetsList | |
506 | 525 | let $s = size($l) | |
507 | 526 | let $acc0 = "" | |
508 | 527 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
509 | 528 | then $a | |
510 | 529 | else forEachAssetZeroReward($a, $l[$i]) | |
511 | 530 | ||
512 | 531 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
513 | 532 | then $a | |
514 | 533 | else throw("List size exceeds 10") | |
515 | 534 | ||
516 | 535 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
517 | 536 | } | |
518 | 537 | else { | |
519 | 538 | let userAddress = addressFromStringValue(userAddressStr) | |
520 | - | let $ | |
521 | - | let isNewUser = $ | |
522 | - | let stakedAmount = $ | |
523 | - | let stakingStart = $ | |
539 | + | let $t02048520590 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
540 | + | let isNewUser = $t02048520590._1 | |
541 | + | let stakedAmount = $t02048520590._2 | |
542 | + | let stakingStart = $t02048520590._3 | |
524 | 543 | let stakedAmountX = toBigInt(stakedAmount) | |
525 | 544 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
526 | 545 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
527 | 546 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
528 | 547 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
529 | - | let $ | |
530 | - | let rewardTotal = $ | |
531 | - | let cached = $ | |
532 | - | let dynamic = $ | |
533 | - | let rewardCachedPartKEY = $ | |
548 | + | let $t02093621074 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
549 | + | let rewardTotal = $t02093621074._1 | |
550 | + | let cached = $t02093621074._2 | |
551 | + | let dynamic = $t02093621074._3 | |
552 | + | let rewardCachedPartKEY = $t02093621074._4 | |
534 | 553 | let claimed = valueOrElse(getInteger(keyClaimed(userAddressStr, asset)), 0) | |
535 | 554 | ((accum + makeString([asset, toString(rewardTotal), toString(claimed)], ":")) + "_") | |
536 | 555 | } | |
537 | 556 | ||
538 | 557 | let $l = supportedAssetsList | |
539 | 558 | let $s = size($l) | |
540 | 559 | let $acc0 = "" | |
541 | 560 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
542 | 561 | then $a | |
543 | 562 | else forEachAssetCalcUnclaimedReward($a, $l[$i]) | |
544 | 563 | ||
545 | 564 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
546 | 565 | then $a | |
547 | 566 | else throw("List size exceeds 10") | |
548 | 567 | ||
549 | 568 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
550 | 569 | } | |
551 | 570 | $Tuple2(nil, dropRight(unclaimedRewardStr, 1)) | |
552 | 571 | } | |
553 | 572 | ||
554 | 573 | ||
555 | 574 | ||
556 | 575 | @Callable(i) | |
557 | 576 | func surfStakingSYSREADONLY (userAddressStrOrEmpty,surfDiff) = { | |
558 | 577 | let surfTotal = getIntOrElse(keyLockParamTotalAmount(), 0) | |
559 | 578 | let gnsbtFromSurfTotal = surfToGnsbt(surfTotal) | |
560 | 579 | if ((userAddressStrOrEmpty == "")) | |
561 | 580 | then $Tuple2(nil, [0, surfTotal, 0, gnsbtFromSurfTotal, 0, height, height]) | |
562 | 581 | else { | |
563 | 582 | let userAddress = toAddressOrFail(userAddressStrOrEmpty) | |
564 | 583 | let mergedData = mergeStake(userAddress, surfDiff) | |
565 | 584 | let isNewUser = mergedData._1 | |
566 | 585 | let stakedAmount = mergedData._2 | |
567 | 586 | let vpEffectiveHeight = mergedData._3 | |
568 | 587 | let stakedAmountNEW = mergedData._4 | |
569 | 588 | let vpEffectiveHeightNEW = mergedData._5 | |
570 | 589 | let surfUser = stakedAmount | |
571 | 590 | let gnsbtFromSurfUser = surfToGnsbt(surfUser) | |
572 | 591 | $Tuple2(nil, [surfUser, surfTotal, gnsbtFromSurfUser, gnsbtFromSurfTotal, vpEffectiveHeight, vpEffectiveHeightNEW]) | |
573 | 592 | } | |
574 | 593 | } | |
575 | 594 | ||
576 | 595 | ||
577 | 596 | ||
578 | 597 | @Callable(i) | |
598 | + | func gnsbtFromSurfSYSREADONLY (surfAmt) = $Tuple2(nil, surfToGnsbt(surfAmt)) | |
599 | + | ||
600 | + | ||
601 | + | ||
602 | + | @Callable(i) | |
579 | 603 | func configSYSREADONLY () = { | |
580 | 604 | let minLockAmt = getIntegerValue(keyMinLockAmount()) | |
581 | - | let gnsbtFromSurfCoeff = (300 * MULT6) | |
582 | 605 | let surfVotingPowerRestrictivePeriod = (1440 * 14) | |
583 | 606 | let brToStartSurfTransformation = 1150000 | |
584 | - | $Tuple2(nil, [minLockAmt, gnsbtFromSurfCoeff, surfVotingPowerRestrictivePeriod, brToStartSurfTransformation]) | |
607 | + | $Tuple2(nil, [minLockAmt, (gnsbtFromSurfCoeff * MULT6), surfVotingPowerRestrictivePeriod, brToStartSurfTransformation]) | |
585 | 608 | } | |
586 | 609 | ||
587 | 610 |
github/deemru/w8io/169f3d6 95.53 ms ◑