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