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