tx · 8hNcYcVgiRSaBTrTeeeJBXye7CPDt6krFJuhbR9zQ9Ty 3MsXpzisJAwnzUr7XrEoW1BZo4U6rw4tsYK: -0.09000000 Waves 2023.02.06 13:01 [2437604] smart account 3MsXpzisJAwnzUr7XrEoW1BZo4U6rw4tsYK > SELF 0.00000000 Waves
{ "type": 13, "id": "8hNcYcVgiRSaBTrTeeeJBXye7CPDt6krFJuhbR9zQ9Ty", "fee": 9000000, "feeAssetId": null, "timestamp": 1675677727459, "version": 2, "chainId": 84, "sender": "3MsXpzisJAwnzUr7XrEoW1BZo4U6rw4tsYK", "senderPublicKey": "FFdBua5rzzMkZebvsvmN7sAdU7XhFK8QNJ3hiwwxAYRA", "proofs": [ "hhQ82zxS6HNkDDKgBYB3CXh3bEEsXRiKDKA3atzjpypRe1tPErEczfpVS253nJNu1cYHJsL7qd3ok9y4iLbcNZM", "JuCHFH3tnt7NC4g6NuE9iDbTY9ZCFndeZLXFkUpCLJxx4uVmWotUtw7RUPwgPsKTqYiZv3Adkn4hJnuTHNUjScq" ], "script": "base64:BgJcCAISAwoBCBIDCgEIEgMKAQgSBAoCCAESBQoDAggBEgUKAwgBARIECgIICBIECgIIARIFCgMCCAESAwoBCBIECgIIAhIDCgEIEgMKARgSAwoBGBIECgIICBIAEgBcAAdrQWN0aXZlAgZhY3RpdmUAC2tBY3RpdmVHbG9iAhRhY3RpdmVfYWxsX2NvbnRyYWN0cwAGa0NhdXNlAg5zaHV0ZG93bl9jYXVzZQAaa1Jld2FyZFBvb2xGcmFjdGlvbkN1cnJlbnQCHV9jdXJyZW50X3Bvb2xfZnJhY3Rpb25fcmV3YXJkABtrUmV3YXJkUG9vbEZyYWN0aW9uUHJldmlvdXMCHl9wcmV2aW91c19wb29sX2ZyYWN0aW9uX3Jld2FyZAATa0hlaWdodFBvb2xGcmFjdGlvbgIaX3Bvb2xfcmV3YXJkX3VwZGF0ZV9oZWlnaHQAE2tSZXdhcmRVcGRhdGVIZWlnaHQCFHJld2FyZF91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QYXVzZWQgYnkgYWRtaW4BaQEIYWN0aXZhdGUACQELdmFsdWVPckVsc2UCCQELaXNBZG1pbkNhbGwBBQFpAwUGYWN0aXZlCQACAQIWREFwcCBpcyBhbHJlYWR5IGFjdGl2ZQkAzAgCCQEMQm9vbGVhbkVudHJ5AgUHa0FjdGl2ZQYJAMwIAgkBC0RlbGV0ZUVudHJ5AQUGa0NhdXNlBQNuaWwBAnR4AQZ2ZXJpZnkABAckbWF0Y2gwBQJ0eAQSYWRtaW5QdWJLZXkxU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUMYWRtaW5QdWJLZXkxAAEAAAQSYWRtaW5QdWJLZXkyU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAQUMYWRtaW5QdWJLZXkyAAEAAAQSYWRtaW5QdWJLZXkzU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgUMYWRtaW5QdWJLZXkzAAEAAAkAZwIJAGQCCQBkAgUSYWRtaW5QdWJLZXkxU2lnbmVkBRJhZG1pblB1YktleTJTaWduZWQFEmFkbWluUHViS2V5M1NpZ25lZAACrUdCgQ==", "height": 2437604, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: jK7o6TzhnCbo7VJCTjVDVF3HfyKxtXdTkVqxWzxtgeY Next: 6ZYEWT36y8HhEf4MuifTYHDQt2SqYvpZgxyTNooAXeBP Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | let kActive = "active" | |
5 | 5 | ||
6 | 6 | let kActiveGlob = "active_all_contracts" | |
7 | - | ||
8 | - | let kDeprecatedPool = "deprecated_" | |
9 | 7 | ||
10 | 8 | let kCause = "shutdown_cause" | |
11 | 9 | ||
14 | 12 | let kRewardPoolFractionPrevious = "_previous_pool_fraction_reward" | |
15 | 13 | ||
16 | 14 | let kHeightPoolFraction = "_pool_reward_update_height" | |
17 | - | ||
18 | - | let kTotalRewardPerBlockCurrent = "total_reward_per_block_current" | |
19 | - | ||
20 | - | let kTotalRewardPerBlockPrevious = "total_reward_per_block_previous" | |
21 | 15 | ||
22 | 16 | let kRewardUpdateHeight = "reward_update_height" | |
23 | 17 | ||
54 | 48 | let kSWOPid = "SWOP_id" | |
55 | 49 | ||
56 | 50 | let kAvailableSWOP = "_available_SWOP" | |
57 | - | ||
58 | - | let kSwopYearEmission = "swop_year_emission" | |
59 | 51 | ||
60 | 52 | let kHarvestPoolVote = "_harvest_pool_vote_gSWOP" | |
61 | 53 | ||
105 | 97 | ||
106 | 98 | let defPoolBoostCoef = 500 | |
107 | 99 | ||
108 | - | let bStartH = 3397850 | |
100 | + | let startEmissionH = 1911271 | |
101 | + | ||
102 | + | let swopYearEmission = 100000000000000 | |
103 | + | ||
104 | + | let blocksPerYear = 526330 | |
109 | 105 | ||
110 | 106 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
111 | 107 | case string: String => | |
140 | 136 | let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true) | |
141 | 137 | ||
142 | 138 | let SWOP = fromBase58String(getStringValue(this, kSWOPid)) | |
139 | + | ||
140 | + | func getRewardsPerBlockInfo () = { | |
141 | + | let emissionPeriods = ((height - startEmissionH) / blocksPerYear) | |
142 | + | func calcEmission (acc,i) = { | |
143 | + | let $t047104747 = acc | |
144 | + | let curEmission = $t047104747._1 | |
145 | + | let prevEmission = $t047104747._2 | |
146 | + | if ((emissionPeriods > i)) | |
147 | + | then $Tuple2(fraction(curEmission, 75, 100), curEmission) | |
148 | + | else $Tuple2(curEmission, prevEmission) | |
149 | + | } | |
150 | + | ||
151 | + | let $t049055071 = { | |
152 | + | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] | |
153 | + | let $s = size($l) | |
154 | + | let $acc0 = $Tuple2(swopYearEmission, swopYearEmission) | |
155 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
156 | + | then $a | |
157 | + | else calcEmission($a, $l[$i]) | |
158 | + | ||
159 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
160 | + | then $a | |
161 | + | else throw("List size exceeds 20") | |
162 | + | ||
163 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
164 | + | } | |
165 | + | let curEmission = $t049055071._1 | |
166 | + | let prevEmission = $t049055071._2 | |
167 | + | $Tuple3((curEmission / blocksPerYear), (prevEmission / blocksPerYear), (startEmissionH + (blocksPerYear * emissionPeriods))) | |
168 | + | } | |
169 | + | ||
143 | 170 | ||
144 | 171 | func getHeightFirstHarvest (pool) = valueOrElse(getInteger(Address(fromBase58String(pool)), kFirstHarvestHeight), 0) | |
145 | 172 | ||
181 | 208 | ||
182 | 209 | ||
183 | 210 | func rewardInfo (pool) = { | |
184 | - | let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger(govAddress, kTotalRewardPerBlockCurrent), ((("No data on the key: " + kTotalRewardPerBlockCurrent) + " at address ") + toString(govAddress))) | |
185 | - | let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger(govAddress, kTotalRewardPerBlockPrevious), ((("No data on the key: " + kTotalRewardPerBlockPrevious) + " at address ") + toString(govAddress))) | |
211 | + | let $t068867001 = getRewardsPerBlockInfo() | |
212 | + | let totalRewardPerBlockCurrent = $t068867001._1 | |
213 | + | let totalRewardPerBlockPrevious = $t068867001._2 | |
214 | + | let lastEmissionUpdateHeight = $t068867001._3 | |
186 | 215 | let rewardPoolFractionCurrent = valueOrErrorMessage(getInteger(govAddress, (pool + kRewardPoolFractionCurrent)), (((("No data on the key: " + pool) + kRewardPoolFractionCurrent) + " at address ") + toString(govAddress))) | |
187 | 216 | let rewardUpdateHeight = valueOrErrorMessage(getInteger(govAddress, kRewardUpdateHeight), ((("No data on the key: " + kRewardUpdateHeight) + " at address ") + toString(govAddress))) | |
188 | 217 | let poolRewardUpdateHeight = valueOrElse(getInteger(govAddress, (pool + kHeightPoolFraction)), rewardUpdateHeight) | |
189 | 218 | let rewardPoolFractionPrevious = valueOrErrorMessage(getInteger(govAddress, (pool + kRewardPoolFractionPrevious)), (((("No data on the key: " + pool) + kRewardPoolFractionPrevious) + " at address ") + toString(govAddress))) | |
190 | 219 | let rewardPoolCurrent = fraction(totalRewardPerBlockCurrent, rewardPoolFractionCurrent, totalVoteShare) | |
191 | 220 | let rewardPoolPrevious = fraction(totalRewardPerBlockCurrent, rewardPoolFractionPrevious, totalVoteShare) | |
221 | + | let rewardPoolPrevCurrent = fraction(totalRewardPerBlockPrevious, rewardPoolFractionCurrent, totalVoteShare) | |
222 | + | let rewardPoolPrevPrevious = fraction(totalRewardPerBlockPrevious, rewardPoolFractionPrevious, totalVoteShare) | |
192 | 223 | if (if ((rewardPoolCurrent > totalRewardPerBlockCurrent)) | |
193 | 224 | then true | |
194 | 225 | else (rewardPoolPrevious > totalRewardPerBlockPrevious)) | |
195 | 226 | then throw("rewardPoolCurrent > totalRewardPerBlockCurrent or rewardPoolPrevious > totalRewardPerBlockPrevious") | |
196 | - | else $ | |
227 | + | else $Tuple7(rewardPoolCurrent, rewardUpdateHeight, rewardPoolPrevious, poolRewardUpdateHeight, lastEmissionUpdateHeight, rewardPoolPrevCurrent, rewardPoolPrevPrevious) | |
197 | 228 | } | |
198 | 229 | ||
199 | 230 | ||
217 | 248 | } | |
218 | 249 | ||
219 | 250 | ||
220 | - | func calcInterest (pool,lastInterestHeight,rewardUpdateHeight,poolRewardUpdateHeight,farmInterest,boostInterest,poolVoted,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,scaleValue) = { | |
221 | - | let $ | |
251 | + | func calcInterest (pool,lastInterestHeight,rewardUpdateHeight,poolRewardUpdateHeight,farmInterest,boostInterest,poolVoted,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,scaleValue,toHeight) = { | |
252 | + | let $t01001511200 = if (if (if ((rewardUpdateHeight > toHeight)) | |
222 | 253 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
223 | 254 | else false) | |
224 | 255 | then true | |
225 | - | else if (( | |
256 | + | else if ((toHeight > rewardUpdateHeight)) | |
226 | 257 | then (rewardUpdateHeight != poolRewardUpdateHeight) | |
227 | 258 | else false) | |
228 | 259 | then { | |
229 | - | let r = (previousRewardPerBlock * ( | |
260 | + | let r = (previousRewardPerBlock * (toHeight - lastInterestHeight)) | |
230 | 261 | $Tuple3(r, farmInterest, boostInterest) | |
231 | 262 | } | |
232 | - | else if (if (if (( | |
263 | + | else if (if (if ((toHeight > rewardUpdateHeight)) | |
233 | 264 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
234 | 265 | else false) | |
235 | 266 | then (lastInterestHeight > rewardUpdateHeight) | |
236 | 267 | else false) | |
237 | 268 | then { | |
238 | - | let r = (currentRewardPerBlock * ( | |
269 | + | let r = (currentRewardPerBlock * (toHeight - lastInterestHeight)) | |
239 | 270 | $Tuple3(r, farmInterest, boostInterest) | |
240 | 271 | } | |
241 | 272 | else { | |
244 | 275 | let bBfrUp = (boostInterest + (if ((poolVoted > 0)) | |
245 | 276 | then fraction(calcBoostRwd(pool, rwdBfrUpd), scaleValue8, poolVoted) | |
246 | 277 | else 0)) | |
247 | - | let rwd = (currentRewardPerBlock * ( | |
278 | + | let rwd = (currentRewardPerBlock * (toHeight - rewardUpdateHeight)) | |
248 | 279 | $Tuple3(rwd, fBfrUp, bBfrUp) | |
249 | 280 | } | |
250 | - | let reward = $ | |
251 | - | let farmIntrBefore = $ | |
252 | - | let boostIntrBefore = $ | |
281 | + | let reward = $t01001511200._1 | |
282 | + | let farmIntrBefore = $t01001511200._2 | |
283 | + | let boostIntrBefore = $t01001511200._3 | |
253 | 284 | let newFarmInterest = (farmIntrBefore + fraction(calcFarmRwd(pool, reward), scaleValue, shareTokenLocked)) | |
254 | 285 | let newBoostInterest = (boostIntrBefore + (if ((poolVoted > 0)) | |
255 | 286 | then fraction(calcBoostRwd(pool, reward), scaleValue8, poolVoted) | |
265 | 296 | let shareToken = getTotalShareToken(pool) | |
266 | 297 | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), shareToken) | |
267 | 298 | let stratBFarmInterest = valueOrElse(getInteger(this, (pool + kStratBFarmInterest)), 0) | |
268 | - | let $t01152711608 = getLastInterestInfo(pool) | |
269 | - | let lastInterestHeight = $t01152711608._1 | |
270 | - | let farmInterest = $t01152711608._2 | |
271 | - | let boostInterest = $t01152711608._3 | |
272 | - | let $t01161311727 = rewardInfo(pool) | |
273 | - | let currentRewardPerBlock = $t01161311727._1 | |
274 | - | let rewardUpdateHeight = $t01161311727._2 | |
275 | - | let previousRewardPerBlock = $t01161311727._3 | |
276 | - | let poolRewardUpdateHeight = $t01161311727._4 | |
299 | + | let $t01203812119 = getLastInterestInfo(pool) | |
300 | + | let lastInterestHeight = $t01203812119._1 | |
301 | + | let farmInterest = $t01203812119._2 | |
302 | + | let boostInterest = $t01203812119._3 | |
303 | + | let $t01212412381 = rewardInfo(pool) | |
304 | + | let currentRewardPerBlock = $t01212412381._1 | |
305 | + | let rewardUpdateHeight = $t01212412381._2 | |
306 | + | let previousRewardPerBlock = $t01212412381._3 | |
307 | + | let poolRewardUpdateHeight = $t01212412381._4 | |
308 | + | let emissionUpdateHeight = $t01212412381._5 | |
309 | + | let prevCurrentRewardPerBlock = $t01212412381._6 | |
310 | + | let prevPreviousRewardPerBlock = $t01212412381._7 | |
277 | 311 | let uFarmInterest = valueOrElse(getInteger(this, (((pool + "_") + user) + kFarmUserLastInterest)), farmInterest) | |
278 | 312 | let uBoostInterest = valueOrElse(getInteger(this, (((pool + "_") + user) + kBoostUserLastInterest)), if (if ((stratBFarmInterest > uFarmInterest)) | |
279 | 313 | then (uPoolVoted > 0) | |
284 | 318 | let uShareTokensVirt = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), uShareTokensStaked) | |
285 | 319 | if ((totalShareVirtual == 0)) | |
286 | 320 | then { | |
287 | - | let toTreasury = (currentRewardPerBlock * (height - lastInterestHeight)) | |
321 | + | let toTreasury = if ((emissionUpdateHeight > lastInterestHeight)) | |
322 | + | then ((prevCurrentRewardPerBlock * (emissionUpdateHeight - lastInterestHeight)) + (currentRewardPerBlock * (height - emissionUpdateHeight))) | |
323 | + | else (currentRewardPerBlock * (height - lastInterestHeight)) | |
288 | 324 | $Tuple4(farmInterest, boostInterest, 0, toTreasury) | |
289 | 325 | } | |
290 | 326 | else { | |
291 | - | let $t01244012832 = calcInterest(pool, lastInterestHeight, rewardUpdateHeight, poolRewardUpdateHeight, farmInterest, boostInterest, poolVoted, currentRewardPerBlock, totalShareVirtual, previousRewardPerBlock, scaleValue) | |
292 | - | let newFarmInterest = $t01244012832._1 | |
293 | - | let newBoostInterest = $t01244012832._2 | |
327 | + | let $t01333914476 = if ((emissionUpdateHeight > lastInterestHeight)) | |
328 | + | then { | |
329 | + | let $t01375214311 = calcInterest(pool, lastInterestHeight, rewardUpdateHeight, poolRewardUpdateHeight, farmInterest, boostInterest, poolVoted, prevCurrentRewardPerBlock, totalShareVirtual, prevPreviousRewardPerBlock, scaleValue, emissionUpdateHeight) | |
330 | + | let prevNewFarmInterest = $t01375214311._1 | |
331 | + | let prevNewBoostInterest = $t01375214311._2 | |
332 | + | $Tuple3(prevNewFarmInterest, prevNewBoostInterest, emissionUpdateHeight) | |
333 | + | } | |
334 | + | else $Tuple3(farmInterest, boostInterest, lastInterestHeight) | |
335 | + | let prevFarmInterest = $t01333914476._1 | |
336 | + | let prevBoostInterest = $t01333914476._2 | |
337 | + | let LIHeight = $t01333914476._3 | |
338 | + | let $t01448514908 = calcInterest(pool, LIHeight, rewardUpdateHeight, poolRewardUpdateHeight, prevFarmInterest, prevBoostInterest, poolVoted, currentRewardPerBlock, totalShareVirtual, previousRewardPerBlock, scaleValue, height) | |
339 | + | let newFarmInterest = $t01448514908._1 | |
340 | + | let newBoostInterest = $t01448514908._2 | |
294 | 341 | let farmRwd = fraction(uShareTokensVirt, (newFarmInterest - uFarmInterest), scaleValue) | |
295 | 342 | let poolBoostCoef = valueOrElse(getInteger(this, (pool + kPoolBoostCoef)), defPoolBoostCoef) | |
296 | 343 | let boostRwdMax = fraction(fraction(uShareTokensVirt, (newFarmInterest - max([uFarmInterest, stratBFarmInterest])), scaleValue), poolBoostCoef, lockBoostCoefScale) | |
306 | 353 | ||
307 | 354 | func availableClaimCalcAllByUser (pools,user) = { | |
308 | 355 | func calcAvailable (acc,pool) = { | |
309 | - | let $ | |
310 | - | let newPools = $ | |
311 | - | let amounts = $ | |
312 | - | let $ | |
313 | - | let fi = $ | |
314 | - | let bi = $ | |
315 | - | let claimAmount = $ | |
316 | - | let tt = $ | |
356 | + | let $t01577715806 = acc | |
357 | + | let newPools = $t01577715806._1 | |
358 | + | let amounts = $t01577715806._2 | |
359 | + | let $t01581515868 = claimCalc(pool, user) | |
360 | + | let fi = $t01581515868._1 | |
361 | + | let bi = $t01581515868._2 | |
362 | + | let claimAmount = $t01581515868._3 | |
363 | + | let tt = $t01581515868._4 | |
317 | 364 | let availableFund = (userAvailableSWOP(pool, user) + claimAmount) | |
318 | 365 | $Tuple2((newPools :+ pool), (amounts :+ availableFund)) | |
319 | 366 | } | |
378 | 425 | else throw("Only pool can call this function") | |
379 | 426 | ||
380 | 427 | ||
381 | - | func getDeprecatedPool (pool) = valueOrElse(getBoolean(oracle, (kDeprecatedPool + pool)), false) | |
382 | - | ||
383 | - | ||
384 | - | func isDeprecatedPool (pool) = if (!(getDeprecatedPool(pool))) | |
385 | - | then unit | |
386 | - | else throw("Pool is deprecated. Only unlock action allowed.") | |
387 | - | ||
388 | - | ||
389 | 428 | func isSelfCall (i) = if ((i.caller == this)) | |
390 | 429 | then unit | |
391 | 430 | else throw("Only contract itself can call this function") | |
401 | 440 | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
402 | 441 | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
403 | 442 | let totalUserShareTokens = ((userStakedAmount + userLockedAmount) + i.payments[0].amount) | |
404 | - | let $ | |
405 | - | let lockPeriod = $ | |
406 | - | let lockCoef = $ | |
443 | + | let $t01866918721 = getLockParams(lockType) | |
444 | + | let lockPeriod = $t01866918721._1 | |
445 | + | let lockCoef = $t01866918721._2 | |
407 | 446 | let lockWavesFee = getIntegerValue(this, kLockWavesFee) | |
408 | 447 | if ((i.payments[0].assetId != shareAssetId)) | |
409 | 448 | then throw("Wrong sharetoken in payment") | |
415 | 454 | let shareTokensChangeOnFH = canLockInFirstHarvest(pool, user, userStakedAmount, i.payments[0].amount, lockType) | |
416 | 455 | if ((shareTokensChangeOnFH == shareTokensChangeOnFH)) | |
417 | 456 | then { | |
418 | - | let $ | |
457 | + | let $t01914821082 = if ((lockType == 0)) | |
419 | 458 | then { | |
420 | 459 | let userAmountVirtualNew = ((userAmountVirtual + i.payments[0].amount) - shareTokensChangeOnFH) | |
421 | 460 | $Tuple2([IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), ((userStakedAmount + i.payments[0].amount) - shareTokensChangeOnFH)), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual + i.payments[0].amount) - shareTokensChangeOnFH)), ScriptTransfer(caller, shareTokensChangeOnFH, i.payments[0].assetId)], ((totalShare + i.payments[0].amount) - shareTokensChangeOnFH)) | |
436 | 475 | let userAmountVirtualNew = (fraction(userLockedAmountNew, lockCoef, lockBoostCoefScale) + userStakedAmount) | |
437 | 476 | $Tuple2([IntegerEntry((((pool + "_") + user) + kUserShareTokensLocked), userLockedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedHeight), userLockedHeigtNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedType), lockType), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userAmountVirtualNew))], (totalShare + i.payments[0].amount)) | |
438 | 477 | } | |
439 | - | let lockEntries = $ | |
440 | - | let totalShareNew = $ | |
478 | + | let lockEntries = $t01914821082._1 | |
479 | + | let totalShareNew = $t01914821082._2 | |
441 | 480 | if ((accountBalance(shareAssetId) > totalShareNew)) | |
442 | 481 | then throw("Balance of share-token is lower than totalAmount") | |
443 | 482 | else { | |
444 | - | let $ | |
445 | - | let farmInterest = $ | |
446 | - | let boostInterest = $ | |
447 | - | let claimAmount = $ | |
448 | - | let toTreasure = $ | |
483 | + | let $t02120721289 = claimCalc(pool, user) | |
484 | + | let farmInterest = $t02120721289._1 | |
485 | + | let boostInterest = $t02120721289._2 | |
486 | + | let claimAmount = $t02120721289._3 | |
487 | + | let toTreasure = $t02120721289._4 | |
449 | 488 | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
450 | 489 | let uplp = if ((getString(Address(fromBase58String(pool)), "version") == "3.0.0")) | |
451 | 490 | then invoke(lpFarmingAddress, "updateUserInterest", [user, pool, totalUserShareTokens], nil) | |
460 | 499 | } | |
461 | 500 | ||
462 | 501 | ||
463 | - | func calcWithdrawShareTokens (i,caller,pool,shareTokensWithdrawAmount) = { | |
464 | - | let inv = if (getDeprecatedPool(pool)) | |
465 | - | then invoke(this, "unlockUserLockDeprecated", [pool, toString(caller)], nil) | |
466 | - | else 0 | |
467 | - | if ((inv == inv)) | |
468 | - | then { | |
469 | - | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
470 | - | let user = toString(caller) | |
471 | - | let $t02075820840 = claimCalc(pool, user) | |
472 | - | let farmInterest = $t02075820840._1 | |
473 | - | let boostInterest = $t02075820840._2 | |
474 | - | let claimAmount = $t02075820840._3 | |
475 | - | let toTreasure = $t02075820840._4 | |
476 | - | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
477 | - | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
478 | - | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
479 | - | let userStakedAmountNew = (userStakedAmount - shareTokensWithdrawAmount) | |
480 | - | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
481 | - | let totalShareAmount = getTotalShareToken(pool) | |
482 | - | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), totalShareAmount) | |
483 | - | let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount) | |
484 | - | let totalShareVirtualNew = (totalShareVirtual - shareTokensWithdrawAmount) | |
485 | - | let userAmountVirtualNew = (userAmountVirtual - shareTokensWithdrawAmount) | |
486 | - | if ((shareTokensWithdrawAmount > userStakedAmount)) | |
487 | - | then throw("Withdraw amount more then user locked amount") | |
488 | - | else if ((accountBalance(shareTokensId) > totalShareAmount)) | |
489 | - | then throw("Balance of share-token is lower than totalAmount") | |
490 | - | else { | |
491 | - | let uplp = if ((getString(Address(fromBase58String(pool)), "version") == "3.0.0")) | |
492 | - | then invoke(lpFarmingAddress, "updateUserInterest", [user, pool, (userStakedAmount + userLockedAmount)], nil) | |
493 | - | else 0 | |
494 | - | if ((uplp == uplp)) | |
495 | - | then [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTotalShareTokens), totalShareAmountNew), IntegerEntry((pool + kShareTokensVirtual), totalShareVirtualNew), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
496 | - | else throw("Strict value is not equal to itself.") | |
497 | - | } | |
498 | - | } | |
499 | - | else throw("Strict value is not equal to itself.") | |
500 | - | } | |
502 | + | func calcWithdrawShareTokens (i,caller,pool,shareTokensWithdrawAmount) = valueOrElse(isActive(), { | |
503 | + | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
504 | + | let user = toString(caller) | |
505 | + | let $t02248122563 = claimCalc(pool, user) | |
506 | + | let farmInterest = $t02248122563._1 | |
507 | + | let boostInterest = $t02248122563._2 | |
508 | + | let claimAmount = $t02248122563._3 | |
509 | + | let toTreasure = $t02248122563._4 | |
510 | + | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
511 | + | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
512 | + | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
513 | + | let userStakedAmountNew = (userStakedAmount - shareTokensWithdrawAmount) | |
514 | + | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
515 | + | let totalShareAmount = getTotalShareToken(pool) | |
516 | + | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), totalShareAmount) | |
517 | + | let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount) | |
518 | + | let totalShareVirtualNew = (totalShareVirtual - shareTokensWithdrawAmount) | |
519 | + | let userAmountVirtualNew = (userAmountVirtual - shareTokensWithdrawAmount) | |
520 | + | if ((shareTokensWithdrawAmount > userStakedAmount)) | |
521 | + | then throw("Withdraw amount more then user locked amount") | |
522 | + | else if ((accountBalance(shareTokensId) > totalShareAmount)) | |
523 | + | then throw("Balance of share-token is lower than totalAmount") | |
524 | + | else { | |
525 | + | let uplp = if ((getString(Address(fromBase58String(pool)), "version") == "3.0.0")) | |
526 | + | then invoke(lpFarmingAddress, "updateUserInterest", [user, pool, (userStakedAmount + userLockedAmount)], nil) | |
527 | + | else 0 | |
528 | + | if ((uplp == uplp)) | |
529 | + | then [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTotalShareTokens), totalShareAmountNew), IntegerEntry((pool + kShareTokensVirtual), totalShareVirtualNew), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
530 | + | else throw("Strict value is not equal to itself.") | |
531 | + | } | |
532 | + | }) | |
501 | 533 | ||
502 | 534 | ||
503 | 535 | func calcClaim (i,pool,caller) = { | |
504 | 536 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
505 | 537 | let user = toString(caller) | |
506 | 538 | let shareTokenLocked = getTotalShareToken(pool) | |
507 | - | let $ | |
508 | - | let farmInterest = $ | |
509 | - | let boostInterest = $ | |
510 | - | let claimAmount = $ | |
511 | - | let toTreasure = $ | |
539 | + | let $t02507625158 = claimCalc(pool, user) | |
540 | + | let farmInterest = $t02507625158._1 | |
541 | + | let boostInterest = $t02507625158._2 | |
542 | + | let claimAmount = $t02507625158._3 | |
543 | + | let toTreasure = $t02507625158._4 | |
512 | 544 | let availableFund = (userAvailableSWOP(pool, user) + claimAmount) | |
513 | 545 | if ((accountBalance(shareTokensId) > shareTokenLocked)) | |
514 | 546 | then throw("Balance of share-token is lower than totalAmount") | |
518 | 550 | else nil | |
519 | 551 | $Tuple2(([IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), 0), Reissue(SWOP, (toTreasure + availableFund), true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] ++ uTrans), availableFund) | |
520 | 552 | } | |
521 | - | } | |
522 | - | ||
523 | - | ||
524 | - | func unlockUserLockCalc (i,pool,user) = { | |
525 | - | let totalShareVirtual = getIntegerValue(this, (pool + kShareTokensVirtual)) | |
526 | - | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
527 | - | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
528 | - | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
529 | - | let userStakedAmountNew = (userStakedAmount + userLockedAmount) | |
530 | - | let $t02483624918 = claimCalc(pool, user) | |
531 | - | let farmInterest = $t02483624918._1 | |
532 | - | let boostInterest = $t02483624918._2 | |
533 | - | let claimAmount = $t02483624918._3 | |
534 | - | let toTreasure = $t02483624918._4 | |
535 | - | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
536 | - | [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userStakedAmountNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userStakedAmountNew)), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), DeleteEntry((((pool + "_") + user) + kUserShareTokensLocked)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedHeight)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedType)), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] | |
537 | 553 | } | |
538 | 554 | ||
539 | 555 | ||
559 | 575 | then throw("Only Governance can call this function") | |
560 | 576 | else { | |
561 | 577 | let user = toString(addressFromPublicKey(adminInvokePubKey)) | |
562 | - | let $ | |
563 | - | let farmInterest = $ | |
564 | - | let boostInterest = $ | |
565 | - | let boostLPinterest = $ | |
578 | + | let $t02703527109 = claimCalc(pool, user) | |
579 | + | let farmInterest = $t02703527109._1 | |
580 | + | let boostInterest = $t02703527109._2 | |
581 | + | let boostLPinterest = $t02703527109._3 | |
566 | 582 | [IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height)] | |
567 | 583 | }) | |
568 | 584 | ||
569 | 585 | ||
570 | 586 | ||
571 | 587 | @Callable(i) | |
572 | - | func lockShareTokens (pool,lockType) = | |
588 | + | func lockShareTokens (pool,lockType) = valueOrElse(isActive(), calcLockShareTokens(i, i.caller, pool, lockType)) | |
573 | 589 | ||
574 | 590 | ||
575 | 591 | ||
576 | 592 | @Callable(i) | |
577 | - | func lockShareTokensFromPool (callerBytes,pool,lockType) = | |
593 | + | func lockShareTokensFromPool (callerBytes,pool,lockType) = valueOrElse(isActive(), valueOrElse(isPoolCall(i, pool), calcLockShareTokens(i, Address(callerBytes), pool, lockType))) | |
578 | 594 | ||
579 | 595 | ||
580 | 596 | ||
581 | 597 | @Callable(i) | |
582 | - | func lockStakedShareTokens (pool,lockType,lockAmount) = valueOrElse( | |
598 | + | func lockStakedShareTokens (pool,lockType,lockAmount) = valueOrElse(isActive(), { | |
583 | 599 | let shareAssetId = getShareAssetId(pool) | |
584 | 600 | let user = toString(i.caller) | |
585 | 601 | let totalShare = getTotalShareToken(pool) | |
589 | 605 | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
590 | 606 | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
591 | 607 | let totalUserShareTokens = (userStakedAmount + userLockedAmount) | |
592 | - | let $ | |
593 | - | let lockPeriod = $ | |
594 | - | let lockCoef = $ | |
608 | + | let $t02852828580 = getLockParams(lockType) | |
609 | + | let lockPeriod = $t02852828580._1 | |
610 | + | let lockCoef = $t02852828580._2 | |
595 | 611 | let lockWavesFee = getIntegerValue(this, kLockWavesFee) | |
596 | 612 | if ((getHeightFirstHarvest(pool) > height)) | |
597 | 613 | then throw("You can't lock shareTokens till first harvest end.") | |
622 | 638 | let userStakedAmountNew = (userStakedAmount - lockAmount) | |
623 | 639 | let userLockedHeigtNew = (height + lockPeriod) | |
624 | 640 | let userAmountVirtualNew = (fraction(userLockedAmountNew, lockCoef, lockBoostCoefScale) + userStakedAmountNew) | |
625 | - | let $ | |
626 | - | let farmInterest = $ | |
627 | - | let boostInterest = $ | |
628 | - | let claimAmount = $ | |
629 | - | let toTreasure = $ | |
641 | + | let $t02987029952 = claimCalc(pool, user) | |
642 | + | let farmInterest = $t02987029952._1 | |
643 | + | let boostInterest = $t02987029952._2 | |
644 | + | let claimAmount = $t02987029952._3 | |
645 | + | let toTreasure = $t02987029952._4 | |
630 | 646 | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
631 | 647 | [IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLocked), userLockedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedHeight), userLockedHeigtNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedType), lockType), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userAmountVirtualNew)), IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] | |
632 | 648 | } | |
633 | - | }) | |
649 | + | }) | |
634 | 650 | ||
635 | 651 | ||
636 | 652 | ||
637 | 653 | @Callable(i) | |
638 | 654 | func unlockUserLock (pool,user) = valueOrElse(isActive(), { | |
655 | + | let lockWavesFee = getIntegerValue(this, kLockWavesFee) | |
639 | 656 | let userLockedHeigt = valueOrErrorMessage(getInteger(this, (((pool + "_") + user) + kUserShareTokensLockedHeight)), (((("There is no pool " + pool) + " or user ") + user) + "with lock")) | |
657 | + | let totalShareVirtual = getIntegerValue(this, (pool + kShareTokensVirtual)) | |
658 | + | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
659 | + | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
660 | + | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
640 | 661 | if ((userLockedHeigt > height)) | |
641 | 662 | then throw(("You can't unlock sharetokens till " + toString(userLockedHeigt))) | |
642 | - | else (unlockUserLockCalc(i, pool, user) ++ [ScriptTransfer(i.caller, getIntegerValue(this, kLockWavesFee), unit)]) | |
663 | + | else { | |
664 | + | let userStakedAmountNew = (userStakedAmount + userLockedAmount) | |
665 | + | let $t03202932111 = claimCalc(pool, user) | |
666 | + | let farmInterest = $t03202932111._1 | |
667 | + | let boostInterest = $t03202932111._2 | |
668 | + | let claimAmount = $t03202932111._3 | |
669 | + | let toTreasure = $t03202932111._4 | |
670 | + | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
671 | + | [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userStakedAmountNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userStakedAmountNew)), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), DeleteEntry((((pool + "_") + user) + kUserShareTokensLocked)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedHeight)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedType)), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP), ScriptTransfer(i.caller, lockWavesFee, unit)] | |
672 | + | } | |
643 | 673 | }) | |
644 | - | ||
645 | - | ||
646 | - | ||
647 | - | @Callable(i) | |
648 | - | func unlockUserLockDeprecated (pool,user) = valueOrElse(isActive(), valueOrElse(isSelfCall(i), if (!(getDeprecatedPool(pool))) | |
649 | - | then throw("Pool must be deprecated") | |
650 | - | else if (isDefined(getInteger(this, (((pool + "_") + user) + kUserShareTokensLockedHeight)))) | |
651 | - | then (unlockUserLockCalc(i, pool, user) ++ [ScriptTransfer(moneyBoxAddress, getIntegerValue(this, kLockWavesFee), unit)]) | |
652 | - | else nil)) | |
653 | 674 | ||
654 | 675 | ||
655 | 676 | ||
779 | 800 | func updateUserBoostInterest (pool,user) = valueOrElse(isActive(), if ((i.caller != votingAddress)) | |
780 | 801 | then throw("Only voiting can call this function") | |
781 | 802 | else { | |
782 | - | let $ | |
783 | - | let farmInterest = $ | |
784 | - | let boostInterest = $ | |
785 | - | let claimAmount = $ | |
786 | - | let toTreasure = $ | |
803 | + | let $t03558535667 = claimCalc(pool, user) | |
804 | + | let farmInterest = $t03558535667._1 | |
805 | + | let boostInterest = $t03558535667._2 | |
806 | + | let claimAmount = $t03558535667._3 | |
807 | + | let toTreasure = $t03558535667._4 | |
787 | 808 | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
788 | 809 | [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] | |
789 | 810 | }) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let kActive = "active" | |
5 | 5 | ||
6 | 6 | let kActiveGlob = "active_all_contracts" | |
7 | - | ||
8 | - | let kDeprecatedPool = "deprecated_" | |
9 | 7 | ||
10 | 8 | let kCause = "shutdown_cause" | |
11 | 9 | ||
12 | 10 | let kRewardPoolFractionCurrent = "_current_pool_fraction_reward" | |
13 | 11 | ||
14 | 12 | let kRewardPoolFractionPrevious = "_previous_pool_fraction_reward" | |
15 | 13 | ||
16 | 14 | let kHeightPoolFraction = "_pool_reward_update_height" | |
17 | - | ||
18 | - | let kTotalRewardPerBlockCurrent = "total_reward_per_block_current" | |
19 | - | ||
20 | - | let kTotalRewardPerBlockPrevious = "total_reward_per_block_previous" | |
21 | 15 | ||
22 | 16 | let kRewardUpdateHeight = "reward_update_height" | |
23 | 17 | ||
24 | 18 | let kUserShareTokensStaked = "_share_tokens_locked" | |
25 | 19 | ||
26 | 20 | let kUserShareTokensLocked = "_share_tokens_blocked" | |
27 | 21 | ||
28 | 22 | let kUserShareTokensLockedType = "_share_tokens_blocked_type" | |
29 | 23 | ||
30 | 24 | let kUserShareTokensLockedHeight = "_share_tokens_blocked_height" | |
31 | 25 | ||
32 | 26 | let kUserShareTokensVirtual = "_share_tokens_virtual" | |
33 | 27 | ||
34 | 28 | let kShareTotalShareTokens = "_total_share_tokens_locked" | |
35 | 29 | ||
36 | 30 | let kShareTokensVirtual = "_total_share_tokens_virtual" | |
37 | 31 | ||
38 | 32 | let kLockParams = "_lock_params" | |
39 | 33 | ||
40 | 34 | let kLockWavesFee = "lock_waves_fee" | |
41 | 35 | ||
42 | 36 | let kPoolBoostCoef = "_boost_coef" | |
43 | 37 | ||
44 | 38 | let kFarmLastInterest = "_last_interest" | |
45 | 39 | ||
46 | 40 | let kFarmUserLastInterest = "_last_interest" | |
47 | 41 | ||
48 | 42 | let kBoostLastInterest = "_last_interest_b" | |
49 | 43 | ||
50 | 44 | let kBoostUserLastInterest = "_last_interest_u_b" | |
51 | 45 | ||
52 | 46 | let kLastInterestHeight = "_last_interest_height" | |
53 | 47 | ||
54 | 48 | let kSWOPid = "SWOP_id" | |
55 | 49 | ||
56 | 50 | let kAvailableSWOP = "_available_SWOP" | |
57 | - | ||
58 | - | let kSwopYearEmission = "swop_year_emission" | |
59 | 51 | ||
60 | 52 | let kHarvestPoolVote = "_harvest_pool_vote_gSWOP" | |
61 | 53 | ||
62 | 54 | let kPoolVote = "_pool_vote_gSWOP" | |
63 | 55 | ||
64 | 56 | let kUserPoolVote = "_user_vote_gSWOP" | |
65 | 57 | ||
66 | 58 | let kPoolStruc = "_pool_struc" | |
67 | 59 | ||
68 | 60 | let kUserPoolStruc = "_user_pool_struc" | |
69 | 61 | ||
70 | 62 | let kHarvestUserPoolVote = "_harvest_user_pool_vote_gSWOP" | |
71 | 63 | ||
72 | 64 | let kFirstHarvestHeight = "first_harvest_height" | |
73 | 65 | ||
74 | 66 | let kShareLimitFH = "share_limit_on_first_harvest" | |
75 | 67 | ||
76 | 68 | let kStratBFarmInterest = "_strat_b_farm_interest" | |
77 | 69 | ||
78 | 70 | let kCpmmContract = "cpmm_contract" | |
79 | 71 | ||
80 | 72 | let kAdminPubKey1 = "admin_pub_1" | |
81 | 73 | ||
82 | 74 | let kAdminPubKey2 = "admin_pub_2" | |
83 | 75 | ||
84 | 76 | let kAdminPubKey3 = "admin_pub_3" | |
85 | 77 | ||
86 | 78 | let kAdminInvokePubKey = "admin_invoke_pub" | |
87 | 79 | ||
88 | 80 | let kMoneyBoxAddress = "money_box_address" | |
89 | 81 | ||
90 | 82 | let kVotingAddress = "voting_address" | |
91 | 83 | ||
92 | 84 | let kGovAddress = "governance_address" | |
93 | 85 | ||
94 | 86 | let kLPFarmingAddress = "lp_farming" | |
95 | 87 | ||
96 | 88 | let kFarmingTreasureAddr = "farming_treasure" | |
97 | 89 | ||
98 | 90 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
99 | 91 | ||
100 | 92 | let totalVoteShare = 10000000000 | |
101 | 93 | ||
102 | 94 | let scaleValue8 = 100000000 | |
103 | 95 | ||
104 | 96 | let lockBoostCoefScale = 1000 | |
105 | 97 | ||
106 | 98 | let defPoolBoostCoef = 500 | |
107 | 99 | ||
108 | - | let bStartH = 3397850 | |
100 | + | let startEmissionH = 1911271 | |
101 | + | ||
102 | + | let swopYearEmission = 100000000000000 | |
103 | + | ||
104 | + | let blocksPerYear = 526330 | |
109 | 105 | ||
110 | 106 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
111 | 107 | case string: String => | |
112 | 108 | fromBase58String(string) | |
113 | 109 | case nothing => | |
114 | 110 | throw((key + "is empty")) | |
115 | 111 | } | |
116 | 112 | ||
117 | 113 | ||
118 | 114 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
119 | 115 | ||
120 | 116 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
121 | 117 | ||
122 | 118 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
123 | 119 | ||
124 | 120 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
125 | 121 | ||
126 | 122 | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
127 | 123 | ||
128 | 124 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
129 | 125 | ||
130 | 126 | let adminInvokePubKey = getBase58FromOracle(kAdminInvokePubKey) | |
131 | 127 | ||
132 | 128 | let lpFarmingAddress = Address(getBase58FromOracle(kLPFarmingAddress)) | |
133 | 129 | ||
134 | 130 | let farmingTreasureAddr = Address(getBase58FromOracle(kFarmingTreasureAddr)) | |
135 | 131 | ||
136 | 132 | let cpmmContract = Address(getBase58FromOracle(kCpmmContract)) | |
137 | 133 | ||
138 | 134 | let active = getBooleanValue(this, kActive) | |
139 | 135 | ||
140 | 136 | let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true) | |
141 | 137 | ||
142 | 138 | let SWOP = fromBase58String(getStringValue(this, kSWOPid)) | |
139 | + | ||
140 | + | func getRewardsPerBlockInfo () = { | |
141 | + | let emissionPeriods = ((height - startEmissionH) / blocksPerYear) | |
142 | + | func calcEmission (acc,i) = { | |
143 | + | let $t047104747 = acc | |
144 | + | let curEmission = $t047104747._1 | |
145 | + | let prevEmission = $t047104747._2 | |
146 | + | if ((emissionPeriods > i)) | |
147 | + | then $Tuple2(fraction(curEmission, 75, 100), curEmission) | |
148 | + | else $Tuple2(curEmission, prevEmission) | |
149 | + | } | |
150 | + | ||
151 | + | let $t049055071 = { | |
152 | + | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] | |
153 | + | let $s = size($l) | |
154 | + | let $acc0 = $Tuple2(swopYearEmission, swopYearEmission) | |
155 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
156 | + | then $a | |
157 | + | else calcEmission($a, $l[$i]) | |
158 | + | ||
159 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
160 | + | then $a | |
161 | + | else throw("List size exceeds 20") | |
162 | + | ||
163 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
164 | + | } | |
165 | + | let curEmission = $t049055071._1 | |
166 | + | let prevEmission = $t049055071._2 | |
167 | + | $Tuple3((curEmission / blocksPerYear), (prevEmission / blocksPerYear), (startEmissionH + (blocksPerYear * emissionPeriods))) | |
168 | + | } | |
169 | + | ||
143 | 170 | ||
144 | 171 | func getHeightFirstHarvest (pool) = valueOrElse(getInteger(Address(fromBase58String(pool)), kFirstHarvestHeight), 0) | |
145 | 172 | ||
146 | 173 | ||
147 | 174 | func getFHShareLimitToken (pool) = valueOrErrorMessage(getInteger(pool, kShareLimitFH), ("No data on the key: " + kShareLimitFH)) | |
148 | 175 | ||
149 | 176 | ||
150 | 177 | func getTotalShareToken (pool) = valueOrErrorMessage(getInteger(this, (pool + kShareTotalShareTokens)), (("No data on the key: " + pool) + kShareTotalShareTokens)) | |
151 | 178 | ||
152 | 179 | ||
153 | 180 | func getPoolVoted (pool) = valueOrElse(getInteger(votingAddress, (pool + kPoolVote)), valueOrElse(parseInt(split(valueOrElse(getString(votingAddress, (pool + kPoolStruc)), ""), "_")[0]), 0)) | |
154 | 181 | ||
155 | 182 | ||
156 | 183 | func getUserPoolVoted (pool,user) = valueOrElse(getInteger(votingAddress, (((user + "_") + pool) + kUserPoolVote)), valueOrElse(parseInt(split(valueOrElse(getString(votingAddress, (((user + "_") + pool) + kUserPoolStruc)), ""), "_")[0]), 0)) | |
157 | 184 | ||
158 | 185 | ||
159 | 186 | func getShareAssetId (pool) = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
160 | 187 | ||
161 | 188 | ||
162 | 189 | func accountBalance (assetId) = match assetId { | |
163 | 190 | case id: ByteVector => | |
164 | 191 | assetBalance(this, id) | |
165 | 192 | case waves: Unit => | |
166 | 193 | wavesBalance(this).available | |
167 | 194 | case _ => | |
168 | 195 | throw("Match error") | |
169 | 196 | } | |
170 | 197 | ||
171 | 198 | ||
172 | 199 | func calcScaleValue (assetId1,assetId2) = { | |
173 | 200 | let assetId1Decimals = value(assetInfo(assetId1)).decimals | |
174 | 201 | let assetId2Decimals = value(assetInfo(assetId2)).decimals | |
175 | 202 | let scaleDigits = ((assetId2Decimals - assetId1Decimals) + 8) | |
176 | 203 | pow(10, 0, scaleDigits, 0, 0, DOWN) | |
177 | 204 | } | |
178 | 205 | ||
179 | 206 | ||
180 | 207 | func userAvailableSWOP (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + user) + kAvailableSWOP)), 0) | |
181 | 208 | ||
182 | 209 | ||
183 | 210 | func rewardInfo (pool) = { | |
184 | - | let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger(govAddress, kTotalRewardPerBlockCurrent), ((("No data on the key: " + kTotalRewardPerBlockCurrent) + " at address ") + toString(govAddress))) | |
185 | - | let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger(govAddress, kTotalRewardPerBlockPrevious), ((("No data on the key: " + kTotalRewardPerBlockPrevious) + " at address ") + toString(govAddress))) | |
211 | + | let $t068867001 = getRewardsPerBlockInfo() | |
212 | + | let totalRewardPerBlockCurrent = $t068867001._1 | |
213 | + | let totalRewardPerBlockPrevious = $t068867001._2 | |
214 | + | let lastEmissionUpdateHeight = $t068867001._3 | |
186 | 215 | let rewardPoolFractionCurrent = valueOrErrorMessage(getInteger(govAddress, (pool + kRewardPoolFractionCurrent)), (((("No data on the key: " + pool) + kRewardPoolFractionCurrent) + " at address ") + toString(govAddress))) | |
187 | 216 | let rewardUpdateHeight = valueOrErrorMessage(getInteger(govAddress, kRewardUpdateHeight), ((("No data on the key: " + kRewardUpdateHeight) + " at address ") + toString(govAddress))) | |
188 | 217 | let poolRewardUpdateHeight = valueOrElse(getInteger(govAddress, (pool + kHeightPoolFraction)), rewardUpdateHeight) | |
189 | 218 | let rewardPoolFractionPrevious = valueOrErrorMessage(getInteger(govAddress, (pool + kRewardPoolFractionPrevious)), (((("No data on the key: " + pool) + kRewardPoolFractionPrevious) + " at address ") + toString(govAddress))) | |
190 | 219 | let rewardPoolCurrent = fraction(totalRewardPerBlockCurrent, rewardPoolFractionCurrent, totalVoteShare) | |
191 | 220 | let rewardPoolPrevious = fraction(totalRewardPerBlockCurrent, rewardPoolFractionPrevious, totalVoteShare) | |
221 | + | let rewardPoolPrevCurrent = fraction(totalRewardPerBlockPrevious, rewardPoolFractionCurrent, totalVoteShare) | |
222 | + | let rewardPoolPrevPrevious = fraction(totalRewardPerBlockPrevious, rewardPoolFractionPrevious, totalVoteShare) | |
192 | 223 | if (if ((rewardPoolCurrent > totalRewardPerBlockCurrent)) | |
193 | 224 | then true | |
194 | 225 | else (rewardPoolPrevious > totalRewardPerBlockPrevious)) | |
195 | 226 | then throw("rewardPoolCurrent > totalRewardPerBlockCurrent or rewardPoolPrevious > totalRewardPerBlockPrevious") | |
196 | - | else $ | |
227 | + | else $Tuple7(rewardPoolCurrent, rewardUpdateHeight, rewardPoolPrevious, poolRewardUpdateHeight, lastEmissionUpdateHeight, rewardPoolPrevCurrent, rewardPoolPrevPrevious) | |
197 | 228 | } | |
198 | 229 | ||
199 | 230 | ||
200 | 231 | func getLastInterestInfo (pool) = { | |
201 | 232 | let farmInterest = valueOrErrorMessage(getInteger(this, (pool + kFarmLastInterest)), (("No data on the key: " + pool) + kFarmLastInterest)) | |
202 | 233 | let boostInterest = valueOrElse(getInteger(this, (pool + kBoostLastInterest)), 0) | |
203 | 234 | let lastInterestHeight = valueOrElse(getInteger(this, (pool + kLastInterestHeight)), height) | |
204 | 235 | $Tuple3(lastInterestHeight, farmInterest, boostInterest) | |
205 | 236 | } | |
206 | 237 | ||
207 | 238 | ||
208 | 239 | func calcFarmRwd (pool,curTotalReward) = { | |
209 | 240 | let poolBoostCoef = valueOrElse(getInteger(this, (pool + kPoolBoostCoef)), defPoolBoostCoef) | |
210 | 241 | fraction(curTotalReward, lockBoostCoefScale, (poolBoostCoef + lockBoostCoefScale)) | |
211 | 242 | } | |
212 | 243 | ||
213 | 244 | ||
214 | 245 | func calcBoostRwd (pool,curTotalReward) = { | |
215 | 246 | let poolBoostCoef = valueOrElse(getInteger(this, (pool + kPoolBoostCoef)), defPoolBoostCoef) | |
216 | 247 | fraction(curTotalReward, poolBoostCoef, (poolBoostCoef + lockBoostCoefScale)) | |
217 | 248 | } | |
218 | 249 | ||
219 | 250 | ||
220 | - | func calcInterest (pool,lastInterestHeight,rewardUpdateHeight,poolRewardUpdateHeight,farmInterest,boostInterest,poolVoted,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,scaleValue) = { | |
221 | - | let $ | |
251 | + | func calcInterest (pool,lastInterestHeight,rewardUpdateHeight,poolRewardUpdateHeight,farmInterest,boostInterest,poolVoted,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,scaleValue,toHeight) = { | |
252 | + | let $t01001511200 = if (if (if ((rewardUpdateHeight > toHeight)) | |
222 | 253 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
223 | 254 | else false) | |
224 | 255 | then true | |
225 | - | else if (( | |
256 | + | else if ((toHeight > rewardUpdateHeight)) | |
226 | 257 | then (rewardUpdateHeight != poolRewardUpdateHeight) | |
227 | 258 | else false) | |
228 | 259 | then { | |
229 | - | let r = (previousRewardPerBlock * ( | |
260 | + | let r = (previousRewardPerBlock * (toHeight - lastInterestHeight)) | |
230 | 261 | $Tuple3(r, farmInterest, boostInterest) | |
231 | 262 | } | |
232 | - | else if (if (if (( | |
263 | + | else if (if (if ((toHeight > rewardUpdateHeight)) | |
233 | 264 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
234 | 265 | else false) | |
235 | 266 | then (lastInterestHeight > rewardUpdateHeight) | |
236 | 267 | else false) | |
237 | 268 | then { | |
238 | - | let r = (currentRewardPerBlock * ( | |
269 | + | let r = (currentRewardPerBlock * (toHeight - lastInterestHeight)) | |
239 | 270 | $Tuple3(r, farmInterest, boostInterest) | |
240 | 271 | } | |
241 | 272 | else { | |
242 | 273 | let rwdBfrUpd = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
243 | 274 | let fBfrUp = (farmInterest + fraction(calcFarmRwd(pool, rwdBfrUpd), scaleValue, shareTokenLocked)) | |
244 | 275 | let bBfrUp = (boostInterest + (if ((poolVoted > 0)) | |
245 | 276 | then fraction(calcBoostRwd(pool, rwdBfrUpd), scaleValue8, poolVoted) | |
246 | 277 | else 0)) | |
247 | - | let rwd = (currentRewardPerBlock * ( | |
278 | + | let rwd = (currentRewardPerBlock * (toHeight - rewardUpdateHeight)) | |
248 | 279 | $Tuple3(rwd, fBfrUp, bBfrUp) | |
249 | 280 | } | |
250 | - | let reward = $ | |
251 | - | let farmIntrBefore = $ | |
252 | - | let boostIntrBefore = $ | |
281 | + | let reward = $t01001511200._1 | |
282 | + | let farmIntrBefore = $t01001511200._2 | |
283 | + | let boostIntrBefore = $t01001511200._3 | |
253 | 284 | let newFarmInterest = (farmIntrBefore + fraction(calcFarmRwd(pool, reward), scaleValue, shareTokenLocked)) | |
254 | 285 | let newBoostInterest = (boostIntrBefore + (if ((poolVoted > 0)) | |
255 | 286 | then fraction(calcBoostRwd(pool, reward), scaleValue8, poolVoted) | |
256 | 287 | else 0)) | |
257 | 288 | $Tuple2(newFarmInterest, newBoostInterest) | |
258 | 289 | } | |
259 | 290 | ||
260 | 291 | ||
261 | 292 | func claimCalc (pool,user) = { | |
262 | 293 | let scaleValue = calcScaleValue(SWOP, getShareAssetId(pool)) | |
263 | 294 | let poolVoted = getPoolVoted(pool) | |
264 | 295 | let uPoolVoted = getUserPoolVoted(pool, user) | |
265 | 296 | let shareToken = getTotalShareToken(pool) | |
266 | 297 | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), shareToken) | |
267 | 298 | let stratBFarmInterest = valueOrElse(getInteger(this, (pool + kStratBFarmInterest)), 0) | |
268 | - | let $t01152711608 = getLastInterestInfo(pool) | |
269 | - | let lastInterestHeight = $t01152711608._1 | |
270 | - | let farmInterest = $t01152711608._2 | |
271 | - | let boostInterest = $t01152711608._3 | |
272 | - | let $t01161311727 = rewardInfo(pool) | |
273 | - | let currentRewardPerBlock = $t01161311727._1 | |
274 | - | let rewardUpdateHeight = $t01161311727._2 | |
275 | - | let previousRewardPerBlock = $t01161311727._3 | |
276 | - | let poolRewardUpdateHeight = $t01161311727._4 | |
299 | + | let $t01203812119 = getLastInterestInfo(pool) | |
300 | + | let lastInterestHeight = $t01203812119._1 | |
301 | + | let farmInterest = $t01203812119._2 | |
302 | + | let boostInterest = $t01203812119._3 | |
303 | + | let $t01212412381 = rewardInfo(pool) | |
304 | + | let currentRewardPerBlock = $t01212412381._1 | |
305 | + | let rewardUpdateHeight = $t01212412381._2 | |
306 | + | let previousRewardPerBlock = $t01212412381._3 | |
307 | + | let poolRewardUpdateHeight = $t01212412381._4 | |
308 | + | let emissionUpdateHeight = $t01212412381._5 | |
309 | + | let prevCurrentRewardPerBlock = $t01212412381._6 | |
310 | + | let prevPreviousRewardPerBlock = $t01212412381._7 | |
277 | 311 | let uFarmInterest = valueOrElse(getInteger(this, (((pool + "_") + user) + kFarmUserLastInterest)), farmInterest) | |
278 | 312 | let uBoostInterest = valueOrElse(getInteger(this, (((pool + "_") + user) + kBoostUserLastInterest)), if (if ((stratBFarmInterest > uFarmInterest)) | |
279 | 313 | then (uPoolVoted > 0) | |
280 | 314 | else false) | |
281 | 315 | then 0 | |
282 | 316 | else boostInterest) | |
283 | 317 | let uShareTokensStaked = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
284 | 318 | let uShareTokensVirt = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), uShareTokensStaked) | |
285 | 319 | if ((totalShareVirtual == 0)) | |
286 | 320 | then { | |
287 | - | let toTreasury = (currentRewardPerBlock * (height - lastInterestHeight)) | |
321 | + | let toTreasury = if ((emissionUpdateHeight > lastInterestHeight)) | |
322 | + | then ((prevCurrentRewardPerBlock * (emissionUpdateHeight - lastInterestHeight)) + (currentRewardPerBlock * (height - emissionUpdateHeight))) | |
323 | + | else (currentRewardPerBlock * (height - lastInterestHeight)) | |
288 | 324 | $Tuple4(farmInterest, boostInterest, 0, toTreasury) | |
289 | 325 | } | |
290 | 326 | else { | |
291 | - | let $t01244012832 = calcInterest(pool, lastInterestHeight, rewardUpdateHeight, poolRewardUpdateHeight, farmInterest, boostInterest, poolVoted, currentRewardPerBlock, totalShareVirtual, previousRewardPerBlock, scaleValue) | |
292 | - | let newFarmInterest = $t01244012832._1 | |
293 | - | let newBoostInterest = $t01244012832._2 | |
327 | + | let $t01333914476 = if ((emissionUpdateHeight > lastInterestHeight)) | |
328 | + | then { | |
329 | + | let $t01375214311 = calcInterest(pool, lastInterestHeight, rewardUpdateHeight, poolRewardUpdateHeight, farmInterest, boostInterest, poolVoted, prevCurrentRewardPerBlock, totalShareVirtual, prevPreviousRewardPerBlock, scaleValue, emissionUpdateHeight) | |
330 | + | let prevNewFarmInterest = $t01375214311._1 | |
331 | + | let prevNewBoostInterest = $t01375214311._2 | |
332 | + | $Tuple3(prevNewFarmInterest, prevNewBoostInterest, emissionUpdateHeight) | |
333 | + | } | |
334 | + | else $Tuple3(farmInterest, boostInterest, lastInterestHeight) | |
335 | + | let prevFarmInterest = $t01333914476._1 | |
336 | + | let prevBoostInterest = $t01333914476._2 | |
337 | + | let LIHeight = $t01333914476._3 | |
338 | + | let $t01448514908 = calcInterest(pool, LIHeight, rewardUpdateHeight, poolRewardUpdateHeight, prevFarmInterest, prevBoostInterest, poolVoted, currentRewardPerBlock, totalShareVirtual, previousRewardPerBlock, scaleValue, height) | |
339 | + | let newFarmInterest = $t01448514908._1 | |
340 | + | let newBoostInterest = $t01448514908._2 | |
294 | 341 | let farmRwd = fraction(uShareTokensVirt, (newFarmInterest - uFarmInterest), scaleValue) | |
295 | 342 | let poolBoostCoef = valueOrElse(getInteger(this, (pool + kPoolBoostCoef)), defPoolBoostCoef) | |
296 | 343 | let boostRwdMax = fraction(fraction(uShareTokensVirt, (newFarmInterest - max([uFarmInterest, stratBFarmInterest])), scaleValue), poolBoostCoef, lockBoostCoefScale) | |
297 | 344 | let curBoostRwd = fraction((newBoostInterest - uBoostInterest), uPoolVoted, scaleValue8) | |
298 | 345 | let boostRwd = min([boostRwdMax, curBoostRwd]) | |
299 | 346 | let toTreasury = (boostRwdMax - boostRwd) | |
300 | 347 | if ((0 > toTreasury)) | |
301 | 348 | then throw("toTreasury < 0") | |
302 | 349 | else $Tuple4(newFarmInterest, newBoostInterest, (farmRwd + boostRwd), toTreasury) | |
303 | 350 | } | |
304 | 351 | } | |
305 | 352 | ||
306 | 353 | ||
307 | 354 | func availableClaimCalcAllByUser (pools,user) = { | |
308 | 355 | func calcAvailable (acc,pool) = { | |
309 | - | let $ | |
310 | - | let newPools = $ | |
311 | - | let amounts = $ | |
312 | - | let $ | |
313 | - | let fi = $ | |
314 | - | let bi = $ | |
315 | - | let claimAmount = $ | |
316 | - | let tt = $ | |
356 | + | let $t01577715806 = acc | |
357 | + | let newPools = $t01577715806._1 | |
358 | + | let amounts = $t01577715806._2 | |
359 | + | let $t01581515868 = claimCalc(pool, user) | |
360 | + | let fi = $t01581515868._1 | |
361 | + | let bi = $t01581515868._2 | |
362 | + | let claimAmount = $t01581515868._3 | |
363 | + | let tt = $t01581515868._4 | |
317 | 364 | let availableFund = (userAvailableSWOP(pool, user) + claimAmount) | |
318 | 365 | $Tuple2((newPools :+ pool), (amounts :+ availableFund)) | |
319 | 366 | } | |
320 | 367 | ||
321 | 368 | let $l = pools | |
322 | 369 | let $s = size($l) | |
323 | 370 | let $acc0 = $Tuple2(nil, nil) | |
324 | 371 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
325 | 372 | then $a | |
326 | 373 | else calcAvailable($a, $l[$i]) | |
327 | 374 | ||
328 | 375 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
329 | 376 | then $a | |
330 | 377 | else throw("List size exceeds 60") | |
331 | 378 | ||
332 | 379 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60) | |
333 | 380 | } | |
334 | 381 | ||
335 | 382 | ||
336 | 383 | func canLockInFirstHarvest (pool,user,userShareTokensStaked,pmtAmount,lockType) = if ((getHeightFirstHarvest(pool) > height)) | |
337 | 384 | then { | |
338 | 385 | let totalVoteAmount = valueOrElse(getInteger(votingAddress, (pool + kHarvestPoolVote)), 0) | |
339 | 386 | let userVoteAmount = valueOrElse(getInteger(votingAddress, (((user + "_") + pool) + kHarvestUserPoolVote)), 0) | |
340 | 387 | let FHShareTokenLimit = getFHShareLimitToken(addressFromStringValue(pool)) | |
341 | 388 | let FHShareTokenUserLimit = (fraction(FHShareTokenLimit, userVoteAmount, totalVoteAmount) - userShareTokensStaked) | |
342 | 389 | if ((lockType > 0)) | |
343 | 390 | then throw("You can't lock shareTokens till first harvest end.") | |
344 | 391 | else if ((userVoteAmount == 0)) | |
345 | 392 | then 0 | |
346 | 393 | else if ((pmtAmount >= FHShareTokenUserLimit)) | |
347 | 394 | then (pmtAmount - FHShareTokenUserLimit) | |
348 | 395 | else 0 | |
349 | 396 | } | |
350 | 397 | else 0 | |
351 | 398 | ||
352 | 399 | ||
353 | 400 | func getLockParams (type) = { | |
354 | 401 | let lockParams = split(valueOrErrorMessage(getString(this, (toString(type) + kLockParams)), ("There are no key for lock type" + toString(type))), "_") | |
355 | 402 | $Tuple2(parseIntValue(lockParams[0]), parseIntValue(lockParams[1])) | |
356 | 403 | } | |
357 | 404 | ||
358 | 405 | ||
359 | 406 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
360 | 407 | ||
361 | 408 | ||
362 | 409 | func isActive () = if (if (active) | |
363 | 410 | then activeGlob | |
364 | 411 | else false) | |
365 | 412 | then unit | |
366 | 413 | else throw("DApp is inactive at this moment") | |
367 | 414 | ||
368 | 415 | ||
369 | 416 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
370 | 417 | then unit | |
371 | 418 | else throw("Only admin can call this function") | |
372 | 419 | ||
373 | 420 | ||
374 | 421 | func isPoolCall (i,pool) = if (if ((toString(i.caller) == pool)) | |
375 | 422 | then true | |
376 | 423 | else (i.caller == cpmmContract)) | |
377 | 424 | then unit | |
378 | 425 | else throw("Only pool can call this function") | |
379 | 426 | ||
380 | 427 | ||
381 | - | func getDeprecatedPool (pool) = valueOrElse(getBoolean(oracle, (kDeprecatedPool + pool)), false) | |
382 | - | ||
383 | - | ||
384 | - | func isDeprecatedPool (pool) = if (!(getDeprecatedPool(pool))) | |
385 | - | then unit | |
386 | - | else throw("Pool is deprecated. Only unlock action allowed.") | |
387 | - | ||
388 | - | ||
389 | 428 | func isSelfCall (i) = if ((i.caller == this)) | |
390 | 429 | then unit | |
391 | 430 | else throw("Only contract itself can call this function") | |
392 | 431 | ||
393 | 432 | ||
394 | 433 | func calcLockShareTokens (i,caller,pool,lockType) = { | |
395 | 434 | let shareAssetId = getShareAssetId(pool) | |
396 | 435 | let user = toString(caller) | |
397 | 436 | let totalShare = getTotalShareToken(pool) | |
398 | 437 | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), totalShare) | |
399 | 438 | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
400 | 439 | let userLockedHeigt = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLockedHeight)), 0) | |
401 | 440 | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
402 | 441 | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
403 | 442 | let totalUserShareTokens = ((userStakedAmount + userLockedAmount) + i.payments[0].amount) | |
404 | - | let $ | |
405 | - | let lockPeriod = $ | |
406 | - | let lockCoef = $ | |
443 | + | let $t01866918721 = getLockParams(lockType) | |
444 | + | let lockPeriod = $t01866918721._1 | |
445 | + | let lockCoef = $t01866918721._2 | |
407 | 446 | let lockWavesFee = getIntegerValue(this, kLockWavesFee) | |
408 | 447 | if ((i.payments[0].assetId != shareAssetId)) | |
409 | 448 | then throw("Wrong sharetoken in payment") | |
410 | 449 | else if ((0 >= i.payments[0].amount)) | |
411 | 450 | then throw("Payment amount must be greater than 0") | |
412 | 451 | else if ((0 > lockType)) | |
413 | 452 | then throw("lockType must be >= 0") | |
414 | 453 | else { | |
415 | 454 | let shareTokensChangeOnFH = canLockInFirstHarvest(pool, user, userStakedAmount, i.payments[0].amount, lockType) | |
416 | 455 | if ((shareTokensChangeOnFH == shareTokensChangeOnFH)) | |
417 | 456 | then { | |
418 | - | let $ | |
457 | + | let $t01914821082 = if ((lockType == 0)) | |
419 | 458 | then { | |
420 | 459 | let userAmountVirtualNew = ((userAmountVirtual + i.payments[0].amount) - shareTokensChangeOnFH) | |
421 | 460 | $Tuple2([IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), ((userStakedAmount + i.payments[0].amount) - shareTokensChangeOnFH)), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual + i.payments[0].amount) - shareTokensChangeOnFH)), ScriptTransfer(caller, shareTokensChangeOnFH, i.payments[0].assetId)], ((totalShare + i.payments[0].amount) - shareTokensChangeOnFH)) | |
422 | 461 | } | |
423 | 462 | else if (if ((userLockedHeigt == 0)) | |
424 | 463 | then if (if ((2 > size(i.payments))) | |
425 | 464 | then true | |
426 | 465 | else (i.payments[1].assetId != unit)) | |
427 | 466 | then true | |
428 | 467 | else (lockWavesFee > i.payments[1].amount) | |
429 | 468 | else false) | |
430 | 469 | then throw((("You need to pay additional waves comission " + toString(lockWavesFee)) + "WAVES")) | |
431 | 470 | else if ((userLockedHeigt > (height + lockPeriod))) | |
432 | 471 | then throw("You cannot lock sharetokens for a period less than what you have already locked") | |
433 | 472 | else { | |
434 | 473 | let userLockedAmountNew = (userLockedAmount + i.payments[0].amount) | |
435 | 474 | let userLockedHeigtNew = (height + lockPeriod) | |
436 | 475 | let userAmountVirtualNew = (fraction(userLockedAmountNew, lockCoef, lockBoostCoefScale) + userStakedAmount) | |
437 | 476 | $Tuple2([IntegerEntry((((pool + "_") + user) + kUserShareTokensLocked), userLockedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedHeight), userLockedHeigtNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedType), lockType), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userAmountVirtualNew))], (totalShare + i.payments[0].amount)) | |
438 | 477 | } | |
439 | - | let lockEntries = $ | |
440 | - | let totalShareNew = $ | |
478 | + | let lockEntries = $t01914821082._1 | |
479 | + | let totalShareNew = $t01914821082._2 | |
441 | 480 | if ((accountBalance(shareAssetId) > totalShareNew)) | |
442 | 481 | then throw("Balance of share-token is lower than totalAmount") | |
443 | 482 | else { | |
444 | - | let $ | |
445 | - | let farmInterest = $ | |
446 | - | let boostInterest = $ | |
447 | - | let claimAmount = $ | |
448 | - | let toTreasure = $ | |
483 | + | let $t02120721289 = claimCalc(pool, user) | |
484 | + | let farmInterest = $t02120721289._1 | |
485 | + | let boostInterest = $t02120721289._2 | |
486 | + | let claimAmount = $t02120721289._3 | |
487 | + | let toTreasure = $t02120721289._4 | |
449 | 488 | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
450 | 489 | let uplp = if ((getString(Address(fromBase58String(pool)), "version") == "3.0.0")) | |
451 | 490 | then invoke(lpFarmingAddress, "updateUserInterest", [user, pool, totalUserShareTokens], nil) | |
452 | 491 | else 0 | |
453 | 492 | if ((uplp == uplp)) | |
454 | 493 | then ([IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((pool + kShareTotalShareTokens), totalShareNew), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] ++ lockEntries) | |
455 | 494 | else throw("Strict value is not equal to itself.") | |
456 | 495 | } | |
457 | 496 | } | |
458 | 497 | else throw("Strict value is not equal to itself.") | |
459 | 498 | } | |
460 | 499 | } | |
461 | 500 | ||
462 | 501 | ||
463 | - | func calcWithdrawShareTokens (i,caller,pool,shareTokensWithdrawAmount) = { | |
464 | - | let inv = if (getDeprecatedPool(pool)) | |
465 | - | then invoke(this, "unlockUserLockDeprecated", [pool, toString(caller)], nil) | |
466 | - | else 0 | |
467 | - | if ((inv == inv)) | |
468 | - | then { | |
469 | - | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
470 | - | let user = toString(caller) | |
471 | - | let $t02075820840 = claimCalc(pool, user) | |
472 | - | let farmInterest = $t02075820840._1 | |
473 | - | let boostInterest = $t02075820840._2 | |
474 | - | let claimAmount = $t02075820840._3 | |
475 | - | let toTreasure = $t02075820840._4 | |
476 | - | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
477 | - | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
478 | - | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
479 | - | let userStakedAmountNew = (userStakedAmount - shareTokensWithdrawAmount) | |
480 | - | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
481 | - | let totalShareAmount = getTotalShareToken(pool) | |
482 | - | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), totalShareAmount) | |
483 | - | let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount) | |
484 | - | let totalShareVirtualNew = (totalShareVirtual - shareTokensWithdrawAmount) | |
485 | - | let userAmountVirtualNew = (userAmountVirtual - shareTokensWithdrawAmount) | |
486 | - | if ((shareTokensWithdrawAmount > userStakedAmount)) | |
487 | - | then throw("Withdraw amount more then user locked amount") | |
488 | - | else if ((accountBalance(shareTokensId) > totalShareAmount)) | |
489 | - | then throw("Balance of share-token is lower than totalAmount") | |
490 | - | else { | |
491 | - | let uplp = if ((getString(Address(fromBase58String(pool)), "version") == "3.0.0")) | |
492 | - | then invoke(lpFarmingAddress, "updateUserInterest", [user, pool, (userStakedAmount + userLockedAmount)], nil) | |
493 | - | else 0 | |
494 | - | if ((uplp == uplp)) | |
495 | - | then [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTotalShareTokens), totalShareAmountNew), IntegerEntry((pool + kShareTokensVirtual), totalShareVirtualNew), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
496 | - | else throw("Strict value is not equal to itself.") | |
497 | - | } | |
498 | - | } | |
499 | - | else throw("Strict value is not equal to itself.") | |
500 | - | } | |
502 | + | func calcWithdrawShareTokens (i,caller,pool,shareTokensWithdrawAmount) = valueOrElse(isActive(), { | |
503 | + | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
504 | + | let user = toString(caller) | |
505 | + | let $t02248122563 = claimCalc(pool, user) | |
506 | + | let farmInterest = $t02248122563._1 | |
507 | + | let boostInterest = $t02248122563._2 | |
508 | + | let claimAmount = $t02248122563._3 | |
509 | + | let toTreasure = $t02248122563._4 | |
510 | + | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
511 | + | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
512 | + | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
513 | + | let userStakedAmountNew = (userStakedAmount - shareTokensWithdrawAmount) | |
514 | + | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
515 | + | let totalShareAmount = getTotalShareToken(pool) | |
516 | + | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), totalShareAmount) | |
517 | + | let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount) | |
518 | + | let totalShareVirtualNew = (totalShareVirtual - shareTokensWithdrawAmount) | |
519 | + | let userAmountVirtualNew = (userAmountVirtual - shareTokensWithdrawAmount) | |
520 | + | if ((shareTokensWithdrawAmount > userStakedAmount)) | |
521 | + | then throw("Withdraw amount more then user locked amount") | |
522 | + | else if ((accountBalance(shareTokensId) > totalShareAmount)) | |
523 | + | then throw("Balance of share-token is lower than totalAmount") | |
524 | + | else { | |
525 | + | let uplp = if ((getString(Address(fromBase58String(pool)), "version") == "3.0.0")) | |
526 | + | then invoke(lpFarmingAddress, "updateUserInterest", [user, pool, (userStakedAmount + userLockedAmount)], nil) | |
527 | + | else 0 | |
528 | + | if ((uplp == uplp)) | |
529 | + | then [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTotalShareTokens), totalShareAmountNew), IntegerEntry((pool + kShareTokensVirtual), totalShareVirtualNew), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
530 | + | else throw("Strict value is not equal to itself.") | |
531 | + | } | |
532 | + | }) | |
501 | 533 | ||
502 | 534 | ||
503 | 535 | func calcClaim (i,pool,caller) = { | |
504 | 536 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
505 | 537 | let user = toString(caller) | |
506 | 538 | let shareTokenLocked = getTotalShareToken(pool) | |
507 | - | let $ | |
508 | - | let farmInterest = $ | |
509 | - | let boostInterest = $ | |
510 | - | let claimAmount = $ | |
511 | - | let toTreasure = $ | |
539 | + | let $t02507625158 = claimCalc(pool, user) | |
540 | + | let farmInterest = $t02507625158._1 | |
541 | + | let boostInterest = $t02507625158._2 | |
542 | + | let claimAmount = $t02507625158._3 | |
543 | + | let toTreasure = $t02507625158._4 | |
512 | 544 | let availableFund = (userAvailableSWOP(pool, user) + claimAmount) | |
513 | 545 | if ((accountBalance(shareTokensId) > shareTokenLocked)) | |
514 | 546 | then throw("Balance of share-token is lower than totalAmount") | |
515 | 547 | else { | |
516 | 548 | let uTrans = if ((i.caller != this)) | |
517 | 549 | then [ScriptTransfer(i.caller, availableFund, SWOP)] | |
518 | 550 | else nil | |
519 | 551 | $Tuple2(([IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), 0), Reissue(SWOP, (toTreasure + availableFund), true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] ++ uTrans), availableFund) | |
520 | 552 | } | |
521 | - | } | |
522 | - | ||
523 | - | ||
524 | - | func unlockUserLockCalc (i,pool,user) = { | |
525 | - | let totalShareVirtual = getIntegerValue(this, (pool + kShareTokensVirtual)) | |
526 | - | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
527 | - | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
528 | - | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
529 | - | let userStakedAmountNew = (userStakedAmount + userLockedAmount) | |
530 | - | let $t02483624918 = claimCalc(pool, user) | |
531 | - | let farmInterest = $t02483624918._1 | |
532 | - | let boostInterest = $t02483624918._2 | |
533 | - | let claimAmount = $t02483624918._3 | |
534 | - | let toTreasure = $t02483624918._4 | |
535 | - | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
536 | - | [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userStakedAmountNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userStakedAmountNew)), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), DeleteEntry((((pool + "_") + user) + kUserShareTokensLocked)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedHeight)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedType)), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] | |
537 | 553 | } | |
538 | 554 | ||
539 | 555 | ||
540 | 556 | @Callable(i) | |
541 | 557 | func init (earlyLP) = if (isDefined(getString(this, kSWOPid))) | |
542 | 558 | then throw("SWOP already initialized") | |
543 | 559 | else { | |
544 | 560 | let initAmount = 100000000000000 | |
545 | 561 | let SWOPissue = Issue("SWOP", "SWOP protocol token", initAmount, 8, true) | |
546 | 562 | let SWOPid = calculateAssetId(SWOPissue) | |
547 | 563 | [BooleanEntry(kActive, true), Issue("SWOP", "SWOP protocol token", initAmount, 8, true), StringEntry(kSWOPid, toBase58String(SWOPid))] | |
548 | 564 | } | |
549 | 565 | ||
550 | 566 | ||
551 | 567 | ||
552 | 568 | @Callable(i) | |
553 | 569 | func initPoolShareFarming (pool) = valueOrElse(isAdminCall(i), [IntegerEntry((pool + kShareTotalShareTokens), 0), IntegerEntry((pool + kFarmLastInterest), 0), IntegerEntry((pool + kBoostLastInterest), 0), IntegerEntry((pool + kLastInterestHeight), height)]) | |
554 | 570 | ||
555 | 571 | ||
556 | 572 | ||
557 | 573 | @Callable(i) | |
558 | 574 | func updatePoolInterest (pool) = valueOrElse(isActive(), if ((i.caller != govAddress)) | |
559 | 575 | then throw("Only Governance can call this function") | |
560 | 576 | else { | |
561 | 577 | let user = toString(addressFromPublicKey(adminInvokePubKey)) | |
562 | - | let $ | |
563 | - | let farmInterest = $ | |
564 | - | let boostInterest = $ | |
565 | - | let boostLPinterest = $ | |
578 | + | let $t02703527109 = claimCalc(pool, user) | |
579 | + | let farmInterest = $t02703527109._1 | |
580 | + | let boostInterest = $t02703527109._2 | |
581 | + | let boostLPinterest = $t02703527109._3 | |
566 | 582 | [IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height)] | |
567 | 583 | }) | |
568 | 584 | ||
569 | 585 | ||
570 | 586 | ||
571 | 587 | @Callable(i) | |
572 | - | func lockShareTokens (pool,lockType) = | |
588 | + | func lockShareTokens (pool,lockType) = valueOrElse(isActive(), calcLockShareTokens(i, i.caller, pool, lockType)) | |
573 | 589 | ||
574 | 590 | ||
575 | 591 | ||
576 | 592 | @Callable(i) | |
577 | - | func lockShareTokensFromPool (callerBytes,pool,lockType) = | |
593 | + | func lockShareTokensFromPool (callerBytes,pool,lockType) = valueOrElse(isActive(), valueOrElse(isPoolCall(i, pool), calcLockShareTokens(i, Address(callerBytes), pool, lockType))) | |
578 | 594 | ||
579 | 595 | ||
580 | 596 | ||
581 | 597 | @Callable(i) | |
582 | - | func lockStakedShareTokens (pool,lockType,lockAmount) = valueOrElse( | |
598 | + | func lockStakedShareTokens (pool,lockType,lockAmount) = valueOrElse(isActive(), { | |
583 | 599 | let shareAssetId = getShareAssetId(pool) | |
584 | 600 | let user = toString(i.caller) | |
585 | 601 | let totalShare = getTotalShareToken(pool) | |
586 | 602 | let totalShareVirtual = valueOrElse(getInteger(this, (pool + kShareTokensVirtual)), totalShare) | |
587 | 603 | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
588 | 604 | let userLockedHeigt = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLockedHeight)), 0) | |
589 | 605 | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
590 | 606 | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
591 | 607 | let totalUserShareTokens = (userStakedAmount + userLockedAmount) | |
592 | - | let $ | |
593 | - | let lockPeriod = $ | |
594 | - | let lockCoef = $ | |
608 | + | let $t02852828580 = getLockParams(lockType) | |
609 | + | let lockPeriod = $t02852828580._1 | |
610 | + | let lockCoef = $t02852828580._2 | |
595 | 611 | let lockWavesFee = getIntegerValue(this, kLockWavesFee) | |
596 | 612 | if ((getHeightFirstHarvest(pool) > height)) | |
597 | 613 | then throw("You can't lock shareTokens till first harvest end.") | |
598 | 614 | else if ((0 >= lockType)) | |
599 | 615 | then throw("lockType must be > 0") | |
600 | 616 | else if ((lockAmount > userStakedAmount)) | |
601 | 617 | then throw(("You can't lock more than " + toString(userStakedAmount))) | |
602 | 618 | else if ((accountBalance(shareAssetId) > totalShare)) | |
603 | 619 | then throw("Balance of share-token is lower than totalAmount") | |
604 | 620 | else if (if ((userLockedHeigt == 0)) | |
605 | 621 | then if (if ((1 > size(i.payments))) | |
606 | 622 | then true | |
607 | 623 | else (i.payments[0].assetId != unit)) | |
608 | 624 | then true | |
609 | 625 | else (lockWavesFee > i.payments[0].amount) | |
610 | 626 | else false) | |
611 | 627 | then throw((("You need to pay additional waves comission " + toString(lockWavesFee)) + "WAVES")) | |
612 | 628 | else if (if ((userLockedHeigt == 0)) | |
613 | 629 | then (0 >= lockAmount) | |
614 | 630 | else false) | |
615 | 631 | then throw("lockAmount must be greater than 0") | |
616 | 632 | else if ((0 > lockAmount)) | |
617 | 633 | then throw("lockAmount must be positive") | |
618 | 634 | else if ((userLockedHeigt > (height + lockPeriod))) | |
619 | 635 | then throw("You cannot lock sharetokens for a period less than what you have already locked") | |
620 | 636 | else { | |
621 | 637 | let userLockedAmountNew = (userLockedAmount + lockAmount) | |
622 | 638 | let userStakedAmountNew = (userStakedAmount - lockAmount) | |
623 | 639 | let userLockedHeigtNew = (height + lockPeriod) | |
624 | 640 | let userAmountVirtualNew = (fraction(userLockedAmountNew, lockCoef, lockBoostCoefScale) + userStakedAmountNew) | |
625 | - | let $ | |
626 | - | let farmInterest = $ | |
627 | - | let boostInterest = $ | |
628 | - | let claimAmount = $ | |
629 | - | let toTreasure = $ | |
641 | + | let $t02987029952 = claimCalc(pool, user) | |
642 | + | let farmInterest = $t02987029952._1 | |
643 | + | let boostInterest = $t02987029952._2 | |
644 | + | let claimAmount = $t02987029952._3 | |
645 | + | let toTreasure = $t02987029952._4 | |
630 | 646 | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
631 | 647 | [IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLocked), userLockedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedHeight), userLockedHeigtNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensLockedType), lockType), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userAmountVirtualNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userAmountVirtualNew)), IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] | |
632 | 648 | } | |
633 | - | }) | |
649 | + | }) | |
634 | 650 | ||
635 | 651 | ||
636 | 652 | ||
637 | 653 | @Callable(i) | |
638 | 654 | func unlockUserLock (pool,user) = valueOrElse(isActive(), { | |
655 | + | let lockWavesFee = getIntegerValue(this, kLockWavesFee) | |
639 | 656 | let userLockedHeigt = valueOrErrorMessage(getInteger(this, (((pool + "_") + user) + kUserShareTokensLockedHeight)), (((("There is no pool " + pool) + " or user ") + user) + "with lock")) | |
657 | + | let totalShareVirtual = getIntegerValue(this, (pool + kShareTokensVirtual)) | |
658 | + | let userStakedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensStaked)), 0) | |
659 | + | let userLockedAmount = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensLocked)), 0) | |
660 | + | let userAmountVirtual = valueOrElse(getInteger(this, (((pool + "_") + user) + kUserShareTokensVirtual)), userStakedAmount) | |
640 | 661 | if ((userLockedHeigt > height)) | |
641 | 662 | then throw(("You can't unlock sharetokens till " + toString(userLockedHeigt))) | |
642 | - | else (unlockUserLockCalc(i, pool, user) ++ [ScriptTransfer(i.caller, getIntegerValue(this, kLockWavesFee), unit)]) | |
663 | + | else { | |
664 | + | let userStakedAmountNew = (userStakedAmount + userLockedAmount) | |
665 | + | let $t03202932111 = claimCalc(pool, user) | |
666 | + | let farmInterest = $t03202932111._1 | |
667 | + | let boostInterest = $t03202932111._2 | |
668 | + | let claimAmount = $t03202932111._3 | |
669 | + | let toTreasure = $t03202932111._4 | |
670 | + | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
671 | + | [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kUserShareTokensStaked), userStakedAmountNew), IntegerEntry((((pool + "_") + user) + kUserShareTokensVirtual), userStakedAmountNew), IntegerEntry((pool + kShareTokensVirtual), ((totalShareVirtual - userAmountVirtual) + userStakedAmountNew)), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), DeleteEntry((((pool + "_") + user) + kUserShareTokensLocked)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedHeight)), DeleteEntry((((pool + "_") + user) + kUserShareTokensLockedType)), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP), ScriptTransfer(i.caller, lockWavesFee, unit)] | |
672 | + | } | |
643 | 673 | }) | |
644 | - | ||
645 | - | ||
646 | - | ||
647 | - | @Callable(i) | |
648 | - | func unlockUserLockDeprecated (pool,user) = valueOrElse(isActive(), valueOrElse(isSelfCall(i), if (!(getDeprecatedPool(pool))) | |
649 | - | then throw("Pool must be deprecated") | |
650 | - | else if (isDefined(getInteger(this, (((pool + "_") + user) + kUserShareTokensLockedHeight)))) | |
651 | - | then (unlockUserLockCalc(i, pool, user) ++ [ScriptTransfer(moneyBoxAddress, getIntegerValue(this, kLockWavesFee), unit)]) | |
652 | - | else nil)) | |
653 | 674 | ||
654 | 675 | ||
655 | 676 | ||
656 | 677 | @Callable(i) | |
657 | 678 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = valueOrElse(isActive(), calcWithdrawShareTokens(i, i.caller, pool, shareTokensWithdrawAmount)) | |
658 | 679 | ||
659 | 680 | ||
660 | 681 | ||
661 | 682 | @Callable(i) | |
662 | 683 | func withdrawShareTokensFromPool (callerBytes,pool,shareTokensWithdrawAmount) = valueOrElse(isActive(), valueOrElse(isPoolCall(i, pool), calcWithdrawShareTokens(i, Address(callerBytes), pool, shareTokensWithdrawAmount))) | |
663 | 684 | ||
664 | 685 | ||
665 | 686 | ||
666 | 687 | @Callable(i) | |
667 | 688 | func claim (pool) = valueOrElse(isActive(), { | |
668 | 689 | let r = calcClaim(i, pool, i.caller) | |
669 | 690 | if ((r._2 == 0)) | |
670 | 691 | then throw("You have 0 available SWOP") | |
671 | 692 | else r | |
672 | 693 | }) | |
673 | 694 | ||
674 | 695 | ||
675 | 696 | ||
676 | 697 | @Callable(i) | |
677 | 698 | func claimInternal (pool,caller) = valueOrElse(isActive(), valueOrElse(isSelfCall(i), calcClaim(i, pool, Address(caller)))) | |
678 | 699 | ||
679 | 700 | ||
680 | 701 | ||
681 | 702 | @Callable(i) | |
682 | 703 | func claimAndStake (pool) = valueOrElse(isActive(), { | |
683 | 704 | let claimAmount = { | |
684 | 705 | let @ = invoke(this, "claimInternal", [pool, i.caller.bytes], nil) | |
685 | 706 | if ($isInstanceOf(@, "Int")) | |
686 | 707 | then @ | |
687 | 708 | else throw(($getType(@) + " couldn't be cast to Int")) | |
688 | 709 | } | |
689 | 710 | if ((claimAmount == claimAmount)) | |
690 | 711 | then if ((claimAmount == 0)) | |
691 | 712 | then throw("You have 0 available SWOP") | |
692 | 713 | else { | |
693 | 714 | let stakeToGov = invoke(govAddress, "lockSWOPFromFarming", nil, [AttachedPayment(SWOP, claimAmount)]) | |
694 | 715 | if ((stakeToGov == stakeToGov)) | |
695 | 716 | then nil | |
696 | 717 | else throw("Strict value is not equal to itself.") | |
697 | 718 | } | |
698 | 719 | else throw("Strict value is not equal to itself.") | |
699 | 720 | }) | |
700 | 721 | ||
701 | 722 | ||
702 | 723 | ||
703 | 724 | @Callable(i) | |
704 | 725 | func claimAll (pools) = valueOrElse(isActive(), { | |
705 | 726 | func claimInv (claimTotal,pool) = { | |
706 | 727 | let claimAmount = { | |
707 | 728 | let @ = invoke(this, "claimInternal", [pool, i.caller.bytes], nil) | |
708 | 729 | if ($isInstanceOf(@, "Int")) | |
709 | 730 | then @ | |
710 | 731 | else throw(($getType(@) + " couldn't be cast to Int")) | |
711 | 732 | } | |
712 | 733 | if ((claimAmount == claimAmount)) | |
713 | 734 | then (claimTotal + claimAmount) | |
714 | 735 | else throw("Strict value is not equal to itself.") | |
715 | 736 | } | |
716 | 737 | ||
717 | 738 | let claimTotal = { | |
718 | 739 | let $l = pools | |
719 | 740 | let $s = size($l) | |
720 | 741 | let $acc0 = 0 | |
721 | 742 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
722 | 743 | then $a | |
723 | 744 | else claimInv($a, $l[$i]) | |
724 | 745 | ||
725 | 746 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
726 | 747 | then $a | |
727 | 748 | else throw("List size exceeds 60") | |
728 | 749 | ||
729 | 750 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60) | |
730 | 751 | } | |
731 | 752 | if ((claimTotal == 0)) | |
732 | 753 | then throw("You have 0 available SWOP") | |
733 | 754 | else [ScriptTransfer(i.caller, claimTotal, SWOP)] | |
734 | 755 | }) | |
735 | 756 | ||
736 | 757 | ||
737 | 758 | ||
738 | 759 | @Callable(i) | |
739 | 760 | func claimAllAndStake (pools) = valueOrElse(isActive(), { | |
740 | 761 | func claimInv (claimTotal,pool) = { | |
741 | 762 | let claimAmount = { | |
742 | 763 | let @ = invoke(this, "claimInternal", [pool, i.caller.bytes], nil) | |
743 | 764 | if ($isInstanceOf(@, "Int")) | |
744 | 765 | then @ | |
745 | 766 | else throw(($getType(@) + " couldn't be cast to Int")) | |
746 | 767 | } | |
747 | 768 | if ((claimAmount == claimAmount)) | |
748 | 769 | then (claimTotal + claimAmount) | |
749 | 770 | else throw("Strict value is not equal to itself.") | |
750 | 771 | } | |
751 | 772 | ||
752 | 773 | let claimTotal = { | |
753 | 774 | let $l = pools | |
754 | 775 | let $s = size($l) | |
755 | 776 | let $acc0 = 0 | |
756 | 777 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
757 | 778 | then $a | |
758 | 779 | else claimInv($a, $l[$i]) | |
759 | 780 | ||
760 | 781 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
761 | 782 | then $a | |
762 | 783 | else throw("List size exceeds 60") | |
763 | 784 | ||
764 | 785 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60) | |
765 | 786 | } | |
766 | 787 | if ((claimTotal == 0)) | |
767 | 788 | then throw("You have 0 available SWOP") | |
768 | 789 | else { | |
769 | 790 | let stakeToGov = invoke(govAddress, "lockSWOPFromFarming", nil, [AttachedPayment(SWOP, claimTotal)]) | |
770 | 791 | if ((stakeToGov == stakeToGov)) | |
771 | 792 | then nil | |
772 | 793 | else throw("Strict value is not equal to itself.") | |
773 | 794 | } | |
774 | 795 | }) | |
775 | 796 | ||
776 | 797 | ||
777 | 798 | ||
778 | 799 | @Callable(i) | |
779 | 800 | func updateUserBoostInterest (pool,user) = valueOrElse(isActive(), if ((i.caller != votingAddress)) | |
780 | 801 | then throw("Only voiting can call this function") | |
781 | 802 | else { | |
782 | - | let $ | |
783 | - | let farmInterest = $ | |
784 | - | let boostInterest = $ | |
785 | - | let claimAmount = $ | |
786 | - | let toTreasure = $ | |
803 | + | let $t03558535667 = claimCalc(pool, user) | |
804 | + | let farmInterest = $t03558535667._1 | |
805 | + | let boostInterest = $t03558535667._2 | |
806 | + | let claimAmount = $t03558535667._3 | |
807 | + | let toTreasure = $t03558535667._4 | |
787 | 808 | let availableFundsNew = (userAvailableSWOP(pool, user) + claimAmount) | |
788 | 809 | [IntegerEntry((((pool + "_") + user) + kFarmUserLastInterest), farmInterest), IntegerEntry((((pool + "_") + user) + kBoostUserLastInterest), boostInterest), IntegerEntry((pool + kFarmLastInterest), farmInterest), IntegerEntry((pool + kBoostLastInterest), boostInterest), IntegerEntry((pool + kLastInterestHeight), height), IntegerEntry((((pool + "_") + user) + kAvailableSWOP), availableFundsNew), Reissue(SWOP, toTreasure, true), ScriptTransfer(farmingTreasureAddr, toTreasure, SWOP)] | |
789 | 810 | }) | |
790 | 811 | ||
791 | 812 | ||
792 | 813 | ||
793 | 814 | @Callable(i) | |
794 | 815 | func shutdown () = valueOrElse(isAdminCall(i), if (!(active)) | |
795 | 816 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
796 | 817 | else suspend("Paused by admin")) | |
797 | 818 | ||
798 | 819 | ||
799 | 820 | ||
800 | 821 | @Callable(i) | |
801 | 822 | func activate () = valueOrElse(isAdminCall(i), if (active) | |
802 | 823 | then throw("DApp is already active") | |
803 | 824 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
804 | 825 | ||
805 | 826 | ||
806 | 827 | @Verifier(tx) | |
807 | 828 | func verify () = match tx { | |
808 | 829 | case _ => | |
809 | 830 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
810 | 831 | then 1 | |
811 | 832 | else 0 | |
812 | 833 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
813 | 834 | then 1 | |
814 | 835 | else 0 | |
815 | 836 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
816 | 837 | then 1 | |
817 | 838 | else 0 | |
818 | 839 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
819 | 840 | } | |
820 | 841 |
github/deemru/w8io/026f985 163.31 ms ◑