tx · D8nCrZjFz3MAFFfDgPadLBbjhSijxEE1emYRayEDzyie 3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy: -0.03100000 Waves 2023.03.01 18:19 [2471170] smart account 3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy > SELF 0.00000000 Waves
{ "type": 13, "id": "D8nCrZjFz3MAFFfDgPadLBbjhSijxEE1emYRayEDzyie", "fee": 3100000, "feeAssetId": null, "timestamp": 1677683940155, "version": 2, "chainId": 84, "sender": "3N5yarEiTQccnnuerogYT3BxM5Zc5bRgDZy", "senderPublicKey": "FK9j3YFWVChXKESTn33fMZz1JseCNMMqHhfB7smxJo4e", "proofs": [ "3aJYfcAWBaj6LWHxbQBkse6qPQhyR8Fi1UoKutGtkopQ525AoWy1ZyELdAEE8D134puopTTTxVMpdShAW9qUVNTa" ], "script": "base64:BgIvCAISBQoDAQgIEgASABIDCgEBEgASABIAEgMKAQgSAwoBCBIECgIIARIDCgEBEgBoAAlzZXBhcmF0b3ICAl9fAANTRVACAl9fAAVNVUxUNgDAhD0ABU1VTFQ4AIDC1y8ABk1VTFRYNgkAtgIBBQVNVUxUNgAGTVVMVFg4CQC2AgEFBU1VTFQ4AAdNVUxUWDE4CQC2AgEAgICQu7rWrfANAApXQVZFU0lEU1RSAgVXQVZFUwAHV0FWRVNJRAkA2QQBBQpXQVZFU0lEU1RSAAlEQVlNSUxMSVMAgLiZKQANREVGQVVMVFBFUklPRAkAaAIAoAsADgAZSWR4Q29udHJvbENmZ05ldXRyaW5vRGFwcAABABhJZHhDb250cm9sQ2ZnQXVjdGlvbkRhcHAAAgAUSWR4Q29udHJvbENmZ1JwZERhcHAAAwAVSWR4Q29udHJvbENmZ01hdGhEYXBwAAQAHElkeENvbnRyb2xDZmdMaXF1aWRhdGlvbkRhcHAABQAVSWR4Q29udHJvbENmZ1Jlc3REYXBwAAYAHUlkeENvbnRyb2xDZmdOb2RlUmVnaXN0cnlEYXBwAAcAHElkeENvbnRyb2xDZmdOc2J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ity": 0 } View: original | compacted Prev: 2T6hx9eSuror7g1UcGXvPb9TD4ihNMRGoJASaZ2Rq5G2 Next: 7etKT7XUQjwwfrWitaju1cJvoNDDynuYXbi87DYRM714 Full:
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 DAYMILLIS = 86400000 | |
23 | 23 | ||
24 | 24 | let DEFAULTPERIOD = (1440 * 14) | |
25 | 25 | ||
26 | 26 | let IdxControlCfgNeutrinoDapp = 1 | |
27 | 27 | ||
28 | 28 | let IdxControlCfgAuctionDapp = 2 | |
29 | 29 | ||
30 | 30 | let IdxControlCfgRpdDapp = 3 | |
31 | 31 | ||
32 | 32 | let IdxControlCfgMathDapp = 4 | |
33 | 33 | ||
34 | 34 | let IdxControlCfgLiquidationDapp = 5 | |
35 | 35 | ||
36 | 36 | let IdxControlCfgRestDapp = 6 | |
37 | 37 | ||
38 | 38 | let IdxControlCfgNodeRegistryDapp = 7 | |
39 | 39 | ||
40 | 40 | let IdxControlCfgNsbtStakingDapp = 8 | |
41 | 41 | ||
42 | 42 | let IdxControlCfgMediatorDapp = 9 | |
43 | 43 | ||
44 | 44 | let IdxControlCfgSurfStakingDapp = 10 | |
45 | 45 | ||
46 | 46 | let IdxControlCfgGnsbtControllerDapp = 11 | |
47 | 47 | ||
48 | 48 | let IdxControlCfgRestV2Dapp = 12 | |
49 | 49 | ||
50 | 50 | let IdxControlCfgGovernanceDapp = 13 | |
51 | 51 | ||
52 | 52 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined")) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func keyControlAddress () = "%s%s__config__controlAddress" | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func keyControlCfg () = "%s__controlConfig" | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func keyGnsbtFromSurfCoeff () = "%s%s__cfg__gnsbtFromSurfCoeff" | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func readControlCfgOrFail (control) = split_4C(getStringOrFail(control, keyControlCfg()), SEP) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
71 | 71 | ||
72 | 72 | let controlCfg = readControlCfgOrFail(controlContract) | |
73 | 73 | ||
74 | 74 | let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp) | |
75 | 75 | ||
76 | 76 | let neutrinoContract = getContractAddressOrFail(controlCfg, IdxControlCfgNeutrinoDapp) | |
77 | 77 | ||
78 | 78 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
79 | 79 | ||
80 | 80 | let govContract = getContractAddressOrFail(controlCfg, IdxControlCfgGovernanceDapp) | |
81 | 81 | ||
82 | 82 | let gnsbtFromSurfCoeff = valueOrElse(getInteger(this, keyGnsbtFromSurfCoeff()), 300) | |
83 | 83 | ||
84 | 84 | func keyBondAsset () = "bond_asset_id" | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keyAuctionContractAddress () = "auction_contract" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyMinLockAmount () = "%s__minLockAmount" | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyStakedAssetId () = "%s__stakedAssetId" | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "amount"], separator) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func keyLockParamStartBlock (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "start"], separator) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func keyLockParamVotingPowerEffectiveHeight (userAddress) = makeString(["%s%s%s", "paramByUser", toString(userAddress), "vpEffectiveHeight"], separator) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func keyHistoryRecord (type,userAddress,txId) = makeString(["%s%s%s%s", "history", type, toString(userAddress), toBase58String(txId)], separator) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func keyLockParamTotalAmount () = makeString(["%s%s", "stats", "activeTotalLocked"], separator) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func keyStatsLocksCount () = makeString(["%s%s", "stats", "locksCount"], separator) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func keyStatsUsersCount () = makeString(["%s%s", "stats", "activeUsersCount"], separator) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func keyStatsDepositAmtByDay (timestamp) = makeString(["%s%s%d", "stats", "depositAmtByDay", toString(timestamp)], separator) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func keyStatsDepositAmtTotals () = makeString(["%s%s%d", "stats", "depositAmtTotals"], separator) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keySupportedRewardAssets () = "supportedRewardAssets" | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyDepositNumLast () = makeString(["%s%s%s", "dep", "lastNum"], separator) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func keyUserRewardFromDepositNum (userAddress) = makeString(["%s%s%s", "userRwdFromDepNum", userAddress], separator) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func keyRewardPerNsbtSumAt (depositNum,tkn) = makeString(["%s%d", "rwdPerNsbtSumByDepNum", toString(depositNum), tkn], separator) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func keyReward (userAddress,tkn) = makeString(["%s%s%s", "rwd", userAddress, tkn], separator) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func keyClaimed (userAddress,tkn) = makeString(["%s%s%s", "clm", userAddress, tkn], separator) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func keyNotDistributedReward (tkn) = makeString(["%s%s", "notDistributed", tkn], separator) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func keyVpPeriodDuration () = makeString(["%s%s", "vp", "periodDuration"], separator) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func keyLastTotalsPeriodProcessed () = makeString(["%s%s", "vp", "lastTotalsPeriodProcessed"], separator) | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func keyLastUserPeriodProcessed (userAddress) = makeString(["%s%s%s", "vp", "lastUserPeriodProcessed", userAddress], separator) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func keyTotalMature () = makeString(["%s%s", "vp", "totalMature"], separator) | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func keyTotalTeen () = makeString(["%s%s", "vp", "totalTeen"], separator) | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func keyTotalKid () = makeString(["%s%s", "vp", "totalKid"], separator) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func keyUserMature (userAddress) = makeString(["%s%s%s", "vp", "userMature", userAddress], separator) | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func keyUserTeen (userAddress) = makeString(["%s%s%s", "vp", "userTeen", userAddress], separator) | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func keyUserKid (userAddress) = makeString(["%s%s%s", "vp", "userKid", userAddress], separator) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func toX18 (origVal,origMult) = fraction(toBigInt(origVal), MULTX18, origMult) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func getIntOrZero (key) = valueOrElse(getInteger(this, key), 0) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func getIntOrElse (key,defaultVal) = valueOrElse(getInteger(this, key), defaultVal) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (("Mandatory this." + key) + " is not defined")) | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | func getStrOrElse (key,defaultVal) = valueOrElse(getString(this, key), defaultVal) | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | func toAddressOrFail (addressStr) = valueOrErrorMessage(addressFromString(addressStr), ("couldn't parse passed addressStr=" + addressStr)) | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func toAssetVect (assetStr) = if ((assetStr == WAVESIDSTR)) | |
190 | 190 | then unit | |
191 | 191 | else fromBase58String(assetStr) | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func asInt (val) = match val { | |
195 | 195 | case valInt: Int => | |
196 | 196 | valInt | |
197 | 197 | case _ => | |
198 | 198 | throw("fail to cast into Int") | |
199 | 199 | } | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func asSwapParamsSTRUCT (v) = match v { | |
203 | 203 | case struct: (Int, Int, Int, Int, Int, Int, Int) => | |
204 | 204 | struct | |
205 | 205 | case _ => | |
206 | 206 | throw("fail to cast into Int") | |
207 | 207 | } | |
208 | 208 | ||
209 | 209 | ||
210 | 210 | 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) | |
211 | 211 | ||
212 | 212 | ||
213 | 213 | func formatClaimHistoryRecord (user,claimedRewards) = makeString(["%s%d%d%s", user, toString(lastBlock.height), toString(lastBlock.timestamp), claimedRewards], separator) | |
214 | 214 | ||
215 | 215 | ||
216 | 216 | func HistoryRecordEntry (type,userAddress,txId,oldAmount,oldStart,newAmount,newStart) = StringEntry(keyHistoryRecord(type, userAddress, txId), formatHistoryRecord(oldAmount, oldStart, newAmount, newStart)) | |
217 | 217 | ||
218 | 218 | ||
219 | 219 | func ClaimHistoryEntry (userAddress,txId,claimedRewards) = StringEntry(keyHistoryRecord("claim", userAddress, txId), formatClaimHistoryRecord(toString(userAddress), claimedRewards)) | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | func StatsResult (totalLockedInc,lockCountInc,usersCountInc) = { | |
223 | 223 | let locksCount = getIntOrZero(keyStatsLocksCount()) | |
224 | 224 | let usersCount = getIntOrZero(keyStatsUsersCount()) | |
225 | 225 | let totalAmount = getIntOrZero(keyLockParamTotalAmount()) | |
226 | 226 | let totalAmountNew = (totalAmount + totalLockedInc) | |
227 | 227 | $Tuple3([IntegerEntry(keyStatsLocksCount(), (locksCount + lockCountInc)), IntegerEntry(keyStatsUsersCount(), (usersCount + usersCountInc)), IntegerEntry(keyLockParamTotalAmount(), totalAmountNew)], totalAmount, totalAmountNew) | |
228 | 228 | } | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | func LockParamsEntry (userAddress,amount,votingPowerEffectiveHeight) = [IntegerEntry(keyLockParamUserAmount(userAddress), amount), IntegerEntry(keyLockParamStartBlock(userAddress), votingPowerEffectiveHeight)] | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | func getParamsOrFail () = $Tuple2(fromBase58String(getStringOrFail(this, keyStakedAssetId())), getIntOrFail(keyMinLockAmount())) | |
235 | 235 | ||
236 | 236 | ||
237 | 237 | func isActiveUser (userAddress) = (getIntOrElse(keyLockParamUserAmount(userAddress), 0) > 0) | |
238 | 238 | ||
239 | 239 | ||
240 | 240 | func getUserParamsOrUnit (userAddress) = if (isActiveUser(userAddress)) | |
241 | 241 | then $Tuple3(false, getIntOrFail(keyLockParamUserAmount(userAddress)), getIntOrFail(keyLockParamStartBlock(userAddress))) | |
242 | 242 | else unit | |
243 | 243 | ||
244 | 244 | ||
245 | 245 | func getUserParamsOrFail (userAddress) = valueOrErrorMessage(getUserParamsOrUnit(userAddress), (("User " + toString(userAddress)) + " is not defined")) | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | let supportedAssetsStr = getStrOrElse(keySupportedRewardAssets(), "") | |
249 | 249 | ||
250 | 250 | let supportedAssetsList = split(supportedAssetsStr, "_") | |
251 | 251 | ||
252 | 252 | func calcReward (userAddress,assetId,stakedAmountX,depositNumUser,depositNumLast) = { | |
253 | 253 | let rewardPerNsbtSumLastKEY = keyRewardPerNsbtSumAt(depositNumLast, assetId) | |
254 | 254 | let sumLastX18 = parseBigIntValue(getStrOrElse(keyRewardPerNsbtSumAt(depositNumLast, assetId), "0")) | |
255 | 255 | let sumUserX18 = parseBigIntValue(getStrOrElse(keyRewardPerNsbtSumAt(depositNumUser, assetId), "0")) | |
256 | 256 | let rewardDynamicPart = toInt(fraction((sumLastX18 - sumUserX18), stakedAmountX, MULTX18)) | |
257 | 257 | let rewardCachedPartKEY = keyReward(userAddress, assetId) | |
258 | 258 | let rewardCachedPart = getIntOrElse(rewardCachedPartKEY, 0) | |
259 | 259 | $Tuple4((rewardCachedPart + rewardDynamicPart), rewardCachedPart, rewardDynamicPart, rewardCachedPartKEY) | |
260 | 260 | } | |
261 | 261 | ||
262 | 262 | ||
263 | 263 | func toStartOfDay (timestamp) = ((timestamp / DAYMILLIS) * DAYMILLIS) | |
264 | 264 | ||
265 | 265 | ||
266 | 266 | func findElementPosition (src,element,sep) = { | |
267 | 267 | let elementStart = valueOrErrorMessage(indexOf(src, element), ((("there is no substring " + element) + " in ") + src)) | |
268 | 268 | if ((elementStart == 0)) | |
269 | 269 | then 0 | |
270 | 270 | else { | |
271 | 271 | let left = take(src, elementStart) | |
272 | 272 | (size(split(left, sep)) - 1) | |
273 | 273 | } | |
274 | 274 | } | |
275 | 275 | ||
276 | 276 | ||
277 | 277 | let DepositTotalsPREFIX = "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d" | |
278 | 278 | ||
279 | 279 | let defaultTotalsDATA = (DepositTotalsPREFIX + "__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0__0") | |
280 | 280 | ||
281 | 281 | func RewardEntries (isNewUser,userAddress,stakedAmount) = { | |
282 | 282 | let stakedAmountX = toBigInt(stakedAmount) | |
283 | 283 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddress) | |
284 | 284 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
285 | 285 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
286 | 286 | func forEachAssetCacheUserReward (accum,asset) = { | |
287 | 287 | let $t01083110966 = calcReward(userAddress, asset, stakedAmountX, depositNumUser, depositNumLast) | |
288 | 288 | let rewardTotal = $t01083110966._1 | |
289 | 289 | let cached = $t01083110966._2 | |
290 | 290 | let dynamic = $t01083110966._3 | |
291 | 291 | let rewardCachedPartKEY = $t01083110966._4 | |
292 | 292 | (accum :+ IntegerEntry(rewardCachedPartKEY, rewardTotal)) | |
293 | 293 | } | |
294 | 294 | ||
295 | 295 | if (if ((depositNumLast == -1)) | |
296 | 296 | then (depositNumUser == -1) | |
297 | 297 | else false) | |
298 | 298 | then nil | |
299 | 299 | else if (if ((depositNumLast == -1)) | |
300 | 300 | then (depositNumUser > -1) | |
301 | 301 | else false) | |
302 | 302 | then throw("invalid depositNumLast and depositNumUser state") | |
303 | 303 | else if (if ((depositNumLast > -1)) | |
304 | 304 | then (depositNumUser >= -1) | |
305 | 305 | else false) | |
306 | 306 | then if (isNewUser) | |
307 | 307 | then [IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)] | |
308 | 308 | else ({ | |
309 | 309 | let $l = supportedAssetsList | |
310 | 310 | let $s = size($l) | |
311 | 311 | let $acc0 = nil | |
312 | 312 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
313 | 313 | then $a | |
314 | 314 | else forEachAssetCacheUserReward($a, $l[$i]) | |
315 | 315 | ||
316 | 316 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
317 | 317 | then $a | |
318 | 318 | else throw("List size exceeds 9") | |
319 | 319 | ||
320 | 320 | $f0_2($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) | |
321 | 321 | } :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) | |
322 | 322 | else throw(((("uncovered condition: depositNumLast=" + toString(depositNumLast)) + " depositNumUser=") + toString(depositNumUser))) | |
323 | 323 | } | |
324 | 324 | ||
325 | 325 | ||
326 | 326 | func IncrementNotDistributedRewardEntry (tkn,amountInc) = { | |
327 | 327 | let notDistributedRewardKEY = keyNotDistributedReward(tkn) | |
328 | 328 | let notDistributedReward = getIntOrElse(notDistributedRewardKEY, 0) | |
329 | 329 | IntegerEntry(notDistributedRewardKEY, (notDistributedReward + amountInc)) | |
330 | 330 | } | |
331 | 331 | ||
332 | 332 | ||
333 | 333 | func surfToGnsbt (surfAmt) = (surfAmt / gnsbtFromSurfCoeff) | |
334 | 334 | ||
335 | 335 | ||
336 | 336 | func mergeStake (userAddress,amountToAdd,userTeen,userKid) = { | |
337 | 337 | let $t01388713997 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
338 | 338 | let isNewUser = $t01388713997._1 | |
339 | 339 | let stakedAmount = $t01388713997._2 | |
340 | 340 | let vpEffectiveHeight = $t01388713997._3 | |
341 | 341 | let stakedAmountNEW = if (isNewUser) | |
342 | 342 | then amountToAdd | |
343 | 343 | else (amountToAdd + stakedAmount) | |
344 | 344 | let W2 = getIntOrElse(keyVpPeriodDuration(), DEFAULTPERIOD) | |
345 | 345 | let period = (height / W2) | |
346 | 346 | let vpEffectivePeriodNEW = if ((userKid > 0)) | |
347 | 347 | then (period + 2) | |
348 | 348 | else if ((userTeen > 0)) | |
349 | 349 | then (period + 1) | |
350 | 350 | else period | |
351 | 351 | $Tuple5(isNewUser, stakedAmount, vpEffectiveHeight, stakedAmountNEW, (vpEffectivePeriodNEW * W2)) | |
352 | 352 | } | |
353 | 353 | ||
354 | 354 | ||
355 | 355 | func updateTotals () = { | |
356 | 356 | let period = (height / getIntOrElse(keyVpPeriodDuration(), DEFAULTPERIOD)) | |
357 | 357 | if ((period > getIntOrZero(keyLastTotalsPeriodProcessed()))) | |
358 | 358 | then { | |
359 | 359 | let totalMature = valueOrElse(getInteger(keyTotalMature()), getIntOrZero(keyLockParamTotalAmount())) | |
360 | 360 | [IntegerEntry(keyTotalMature(), (totalMature + getIntOrZero(keyTotalTeen()))), IntegerEntry(keyTotalTeen(), getIntOrZero(keyTotalKid())), IntegerEntry(keyTotalKid(), 0), IntegerEntry(keyLastTotalsPeriodProcessed(), period)] | |
361 | 361 | } | |
362 | 362 | else nil | |
363 | 363 | } | |
364 | 364 | ||
365 | 365 | ||
366 | 366 | func onStake (userAddressStr,amountToAdd) = if ((0 > amountToAdd)) | |
367 | 367 | then throw("amountToAdd should be >= 0") | |
368 | 368 | else { | |
369 | 369 | let W2 = getIntOrElse(keyVpPeriodDuration(), DEFAULTPERIOD) | |
370 | 370 | let period = (height / W2) | |
371 | 371 | let totalMature = valueOrElse(getInteger(keyTotalMature()), getIntOrZero(keyLockParamTotalAmount())) | |
372 | 372 | let totalTeen = getIntOrZero(keyTotalTeen()) | |
373 | 373 | let totalKid = getIntOrZero(keyTotalKid()) | |
374 | 374 | let userMature = if ((userAddressStr == "")) | |
375 | 375 | then 0 | |
376 | 376 | else valueOrElse(getInteger(keyUserMature(userAddressStr)), getIntOrZero(keyLockParamUserAmount(addressFromStringValue(userAddressStr)))) | |
377 | 377 | let userTeen = getIntOrZero(keyUserTeen(userAddressStr)) | |
378 | 378 | let userKid = getIntOrZero(keyUserKid(userAddressStr)) | |
379 | 379 | let tmp = if ((period > getIntOrZero(keyLastUserPeriodProcessed(userAddressStr)))) | |
380 | 380 | then $Tuple7((totalMature + userTeen), (totalTeen + (userKid - userTeen)), (totalKid - userKid), (userMature + userTeen), userKid, 0, [IntegerEntry(keyLastUserPeriodProcessed(userAddressStr), period)]) | |
381 | 381 | else $Tuple7(totalMature, totalTeen, totalKid, userMature, userTeen, userKid, nil) | |
382 | 382 | let totals = if ((period > getIntOrZero(keyLastTotalsPeriodProcessed()))) | |
383 | 383 | then $Tuple4([IntegerEntry(keyTotalMature(), (tmp._1 + tmp._2)), IntegerEntry(keyTotalTeen(), tmp._3), IntegerEntry(keyTotalKid(), 0), IntegerEntry(keyLastTotalsPeriodProcessed(), period)], (tmp._1 + tmp._2), tmp._3, 0) | |
384 | 384 | else $Tuple4(nil, totalMature, totalTeen, totalKid) | |
385 | 385 | let newKid = fraction(amountToAdd, (height % W2), W2) | |
386 | 386 | let newTeen = (amountToAdd - newKid) | |
387 | 387 | $Tuple7(((((totals._1 :+ IntegerEntry(keyUserMature(userAddressStr), tmp._4)) :+ IntegerEntry(keyUserTeen(userAddressStr), (tmp._5 + newTeen))) :+ IntegerEntry(keyUserKid(userAddressStr), (tmp._6 + newKid))) ++ tmp._7), totals._2, totals._3, totals._4, tmp._4, (tmp._5 + newTeen), (tmp._6 + newKid)) | |
388 | 388 | } | |
389 | 389 | ||
390 | 390 | ||
391 | 391 | let IdxNewDiff = 0 | |
392 | 392 | ||
393 | 393 | let IdxNewGnsbt = 1 | |
394 | 394 | ||
395 | 395 | func userDecrease (gnsbt,diff) = if ((diff >= gnsbt)) | |
396 | 396 | then [(diff - gnsbt), 0] | |
397 | 397 | else [0, (gnsbt - diff)] | |
398 | 398 | ||
399 | 399 | ||
400 | 400 | func onUnstake (userAddressStr,amountToRemove) = if ((0 >= amountToRemove)) | |
401 | 401 | then throw("amountToRemove should be > 0") | |
402 | 402 | else { | |
403 | 403 | let W2 = getIntOrElse(keyVpPeriodDuration(), DEFAULTPERIOD) | |
404 | 404 | let period = (height / W2) | |
405 | 405 | let totalMature = valueOrElse(getInteger(keyTotalMature()), getIntOrZero(keyLockParamTotalAmount())) | |
406 | 406 | let totalTeen = getIntOrZero(keyTotalTeen()) | |
407 | 407 | let totalKid = getIntOrZero(keyTotalKid()) | |
408 | 408 | let userMature = if ((userAddressStr == "")) | |
409 | 409 | then 0 | |
410 | 410 | else valueOrElse(getInteger(keyUserMature(userAddressStr)), getIntOrZero(keyLockParamUserAmount(addressFromStringValue(userAddressStr)))) | |
411 | 411 | let userTeen = getIntOrZero(keyUserTeen(userAddressStr)) | |
412 | 412 | let userKid = getIntOrZero(keyUserKid(userAddressStr)) | |
413 | 413 | let um = userDecrease(userMature, amountToRemove) | |
414 | 414 | let ut = userDecrease(userTeen, um[IdxNewDiff]) | |
415 | 415 | let uk = userDecrease(userKid, ut[IdxNewDiff]) | |
416 | 416 | if ((uk[IdxNewDiff] != 0)) | |
417 | 417 | then throw("Should not happen") | |
418 | 418 | else { | |
419 | 419 | let tmp = if ((period > getIntOrZero(keyLastUserPeriodProcessed(userAddressStr)))) | |
420 | 420 | then $Tuple7((totalMature + ut[IdxNewGnsbt]), (totalTeen + (uk[IdxNewGnsbt] - ut[IdxNewGnsbt])), (totalKid - uk[IdxNewGnsbt]), (um[IdxNewGnsbt] + ut[IdxNewGnsbt]), uk[IdxNewGnsbt], 0, [IntegerEntry(keyLastUserPeriodProcessed(userAddressStr), period)]) | |
421 | 421 | else $Tuple7(totalMature, totalTeen, totalKid, um[IdxNewGnsbt], ut[IdxNewGnsbt], uk[IdxNewGnsbt], nil) | |
422 | 422 | let totals = if ((period > getIntOrZero(keyLastTotalsPeriodProcessed()))) | |
423 | 423 | then $Tuple4([IntegerEntry(keyTotalMature(), (tmp._1 + tmp._2)), IntegerEntry(keyTotalTeen(), tmp._3), IntegerEntry(keyTotalKid(), 0), IntegerEntry(keyLastTotalsPeriodProcessed(), period)], (tmp._1 + tmp._2), tmp._3, 0) | |
424 | 424 | else $Tuple4(nil, totalMature, totalTeen, totalKid) | |
425 | 425 | $Tuple7(((((totals._1 :+ IntegerEntry(keyUserMature(userAddressStr), tmp._4)) :+ IntegerEntry(keyUserTeen(userAddressStr), tmp._5)) :+ IntegerEntry(keyUserKid(userAddressStr), tmp._6)) ++ tmp._7), totals._2, totals._3, totals._4, tmp._4, tmp._5, tmp._6) | |
426 | 426 | } | |
427 | 427 | } | |
428 | 428 | ||
429 | 429 | ||
430 | 430 | func commonStake (userAddress,i) = { | |
431 | 431 | let $t01988419938 = getParamsOrFail() | |
432 | 432 | let stakedAssetId = $t01988419938._1 | |
433 | 433 | let minLockAmount = $t01988419938._2 | |
434 | 434 | if ((size(i.payments) != 1)) | |
435 | 435 | then throw("Invalid payments size") | |
436 | 436 | else { | |
437 | 437 | let payment = i.payments[0] | |
438 | 438 | let amount = payment.amount | |
439 | 439 | let invalidAssetMessage = (("Invalid asset. " + toBase58String(stakedAssetId)) + " is expected") | |
440 | 440 | let assetId = valueOrErrorMessage(payment.assetId, invalidAssetMessage) | |
441 | 441 | if ((assetId != stakedAssetId)) | |
442 | 442 | then throw(invalidAssetMessage) | |
443 | 443 | else { | |
444 | 444 | let userAddressStr = toString(userAddress) | |
445 | 445 | let r = onStake(userAddressStr, amount) | |
446 | 446 | let mergedData = mergeStake(userAddress, amount, r._6, r._7) | |
447 | 447 | let isNewUser = mergedData._1 | |
448 | 448 | let stakedAmount = mergedData._2 | |
449 | 449 | let vpEffectiveHeight = mergedData._3 | |
450 | 450 | let stakedAmountNEW = mergedData._4 | |
451 | 451 | let vpEffectiveHeightNEW = mergedData._5 | |
452 | 452 | if ((minLockAmount > stakedAmountNEW)) | |
453 | 453 | then throw(("Min lock amount is " + toString(minLockAmount))) | |
454 | 454 | else { | |
455 | 455 | let $t02079220894 = StatsResult(amount, 1, if (isNewUser) | |
456 | 456 | then 1 | |
457 | 457 | else 0) | |
458 | 458 | let statsEntries = $t02079220894._1 | |
459 | 459 | let totalStaked = $t02079220894._2 | |
460 | 460 | let totalStakedNew = $t02079220894._3 | |
461 | 461 | (((([HistoryRecordEntry("stake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeightNEW)] ++ RewardEntries(isNewUser, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeightNEW)) ++ statsEntries) ++ r._1) | |
462 | 462 | } | |
463 | 463 | } | |
464 | 464 | } | |
465 | 465 | } | |
466 | 466 | ||
467 | 467 | ||
468 | 468 | func commonClaim (userAddress,i) = { | |
469 | 469 | let userAddressStr = toString(userAddress) | |
470 | 470 | if ((size(i.payments) > 0)) | |
471 | 471 | then throw("payments are not accepted") | |
472 | 472 | else { | |
473 | 473 | let $t02140121506 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
474 | 474 | let isNewUser = $t02140121506._1 | |
475 | 475 | let stakedAmount = $t02140121506._2 | |
476 | 476 | let stakingStart = $t02140121506._3 | |
477 | 477 | let stakedAmountX = toBigInt(stakedAmount) | |
478 | 478 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
479 | 479 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
480 | 480 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
481 | 481 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
482 | 482 | let $t02187722015 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
483 | 483 | let rewardTotal = $t02187722015._1 | |
484 | 484 | let cached = $t02187722015._2 | |
485 | 485 | let dynamic = $t02187722015._3 | |
486 | 486 | let rewardCachedPartKEY = $t02187722015._4 | |
487 | 487 | let claimedKEY = keyClaimed(userAddressStr, asset) | |
488 | 488 | let $t02207522112 = accum | |
489 | 489 | let data = $t02207522112._1 | |
490 | 490 | let claimedAmtByAsset = $t02207522112._2 | |
491 | 491 | let newPart = makeString([asset, toString(rewardTotal)], ":") | |
492 | 492 | let claimedAmtByAssetNew = makeString([claimedAmtByAsset, newPart], "_") | |
493 | 493 | if ((0 >= rewardTotal)) | |
494 | 494 | then $Tuple2(data, claimedAmtByAssetNew) | |
495 | 495 | else $Tuple2((((data :+ ScriptTransfer(userAddress, rewardTotal, toAssetVect(asset))) :+ IntegerEntry(claimedKEY, (valueOrElse(getInteger(claimedKEY), 0) + rewardTotal))) :+ IntegerEntry(rewardCachedPartKEY, 0)), claimedAmtByAssetNew) | |
496 | 496 | } | |
497 | 497 | ||
498 | 498 | let $t02257222685 = { | |
499 | 499 | let $l = supportedAssetsList | |
500 | 500 | let $s = size($l) | |
501 | 501 | let $acc0 = $Tuple2(nil, "") | |
502 | 502 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
503 | 503 | then $a | |
504 | 504 | else forEachAssetCalcUnclaimedReward($a, $l[$i]) | |
505 | 505 | ||
506 | 506 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
507 | 507 | then $a | |
508 | 508 | else throw("List size exceeds 9") | |
509 | 509 | ||
510 | 510 | $f0_2($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) | |
511 | 511 | } | |
512 | 512 | let transfers = $t02257222685._1 | |
513 | 513 | let claimedAmtByAssetResult = $t02257222685._2 | |
514 | 514 | if ((0 >= size(transfers))) | |
515 | 515 | then $Tuple2(nil, 0) | |
516 | 516 | else $Tuple2(((transfers :+ IntegerEntry(userRewardFromDepositNumKEY, depositNumLast)) :+ ClaimHistoryEntry(userAddress, i.transactionId, drop(claimedAmtByAssetResult, 1))), size(transfers)) | |
517 | 517 | } | |
518 | 518 | } | |
519 | 519 | ||
520 | 520 | ||
521 | 521 | @Callable(i) | |
522 | 522 | func constructorV1 (minLockAmount,supportedRewardAssets,stakedAssetId) = if ((i.caller != this)) | |
523 | 523 | then throw("Permission denied") | |
524 | 524 | else [IntegerEntry(keyMinLockAmount(), minLockAmount), StringEntry(keySupportedRewardAssets(), supportedRewardAssets), StringEntry(keyStakedAssetId(), stakedAssetId)] | |
525 | 525 | ||
526 | 526 | ||
527 | 527 | ||
528 | 528 | @Callable(i) | |
529 | 529 | func stake () = commonStake(i.caller, i) | |
530 | 530 | ||
531 | 531 | ||
532 | 532 | ||
533 | 533 | @Callable(i) | |
534 | 534 | func stakeByOriginCaller () = commonStake(i.originCaller, i) | |
535 | 535 | ||
536 | 536 | ||
537 | 537 | ||
538 | 538 | @Callable(i) | |
539 | 539 | func unstake (amount) = if ((size(i.payments) != 0)) | |
540 | 540 | then throw("unstake doesn't require any payment") | |
541 | 541 | else { | |
542 | 542 | let userAddress = i.caller | |
543 | 543 | let userAddressStr = toString(userAddress) | |
544 | 544 | let $t02362123675 = getParamsOrFail() | |
545 | 545 | let stakedAssetId = $t02362123675._1 | |
546 | 546 | let minLockAmount = $t02362123675._2 | |
547 | 547 | let $t02367823762 = getUserParamsOrFail(userAddress) | |
548 | 548 | let isNewUser = $t02367823762._1 | |
549 | 549 | let stakedAmount = $t02367823762._2 | |
550 | 550 | let vpEffectiveHeight = $t02367823762._3 | |
551 | 551 | let swapParamsSTRUCT = asSwapParamsSTRUCT(reentrantInvoke(neutrinoContract, "swapParamsByUserSYSREADONLY", [userAddressStr, 0], nil)) | |
552 | 552 | let swapLimitSpentInUsdn = swapParamsSTRUCT._2 | |
553 | 553 | let blcks2LmtReset = swapParamsSTRUCT._3 | |
554 | 554 | if ((swapLimitSpentInUsdn > 0)) | |
555 | 555 | then throw((("You have already made a swap operation. Wait " + toString((height + blcks2LmtReset))) + " height to unstake")) | |
556 | 556 | else if ((0 >= stakedAmount)) | |
557 | 557 | then throw("Nothing to unstake") | |
558 | 558 | else if ((amount > stakedAmount)) | |
559 | 559 | then throw(((("Requested " + toString(amount)) + ", but staked only ") + toString(stakedAmount))) | |
560 | 560 | else { | |
561 | 561 | let stakedAmountNEW = (stakedAmount - amount) | |
562 | 562 | let $t02440024558 = StatsResult(-(amount), if ((amount == stakedAmount)) | |
563 | 563 | then -1 | |
564 | 564 | else 0, if ((amount == stakedAmount)) | |
565 | 565 | then -1 | |
566 | 566 | else 0) | |
567 | 567 | let statsEntries = $t02440024558._1 | |
568 | 568 | let totalStaked = $t02440024558._2 | |
569 | 569 | let totalStakedNew = $t02440024558._3 | |
570 | 570 | (((([ScriptTransfer(userAddress, amount, stakedAssetId), HistoryRecordEntry("unstake", userAddress, i.transactionId, stakedAmount, vpEffectiveHeight, stakedAmountNEW, vpEffectiveHeight)] ++ RewardEntries(false, userAddressStr, stakedAmount)) ++ LockParamsEntry(userAddress, stakedAmountNEW, vpEffectiveHeight)) ++ statsEntries) ++ onUnstake(userAddressStr, amount)._1) | |
571 | 571 | } | |
572 | 572 | } | |
573 | 573 | ||
574 | 574 | ||
575 | 575 | ||
576 | 576 | @Callable(i) | |
577 | 577 | func deposit () = { | |
578 | 578 | let totalStaked = getIntOrElse(keyLockParamTotalAmount(), 0) | |
579 | 579 | if ((0 > totalStaked)) | |
580 | 580 | then throw("TODO: case is not supported") | |
581 | 581 | else { | |
582 | 582 | let depositNumLastKEY = keyDepositNumLast() | |
583 | 583 | let depositNumLast = getIntOrElse(depositNumLastKEY, -1) | |
584 | 584 | let depositNumNew = (depositNumLast + 1) | |
585 | 585 | let totalsKEY = keyStatsDepositAmtTotals() | |
586 | 586 | let byDayKEY = keyStatsDepositAmtByDay(toStartOfDay(lastBlock.timestamp)) | |
587 | 587 | let currTotals = split(valueOrElse(getString(totalsKEY), defaultTotalsDATA), SEP) | |
588 | 588 | let currByDay = split(valueOrElse(getString(byDayKEY), defaultTotalsDATA), SEP) | |
589 | 589 | func dep (acc,pmt) = { | |
590 | 590 | let amount = pmt.amount | |
591 | 591 | let pmtAssetIdStr = toBase58String(valueOrElse(pmt.assetId, WAVESID)) | |
592 | 592 | if (!(contains(supportedAssetsStr, pmtAssetIdStr))) | |
593 | 593 | then throw(((supportedAssetsStr + " doesn't contain ") + pmtAssetIdStr)) | |
594 | 594 | else if ((totalStaked == 0)) | |
595 | 595 | then $Tuple4((acc._1 :+ IncrementNotDistributedRewardEntry(pmtAssetIdStr, amount)), (acc._2 :+ pmtAssetIdStr), (acc._3 :+ toBigInt(0)), (acc._4 :+ amount)) | |
596 | 596 | else { | |
597 | 597 | let rewardPerNsbtX18 = fraction(toBigInt(amount), MULTX18, toBigInt(totalStaked)) | |
598 | 598 | $Tuple4(acc._1, (acc._2 :+ pmtAssetIdStr), (acc._3 :+ rewardPerNsbtX18), (acc._4 :+ amount)) | |
599 | 599 | } | |
600 | 600 | } | |
601 | 601 | ||
602 | 602 | let pmtsResult = { | |
603 | 603 | let $l = i.payments | |
604 | 604 | let $s = size($l) | |
605 | 605 | let $acc0 = $Tuple4(nil, nil, nil, nil) | |
606 | 606 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
607 | 607 | then $a | |
608 | 608 | else dep($a, $l[$i]) | |
609 | 609 | ||
610 | 610 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
611 | 611 | then $a | |
612 | 612 | else throw("List size exceeds 10") | |
613 | 613 | ||
614 | 614 | $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) | |
615 | 615 | } | |
616 | 616 | func refreshRewardUpdateTotals (accum,nextAsset) = { | |
617 | 617 | let k = accum._4 | |
618 | 618 | let sumLastStr = getStrOrElse(keyRewardPerNsbtSumAt(depositNumLast, nextAsset), "0") | |
619 | 619 | let idx = indexOf(pmtsResult._2, nextAsset) | |
620 | 620 | let sum = if (isDefined(idx)) | |
621 | 621 | then { | |
622 | 622 | let j = value(idx) | |
623 | 623 | let statsDelta = pmtsResult._4[j] | |
624 | 624 | $Tuple3(toString((parseBigIntValue(sumLastStr) + pmtsResult._3[j])), toString((parseIntValue(currTotals[(k + 1)]) + statsDelta)), toString((parseIntValue(currByDay[(k + 1)]) + statsDelta))) | |
625 | 625 | } | |
626 | 626 | else $Tuple3(sumLastStr, currTotals[(k + 1)], currByDay[(k + 1)]) | |
627 | 627 | $Tuple4((accum._1 :+ StringEntry(keyRewardPerNsbtSumAt(depositNumNew, nextAsset), sum._1)), ((accum._2 + SEP) + sum._2), ((accum._3 + SEP) + sum._3), (k + 1)) | |
628 | 628 | } | |
629 | 629 | ||
630 | 630 | let assetsResult = { | |
631 | 631 | let $l = supportedAssetsList | |
632 | 632 | let $s = size($l) | |
633 | 633 | let $acc0 = $Tuple4(nil, DepositTotalsPREFIX, DepositTotalsPREFIX, 0) | |
634 | 634 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
635 | 635 | then $a | |
636 | 636 | else refreshRewardUpdateTotals($a, $l[$i]) | |
637 | 637 | ||
638 | 638 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
639 | 639 | then $a | |
640 | 640 | else throw("List size exceeds 9") | |
641 | 641 | ||
642 | 642 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9) | |
643 | 643 | } | |
644 | 644 | $Tuple2((((((pmtsResult._1 ++ assetsResult._1) ++ updateTotals()) :+ IntegerEntry(depositNumLastKEY, depositNumNew)) :+ StringEntry(totalsKEY, assetsResult._2)) :+ StringEntry(byDayKEY, assetsResult._3)), depositNumNew) | |
645 | 645 | } | |
646 | 646 | } | |
647 | 647 | ||
648 | 648 | ||
649 | 649 | ||
650 | 650 | @Callable(i) | |
651 | 651 | func claimRewards () = commonClaim(i.caller, i) | |
652 | 652 | ||
653 | 653 | ||
654 | 654 | ||
655 | 655 | @Callable(i) | |
656 | 656 | func claimRewardsByOriginCaller () = commonClaim(i.originCaller, i) | |
657 | 657 | ||
658 | 658 | ||
659 | 659 | ||
660 | 660 | @Callable(i) | |
661 | 661 | func unclaimedRewardsREADONLY (userAddressStr) = { | |
662 | 662 | func forEachAssetZeroReward (accum,asset) = ((accum + makeString([asset, "0", "0"], ":")) + "_") | |
663 | 663 | ||
664 | 664 | let unclaimedRewardStr = if ((userAddressStr == "")) | |
665 | 665 | then { | |
666 | 666 | let $l = supportedAssetsList | |
667 | 667 | let $s = size($l) | |
668 | 668 | let $acc0 = "" | |
669 | 669 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
670 | 670 | then $a | |
671 | 671 | else forEachAssetZeroReward($a, $l[$i]) | |
672 | 672 | ||
673 | 673 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
674 | 674 | then $a | |
675 | 675 | else throw("List size exceeds 9") | |
676 | 676 | ||
677 | 677 | $f0_2($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) | |
678 | 678 | } | |
679 | 679 | else { | |
680 | 680 | let userAddress = addressFromStringValue(userAddressStr) | |
681 | 681 | let $t02848428589 = valueOrElse(getUserParamsOrUnit(userAddress), $Tuple3(true, 0, 0)) | |
682 | 682 | let isNewUser = $t02848428589._1 | |
683 | 683 | let stakedAmount = $t02848428589._2 | |
684 | 684 | let stakingStart = $t02848428589._3 | |
685 | 685 | let stakedAmountX = toBigInt(stakedAmount) | |
686 | 686 | let userRewardFromDepositNumKEY = keyUserRewardFromDepositNum(userAddressStr) | |
687 | 687 | let depositNumUser = getIntOrElse(userRewardFromDepositNumKEY, -1) | |
688 | 688 | let depositNumLast = getIntOrElse(keyDepositNumLast(), -1) | |
689 | 689 | func forEachAssetCalcUnclaimedReward (accum,asset) = { | |
690 | 690 | let $t02893529073 = calcReward(userAddressStr, asset, stakedAmountX, depositNumUser, depositNumLast) | |
691 | 691 | let rewardTotal = $t02893529073._1 | |
692 | 692 | let cached = $t02893529073._2 | |
693 | 693 | let dynamic = $t02893529073._3 | |
694 | 694 | let rewardCachedPartKEY = $t02893529073._4 | |
695 | 695 | let claimed = valueOrElse(getInteger(keyClaimed(userAddressStr, asset)), 0) | |
696 | 696 | ((accum + makeString([asset, toString(rewardTotal), toString(claimed)], ":")) + "_") | |
697 | 697 | } | |
698 | 698 | ||
699 | 699 | let $l = supportedAssetsList | |
700 | 700 | let $s = size($l) | |
701 | 701 | let $acc0 = "" | |
702 | 702 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
703 | 703 | then $a | |
704 | 704 | else forEachAssetCalcUnclaimedReward($a, $l[$i]) | |
705 | 705 | ||
706 | 706 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
707 | 707 | then $a | |
708 | 708 | else throw("List size exceeds 9") | |
709 | 709 | ||
710 | 710 | $f0_2($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) | |
711 | 711 | } | |
712 | 712 | $Tuple2(nil, dropRight(unclaimedRewardStr, 1)) | |
713 | 713 | } | |
714 | 714 | ||
715 | 715 | ||
716 | 716 | ||
717 | 717 | @Callable(i) | |
718 | 718 | func updateVotingPower (userAddressStr) = if (!(isDefined(addressFromString(userAddressStr)))) | |
719 | 719 | then throw("Invalid user address") | |
720 | 720 | else { | |
721 | 721 | let r = onStake(userAddressStr, 0) | |
722 | 722 | $Tuple2(r._1, [surfToGnsbt(r._2), surfToGnsbt(r._3), surfToGnsbt(r._4), surfToGnsbt(r._5), surfToGnsbt(r._6), surfToGnsbt(r._7)]) | |
723 | 723 | } | |
724 | 724 | ||
725 | 725 | ||
726 | 726 | ||
727 | 727 | @Callable(i) | |
728 | 728 | func surfStakingSYSREADONLY (userAddressStrOrEmpty,surfDiff) = { | |
729 | 729 | let surfTotal = getIntOrElse(keyLockParamTotalAmount(), 0) | |
730 | 730 | let gnsbtFromSurfTotal = surfToGnsbt(surfTotal) | |
731 | 731 | let r = if ((surfDiff >= 0)) | |
732 | 732 | then onStake(userAddressStrOrEmpty, surfDiff) | |
733 | 733 | else onUnstake(userAddressStrOrEmpty, -(surfDiff)) | |
734 | 734 | if ((userAddressStrOrEmpty == "")) | |
735 | 735 | then $Tuple2(nil, [0, surfTotal, 0, gnsbtFromSurfTotal, height, height, surfToGnsbt(r._2), surfToGnsbt(r._3), surfToGnsbt(r._4), surfToGnsbt(r._5), surfToGnsbt(r._6), surfToGnsbt(r._7)]) | |
736 | 736 | else { | |
737 | 737 | let userAddress = toAddressOrFail(userAddressStrOrEmpty) | |
738 | 738 | let mergedData = mergeStake(userAddress, surfDiff, r._6, r._7) | |
739 | 739 | let stakedAmount = mergedData._2 | |
740 | 740 | let vpEffectiveHeight = mergedData._3 | |
741 | 741 | let stakedAmountNEW = mergedData._4 | |
742 | 742 | let vpEffectiveHeightNEW = mergedData._5 | |
743 | 743 | let surfUser = stakedAmount | |
744 | 744 | let gnsbtFromSurfUser = surfToGnsbt(surfUser) | |
745 | 745 | $Tuple2(nil, [surfUser, surfTotal, gnsbtFromSurfUser, gnsbtFromSurfTotal, vpEffectiveHeight, vpEffectiveHeightNEW, surfToGnsbt(r._2), surfToGnsbt(r._3), surfToGnsbt(r._4), surfToGnsbt(r._5), surfToGnsbt(r._6), surfToGnsbt(r._7)]) | |
746 | 746 | } | |
747 | 747 | } | |
748 | 748 | ||
749 | 749 | ||
750 | 750 | ||
751 | 751 | @Callable(i) | |
752 | 752 | func gnsbtFromSurfSYSREADONLY (surfAmt) = $Tuple2(nil, surfToGnsbt(surfAmt)) | |
753 | 753 | ||
754 | 754 | ||
755 | 755 | ||
756 | 756 | @Callable(i) | |
757 | 757 | func configSYSREADONLY () = { | |
758 | 758 | let minLockAmt = getIntegerValue(keyMinLockAmount()) | |
759 | 759 | let surfVotingPowerRestrictivePeriod = DEFAULTPERIOD | |
760 | 760 | let brToStartSurfTransformation = 1150000 | |
761 | 761 | $Tuple2(nil, [minLockAmt, (gnsbtFromSurfCoeff * MULT6), surfVotingPowerRestrictivePeriod, brToStartSurfTransformation]) | |
762 | 762 | } | |
763 | 763 | ||
764 | 764 |
github/deemru/w8io/026f985 67.58 ms ◑