tx · 8hraZNZWs8RcDguguFv4reGvojcGJg3AfgCgkfoMqnoR 3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy: -0.04000000 Waves 2022.08.09 20:03 [2177196] smart account 3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy > SELF 0.00000000 Waves
{ "type": 13, "id": "8hraZNZWs8RcDguguFv4reGvojcGJg3AfgCgkfoMqnoR", "fee": 4000000, "feeAssetId": null, "timestamp": 1660064651387, "version": 1, "sender": "3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy", "senderPublicKey": "FK9j3YFWVChXKESTn33fMZz1JseCNMMqHhfB7smxJo4e", "proofs": [ "48nu2R95fp6PtbrY3f8oLxPSWBo8VJdhnLK9oBcXdU7RC8ae8P1VMBxLcxUk4S8EserMiDTRMNxLhnu7Y5WGMw6Q" ], "script": "base64:BgIqCAISBQoDAQgIEgASABIDCgEBEgASABIAEgMKAQgSBAoCCAESAwoBARIAUAAJc2VwYXJhdG9yAgJfXwADU0VQAgJfXwAFTVVMVDYAwIQ9AAVNVUxUOACAwtcvAAZNVUxUWDYJALYCAQUFTVVMVDYABk1VTFRYOAkAtgIBBQVNVUxUOAAHTVVMVFgxOAkAtgIBAICAkLu61q3wDQAKV0FWRVNJRFNUUgIFV0FWRVMAB1dBVkVTSUQJANkEAQUKV0FWRVNJRFNUUgAZSWR4Q29udHJvbENmZ05ldXRyaW5vRGFwcAABABhJZHhDb250cm9sQ2ZnQXVjdGlvbkRhcHAAAgAUSWR4Q29udHJvbENmZ1JwZERhcHAAAwAVSWR4Q29udHJvbENmZ01hdGhEYXBwAAQAHElkeENvbnRyb2xDZmdMaXF1aWRhdGlvbkRhcHAABQAVSWR4Q29udHJvbENmZ1Jlc3REYXBwAAYAHUlkeENvbnRyb2xDZmdOb2RlUmVnaXN0cnlEYXBwAAcAHElkeENvbnRyb2xDZmdOc2J0U3Rha2luZ0RhcHAACAAZSWR4Q29udHJvbENmZ01lZGlhdG9yRGFwcAAJABxJZHh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2h0TkVXBQNuaWwBaQEYZ25zYnRGcm9tU3VyZlNZU1JFQURPTkxZAQdzdXJmQW10CQCUCgIFA25pbAkBC3N1cmZUb0duc2J0AQUHc3VyZkFtdAFpARFjb25maWdTWVNSRUFET05MWQAECm1pbkxvY2tBbXQJARFAZXh0ck5hdGl2ZSgxMDU1KQEJARBrZXlNaW5Mb2NrQW1vdW50AAQgc3VyZlZvdGluZ1Bvd2VyUmVzdHJpY3RpdmVQZXJpb2QJAGgCAKALAA4EG2JyVG9TdGFydFN1cmZUcmFuc2Zvcm1hdGlvbgCwmEYJAJQKAgUDbmlsCQDMCAIFCm1pbkxvY2tBbXQJAMwIAgkAaAIFEmduc2J0RnJvbVN1cmZDb2VmZgUFTVVMVDYJAMwIAgUgc3VyZlZvdGluZ1Bvd2VyUmVzdHJpY3RpdmVQZXJpb2QJAMwIAgUbYnJUb1N0YXJ0U3VyZlRyYW5zZm9ybWF0aW9uBQNuaWwAODVa1g==", "chainId": 84, "height": 2177196, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2UYAH4ZPNW5g4fQtxyKBtSWvgRJwXpEbWG1k3BUafkJA Next: 295jyYfSD5FqVAecBXQbuLR7xsT5M9YLR34GvwjYCkfH Diff:
Old | New | Differences | |
---|---|---|---|
425 | 425 | let isNewUser = $t01701117095._1 | |
426 | 426 | let stakedAmount = $t01701117095._2 | |
427 | 427 | let vpEffectiveHeight = $t01701117095._3 | |
428 | - | let swapParamsSTRUCT = asSwapParamsSTRUCT( | |
428 | + | let swapParamsSTRUCT = asSwapParamsSTRUCT(reentrantInvoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStr, 0], nil)) | |
429 | 429 | let swapLimitMax = swapParamsSTRUCT._1 | |
430 | 430 | let swapLimitSpent = swapParamsSTRUCT._2 | |
431 | 431 | let blcks2LmtReset = swapParamsSTRUCT._3 | |
437 | 437 | then throw(((("Requested " + toString(amount)) + ", but staked only ") + toString(stakedAmount))) | |
438 | 438 | else { | |
439 | 439 | let stakedAmountNEW = (stakedAmount - amount) | |
440 | - | let $ | |
440 | + | let $t01776517923 = StatsResult(-(amount), if ((amount == stakedAmount)) | |
441 | 441 | then -1 | |
442 | 442 | else 0, if ((amount == stakedAmount)) | |
443 | 443 | then -1 | |
444 | 444 | else 0) | |
445 | - | let statsEntries = $ | |
446 | - | let totalStaked = $ | |
447 | - | let totalStakedNew = $ | |
445 | + | let statsEntries = $t01776517923._1 | |
446 | + | let totalStaked = $t01776517923._2 | |
447 | + | let totalStakedNew = $t01776517923._3 | |
448 | 448 | ((([ScriptTransfer(userAddress, amount, stakedAssetId), HistoryRecordEntry("unstake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeight)] ++ RewardEntries(false, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeight)) ++ statsEntries) | |
449 | 449 | } | |
450 | 450 | } | |
536 | 536 | } | |
537 | 537 | else { | |
538 | 538 | let userAddress = addressFromStringValue(userAddressStr) | |
539 | - | let $ | |
540 | - | let isNewUser = $ | |
541 | - | let stakedAmount = $ | |
542 | - | let stakingStart = $ | |
539 | + | let $t02049720602 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
540 | + | let isNewUser = $t02049720602._1 | |
541 | + | let stakedAmount = $t02049720602._2 | |
542 | + | let stakingStart = $t02049720602._3 | |
543 | 543 | let stakedAmountX = toBigInt(stakedAmount) | |
544 | 544 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
545 | 545 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
546 | 546 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
547 | 547 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
548 | - | let $ | |
549 | - | let rewardTotal = $ | |
550 | - | let cached = $ | |
551 | - | let dynamic = $ | |
552 | - | let rewardCachedPartKEY = $ | |
548 | + | let $t02094821086 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
549 | + | let rewardTotal = $t02094821086._1 | |
550 | + | let cached = $t02094821086._2 | |
551 | + | let dynamic = $t02094821086._3 | |
552 | + | let rewardCachedPartKEY = $t02094821086._4 | |
553 | 553 | let claimed = valueOrElse(getInteger(keyClaimed(userAddressStr, asset)), 0) | |
554 | 554 | ((accum + makeString([asset, toString(rewardTotal), toString(claimed)], ":")) + "_") | |
555 | 555 | } |
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 | 163 | case struct: (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 | 229 | let $t089429077 = calcReward(userAddress, asset, stakedAmountX, depositNumUser, depositNumLast) | |
230 | 230 | let rewardTotal = $t089429077._1 | |
231 | 231 | let cached = $t089429077._2 | |
232 | 232 | let dynamic = $t089429077._3 | |
233 | 233 | let rewardCachedPartKEY = $t089429077._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 | 293 | let $t01273012840 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
294 | 294 | let isNewUser = $t01273012840._1 | |
295 | 295 | let stakedAmount = $t01273012840._2 | |
296 | 296 | let vpEffectiveHeight = $t01273012840._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 | 309 | let $t01332613380 = getParamsOrFail() | |
310 | 310 | let stakedAssetId = $t01332613380._1 | |
311 | 311 | let minLockAmount = $t01332613380._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 | 332 | let $t01417914281 = StatsResult(amount, 1, if (isNewUser) | |
333 | 333 | then 1 | |
334 | 334 | else 0) | |
335 | 335 | let statsEntries = $t01417914281._1 | |
336 | 336 | let totalStaked = $t01417914281._2 | |
337 | 337 | let totalStakedNew = $t01417914281._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 | 350 | let $t01476014865 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
351 | 351 | let isNewUser = $t01476014865._1 | |
352 | 352 | let stakedAmount = $t01476014865._2 | |
353 | 353 | let stakingStart = $t01476014865._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 | 359 | let $t01523615374 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
360 | 360 | let rewardTotal = $t01523615374._1 | |
361 | 361 | let cached = $t01523615374._2 | |
362 | 362 | let dynamic = $t01523615374._3 | |
363 | 363 | let rewardCachedPartKEY = $t01523615374._4 | |
364 | 364 | let claimedKEY = keyClaimed(userAddressStr, asset) | |
365 | 365 | let $t01543415471 = accum | |
366 | 366 | let data = $t01543415471._1 | |
367 | 367 | let claimedAmtByAsset = $t01543415471._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 | 375 | let $t01593116045 = { | |
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 | 389 | let transfers = $t01593116045._1 | |
390 | 390 | let claimedAmtByAssetResult = $t01593116045._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 | 421 | let $t01695417008 = getParamsOrFail() | |
422 | 422 | let stakedAssetId = $t01695417008._1 | |
423 | 423 | let minLockAmount = $t01695417008._2 | |
424 | 424 | let $t01701117095 = getUserParamsOrFail(userAddress) | |
425 | 425 | let isNewUser = $t01701117095._1 | |
426 | 426 | let stakedAmount = $t01701117095._2 | |
427 | 427 | let vpEffectiveHeight = $t01701117095._3 | |
428 | - | let swapParamsSTRUCT = asSwapParamsSTRUCT( | |
428 | + | let swapParamsSTRUCT = asSwapParamsSTRUCT(reentrantInvoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStr, 0], nil)) | |
429 | 429 | let swapLimitMax = swapParamsSTRUCT._1 | |
430 | 430 | let swapLimitSpent = swapParamsSTRUCT._2 | |
431 | 431 | let blcks2LmtReset = swapParamsSTRUCT._3 | |
432 | 432 | if ((swapLimitSpent > 0)) | |
433 | 433 | then throw((("You have already made a swap operation. Wait " + toString((height + blcks2LmtReset))) + " height to unstake")) | |
434 | 434 | else if ((0 >= stakedAmount)) | |
435 | 435 | then throw("Nothing to unstake") | |
436 | 436 | else if ((amount > stakedAmount)) | |
437 | 437 | then throw(((("Requested " + toString(amount)) + ", but staked only ") + toString(stakedAmount))) | |
438 | 438 | else { | |
439 | 439 | let stakedAmountNEW = (stakedAmount - amount) | |
440 | - | let $ | |
440 | + | let $t01776517923 = StatsResult(-(amount), if ((amount == stakedAmount)) | |
441 | 441 | then -1 | |
442 | 442 | else 0, if ((amount == stakedAmount)) | |
443 | 443 | then -1 | |
444 | 444 | else 0) | |
445 | - | let statsEntries = $ | |
446 | - | let totalStaked = $ | |
447 | - | let totalStakedNew = $ | |
445 | + | let statsEntries = $t01776517923._1 | |
446 | + | let totalStaked = $t01776517923._2 | |
447 | + | let totalStakedNew = $t01776517923._3 | |
448 | 448 | ((([ScriptTransfer(userAddress, amount, stakedAssetId), HistoryRecordEntry("unstake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeight)] ++ RewardEntries(false, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeight)) ++ statsEntries) | |
449 | 449 | } | |
450 | 450 | } | |
451 | 451 | ||
452 | 452 | ||
453 | 453 | ||
454 | 454 | @Callable(i) | |
455 | 455 | func deposit () = if ((size(i.payments) != 1)) | |
456 | 456 | then throw("exact 1 payment is allowed only") | |
457 | 457 | else { | |
458 | 458 | let pmt = i.payments[0] | |
459 | 459 | let amount = pmt.amount | |
460 | 460 | let pmtAssetId = valueOrElse(pmt.assetId, WAVESID) | |
461 | 461 | let pmtAssetIdStr = toBase58String(pmtAssetId) | |
462 | 462 | let pmtMultX = if ((pmtAssetId == WAVESID)) | |
463 | 463 | then MULTX8 | |
464 | 464 | else MULTX6 | |
465 | 465 | let amountX = toBigInt(amount) | |
466 | 466 | let totalStaked = getIntOrElse(keyLockParamTotalAmount(), 0) | |
467 | 467 | let totalStakedX = toBigInt(totalStaked) | |
468 | 468 | if ((0 > totalStaked)) | |
469 | 469 | then throw("TODO: case is not supported") | |
470 | 470 | else if ((totalStaked == 0)) | |
471 | 471 | then IncrementNotDistributedRewardEntry(pmtAssetIdStr, amount) | |
472 | 472 | else { | |
473 | 473 | let rewardPerNsbtX18 = fraction(amountX, MULTX18, totalStakedX) | |
474 | 474 | let depositNumLastKEY = keyDepositNumLast() | |
475 | 475 | let depositNumLast = getIntOrElse(depositNumLastKEY, -1) | |
476 | 476 | let depositNumNew = (depositNumLast + 1) | |
477 | 477 | if (!(contains(supportedAssetsStr, pmtAssetIdStr))) | |
478 | 478 | then throw(((supportedAssetsStr + " doesn't contain ") + pmtAssetIdStr)) | |
479 | 479 | else { | |
480 | 480 | func refreshRewardPerNsbtSUM (accum,nextAsset) = { | |
481 | 481 | let rewardPerNsbtSumNewKEY = keyRewardPerNsbtSumAt(depositNumNew, nextAsset) | |
482 | 482 | let sumLastStr = getStrOrElse(keyRewardPerNsbtSumAt(depositNumLast, nextAsset), "0") | |
483 | 483 | (accum :+ (if ((nextAsset == pmtAssetIdStr)) | |
484 | 484 | then StringEntry(rewardPerNsbtSumNewKEY, toString((parseBigIntValue(sumLastStr) + rewardPerNsbtX18))) | |
485 | 485 | else StringEntry(rewardPerNsbtSumNewKEY, sumLastStr))) | |
486 | 486 | } | |
487 | 487 | ||
488 | 488 | ({ | |
489 | 489 | let $l = supportedAssetsList | |
490 | 490 | let $s = size($l) | |
491 | 491 | let $acc0 = nil | |
492 | 492 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
493 | 493 | then $a | |
494 | 494 | else refreshRewardPerNsbtSUM($a, $l[$i]) | |
495 | 495 | ||
496 | 496 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
497 | 497 | then $a | |
498 | 498 | else throw("List size exceeds 10") | |
499 | 499 | ||
500 | 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) | |
501 | 501 | } :+ IntegerEntry(depositNumLastKEY, depositNumNew)) | |
502 | 502 | } | |
503 | 503 | } | |
504 | 504 | } | |
505 | 505 | ||
506 | 506 | ||
507 | 507 | ||
508 | 508 | @Callable(i) | |
509 | 509 | func claimRewards () = commonClaim(i.caller, i) | |
510 | 510 | ||
511 | 511 | ||
512 | 512 | ||
513 | 513 | @Callable(i) | |
514 | 514 | func claimRewardsByOriginCaller () = commonClaim(i.originCaller, i) | |
515 | 515 | ||
516 | 516 | ||
517 | 517 | ||
518 | 518 | @Callable(i) | |
519 | 519 | func unclaimedRewardsREADONLY (userAddressStr) = { | |
520 | 520 | func forEachAssetZeroReward (accum,asset) = ((accum + makeString([asset, "0", "0"], ":")) + "_") | |
521 | 521 | ||
522 | 522 | let unclaimedRewardStr = if ((userAddressStr == "")) | |
523 | 523 | then { | |
524 | 524 | let $l = supportedAssetsList | |
525 | 525 | let $s = size($l) | |
526 | 526 | let $acc0 = "" | |
527 | 527 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
528 | 528 | then $a | |
529 | 529 | else forEachAssetZeroReward($a, $l[$i]) | |
530 | 530 | ||
531 | 531 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
532 | 532 | then $a | |
533 | 533 | else throw("List size exceeds 10") | |
534 | 534 | ||
535 | 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) | |
536 | 536 | } | |
537 | 537 | else { | |
538 | 538 | let userAddress = addressFromStringValue(userAddressStr) | |
539 | - | let $ | |
540 | - | let isNewUser = $ | |
541 | - | let stakedAmount = $ | |
542 | - | let stakingStart = $ | |
539 | + | let $t02049720602 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
540 | + | let isNewUser = $t02049720602._1 | |
541 | + | let stakedAmount = $t02049720602._2 | |
542 | + | let stakingStart = $t02049720602._3 | |
543 | 543 | let stakedAmountX = toBigInt(stakedAmount) | |
544 | 544 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
545 | 545 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
546 | 546 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
547 | 547 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
548 | - | let $ | |
549 | - | let rewardTotal = $ | |
550 | - | let cached = $ | |
551 | - | let dynamic = $ | |
552 | - | let rewardCachedPartKEY = $ | |
548 | + | let $t02094821086 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
549 | + | let rewardTotal = $t02094821086._1 | |
550 | + | let cached = $t02094821086._2 | |
551 | + | let dynamic = $t02094821086._3 | |
552 | + | let rewardCachedPartKEY = $t02094821086._4 | |
553 | 553 | let claimed = valueOrElse(getInteger(keyClaimed(userAddressStr, asset)), 0) | |
554 | 554 | ((accum + makeString([asset, toString(rewardTotal), toString(claimed)], ":")) + "_") | |
555 | 555 | } | |
556 | 556 | ||
557 | 557 | let $l = supportedAssetsList | |
558 | 558 | let $s = size($l) | |
559 | 559 | let $acc0 = "" | |
560 | 560 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
561 | 561 | then $a | |
562 | 562 | else forEachAssetCalcUnclaimedReward($a, $l[$i]) | |
563 | 563 | ||
564 | 564 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
565 | 565 | then $a | |
566 | 566 | else throw("List size exceeds 10") | |
567 | 567 | ||
568 | 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) | |
569 | 569 | } | |
570 | 570 | $Tuple2(nil, dropRight(unclaimedRewardStr, 1)) | |
571 | 571 | } | |
572 | 572 | ||
573 | 573 | ||
574 | 574 | ||
575 | 575 | @Callable(i) | |
576 | 576 | func surfStakingSYSREADONLY (userAddressStrOrEmpty,surfDiff) = { | |
577 | 577 | let surfTotal = getIntOrElse(keyLockParamTotalAmount(), 0) | |
578 | 578 | let gnsbtFromSurfTotal = surfToGnsbt(surfTotal) | |
579 | 579 | if ((userAddressStrOrEmpty == "")) | |
580 | 580 | then $Tuple2(nil, [0, surfTotal, 0, gnsbtFromSurfTotal, 0, height, height]) | |
581 | 581 | else { | |
582 | 582 | let userAddress = toAddressOrFail(userAddressStrOrEmpty) | |
583 | 583 | let mergedData = mergeStake(userAddress, surfDiff) | |
584 | 584 | let isNewUser = mergedData._1 | |
585 | 585 | let stakedAmount = mergedData._2 | |
586 | 586 | let vpEffectiveHeight = mergedData._3 | |
587 | 587 | let stakedAmountNEW = mergedData._4 | |
588 | 588 | let vpEffectiveHeightNEW = mergedData._5 | |
589 | 589 | let surfUser = stakedAmount | |
590 | 590 | let gnsbtFromSurfUser = surfToGnsbt(surfUser) | |
591 | 591 | $Tuple2(nil, [surfUser, surfTotal, gnsbtFromSurfUser, gnsbtFromSurfTotal, vpEffectiveHeight, vpEffectiveHeightNEW]) | |
592 | 592 | } | |
593 | 593 | } | |
594 | 594 | ||
595 | 595 | ||
596 | 596 | ||
597 | 597 | @Callable(i) | |
598 | 598 | func gnsbtFromSurfSYSREADONLY (surfAmt) = $Tuple2(nil, surfToGnsbt(surfAmt)) | |
599 | 599 | ||
600 | 600 | ||
601 | 601 | ||
602 | 602 | @Callable(i) | |
603 | 603 | func configSYSREADONLY () = { | |
604 | 604 | let minLockAmt = getIntegerValue(keyMinLockAmount()) | |
605 | 605 | let surfVotingPowerRestrictivePeriod = (1440 * 14) | |
606 | 606 | let brToStartSurfTransformation = 1150000 | |
607 | 607 | $Tuple2(nil, [minLockAmt, (gnsbtFromSurfCoeff * MULT6), surfVotingPowerRestrictivePeriod, brToStartSurfTransformation]) | |
608 | 608 | } | |
609 | 609 | ||
610 | 610 |
github/deemru/w8io/169f3d6 74.00 ms ◑