tx · EKqVxeQk3PTQKgAdf9TtdpCDTKfhPibt8QEHapJaPWHi 3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT: -0.03400000 Waves 2022.06.28 18:02 [2116442] smart account 3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT > SELF 0.00000000 Waves
{ "type": 13, "id": "EKqVxeQk3PTQKgAdf9TtdpCDTKfhPibt8QEHapJaPWHi", "fee": 3400000, "feeAssetId": null, "timestamp": 1656428568012, "version": 2, "chainId": 84, "sender": "3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT", "senderPublicKey": "3ijdmxaYrpDFsKVbQH2kvB7i6JzHj9bep9bGWiQPra2D", "proofs": [ "31y3AzDFHeCmgiwpx8jij5J8NXymBR4CM1mzuK4xXkLS3fZoADcH1iiTvzcxh8KCRAV77bgsfJLzP9AKaggf4FTo", "3WFN56bNzQ2tAEc61NSAo1ntos5MkMcVtM425EXHetdAEPLbsg2N7NKvfW166hUVbxbJtGL5xcR3wB9ZshbqxA9X" ], "script": "base64:BgIlCAISAwoBCBIDCgEIEgMKAQgSAwoBCBIECgIIARIDCgEIEgASAFsADGFkbWluUHViS2V5MQEg4qeMQDuGzRfmtEuH2+Whg6yuKqHsNy5eZQUT8rXs7wQADGFkbWluUHViS2V5MgEg6jisuQG1iDxyo54oPYHUGiJlERON346DjXz9V/GbEVkADGFkbWluUHViS2V5MwEgpzSWgrCjycddMmIBfztFJ08z6r82xAHPELd0cKonzG4AFGtleVNoYXJlVG9rZW5zTG9ja2VkAhpfdG90YWxfc2hhcmVfdG9rZW5zX2xvY2tlZAALa1NoYXJlTGltaXQCHHNoYXJlX2xpbWl0X29uX2ZpcnN0X2hhcnZlc3QACWtleUFjdGl2ZQIGYWN0aXZlAAhrZXlDYXVzZQIOc2h1dGRvd25fY2F1c2UAHGtleVJld2FyZFBvb2xGcmFjdGlvbkN1cnJlbnQCHV9jdXJyZW50X3Bvb2xfZnJhY3Rpb25fcmV3YXJkAB1rZXlSZX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YktleTNTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwACBQxhZG1pblB1YktleTMAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAJvnZSO", "height": 2116442, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2QrwwhjcKYHnKga9twrM43qerD97ZDxdK42E9Huij8v3 Next: GtPPpj9uqMYgi57c6QfvDQnyV8yS2u4CnSFZSLrfYW4g Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy' | |
215 | 215 | let assetId1Decimals = value(assetInfo(assetId1)).decimals | |
216 | 216 | let assetId2Decimals = value(assetInfo(assetId2)).decimals | |
217 | 217 | let scaleDigits = ((assetId2Decimals - assetId1Decimals) + 8) | |
218 | - | pow(10, 0, scaleDigits, 0, 0, | |
218 | + | pow(10, 0, scaleDigits, 0, 0, DOWN) | |
219 | 219 | } | |
220 | 220 | ||
221 | 221 | ||
320 | 320 | let shareAssetId = getShareAssetId(pool) | |
321 | 321 | let scaleValue = calcScaleValue(SWOP, shareAssetId) | |
322 | 322 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
323 | - | let $ | |
324 | - | let lastInterestHeight = $ | |
325 | - | let lastInterest = $ | |
326 | - | let $ | |
327 | - | let currentRewardPerBlock = $ | |
328 | - | let rewardUpdateHeight = $ | |
329 | - | let previousRewardPerBlock = $ | |
330 | - | let poolRewardUpdateHeight = $ | |
331 | - | let $ | |
332 | - | let userLastInterest = $ | |
333 | - | let userShareTokensAmount = $ | |
323 | + | let $t01309113156 = getLastInterestInfo(pool) | |
324 | + | let lastInterestHeight = $t01309113156._1 | |
325 | + | let lastInterest = $t01309113156._2 | |
326 | + | let $t01316113273 = rewardInfo(pool) | |
327 | + | let currentRewardPerBlock = $t01316113273._1 | |
328 | + | let rewardUpdateHeight = $t01316113273._2 | |
329 | + | let previousRewardPerBlock = $t01316113273._3 | |
330 | + | let poolRewardUpdateHeight = $t01316113273._4 | |
331 | + | let $t01327813357 = getUserInterestInfo(pool, caller) | |
332 | + | let userLastInterest = $t01327813357._1 | |
333 | + | let userShareTokensAmount = $t01327813357._2 | |
334 | 334 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, poolRewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue, pmtAmount) | |
335 | 335 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue) | |
336 | 336 | let userNewInterest = currentInterest | |
339 | 339 | ||
340 | 340 | ||
341 | 341 | func calculateProtocolReward (pool) = { | |
342 | - | let $ | |
343 | - | let lastInterestHeight = $ | |
344 | - | let lastInterest = $ | |
345 | - | let $ | |
346 | - | let currentRewardPerBlock = $ | |
347 | - | let rewardUpdateHeight = $ | |
348 | - | let previousRewardPerBlock = $ | |
349 | - | let poolRewardUpdateHeight = $ | |
342 | + | let $t01387513940 = getLastInterestInfo(pool) | |
343 | + | let lastInterestHeight = $t01387513940._1 | |
344 | + | let lastInterest = $t01387513940._2 | |
345 | + | let $t01394514056 = rewardInfo(pool) | |
346 | + | let currentRewardPerBlock = $t01394514056._1 | |
347 | + | let rewardUpdateHeight = $t01394514056._2 | |
348 | + | let previousRewardPerBlock = $t01394514056._3 | |
349 | + | let poolRewardUpdateHeight = $t01394514056._4 | |
350 | 350 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
351 | 351 | if (if ((shareTokenLocked == 0)) | |
352 | 352 | then (poolRewardUpdateHeight == 0) | |
431 | 431 | func initPoolShareFarming (pool) = if ((i.caller != this)) | |
432 | 432 | then throw("Only the DApp itself can call this function") | |
433 | 433 | else { | |
434 | - | let $ | |
435 | - | let currentReward = $ | |
436 | - | let rewardUpdateHeight = $ | |
437 | - | let previousRewardPerBlock = $ | |
438 | - | let poolRewardUpdateHeight = $ | |
434 | + | let $t01703817141 = rewardInfo(pool) | |
435 | + | let currentReward = $t01703817141._1 | |
436 | + | let rewardUpdateHeight = $t01703817141._2 | |
437 | + | let previousRewardPerBlock = $t01703817141._3 | |
438 | + | let poolRewardUpdateHeight = $t01703817141._4 | |
439 | 439 | [IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyLastInterestHeight), height)] | |
440 | 440 | } | |
441 | 441 | ||
447 | 447 | else if (!(isActive)) | |
448 | 448 | then throw("DApp is inactive at this moment") | |
449 | 449 | else { | |
450 | - | let $ | |
451 | - | let userNewInterest = $ | |
452 | - | let currentInterest = $ | |
453 | - | let claimAmount = $ | |
454 | - | let userShareTokensAmount = $ | |
455 | - | let $ | |
456 | - | let currentReward = $ | |
457 | - | let rewardUpdateHeight = $ | |
458 | - | let previousRewardPerBlock = $ | |
459 | - | let poolRewardUpdateHeight = $ | |
450 | + | let $t01755017670 = claimCalc(pool, adminIncreaseInterestAddress, 0) | |
451 | + | let userNewInterest = $t01755017670._1 | |
452 | + | let currentInterest = $t01755017670._2 | |
453 | + | let claimAmount = $t01755017670._3 | |
454 | + | let userShareTokensAmount = $t01755017670._4 | |
455 | + | let $t01767517778 = rewardInfo(pool) | |
456 | + | let currentReward = $t01767517778._1 | |
457 | + | let rewardUpdateHeight = $t01767517778._2 | |
458 | + | let previousRewardPerBlock = $t01767517778._3 | |
459 | + | let poolRewardUpdateHeight = $t01767517778._4 | |
460 | 460 | [IntegerEntry((pool + keyLastInterest), userNewInterest), IntegerEntry((pool + keyLastInterestHeight), height)] | |
461 | 461 | } | |
462 | 462 | ||
464 | 464 | ||
465 | 465 | @Callable(i) | |
466 | 466 | func lockShareTokens (pool) = { | |
467 | - | let $ | |
468 | - | let pmtAmount = $ | |
469 | - | let pmtAssetId = $ | |
470 | - | let $ | |
471 | - | let pmtStrAssetId = $ | |
472 | - | let pmtAssetName = $ | |
473 | - | let pmtDecimals = $ | |
474 | - | let $ | |
475 | - | let userNewInterest = $ | |
476 | - | let currentInterest = $ | |
477 | - | let claimAmount = $ | |
478 | - | let userShareTokensAmount = $ | |
467 | + | let $t01797018045 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
468 | + | let pmtAmount = $t01797018045._1 | |
469 | + | let pmtAssetId = $t01797018045._2 | |
470 | + | let $t01805018123 = getAssetInfo(pmtAssetId) | |
471 | + | let pmtStrAssetId = $t01805018123._1 | |
472 | + | let pmtAssetName = $t01805018123._2 | |
473 | + | let pmtDecimals = $t01805018123._3 | |
474 | + | let $t01812818236 = claimCalc(pool, i.caller, pmtAmount) | |
475 | + | let userNewInterest = $t01812818236._1 | |
476 | + | let currentInterest = $t01812818236._2 | |
477 | + | let claimAmount = $t01812818236._3 | |
478 | + | let userShareTokensAmount = $t01812818236._4 | |
479 | 479 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
480 | 480 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
481 | 481 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
508 | 508 | @Callable(i) | |
509 | 509 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
510 | 510 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
511 | - | let $ | |
512 | - | let userNewInterest = $ | |
513 | - | let currentInterest = $ | |
514 | - | let claimAmount = $ | |
515 | - | let userShareTokensAmount = $ | |
511 | + | let $t02122321323 = claimCalc(pool, i.caller, 1) | |
512 | + | let userNewInterest = $t02122321323._1 | |
513 | + | let currentInterest = $t02122321323._2 | |
514 | + | let claimAmount = $t02122321323._3 | |
515 | + | let userShareTokensAmount = $t02122321323._4 | |
516 | 516 | let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount) | |
517 | 517 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
518 | 518 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
536 | 536 | func claim (pool) = { | |
537 | 537 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
538 | 538 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
539 | - | let $ | |
540 | - | let lastInterestHeight = $ | |
541 | - | let lastInterest = $ | |
542 | - | let $ | |
543 | - | let currentRewardPerBlock = $ | |
544 | - | let rewardUpdateHeight = $ | |
545 | - | let previousRewardPerBlock = $ | |
546 | - | let poolRewardUpdateHeight = $ | |
547 | - | let $ | |
548 | - | let userNewInterest = $ | |
549 | - | let currentInterest = $ | |
550 | - | let claimAmount = $ | |
551 | - | let userShareTokensAmount = $ | |
539 | + | let $t02333023395 = getLastInterestInfo(pool) | |
540 | + | let lastInterestHeight = $t02333023395._1 | |
541 | + | let lastInterest = $t02333023395._2 | |
542 | + | let $t02340023512 = rewardInfo(pool) | |
543 | + | let currentRewardPerBlock = $t02340023512._1 | |
544 | + | let rewardUpdateHeight = $t02340023512._2 | |
545 | + | let previousRewardPerBlock = $t02340023512._3 | |
546 | + | let poolRewardUpdateHeight = $t02340023512._4 | |
547 | + | let $t02351723617 = claimCalc(pool, i.caller, 1) | |
548 | + | let userNewInterest = $t02351723617._1 | |
549 | + | let currentInterest = $t02351723617._2 | |
550 | + | let claimAmount = $t02351723617._3 | |
551 | + | let userShareTokensAmount = $t02351723617._4 | |
552 | 552 | let availableFund = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
553 | 553 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
554 | 554 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy' | |
5 | 5 | ||
6 | 6 | let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk' | |
7 | 7 | ||
8 | 8 | let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP' | |
9 | 9 | ||
10 | 10 | let keyShareTokensLocked = "_total_share_tokens_locked" | |
11 | 11 | ||
12 | 12 | let kShareLimit = "share_limit_on_first_harvest" | |
13 | 13 | ||
14 | 14 | let keyActive = "active" | |
15 | 15 | ||
16 | 16 | let keyCause = "shutdown_cause" | |
17 | 17 | ||
18 | 18 | let keyRewardPoolFractionCurrent = "_current_pool_fraction_reward" | |
19 | 19 | ||
20 | 20 | let keyRewardPoolFractionPrevious = "_previous_pool_fraction_reward" | |
21 | 21 | ||
22 | 22 | let keyHeightPoolFraction = "_pool_reward_update_height" | |
23 | 23 | ||
24 | 24 | let keyTotalRewardPerBlockCurrent = "total_reward_per_block_current" | |
25 | 25 | ||
26 | 26 | let keyTotalRewardPerBlockPrevious = "total_reward_per_block_previous" | |
27 | 27 | ||
28 | 28 | let keyRewardUpdateHeight = "reward_update_height" | |
29 | 29 | ||
30 | 30 | let keyLastInterest = "_last_interest" | |
31 | 31 | ||
32 | 32 | let keyLastInterestHeight = "_last_interest_height" | |
33 | 33 | ||
34 | 34 | let keyUserShareTokensLocked = "_share_tokens_locked" | |
35 | 35 | ||
36 | 36 | let keyUserLastInterest = "_last_interest" | |
37 | 37 | ||
38 | 38 | let keySWOPid = "SWOP_id" | |
39 | 39 | ||
40 | 40 | let keyUserSWOPClaimedAmount = "_SWOP_claimed_amount" | |
41 | 41 | ||
42 | 42 | let keyUserSWOPLastClaimedAmount = "_SWOP_last_claimed_amount" | |
43 | 43 | ||
44 | 44 | let keyAvailableSWOP = "_available_SWOP" | |
45 | 45 | ||
46 | 46 | let keyFarmingStartHeight = "farming_start_height" | |
47 | 47 | ||
48 | 48 | let keyAPY = "apy" | |
49 | 49 | ||
50 | 50 | let kPreviousTotalVoteSWOP = "previous_total_vote_SWOP" | |
51 | 51 | ||
52 | 52 | let keySwopYearEmission = "swop_year_emission" | |
53 | 53 | ||
54 | 54 | let keyBalancecpmmA = "A_asset_balance" | |
55 | 55 | ||
56 | 56 | let keyBalancecpmmB = "B_asset_balance" | |
57 | 57 | ||
58 | 58 | let kHarvestPoolActiveVoteStrucVoting = "_harvest_pool_activeVote_struc" | |
59 | 59 | ||
60 | 60 | let kHarvestUserPoolActiveVoteStrucVoting = "_harvest_user_pool_activeVote_struc" | |
61 | 61 | ||
62 | 62 | let keyLimitShareFirstHarvest = "share_limit_on_first_harvest" | |
63 | 63 | ||
64 | 64 | let keyAssetIdA = "A_asset_id" | |
65 | 65 | ||
66 | 66 | let keyAssetIdB = "B_asset_id" | |
67 | 67 | ||
68 | 68 | let keyFirstHarvestHeight = "first_harvest_height" | |
69 | 69 | ||
70 | 70 | let keyfirstHarvestCpmm = "first_harvest" | |
71 | 71 | ||
72 | 72 | let keyTempPrevSum = "sum_reward_previous" | |
73 | 73 | ||
74 | 74 | let keyTempCurSum = "sum_reward_current" | |
75 | 75 | ||
76 | 76 | let governanceAddress = Address(base58'3N5W8da2iiijVieA6qLGo7KzCJj8B19smWU') | |
77 | 77 | ||
78 | 78 | let wallet = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
79 | 79 | ||
80 | 80 | let votingAddress = Address(base58'3MrJgdL1GniipErHy44YF9idzLaUL2iX5DQ') | |
81 | 81 | ||
82 | 82 | let adminIncreaseInterestAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
83 | 83 | ||
84 | 84 | let oneWeekInBlock = 10106 | |
85 | 85 | ||
86 | 86 | let totalVoteShare = 10000000000 | |
87 | 87 | ||
88 | 88 | let scaleValue1 = 10 | |
89 | 89 | ||
90 | 90 | let scaleValue3 = 1000 | |
91 | 91 | ||
92 | 92 | let scaleValue5 = 100000 | |
93 | 93 | ||
94 | 94 | let scaleValue6 = 1000000 | |
95 | 95 | ||
96 | 96 | let scaleValue8 = 100000000 | |
97 | 97 | ||
98 | 98 | let scaleValue11 = 100000000000 | |
99 | 99 | ||
100 | 100 | func strAssetIdA (pool) = getStringValue(pool, keyAssetIdA) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func strAssetIdB (pool) = getStringValue(pool, keyAssetIdB) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func assetIdA (pool) = if ((strAssetIdA(pool) == "WAVES")) | |
107 | 107 | then unit | |
108 | 108 | else fromBase58String(strAssetIdA(pool)) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func assetIdB (pool) = if ((strAssetIdB(pool) == "WAVES")) | |
112 | 112 | then unit | |
113 | 113 | else fromBase58String(strAssetIdB(pool)) | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | let kBasePeriod = "base_period" | |
117 | 117 | ||
118 | 118 | let kPeriodLength = "period_length" | |
119 | 119 | ||
120 | 120 | let kStartHeight = "start_height" | |
121 | 121 | ||
122 | 122 | let kFirstHarvestHeight = "first_harvest_height" | |
123 | 123 | ||
124 | 124 | let kDurationFullVotePower = "duration_full_vote_power" | |
125 | 125 | ||
126 | 126 | let kMinVotePower = "min_vote_power" | |
127 | 127 | ||
128 | 128 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
129 | 129 | ||
130 | 130 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
131 | 131 | ||
132 | 132 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
133 | 133 | ||
134 | 134 | let durationFullVotePower = valueOrErrorMessage(getInteger(votingAddress, kDurationFullVotePower), "Empty kDurationFullVotePower") | |
135 | 135 | ||
136 | 136 | let minVotePower = valueOrErrorMessage(getInteger(votingAddress, kMinVotePower), "Empty kMinVotePower") | |
137 | 137 | ||
138 | 138 | let isActive = getBooleanValue(this, keyActive) | |
139 | 139 | ||
140 | 140 | let currPeriod = (basePeriod + ((height - startHeight) / periodLength)) | |
141 | 141 | ||
142 | 142 | func getLimitToken (pool) = valueOrElse(getIntegerValue(pool, keyLimitShareFirstHarvest), 0) | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | let APY = getIntegerValue(this, keyAPY) | |
146 | 146 | ||
147 | 147 | let SwopYearEmission = getIntegerValue(this, keySwopYearEmission) | |
148 | 148 | ||
149 | 149 | func assetNameA (pool) = match assetIdA(pool) { | |
150 | 150 | case id: ByteVector => | |
151 | 151 | value(assetInfo(id)).name | |
152 | 152 | case waves: Unit => | |
153 | 153 | "WAVES" | |
154 | 154 | case _ => | |
155 | 155 | throw("Match error") | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func assetNameB (pool) = match assetIdB(pool) { | |
160 | 160 | case id: ByteVector => | |
161 | 161 | value(assetInfo(id)).name | |
162 | 162 | case waves: Unit => | |
163 | 163 | "WAVES" | |
164 | 164 | case _ => | |
165 | 165 | throw("Match error") | |
166 | 166 | } | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | let SWOP = fromBase58String(getStringValue(this, keySWOPid)) | |
170 | 170 | ||
171 | 171 | func isFirstHarvest (pool) = valueOrElse(getBoolean(pool, keyfirstHarvestCpmm), false) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func getHeightFirstHarvest (pool) = valueOrElse(getInteger(pool, keyFirstHarvestHeight), 0) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func getBalanceA (pool) = valueOrErrorMessage(getInteger(pool, keyBalancecpmmA), ("No data on the key: " + keyBalancecpmmA)) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func getBalanceB (pool) = valueOrErrorMessage(getInteger(pool, keyBalancecpmmB), ("No data on the key: " + keyBalancecpmmB)) | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | func getShareLimitToken (pool) = valueOrErrorMessage(getInteger(pool, kShareLimit), ("No data on the key: " + kShareLimit)) | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | func getTotalShareTokenLocked (pool) = valueOrErrorMessage(getInteger(this, (pool + keyShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked)) | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func getShareAssetId (pool) = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | func accountBalance (assetId) = match assetId { | |
193 | 193 | case id: ByteVector => | |
194 | 194 | assetBalance(this, id) | |
195 | 195 | case waves: Unit => | |
196 | 196 | wavesBalance(this).available | |
197 | 197 | case _ => | |
198 | 198 | throw("Match error") | |
199 | 199 | } | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func getAssetInfo (assetId) = match assetId { | |
203 | 203 | case id: ByteVector => | |
204 | 204 | let stringId = toBase58String(id) | |
205 | 205 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
206 | 206 | $Tuple3(stringId, info.name, info.decimals) | |
207 | 207 | case waves: Unit => | |
208 | 208 | $Tuple3("WAVES", "WAVES", 8) | |
209 | 209 | case _ => | |
210 | 210 | throw("Match error") | |
211 | 211 | } | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | func calcScaleValue (assetId1,assetId2) = { | |
215 | 215 | let assetId1Decimals = value(assetInfo(assetId1)).decimals | |
216 | 216 | let assetId2Decimals = value(assetInfo(assetId2)).decimals | |
217 | 217 | let scaleDigits = ((assetId2Decimals - assetId1Decimals) + 8) | |
218 | - | pow(10, 0, scaleDigits, 0, 0, | |
218 | + | pow(10, 0, scaleDigits, 0, 0, DOWN) | |
219 | 219 | } | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | func userAvailableSWOP (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyAvailableSWOP)), 0) | |
223 | 223 | ||
224 | 224 | ||
225 | 225 | func rewardInfo (pool) = { | |
226 | 226 | let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger(governanceAddress, keyTotalRewardPerBlockCurrent), ((("No data on the key: " + keyTotalRewardPerBlockCurrent) + " at address ") + toString(governanceAddress))) | |
227 | 227 | let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger(governanceAddress, keyTotalRewardPerBlockPrevious), ((("No data on the key: " + keyTotalRewardPerBlockPrevious) + " at address ") + toString(governanceAddress))) | |
228 | 228 | let rewardPoolFractionCurrent = valueOrErrorMessage(getInteger(governanceAddress, (pool + keyRewardPoolFractionCurrent)), (((("No data on the key: " + pool) + keyRewardPoolFractionCurrent) + " at address ") + toString(governanceAddress))) | |
229 | 229 | let rewardUpdateHeight = valueOrErrorMessage(getInteger(governanceAddress, keyRewardUpdateHeight), ((("No data on the key: " + keyRewardUpdateHeight) + " at address ") + toString(governanceAddress))) | |
230 | 230 | let poolRewardUpdateHeight = valueOrElse(getInteger(governanceAddress, (pool + keyHeightPoolFraction)), 0) | |
231 | 231 | let rewardPoolFractionPrevious = valueOrErrorMessage(getInteger(governanceAddress, (pool + keyRewardPoolFractionPrevious)), (((("No data on the key: " + pool) + keyRewardPoolFractionPrevious) + " at address ") + toString(governanceAddress))) | |
232 | 232 | let rewardPoolCurrent = fraction(totalRewardPerBlockCurrent, rewardPoolFractionCurrent, totalVoteShare) | |
233 | 233 | let rewardPoolPrevious = fraction(totalRewardPerBlockPrevious, rewardPoolFractionPrevious, totalVoteShare) | |
234 | 234 | if (if ((rewardPoolCurrent > totalRewardPerBlockCurrent)) | |
235 | 235 | then true | |
236 | 236 | else (rewardPoolPrevious > totalRewardPerBlockPrevious)) | |
237 | 237 | then throw("rewardPoolCurrent > totalRewardPerBlockCurrent or rewardPoolPrevious > totalRewardPerBlockPrevious") | |
238 | 238 | else $Tuple4(rewardPoolCurrent, rewardUpdateHeight, rewardPoolPrevious, poolRewardUpdateHeight) | |
239 | 239 | } | |
240 | 240 | ||
241 | 241 | ||
242 | 242 | func getLastInterestInfo (pool) = { | |
243 | 243 | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (("No data on the key: " + pool) + keyLastInterest)) | |
244 | 244 | let lastInterestHeight = valueOrElse(getInteger(this, (pool + keyLastInterestHeight)), height) | |
245 | 245 | $Tuple2(lastInterestHeight, lastInterest) | |
246 | 246 | } | |
247 | 247 | ||
248 | 248 | ||
249 | 249 | func getUserInterestInfo (pool,userAddress) = { | |
250 | 250 | let userLastInterest = getInteger(this, (((pool + "_") + toString(userAddress)) + keyUserLastInterest)) | |
251 | 251 | let userShare = getInteger(this, (((pool + "_") + toString(userAddress)) + keyUserShareTokensLocked)) | |
252 | 252 | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (("No data on the key: " + pool) + keyLastInterest)) | |
253 | 253 | let userLastInterestValue = match userLastInterest { | |
254 | 254 | case userLastInterest: Int => | |
255 | 255 | userLastInterest | |
256 | 256 | case _ => | |
257 | 257 | lastInterest | |
258 | 258 | } | |
259 | 259 | let userShareTokensAmount = match userShare { | |
260 | 260 | case userShare: Int => | |
261 | 261 | userShare | |
262 | 262 | case _ => | |
263 | 263 | 0 | |
264 | 264 | } | |
265 | 265 | $Tuple2(userLastInterestValue, userShareTokensAmount) | |
266 | 266 | } | |
267 | 267 | ||
268 | 268 | ||
269 | 269 | func calcInterest (lastInterestHeight,rewardUpdateHeight,poolRewardUpdateHeight,lastInterest,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,shareAssetId,scaleValue,pmtAmount) = if ((shareTokenLocked == 0)) | |
270 | 270 | then 0 | |
271 | 271 | else if ((poolRewardUpdateHeight != 0)) | |
272 | 272 | then if (if ((rewardUpdateHeight > height)) | |
273 | 273 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
274 | 274 | else false) | |
275 | 275 | then { | |
276 | 276 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
277 | 277 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
278 | 278 | } | |
279 | 279 | else if (if ((height > rewardUpdateHeight)) | |
280 | 280 | then (rewardUpdateHeight != poolRewardUpdateHeight) | |
281 | 281 | else false) | |
282 | 282 | then { | |
283 | 283 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
284 | 284 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
285 | 285 | } | |
286 | 286 | else if (if (if ((height > rewardUpdateHeight)) | |
287 | 287 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
288 | 288 | else false) | |
289 | 289 | then (lastInterestHeight > rewardUpdateHeight) | |
290 | 290 | else false) | |
291 | 291 | then { | |
292 | 292 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
293 | 293 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
294 | 294 | } | |
295 | 295 | else { | |
296 | 296 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
297 | 297 | let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked)) | |
298 | 298 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
299 | 299 | (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked)) | |
300 | 300 | } | |
301 | 301 | else if ((rewardUpdateHeight > height)) | |
302 | 302 | then { | |
303 | 303 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
304 | 304 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
305 | 305 | } | |
306 | 306 | else if ((lastInterestHeight > rewardUpdateHeight)) | |
307 | 307 | then { | |
308 | 308 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
309 | 309 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
310 | 310 | } | |
311 | 311 | else { | |
312 | 312 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
313 | 313 | let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked)) | |
314 | 314 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
315 | 315 | (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked)) | |
316 | 316 | } | |
317 | 317 | ||
318 | 318 | ||
319 | 319 | func claimCalc (pool,caller,pmtAmount) = { | |
320 | 320 | let shareAssetId = getShareAssetId(pool) | |
321 | 321 | let scaleValue = calcScaleValue(SWOP, shareAssetId) | |
322 | 322 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
323 | - | let $ | |
324 | - | let lastInterestHeight = $ | |
325 | - | let lastInterest = $ | |
326 | - | let $ | |
327 | - | let currentRewardPerBlock = $ | |
328 | - | let rewardUpdateHeight = $ | |
329 | - | let previousRewardPerBlock = $ | |
330 | - | let poolRewardUpdateHeight = $ | |
331 | - | let $ | |
332 | - | let userLastInterest = $ | |
333 | - | let userShareTokensAmount = $ | |
323 | + | let $t01309113156 = getLastInterestInfo(pool) | |
324 | + | let lastInterestHeight = $t01309113156._1 | |
325 | + | let lastInterest = $t01309113156._2 | |
326 | + | let $t01316113273 = rewardInfo(pool) | |
327 | + | let currentRewardPerBlock = $t01316113273._1 | |
328 | + | let rewardUpdateHeight = $t01316113273._2 | |
329 | + | let previousRewardPerBlock = $t01316113273._3 | |
330 | + | let poolRewardUpdateHeight = $t01316113273._4 | |
331 | + | let $t01327813357 = getUserInterestInfo(pool, caller) | |
332 | + | let userLastInterest = $t01327813357._1 | |
333 | + | let userShareTokensAmount = $t01327813357._2 | |
334 | 334 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, poolRewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue, pmtAmount) | |
335 | 335 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue) | |
336 | 336 | let userNewInterest = currentInterest | |
337 | 337 | $Tuple4(userNewInterest, currentInterest, claimAmount, userShareTokensAmount) | |
338 | 338 | } | |
339 | 339 | ||
340 | 340 | ||
341 | 341 | func calculateProtocolReward (pool) = { | |
342 | - | let $ | |
343 | - | let lastInterestHeight = $ | |
344 | - | let lastInterest = $ | |
345 | - | let $ | |
346 | - | let currentRewardPerBlock = $ | |
347 | - | let rewardUpdateHeight = $ | |
348 | - | let previousRewardPerBlock = $ | |
349 | - | let poolRewardUpdateHeight = $ | |
342 | + | let $t01387513940 = getLastInterestInfo(pool) | |
343 | + | let lastInterestHeight = $t01387513940._1 | |
344 | + | let lastInterest = $t01387513940._2 | |
345 | + | let $t01394514056 = rewardInfo(pool) | |
346 | + | let currentRewardPerBlock = $t01394514056._1 | |
347 | + | let rewardUpdateHeight = $t01394514056._2 | |
348 | + | let previousRewardPerBlock = $t01394514056._3 | |
349 | + | let poolRewardUpdateHeight = $t01394514056._4 | |
350 | 350 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
351 | 351 | if (if ((shareTokenLocked == 0)) | |
352 | 352 | then (poolRewardUpdateHeight == 0) | |
353 | 353 | else false) | |
354 | 354 | then if ((rewardUpdateHeight > height)) | |
355 | 355 | then { | |
356 | 356 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
357 | 357 | reward | |
358 | 358 | } | |
359 | 359 | else if ((lastInterestHeight > rewardUpdateHeight)) | |
360 | 360 | then { | |
361 | 361 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
362 | 362 | reward | |
363 | 363 | } | |
364 | 364 | else { | |
365 | 365 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
366 | 366 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
367 | 367 | (reward + rewardAfterLastInterestBeforeReawardUpdate) | |
368 | 368 | } | |
369 | 369 | else if (if ((shareTokenLocked == 0)) | |
370 | 370 | then (poolRewardUpdateHeight != 0) | |
371 | 371 | else false) | |
372 | 372 | then if (if ((rewardUpdateHeight > height)) | |
373 | 373 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
374 | 374 | else false) | |
375 | 375 | then { | |
376 | 376 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
377 | 377 | reward | |
378 | 378 | } | |
379 | 379 | else if (if ((height > rewardUpdateHeight)) | |
380 | 380 | then (rewardUpdateHeight != poolRewardUpdateHeight) | |
381 | 381 | else false) | |
382 | 382 | then { | |
383 | 383 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
384 | 384 | reward | |
385 | 385 | } | |
386 | 386 | else if (if (if ((height > rewardUpdateHeight)) | |
387 | 387 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
388 | 388 | else false) | |
389 | 389 | then (lastInterestHeight > rewardUpdateHeight) | |
390 | 390 | else false) | |
391 | 391 | then { | |
392 | 392 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
393 | 393 | reward | |
394 | 394 | } | |
395 | 395 | else { | |
396 | 396 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
397 | 397 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
398 | 398 | (reward + rewardAfterLastInterestBeforeReawardUpdate) | |
399 | 399 | } | |
400 | 400 | else 0 | |
401 | 401 | } | |
402 | 402 | ||
403 | 403 | ||
404 | 404 | func checkPmtAssetIdCorrect (pool,pmtAssetId) = { | |
405 | 405 | let poolShareAssetId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
406 | 406 | if ((pmtAssetId == poolShareAssetId)) | |
407 | 407 | then true | |
408 | 408 | else false | |
409 | 409 | } | |
410 | 410 | ||
411 | 411 | ||
412 | 412 | func getUserSWOPClaimedAmount (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyUserSWOPClaimedAmount)), 0) | |
413 | 413 | ||
414 | 414 | ||
415 | 415 | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
416 | 416 | ||
417 | 417 | ||
418 | 418 | @Callable(i) | |
419 | 419 | func init (earlyLP) = if (isDefined(getString(this, keySWOPid))) | |
420 | 420 | then throw("SWOP already initialized") | |
421 | 421 | else { | |
422 | 422 | let initAmount = 100000000000000 | |
423 | 423 | let SWOPissue = Issue("SWOP", "SWOP protocol token", initAmount, 8, true) | |
424 | 424 | let SWOPid = calculateAssetId(SWOPissue) | |
425 | 425 | [BooleanEntry(keyActive, true), Issue("SWOP", "SWOP protocol token", initAmount, 8, true), StringEntry(keySWOPid, toBase58String(SWOPid))] | |
426 | 426 | } | |
427 | 427 | ||
428 | 428 | ||
429 | 429 | ||
430 | 430 | @Callable(i) | |
431 | 431 | func initPoolShareFarming (pool) = if ((i.caller != this)) | |
432 | 432 | then throw("Only the DApp itself can call this function") | |
433 | 433 | else { | |
434 | - | let $ | |
435 | - | let currentReward = $ | |
436 | - | let rewardUpdateHeight = $ | |
437 | - | let previousRewardPerBlock = $ | |
438 | - | let poolRewardUpdateHeight = $ | |
434 | + | let $t01703817141 = rewardInfo(pool) | |
435 | + | let currentReward = $t01703817141._1 | |
436 | + | let rewardUpdateHeight = $t01703817141._2 | |
437 | + | let previousRewardPerBlock = $t01703817141._3 | |
438 | + | let poolRewardUpdateHeight = $t01703817141._4 | |
439 | 439 | [IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyLastInterestHeight), height)] | |
440 | 440 | } | |
441 | 441 | ||
442 | 442 | ||
443 | 443 | ||
444 | 444 | @Callable(i) | |
445 | 445 | func updatePoolInterest (pool) = if ((i.caller != wallet)) | |
446 | 446 | then throw("Only the Admin itself can call this function") | |
447 | 447 | else if (!(isActive)) | |
448 | 448 | then throw("DApp is inactive at this moment") | |
449 | 449 | else { | |
450 | - | let $ | |
451 | - | let userNewInterest = $ | |
452 | - | let currentInterest = $ | |
453 | - | let claimAmount = $ | |
454 | - | let userShareTokensAmount = $ | |
455 | - | let $ | |
456 | - | let currentReward = $ | |
457 | - | let rewardUpdateHeight = $ | |
458 | - | let previousRewardPerBlock = $ | |
459 | - | let poolRewardUpdateHeight = $ | |
450 | + | let $t01755017670 = claimCalc(pool, adminIncreaseInterestAddress, 0) | |
451 | + | let userNewInterest = $t01755017670._1 | |
452 | + | let currentInterest = $t01755017670._2 | |
453 | + | let claimAmount = $t01755017670._3 | |
454 | + | let userShareTokensAmount = $t01755017670._4 | |
455 | + | let $t01767517778 = rewardInfo(pool) | |
456 | + | let currentReward = $t01767517778._1 | |
457 | + | let rewardUpdateHeight = $t01767517778._2 | |
458 | + | let previousRewardPerBlock = $t01767517778._3 | |
459 | + | let poolRewardUpdateHeight = $t01767517778._4 | |
460 | 460 | [IntegerEntry((pool + keyLastInterest), userNewInterest), IntegerEntry((pool + keyLastInterestHeight), height)] | |
461 | 461 | } | |
462 | 462 | ||
463 | 463 | ||
464 | 464 | ||
465 | 465 | @Callable(i) | |
466 | 466 | func lockShareTokens (pool) = { | |
467 | - | let $ | |
468 | - | let pmtAmount = $ | |
469 | - | let pmtAssetId = $ | |
470 | - | let $ | |
471 | - | let pmtStrAssetId = $ | |
472 | - | let pmtAssetName = $ | |
473 | - | let pmtDecimals = $ | |
474 | - | let $ | |
475 | - | let userNewInterest = $ | |
476 | - | let currentInterest = $ | |
477 | - | let claimAmount = $ | |
478 | - | let userShareTokensAmount = $ | |
467 | + | let $t01797018045 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
468 | + | let pmtAmount = $t01797018045._1 | |
469 | + | let pmtAssetId = $t01797018045._2 | |
470 | + | let $t01805018123 = getAssetInfo(pmtAssetId) | |
471 | + | let pmtStrAssetId = $t01805018123._1 | |
472 | + | let pmtAssetName = $t01805018123._2 | |
473 | + | let pmtDecimals = $t01805018123._3 | |
474 | + | let $t01812818236 = claimCalc(pool, i.caller, pmtAmount) | |
475 | + | let userNewInterest = $t01812818236._1 | |
476 | + | let currentInterest = $t01812818236._2 | |
477 | + | let claimAmount = $t01812818236._3 | |
478 | + | let userShareTokensAmount = $t01812818236._4 | |
479 | 479 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
480 | 480 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
481 | 481 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
482 | 482 | let totalShareAmountNew = (totalShareAmount + pmtAmount) | |
483 | 483 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
484 | 484 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
485 | 485 | let baseEntry = [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyShareTokensLocked), totalShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), availableFundsNew)] | |
486 | 486 | let harvestPeriod = ((((getHeightFirstHarvest(Address(fromBase58String(pool))) - startHeight) + 1) / periodLength) - 1) | |
487 | 487 | let amountOfVoting = split(getStringValue(votingAddress, (((toString(i.caller) + "_") + pool) + "_user_pool_struc")), "_") | |
488 | 488 | let amountPoolStract = split(getStringValue(votingAddress, (pool + "_pool_struc")), "_") | |
489 | 489 | let amountActiveVoteUserPoolStract = split(valueOrElse(getString(votingAddress, (((toString(i.caller) + "_") + pool) + kHarvestUserPoolActiveVoteStrucVoting)), ""), "_") | |
490 | 490 | let amountPoolActiveVoteStract = split(valueOrElse(getString(votingAddress, (pool + kHarvestPoolActiveVoteStrucVoting)), ""), "_") | |
491 | 491 | let userShareTokenLocked = userShareTokensAmount | |
492 | 492 | let userPoolActiveVote = if ((toString(currPeriod) == amountOfVoting[2])) | |
493 | 493 | then valueOrElse(parseInt(amountActiveVoteUserPoolStract[0]), 0) | |
494 | 494 | else valueOrElse(parseInt(amountOfVoting[1]), 0) | |
495 | 495 | let poolActiveVote = if ((toString(currPeriod) == amountPoolStract[2])) | |
496 | 496 | then valueOrElse(parseInt(amountPoolActiveVoteStract[0]), 0) | |
497 | 497 | else valueOrElse(parseInt(amountPoolStract[1]), 0) | |
498 | 498 | let protocolReward = calculateProtocolReward(pool) | |
499 | 499 | let limitShareToken = getShareLimitToken(addressFromStringValue(pool)) | |
500 | 500 | let shareToken = (fraction(limitShareToken, userPoolActiveVote, poolActiveVote) - userShareTokenLocked) | |
501 | 501 | if ((fraction(99, (accountBalance(pmtAssetId) + pmtAmount), 100) > totalShareAmountNew)) | |
502 | 502 | then throw("Balance of share-token is greater than totalAmount") | |
503 | 503 | else throw("test error") | |
504 | 504 | } | |
505 | 505 | ||
506 | 506 | ||
507 | 507 | ||
508 | 508 | @Callable(i) | |
509 | 509 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
510 | 510 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
511 | - | let $ | |
512 | - | let userNewInterest = $ | |
513 | - | let currentInterest = $ | |
514 | - | let claimAmount = $ | |
515 | - | let userShareTokensAmount = $ | |
511 | + | let $t02122321323 = claimCalc(pool, i.caller, 1) | |
512 | + | let userNewInterest = $t02122321323._1 | |
513 | + | let currentInterest = $t02122321323._2 | |
514 | + | let claimAmount = $t02122321323._3 | |
515 | + | let userShareTokensAmount = $t02122321323._4 | |
516 | 516 | let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount) | |
517 | 517 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
518 | 518 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
519 | 519 | let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount) | |
520 | 520 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
521 | 521 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
522 | 522 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
523 | 523 | then throw("Withdraw amount more then user locked amount") | |
524 | 524 | else if (!(isActive)) | |
525 | 525 | then throw("DApp is inactive at this moment") | |
526 | 526 | else if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
527 | 527 | then throw("Withdraw amount more then user locked amount") | |
528 | 528 | else if ((fraction(99, (accountBalance(shareTokensId) - shareTokensWithdrawAmount), 100) > totalShareAmountNew)) | |
529 | 529 | then throw("Balance of share-token is greater than totalAmount") | |
530 | 530 | else [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((pool + keyShareTokensLocked), totalShareAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), availableFundsNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
531 | 531 | } | |
532 | 532 | ||
533 | 533 | ||
534 | 534 | ||
535 | 535 | @Callable(i) | |
536 | 536 | func claim (pool) = { | |
537 | 537 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
538 | 538 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
539 | - | let $ | |
540 | - | let lastInterestHeight = $ | |
541 | - | let lastInterest = $ | |
542 | - | let $ | |
543 | - | let currentRewardPerBlock = $ | |
544 | - | let rewardUpdateHeight = $ | |
545 | - | let previousRewardPerBlock = $ | |
546 | - | let poolRewardUpdateHeight = $ | |
547 | - | let $ | |
548 | - | let userNewInterest = $ | |
549 | - | let currentInterest = $ | |
550 | - | let claimAmount = $ | |
551 | - | let userShareTokensAmount = $ | |
539 | + | let $t02333023395 = getLastInterestInfo(pool) | |
540 | + | let lastInterestHeight = $t02333023395._1 | |
541 | + | let lastInterest = $t02333023395._2 | |
542 | + | let $t02340023512 = rewardInfo(pool) | |
543 | + | let currentRewardPerBlock = $t02340023512._1 | |
544 | + | let rewardUpdateHeight = $t02340023512._2 | |
545 | + | let previousRewardPerBlock = $t02340023512._3 | |
546 | + | let poolRewardUpdateHeight = $t02340023512._4 | |
547 | + | let $t02351723617 = claimCalc(pool, i.caller, 1) | |
548 | + | let userNewInterest = $t02351723617._1 | |
549 | + | let currentInterest = $t02351723617._2 | |
550 | + | let claimAmount = $t02351723617._3 | |
551 | + | let userShareTokensAmount = $t02351723617._4 | |
552 | 552 | let availableFund = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
553 | 553 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
554 | 554 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
555 | 555 | if ((availableFund == 0)) | |
556 | 556 | then throw("You have 0 available SWOP") | |
557 | 557 | else if (!(isActive)) | |
558 | 558 | then throw("DApp is inactive at this moment") | |
559 | 559 | else if ((availableFund == 0)) | |
560 | 560 | then throw("You have 0 available SWOP") | |
561 | 561 | else if ((fraction(99, accountBalance(shareTokensId), 100) > shareTokenLocked)) | |
562 | 562 | then throw("Balance of share-token is greater than totalAmount") | |
563 | 563 | else [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), 0), Reissue(SWOP, availableFund, true), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), ScriptTransfer(i.caller, availableFund, SWOP)] | |
564 | 564 | } | |
565 | 565 | ||
566 | 566 | ||
567 | 567 | ||
568 | 568 | @Callable(i) | |
569 | 569 | func shutdown () = if (!(isActive)) | |
570 | 570 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
571 | 571 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
572 | 572 | then throw("Only admin can call this function") | |
573 | 573 | else suspend("Paused by admin") | |
574 | 574 | ||
575 | 575 | ||
576 | 576 | ||
577 | 577 | @Callable(i) | |
578 | 578 | func activate () = if (isActive) | |
579 | 579 | then throw("DApp is already active") | |
580 | 580 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
581 | 581 | then throw("Only admin can call this function") | |
582 | 582 | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
583 | 583 | ||
584 | 584 | ||
585 | 585 | @Verifier(tx) | |
586 | 586 | func verify () = match tx { | |
587 | 587 | case _ => | |
588 | 588 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
589 | 589 | then 1 | |
590 | 590 | else 0 | |
591 | 591 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
592 | 592 | then 1 | |
593 | 593 | else 0 | |
594 | 594 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
595 | 595 | then 1 | |
596 | 596 | else 0 | |
597 | 597 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
598 | 598 | } | |
599 | 599 |
github/deemru/w8io/026f985 84.83 ms ◑