tx · Et81nHcybuoYnA5u4mwGS8qvACpZ1L84tnFaXhNptbrt 3Mp6q2xQpfg2SsgQCmb5wrLEoccocLzsHe7: -0.01400000 Waves 2021.03.13 17:12 [1436014] smart account 3Mp6q2xQpfg2SsgQCmb5wrLEoccocLzsHe7 > SELF 0.00000000 Waves
{ "type": 13, "id": "Et81nHcybuoYnA5u4mwGS8qvACpZ1L84tnFaXhNptbrt", "fee": 1400000, "feeAssetId": null, "timestamp": 1615644766177, "version": 1, "sender": "3Mp6q2xQpfg2SsgQCmb5wrLEoccocLzsHe7", "senderPublicKey": "6ytFxpvYWgvpRb57S4oF6hQ6Koh2Mj5eate4LUXdCyCW", "proofs": [ "3EXjgb3the45nBhpo2GMrg4Vp7BEGpkvatXWinVQnHKhiMsj8xtkhjnvmvvQFk1fULYkhJoCB5CoJVKxuxhsonH8" ], "script": "base64:AAIEAAAAAAAAABwIAhIDCgEIEgMKAQgSAwoBCBIECgIIARIDCgEIAAAAIQAAAAAMYWRtaW5QdWJLZXkxAQAAACC6Cdc7iVmk0V2g//G7M9Cq4TlpD8vivZHWO+5PXqjgEwAAAAAMYWRtaW5QdWJLZXkyAQAAACDCkUSZs9KwtA0ipZFYvYi8oTe7CMv/3YzmlO9bFg5+QAAAAAAMYWRtaW5QdWJLZXkzAQAAACCOHhcueLEHO/RITnozKGB2KHf8meWSMKMgws+oq+kOVQAAAAAUa2V5U2hhcmVUb2tlbnNMb2NrZWQCAAAAGl90b3RhbF9zaGFyZV90b2tlbnNfbG9ja2VkAAAAABxrZXlSZXdhcmRQb29sRnJhY3Rpb25DdXJyZW50AgAAAB1fY3VycmVudF9wb29sX2ZyYWN0aW9uX3Jld2FyZAAAAAAda2V5UmV3YXJkUG9vbEZyYWN0aW9uUHJldmlvdXMCAAAAHl9wcmV2aW91c19wb29sX2ZyYWN0aW9uX3Jld2FyZAAAAAAda2V5VG90YWxSZXdhcmRQZXJCbG9ja0N1cnJlbnQCAAAAHnRvdGFsX3Jld2FyZF9wZXJ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ETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAARwb29sAgAAAAFfCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgUAAAAQa2V5QXZhaWxhYmxlU1dPUAAAAAAAAAAAAAkABEwAAAACCQEAAAAHUmVpc3N1ZQAAAAMFAAAABFNXT1AFAAAADWF2YWlsYWJsZUZ1bmQGCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAARwb29sAgAAAAFfCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgUAAAAYa2V5VXNlclNXT1BDbGFpbWVkQW1vdW50BQAAABR1c2VyQ2xhaW1lZEFtb3VudE5ldwkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgUAAAAEcG9vbAIAAAABXwkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIFAAAAHGtleVVzZXJTV09QTGFzdENsYWltZWRBbW91bnQFAAAAC2NsYWltQW1vdW50CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAANYXZhaWxhYmxlRnVuZAUAAAAEU1dPUAUAAAADbmlsAAAAAPB4pnY=", "chainId": 84, "height": 1436014, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6122BrMCYbKsV75D7NVPy2EkELmdEPeH6K2oEtJHr2ea Next: 32KRs4avyD2TM4eNhbxbBxTJKTs5ovma2S3ddtFi7Cw1 Diff:
Old | New | Differences | |
---|---|---|---|
107 | 107 | ||
108 | 108 | func calcInterest (lastInterestHeight,rewardUpdateHeight,lastInterest,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,shareAssetId,scaleValue,pmtAmount) = if ((shareTokenLocked == 0)) | |
109 | 109 | then 0 | |
110 | - | else if (true) | |
111 | - | then throw(((toString(height) + " ") + toString(rewardUpdateHeight))) | |
112 | - | else if ((rewardUpdateHeight > height)) | |
110 | + | else if ((rewardUpdateHeight > height)) | |
111 | + | then { | |
112 | + | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
113 | + | if (true) | |
114 | + | then throw(((toString(height) + " ") + toString(lastInterestHeight))) | |
115 | + | else (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
116 | + | } | |
117 | + | else if ((lastInterestHeight > rewardUpdateHeight)) | |
113 | 118 | then { | |
114 | - | let reward = ( | |
119 | + | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
115 | 120 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
116 | 121 | } | |
117 | - | else if ((lastInterestHeight > rewardUpdateHeight)) | |
118 | - | then { | |
119 | - | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
120 | - | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
121 | - | } | |
122 | - | else { | |
123 | - | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
124 | - | let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked)) | |
125 | - | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
126 | - | (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked)) | |
127 | - | } | |
122 | + | else { | |
123 | + | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
124 | + | let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked)) | |
125 | + | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
126 | + | (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked)) | |
127 | + | } | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func claimCalc (pool,caller,pmtAmount) = { | |
131 | 131 | let shareAssetId = getShareAssetId(pool) | |
132 | 132 | let scaleValue = calcScaleValue(SWOP, shareAssetId) | |
133 | 133 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
134 | - | let $ | |
135 | - | let lastInterestHeight = $ | |
136 | - | let lastInterest = $ | |
137 | - | let $ | |
138 | - | let currentRewardPerBlock = $ | |
139 | - | let rewardUpdateHeight = $ | |
140 | - | let previousRewardPerBlock = $ | |
141 | - | let $ | |
142 | - | let userLastInterest = $ | |
143 | - | let userShareTokensAmount = $ | |
134 | + | let $t071017166 = getLastInterestInfo(pool) | |
135 | + | let lastInterestHeight = $t071017166._1 | |
136 | + | let lastInterest = $t071017166._2 | |
137 | + | let $t071717259 = rewardInfo(pool) | |
138 | + | let currentRewardPerBlock = $t071717259._1 | |
139 | + | let rewardUpdateHeight = $t071717259._2 | |
140 | + | let previousRewardPerBlock = $t071717259._3 | |
141 | + | let $t072647343 = getUserInterestInfo(pool, caller) | |
142 | + | let userLastInterest = $t072647343._1 | |
143 | + | let userShareTokensAmount = $t072647343._2 | |
144 | 144 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue, pmtAmount) | |
145 | 145 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue) | |
146 | 146 | let userNewInterest = currentInterest | |
173 | 173 | ||
174 | 174 | @Callable(i) | |
175 | 175 | func initPoolShareFarming (pool) = { | |
176 | - | let $ | |
177 | - | let currentReward = $ | |
178 | - | let rewardUpdateHeight = $ | |
179 | - | let previousRewardPerBlock = $ | |
176 | + | let $t088818961 = rewardInfo(pool) | |
177 | + | let currentReward = $t088818961._1 | |
178 | + | let rewardUpdateHeight = $t088818961._2 | |
179 | + | let previousRewardPerBlock = $t088818961._3 | |
180 | 180 | [IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyRewardPoolFractionCurrent), currentReward), IntegerEntry((pool + keyRewardPoolFractionPrevious), previousRewardPerBlock)] | |
181 | 181 | } | |
182 | 182 | ||
184 | 184 | ||
185 | 185 | @Callable(i) | |
186 | 186 | func lockShareTokens (pool) = { | |
187 | - | let $ | |
188 | - | let pmtAmount = $ | |
189 | - | let pmtAssetId = $ | |
187 | + | let $t092929367 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
188 | + | let pmtAmount = $t092929367._1 | |
189 | + | let pmtAssetId = $t092929367._2 | |
190 | 190 | if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
191 | 191 | then throw("Incorrect pmtAssetId") | |
192 | 192 | else { | |
193 | - | let $ | |
194 | - | let userNewInterest = $ | |
195 | - | let currentInterest = $ | |
196 | - | let claimAmount = $ | |
197 | - | let userShareTokensAmount = $ | |
193 | + | let $t094689576 = claimCalc(pool, i.caller, pmtAmount) | |
194 | + | let userNewInterest = $t094689576._1 | |
195 | + | let currentInterest = $t094689576._2 | |
196 | + | let claimAmount = $t094689576._3 | |
197 | + | let userShareTokensAmount = $t094689576._4 | |
198 | 198 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
199 | 199 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
200 | 200 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
210 | 210 | @Callable(i) | |
211 | 211 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
212 | 212 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
213 | - | let $ | |
214 | - | let userNewInterest = $ | |
215 | - | let currentInterest = $ | |
216 | - | let claimAmount = $ | |
217 | - | let userShareTokensAmount = $ | |
213 | + | let $t01093311033 = claimCalc(pool, i.caller, 1) | |
214 | + | let userNewInterest = $t01093311033._1 | |
215 | + | let currentInterest = $t01093311033._2 | |
216 | + | let claimAmount = $t01093311033._3 | |
217 | + | let userShareTokensAmount = $t01093311033._4 | |
218 | 218 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
219 | 219 | then throw("Withdraw amount more then user locked amount") | |
220 | 220 | else { | |
233 | 233 | @Callable(i) | |
234 | 234 | func claim (pool) = { | |
235 | 235 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
236 | - | let $ | |
237 | - | let lastInterestHeight = $ | |
238 | - | let lastInterest = $ | |
239 | - | let $ | |
240 | - | let currentRewardPerBlock = $ | |
241 | - | let rewardUpdateHeight = $ | |
242 | - | let previousRewardPerBlock = $ | |
243 | - | let $ | |
244 | - | let userNewInterest = $ | |
245 | - | let currentInterest = $ | |
246 | - | let claimAmount = $ | |
247 | - | let userShareTokensAmount = $ | |
236 | + | let $t01252512590 = getLastInterestInfo(pool) | |
237 | + | let lastInterestHeight = $t01252512590._1 | |
238 | + | let lastInterest = $t01252512590._2 | |
239 | + | let $t01259512684 = rewardInfo(pool) | |
240 | + | let currentRewardPerBlock = $t01259512684._1 | |
241 | + | let rewardUpdateHeight = $t01259512684._2 | |
242 | + | let previousRewardPerBlock = $t01259512684._3 | |
243 | + | let $t01268912789 = claimCalc(pool, i.caller, 1) | |
244 | + | let userNewInterest = $t01268912789._1 | |
245 | + | let currentInterest = $t01268912789._2 | |
246 | + | let claimAmount = $t01268912789._3 | |
247 | + | let userShareTokensAmount = $t01268912789._4 | |
248 | 248 | let availableFund = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
249 | 249 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
250 | 250 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminPubKey1 = base58'DXDY2itiEcYBtGkVLnkpHtDFyWQUkoLJz79uJ7ECbMrA' | |
5 | 5 | ||
6 | 6 | let adminPubKey2 = base58'E6Wa1SGoktYcjHjsKrvjMiqJY3SWmGKcD8Q5L8kxSPS7' | |
7 | 7 | ||
8 | 8 | let adminPubKey3 = base58'AZmWJtuy4GeVrMmJH4hfFBRApe1StvhJSk4jcbT6bArQ' | |
9 | 9 | ||
10 | 10 | let keyShareTokensLocked = "_total_share_tokens_locked" | |
11 | 11 | ||
12 | 12 | let keyRewardPoolFractionCurrent = "_current_pool_fraction_reward" | |
13 | 13 | ||
14 | 14 | let keyRewardPoolFractionPrevious = "_previous_pool_fraction_reward" | |
15 | 15 | ||
16 | 16 | let keyTotalRewardPerBlockCurrent = "total_reward_per_block_current" | |
17 | 17 | ||
18 | 18 | let keyTotalRewardPerBlockPrevious = "total_reward_per_block_previous" | |
19 | 19 | ||
20 | 20 | let keyRewardUpdateHeight = "reward_update_height" | |
21 | 21 | ||
22 | 22 | let keyLastInterest = "_last_interest" | |
23 | 23 | ||
24 | 24 | let keyLastInterestHeight = "_last_interest_height" | |
25 | 25 | ||
26 | 26 | let keyUserShareTokensLocked = "_share_tokens_locked" | |
27 | 27 | ||
28 | 28 | let keyUserLastInterest = "_last_interest" | |
29 | 29 | ||
30 | 30 | let keySWOPid = "SWOP_id" | |
31 | 31 | ||
32 | 32 | let keyUserSWOPClaimedAmount = "_SWOP_claimed_amount" | |
33 | 33 | ||
34 | 34 | let keyUserSWOPLastClaimedAmount = "_SWOP_last_claimed_amount" | |
35 | 35 | ||
36 | 36 | let keyAvailableSWOP = "_available_SWOP" | |
37 | 37 | ||
38 | 38 | let keyFarmingStartHeight = "farming_start_height" | |
39 | 39 | ||
40 | 40 | let governanveAddress = Address(base58'3NAY381Utk65jiLYmvHBg4c3guUvhiH1SPy') | |
41 | 41 | ||
42 | 42 | let oneWeekInBlock = 10106 | |
43 | 43 | ||
44 | 44 | let totalVoteShare = 10000000000 | |
45 | 45 | ||
46 | 46 | let SWOP = fromBase58String(getStringValue(this, keySWOPid)) | |
47 | 47 | ||
48 | 48 | func getTotalShareTokenLocked (pool) = valueOrErrorMessage(getInteger(this, (pool + keyShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked)) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func getShareAssetId (pool) = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func calcScaleValue (assetId1,assetId2) = { | |
55 | 55 | let assetId1Decimals = value(assetInfo(assetId1)).decimals | |
56 | 56 | let assetId2Decimals = value(assetInfo(assetId2)).decimals | |
57 | 57 | let scaleDigits = ((assetId2Decimals - assetId1Decimals) + 8) | |
58 | 58 | pow(10, 0, scaleDigits, 0, 0, HALFDOWN) | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func userAvailableSWOP (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyAvailableSWOP)), 0) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func rewardInfo (pool) = { | |
66 | 66 | let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger(governanveAddress, keyTotalRewardPerBlockCurrent), ((("No data on the key: " + keyTotalRewardPerBlockCurrent) + " at address ") + toString(governanveAddress))) | |
67 | 67 | let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger(governanveAddress, keyTotalRewardPerBlockPrevious), ((("No data on the key: " + keyTotalRewardPerBlockPrevious) + " at address ") + toString(governanveAddress))) | |
68 | 68 | let rewardPoolFractionCurrent = valueOrErrorMessage(getInteger(governanveAddress, (pool + keyRewardPoolFractionCurrent)), (((("No data on the key: " + pool) + keyRewardPoolFractionCurrent) + " at address ") + toString(governanveAddress))) | |
69 | 69 | let rewardUpdateHeight = valueOrErrorMessage(getInteger(governanveAddress, keyRewardUpdateHeight), ((("No data on the key: " + keyRewardUpdateHeight) + " at address ") + toString(governanveAddress))) | |
70 | 70 | let rewardPoolFractionPrevious = valueOrErrorMessage(getInteger(governanveAddress, (pool + keyRewardPoolFractionPrevious)), (((("No data on the key: " + pool) + keyRewardPoolFractionPrevious) + " at address ") + toString(governanveAddress))) | |
71 | 71 | let rewardPoolCurrent = fraction(totalRewardPerBlockCurrent, rewardPoolFractionCurrent, totalVoteShare) | |
72 | 72 | let rewardPoolPrevious = fraction(totalRewardPerBlockPrevious, rewardPoolFractionPrevious, totalVoteShare) | |
73 | 73 | if (if ((rewardPoolCurrent > totalRewardPerBlockCurrent)) | |
74 | 74 | then true | |
75 | 75 | else (rewardPoolPrevious > totalRewardPerBlockPrevious)) | |
76 | 76 | then throw("rewardPoolCurrent > totalRewardPerBlockCurrent or rewardPoolPrevious > totalRewardPerBlockPrevious") | |
77 | 77 | else $Tuple3(rewardPoolCurrent, rewardUpdateHeight, rewardPoolPrevious) | |
78 | 78 | } | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func getLastInterestInfo (pool) = { | |
82 | 82 | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (("No data on the key: " + pool) + keyLastInterest)) | |
83 | 83 | let lastInterestHeight = valueOrElse(getInteger(this, (pool + keyLastInterestHeight)), height) | |
84 | 84 | $Tuple2(lastInterestHeight, lastInterest) | |
85 | 85 | } | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func getUserInterestInfo (pool,userAddress) = { | |
89 | 89 | let userLastInterest = getInteger(this, (((pool + "_") + toString(userAddress)) + keyUserLastInterest)) | |
90 | 90 | let userShare = getInteger(this, (((pool + "_") + toString(userAddress)) + keyUserShareTokensLocked)) | |
91 | 91 | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (("No data on the key: " + pool) + keyLastInterest)) | |
92 | 92 | let userLastInterestValue = match userLastInterest { | |
93 | 93 | case userLastInterest: Int => | |
94 | 94 | userLastInterest | |
95 | 95 | case _ => | |
96 | 96 | lastInterest | |
97 | 97 | } | |
98 | 98 | let userShareTokensAmount = match userShare { | |
99 | 99 | case userShare: Int => | |
100 | 100 | userShare | |
101 | 101 | case _ => | |
102 | 102 | 0 | |
103 | 103 | } | |
104 | 104 | $Tuple2(userLastInterestValue, userShareTokensAmount) | |
105 | 105 | } | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func calcInterest (lastInterestHeight,rewardUpdateHeight,lastInterest,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,shareAssetId,scaleValue,pmtAmount) = if ((shareTokenLocked == 0)) | |
109 | 109 | then 0 | |
110 | - | else if (true) | |
111 | - | then throw(((toString(height) + " ") + toString(rewardUpdateHeight))) | |
112 | - | else if ((rewardUpdateHeight > height)) | |
110 | + | else if ((rewardUpdateHeight > height)) | |
111 | + | then { | |
112 | + | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
113 | + | if (true) | |
114 | + | then throw(((toString(height) + " ") + toString(lastInterestHeight))) | |
115 | + | else (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
116 | + | } | |
117 | + | else if ((lastInterestHeight > rewardUpdateHeight)) | |
113 | 118 | then { | |
114 | - | let reward = ( | |
119 | + | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
115 | 120 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
116 | 121 | } | |
117 | - | else if ((lastInterestHeight > rewardUpdateHeight)) | |
118 | - | then { | |
119 | - | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
120 | - | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
121 | - | } | |
122 | - | else { | |
123 | - | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
124 | - | let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked)) | |
125 | - | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
126 | - | (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked)) | |
127 | - | } | |
122 | + | else { | |
123 | + | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
124 | + | let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked)) | |
125 | + | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
126 | + | (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked)) | |
127 | + | } | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func claimCalc (pool,caller,pmtAmount) = { | |
131 | 131 | let shareAssetId = getShareAssetId(pool) | |
132 | 132 | let scaleValue = calcScaleValue(SWOP, shareAssetId) | |
133 | 133 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
134 | - | let $ | |
135 | - | let lastInterestHeight = $ | |
136 | - | let lastInterest = $ | |
137 | - | let $ | |
138 | - | let currentRewardPerBlock = $ | |
139 | - | let rewardUpdateHeight = $ | |
140 | - | let previousRewardPerBlock = $ | |
141 | - | let $ | |
142 | - | let userLastInterest = $ | |
143 | - | let userShareTokensAmount = $ | |
134 | + | let $t071017166 = getLastInterestInfo(pool) | |
135 | + | let lastInterestHeight = $t071017166._1 | |
136 | + | let lastInterest = $t071017166._2 | |
137 | + | let $t071717259 = rewardInfo(pool) | |
138 | + | let currentRewardPerBlock = $t071717259._1 | |
139 | + | let rewardUpdateHeight = $t071717259._2 | |
140 | + | let previousRewardPerBlock = $t071717259._3 | |
141 | + | let $t072647343 = getUserInterestInfo(pool, caller) | |
142 | + | let userLastInterest = $t072647343._1 | |
143 | + | let userShareTokensAmount = $t072647343._2 | |
144 | 144 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue, pmtAmount) | |
145 | 145 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue) | |
146 | 146 | let userNewInterest = currentInterest | |
147 | 147 | $Tuple4(userNewInterest, currentInterest, claimAmount, userShareTokensAmount) | |
148 | 148 | } | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func checkPmtAssetIdCorrect (pool,pmtAssetId) = { | |
152 | 152 | let poolShareAssetId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
153 | 153 | if ((pmtAssetId == poolShareAssetId)) | |
154 | 154 | then true | |
155 | 155 | else false | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func getUserSWOPClaimedAmount (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyUserSWOPClaimedAmount)), 0) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | @Callable(i) | |
163 | 163 | func init (earlyLP) = if (isDefined(getString(this, "keySWOPid"))) | |
164 | 164 | then throw("SWOP already initialized") | |
165 | 165 | else { | |
166 | 166 | let initAmount = 100000000000000 | |
167 | 167 | let SWOPissue = Issue("SWOP", "SWOP protocol token", initAmount, 8, true) | |
168 | 168 | let SWOPid = calculateAssetId(SWOPissue) | |
169 | 169 | nil | |
170 | 170 | } | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | ||
174 | 174 | @Callable(i) | |
175 | 175 | func initPoolShareFarming (pool) = { | |
176 | - | let $ | |
177 | - | let currentReward = $ | |
178 | - | let rewardUpdateHeight = $ | |
179 | - | let previousRewardPerBlock = $ | |
176 | + | let $t088818961 = rewardInfo(pool) | |
177 | + | let currentReward = $t088818961._1 | |
178 | + | let rewardUpdateHeight = $t088818961._2 | |
179 | + | let previousRewardPerBlock = $t088818961._3 | |
180 | 180 | [IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyRewardPoolFractionCurrent), currentReward), IntegerEntry((pool + keyRewardPoolFractionPrevious), previousRewardPerBlock)] | |
181 | 181 | } | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | ||
185 | 185 | @Callable(i) | |
186 | 186 | func lockShareTokens (pool) = { | |
187 | - | let $ | |
188 | - | let pmtAmount = $ | |
189 | - | let pmtAssetId = $ | |
187 | + | let $t092929367 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
188 | + | let pmtAmount = $t092929367._1 | |
189 | + | let pmtAssetId = $t092929367._2 | |
190 | 190 | if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
191 | 191 | then throw("Incorrect pmtAssetId") | |
192 | 192 | else { | |
193 | - | let $ | |
194 | - | let userNewInterest = $ | |
195 | - | let currentInterest = $ | |
196 | - | let claimAmount = $ | |
197 | - | let userShareTokensAmount = $ | |
193 | + | let $t094689576 = claimCalc(pool, i.caller, pmtAmount) | |
194 | + | let userNewInterest = $t094689576._1 | |
195 | + | let currentInterest = $t094689576._2 | |
196 | + | let claimAmount = $t094689576._3 | |
197 | + | let userShareTokensAmount = $t094689576._4 | |
198 | 198 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
199 | 199 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
200 | 200 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
201 | 201 | let totalShareAmountNew = (totalShareAmount + pmtAmount) | |
202 | 202 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
203 | 203 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
204 | 204 | [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)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), availableFundsNew)] | |
205 | 205 | } | |
206 | 206 | } | |
207 | 207 | ||
208 | 208 | ||
209 | 209 | ||
210 | 210 | @Callable(i) | |
211 | 211 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
212 | 212 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
213 | - | let $ | |
214 | - | let userNewInterest = $ | |
215 | - | let currentInterest = $ | |
216 | - | let claimAmount = $ | |
217 | - | let userShareTokensAmount = $ | |
213 | + | let $t01093311033 = claimCalc(pool, i.caller, 1) | |
214 | + | let userNewInterest = $t01093311033._1 | |
215 | + | let currentInterest = $t01093311033._2 | |
216 | + | let claimAmount = $t01093311033._3 | |
217 | + | let userShareTokensAmount = $t01093311033._4 | |
218 | 218 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
219 | 219 | then throw("Withdraw amount more then user locked amount") | |
220 | 220 | else { | |
221 | 221 | let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount) | |
222 | 222 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
223 | 223 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
224 | 224 | let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount) | |
225 | 225 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
226 | 226 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
227 | 227 | [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)] | |
228 | 228 | } | |
229 | 229 | } | |
230 | 230 | ||
231 | 231 | ||
232 | 232 | ||
233 | 233 | @Callable(i) | |
234 | 234 | func claim (pool) = { | |
235 | 235 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
236 | - | let $ | |
237 | - | let lastInterestHeight = $ | |
238 | - | let lastInterest = $ | |
239 | - | let $ | |
240 | - | let currentRewardPerBlock = $ | |
241 | - | let rewardUpdateHeight = $ | |
242 | - | let previousRewardPerBlock = $ | |
243 | - | let $ | |
244 | - | let userNewInterest = $ | |
245 | - | let currentInterest = $ | |
246 | - | let claimAmount = $ | |
247 | - | let userShareTokensAmount = $ | |
236 | + | let $t01252512590 = getLastInterestInfo(pool) | |
237 | + | let lastInterestHeight = $t01252512590._1 | |
238 | + | let lastInterest = $t01252512590._2 | |
239 | + | let $t01259512684 = rewardInfo(pool) | |
240 | + | let currentRewardPerBlock = $t01259512684._1 | |
241 | + | let rewardUpdateHeight = $t01259512684._2 | |
242 | + | let previousRewardPerBlock = $t01259512684._3 | |
243 | + | let $t01268912789 = claimCalc(pool, i.caller, 1) | |
244 | + | let userNewInterest = $t01268912789._1 | |
245 | + | let currentInterest = $t01268912789._2 | |
246 | + | let claimAmount = $t01268912789._3 | |
247 | + | let userShareTokensAmount = $t01268912789._4 | |
248 | 248 | let availableFund = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
249 | 249 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
250 | 250 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
251 | 251 | if ((availableFund == 0)) | |
252 | 252 | then throw("You have 0 available SWOP") | |
253 | 253 | 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)] | |
254 | 254 | } | |
255 | 255 | ||
256 | 256 |
github/deemru/w8io/169f3d6 75.64 ms ◑