tx · FVg8nvqDPZ9bPpDH3yzeezxZSccLU6Em2Ti4AFZZC4wB 3MvenppyAqkqbJvpemDnU6P5dvSJ9fvRxRg: -0.01400000 Waves 2020.12.12 16:53 [1305530] smart account 3MvenppyAqkqbJvpemDnU6P5dvSJ9fvRxRg > SELF 0.00000000 Waves
{ "type": 13, "id": "FVg8nvqDPZ9bPpDH3yzeezxZSccLU6Em2Ti4AFZZC4wB", "fee": 1400000, "feeAssetId": null, "timestamp": 1607781257032, "version": 1, "sender": "3MvenppyAqkqbJvpemDnU6P5dvSJ9fvRxRg", "senderPublicKey": "38RJPSAs2g6F7P5zT5FJ6BAc1DyReFGja2vkw8rSz3ga", "proofs": [ "2dnuvbuao7W6SkXXHHJxEFFRUzxJq2bQtYfMiF4r3XtAYDDoMShdg4sqSu5A9rPQ5h4nM99cy1EK3aeK9EoNL1FE" ], "script": "base64:AAIEAAAAAAAAABcIAhIDCgEIEgMKAQgSBAoCCAESAwoBCAAAABsAAAAADGFkbWluUHViS2V5MQEAAAAgELDi6uQgdVvao3EGz2pOOnWzKruRdXrpd4DobbWyZx8AAAAADGFkbWluUHViS2V5MgEAAAAgELDi6uQgdVvao3EGz2pOOnWzKruRdXrpd4DobbWyZx8AAAAADGFkbWluUHViS2V5MwEAAAAgELDi6uQgdVvao3EGz2pOOnWzKruRdXrpd4DobbWyZx8AAAAAFGFkbWluUHViS2V5U3RhcnRTdG9wAQAAACAQsOLq5CB1W9qjcQbPak46dbMqu5F1eul3gOhttbJnHwAAAAASYWRtaW5QdWJLZXlTdGFraW5nAQAAACAQsOLq5CB1W9qjcQbPak46dbMqu5F1eul3gOhttbJnHwAAAAAUa2V5U2hhcmVUb2tlbnNMb2NrZWQCAAAAGl90b3RhbF9zaGFyZV90b2tlbnNfbG9ja2VkAAAAABBrZXlDdXJyZW50UmV3YXJkAgAAAA9fY3VycmVudF9yZXdhcmQAAAAAFWtleVJld2FyZFVwZGF0ZUhlaWdodAIAAAAVX3Jld2FyZF91cGRhdGV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AAIFAAAABHBvb2wCAAAAAV8FAAAAFWtleUxhc3RJbnRlcmVzdEhlaWdodAUAAAAGaGVpZ2h0CQAETAAAAAIJAQAAAAdSZWlzc3VlAAAAAwUAAAAEU1dPUAUAAAALY2xhaW1BbW91bnQGCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAALY2xhaW1BbW91bnQFAAAABFNXT1AFAAAAA25pbAAAAACMN1MO", "chainId": 84, "height": 1305530, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HoRR45b7EJStnnyLM8yktXeWDZtAjkfopcuwfG19XUss Next: CdBzULvBmaCS2jxdw33rfQrF3NkFLz4Raok4wFyjEfV8 Diff:
Old | New | Differences | |
---|---|---|---|
43 | 43 | func throwIsActive () = throw("DApp is already active") | |
44 | 44 | ||
45 | 45 | ||
46 | - | func getTotalShateTokenLocked (pool) = if (true) | |
47 | - | then throw((pool + keyUserShareTokensLocked)) | |
48 | - | else valueOrErrorMessage(getInteger(this, (pool + keyUserShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked)) | |
46 | + | func getTotalShateTokenLocked (pool) = valueOrErrorMessage(getInteger(this, (pool + keyShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked)) | |
49 | 47 | ||
50 | 48 | ||
51 | 49 | func rewardInfo (pool) = { | |
97 | 95 | ||
98 | 96 | func ClaimCalc (pool,caller) = { | |
99 | 97 | let shareTokenLocked = getTotalShateTokenLocked(pool) | |
100 | - | let $ | |
101 | - | let lastInterestHeight = $ | |
102 | - | let lastInterest = $ | |
103 | - | let $ | |
104 | - | let currentRewardPerBlock = $ | |
105 | - | let rewardUpdateHeight = $ | |
106 | - | let previousRewardPerBlock = $ | |
107 | - | let $ | |
108 | - | let userLastInterest = $ | |
109 | - | let userShareTokensAmount = $ | |
98 | + | let $t044314496 = getLastInterestInfo(pool) | |
99 | + | let lastInterestHeight = $t044314496._1 | |
100 | + | let lastInterest = $t044314496._2 | |
101 | + | let $t045014589 = rewardInfo(pool) | |
102 | + | let currentRewardPerBlock = $t045014589._1 | |
103 | + | let rewardUpdateHeight = $t045014589._2 | |
104 | + | let previousRewardPerBlock = $t045014589._3 | |
105 | + | let $t045944673 = getUserInterestInfo(pool, caller) | |
106 | + | let userLastInterest = $t045944673._1 | |
107 | + | let userShareTokensAmount = $t045944673._2 | |
110 | 108 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock) | |
111 | 109 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - (userLastInterest * scale8)), scale8) | |
112 | 110 | let userNewInterest = currentInterest | |
127 | 125 | func initPoolShareLocking (pool) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
128 | 126 | then throw("Only admin can call this function") | |
129 | 127 | else { | |
130 | - | let $ | |
131 | - | let currentReward = $ | |
132 | - | let rewardUpdateHeight = $ | |
133 | - | let previousRewardPerBlock = $ | |
128 | + | let $t055935673 = rewardInfo(pool) | |
129 | + | let currentReward = $t055935673._1 | |
130 | + | let rewardUpdateHeight = $t055935673._2 | |
131 | + | let previousRewardPerBlock = $t055935673._3 | |
134 | 132 | [StringEntry((pool + keyPoolAddress), pool), IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyCurrentReward), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((pool + keyRewardUpdateHeight), rewardUpdateHeight), IntegerEntry((pool + keyPreviousReward), previousRewardPerBlock)] | |
135 | 133 | } | |
136 | 134 | ||
138 | 136 | ||
139 | 137 | @Callable(i) | |
140 | 138 | func lockShareTokens (pool) = { | |
141 | - | let $ | |
142 | - | let pmtAmount = $ | |
143 | - | let pmtAssetId = $ | |
139 | + | let $t061246199 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
140 | + | let pmtAmount = $t061246199._1 | |
141 | + | let pmtAssetId = $t061246199._2 | |
144 | 142 | if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
145 | 143 | then throw("Incorrect pmtAssetId") | |
146 | 144 | else { | |
147 | - | let $ | |
148 | - | let userNewInterest = $ | |
149 | - | let currentInterest = $ | |
150 | - | let claimAmount = $ | |
151 | - | let userShareTokensAmount = $ | |
145 | + | let $t062926390 = ClaimCalc(pool, i.caller) | |
146 | + | let userNewInterest = $t062926390._1 | |
147 | + | let currentInterest = $t062926390._2 | |
148 | + | let claimAmount = $t062926390._3 | |
149 | + | let userShareTokensAmount = $t062926390._4 | |
152 | 150 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
153 | 151 | [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), Reissue(SWOP, claimAmount, true), ScriptTransfer(i.caller, claimAmount, SWOP)] | |
154 | 152 | } | |
158 | 156 | ||
159 | 157 | @Callable(i) | |
160 | 158 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
161 | - | let $ | |
162 | - | let userNewInterest = $ | |
163 | - | let currentInterest = $ | |
164 | - | let claimAmount = $ | |
165 | - | let userShareTokensAmount = $ | |
159 | + | let $t069747072 = ClaimCalc(pool, i.caller) | |
160 | + | let userNewInterest = $t069747072._1 | |
161 | + | let currentInterest = $t069747072._2 | |
162 | + | let claimAmount = $t069747072._3 | |
163 | + | let userShareTokensAmount = $t069747072._4 | |
166 | 164 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
167 | 165 | then throw("Withdraw amount more then user locked amount") | |
168 | 166 | else { | |
177 | 175 | @Callable(i) | |
178 | 176 | func claim (pool) = { | |
179 | 177 | let shareTokenLocked = getTotalShateTokenLocked(pool) | |
180 | - | let $ | |
181 | - | let lastInterestHeight = $ | |
182 | - | let lastInterest = $ | |
183 | - | let $ | |
184 | - | let currentRewardPerBlock = $ | |
185 | - | let rewardUpdateHeight = $ | |
186 | - | let previousRewardPerBlock = $ | |
187 | - | let $ | |
188 | - | let userLastInterest = $ | |
189 | - | let userShare = $ | |
178 | + | let $t079728037 = getLastInterestInfo(pool) | |
179 | + | let lastInterestHeight = $t079728037._1 | |
180 | + | let lastInterest = $t079728037._2 | |
181 | + | let $t080428131 = rewardInfo(pool) | |
182 | + | let currentRewardPerBlock = $t080428131._1 | |
183 | + | let rewardUpdateHeight = $t080428131._2 | |
184 | + | let previousRewardPerBlock = $t080428131._3 | |
185 | + | let $t081368205 = getUserInterestInfo(pool, i.caller) | |
186 | + | let userLastInterest = $t081368205._1 | |
187 | + | let userShare = $t081368205._2 | |
190 | 188 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock) | |
191 | 189 | let claimAmount = fraction(userShare, (currentInterest - (userLastInterest * scale8)), scale8) | |
192 | 190 | let userNewInterest = currentInterest |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminPubKey1 = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU' | |
5 | 5 | ||
6 | 6 | let adminPubKey2 = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU' | |
7 | 7 | ||
8 | 8 | let adminPubKey3 = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU' | |
9 | 9 | ||
10 | 10 | let adminPubKeyStartStop = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU' | |
11 | 11 | ||
12 | 12 | let adminPubKeyStaking = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU' | |
13 | 13 | ||
14 | 14 | let keyShareTokensLocked = "_total_share_tokens_locked" | |
15 | 15 | ||
16 | 16 | let keyCurrentReward = "_current_reward" | |
17 | 17 | ||
18 | 18 | let keyRewardUpdateHeight = "_reward_update_height" | |
19 | 19 | ||
20 | 20 | let keyPreviousReward = "_previous_reward" | |
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_index" | |
29 | 29 | ||
30 | 30 | let keyPoolAddress = "_address" | |
31 | 31 | ||
32 | 32 | let votingAddress = Address(base58'3N5F5DCmWNzT8ZPe1tBfiXaVYzWJriaJZ9E') | |
33 | 33 | ||
34 | 34 | let SWOP = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
35 | 35 | ||
36 | 36 | let scale8 = 100000000 | |
37 | 37 | ||
38 | 38 | let heightRewardUpdate = getIntegerValue(this, "height_reward_update") | |
39 | 39 | ||
40 | 40 | func throwOnlyAdmin () = throw("Only admin can call this function") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func throwIsActive () = throw("DApp is already active") | |
44 | 44 | ||
45 | 45 | ||
46 | - | func getTotalShateTokenLocked (pool) = if (true) | |
47 | - | then throw((pool + keyUserShareTokensLocked)) | |
48 | - | else valueOrErrorMessage(getInteger(this, (pool + keyUserShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked)) | |
46 | + | func getTotalShateTokenLocked (pool) = valueOrErrorMessage(getInteger(this, (pool + keyShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked)) | |
49 | 47 | ||
50 | 48 | ||
51 | 49 | func rewardInfo (pool) = { | |
52 | 50 | let currentReward = valueOrErrorMessage(getInteger(votingAddress, (pool + keyCurrentReward)), (((("No data on the key: " + pool) + keyCurrentReward) + " at address ") + toString(votingAddress))) | |
53 | 51 | let rewardUpdateHeight = valueOrErrorMessage(getInteger(votingAddress, (pool + keyRewardUpdateHeight)), (((("No data on the key: " + pool) + keyRewardUpdateHeight) + " at address ") + toString(votingAddress))) | |
54 | 52 | let rewardPreviousAmount = valueOrErrorMessage(getInteger(votingAddress, (pool + keyRewardUpdateHeight)), (((("No data on the key: " + pool) + keyPreviousReward) + " at address ") + toString(votingAddress))) | |
55 | 53 | $Tuple3(currentReward, rewardUpdateHeight, rewardPreviousAmount) | |
56 | 54 | } | |
57 | 55 | ||
58 | 56 | ||
59 | 57 | func getLastInterestInfo (pool) = { | |
60 | 58 | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (((("No data on the key: " + pool) + "_") + pool) + keyLastInterest)) | |
61 | 59 | let lastInterestHeight = valueOrErrorMessage(getInteger(this, (pool + keyLastInterestHeight)), (("No data on the key: " + pool) + keyLastInterestHeight)) | |
62 | 60 | $Tuple2(lastInterestHeight, lastInterest) | |
63 | 61 | } | |
64 | 62 | ||
65 | 63 | ||
66 | 64 | func getUserInterestInfo (pool,userAddres) = { | |
67 | 65 | let userLastInterest = getInteger(this, (((pool + "_") + toString(userAddres)) + keyUserLastInterest)) | |
68 | 66 | let userShare = getInteger(this, (((pool + "_") + toString(userAddres)) + keyUserShareTokensLocked)) | |
69 | 67 | let userLastInterestValue = match userLastInterest { | |
70 | 68 | case userLastInterest: Int => | |
71 | 69 | userLastInterest | |
72 | 70 | case _ => | |
73 | 71 | 0 | |
74 | 72 | } | |
75 | 73 | let userShareTokensAmount = match userShare { | |
76 | 74 | case userShare: Int => | |
77 | 75 | userShare | |
78 | 76 | case _ => | |
79 | 77 | 0 | |
80 | 78 | } | |
81 | 79 | $Tuple2(userLastInterestValue, userShareTokensAmount) | |
82 | 80 | } | |
83 | 81 | ||
84 | 82 | ||
85 | 83 | func calcInterest (lastInterestHeight,rewardUpdateHeight,lastInterest,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock) = if ((lastInterestHeight > rewardUpdateHeight)) | |
86 | 84 | then { | |
87 | 85 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
88 | 86 | ((lastInterest * scale8) + fraction(reward, scale8, shareTokenLocked)) | |
89 | 87 | } | |
90 | 88 | else { | |
91 | 89 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
92 | 90 | let interestAfterUpdate = ((lastInterest * scale8) + fraction(rewardAfterLastInterestBeforeReawardUpdate, scale8, shareTokenLocked)) | |
93 | 91 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
94 | 92 | ((interestAfterUpdate * scale8) + fraction(reward, scale8, shareTokenLocked)) | |
95 | 93 | } | |
96 | 94 | ||
97 | 95 | ||
98 | 96 | func ClaimCalc (pool,caller) = { | |
99 | 97 | let shareTokenLocked = getTotalShateTokenLocked(pool) | |
100 | - | let $ | |
101 | - | let lastInterestHeight = $ | |
102 | - | let lastInterest = $ | |
103 | - | let $ | |
104 | - | let currentRewardPerBlock = $ | |
105 | - | let rewardUpdateHeight = $ | |
106 | - | let previousRewardPerBlock = $ | |
107 | - | let $ | |
108 | - | let userLastInterest = $ | |
109 | - | let userShareTokensAmount = $ | |
98 | + | let $t044314496 = getLastInterestInfo(pool) | |
99 | + | let lastInterestHeight = $t044314496._1 | |
100 | + | let lastInterest = $t044314496._2 | |
101 | + | let $t045014589 = rewardInfo(pool) | |
102 | + | let currentRewardPerBlock = $t045014589._1 | |
103 | + | let rewardUpdateHeight = $t045014589._2 | |
104 | + | let previousRewardPerBlock = $t045014589._3 | |
105 | + | let $t045944673 = getUserInterestInfo(pool, caller) | |
106 | + | let userLastInterest = $t045944673._1 | |
107 | + | let userShareTokensAmount = $t045944673._2 | |
110 | 108 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock) | |
111 | 109 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - (userLastInterest * scale8)), scale8) | |
112 | 110 | let userNewInterest = currentInterest | |
113 | 111 | $Tuple4(userNewInterest, currentInterest, claimAmount, userShareTokensAmount) | |
114 | 112 | } | |
115 | 113 | ||
116 | 114 | ||
117 | 115 | func checkPmtAssetIdCorrect (pool,pmtAssetId) = { | |
118 | 116 | let poolAddres = value(addressFromString(getStringValue(this, (pool + keyPoolAddress)))) | |
119 | 117 | let poolShareAssetId = fromBase58String(getStringValue(poolAddres, "share_asset_id")) | |
120 | 118 | if ((pmtAssetId == poolShareAssetId)) | |
121 | 119 | then true | |
122 | 120 | else false | |
123 | 121 | } | |
124 | 122 | ||
125 | 123 | ||
126 | 124 | @Callable(i) | |
127 | 125 | func initPoolShareLocking (pool) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
128 | 126 | then throw("Only admin can call this function") | |
129 | 127 | else { | |
130 | - | let $ | |
131 | - | let currentReward = $ | |
132 | - | let rewardUpdateHeight = $ | |
133 | - | let previousRewardPerBlock = $ | |
128 | + | let $t055935673 = rewardInfo(pool) | |
129 | + | let currentReward = $t055935673._1 | |
130 | + | let rewardUpdateHeight = $t055935673._2 | |
131 | + | let previousRewardPerBlock = $t055935673._3 | |
134 | 132 | [StringEntry((pool + keyPoolAddress), pool), IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyCurrentReward), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((pool + keyRewardUpdateHeight), rewardUpdateHeight), IntegerEntry((pool + keyPreviousReward), previousRewardPerBlock)] | |
135 | 133 | } | |
136 | 134 | ||
137 | 135 | ||
138 | 136 | ||
139 | 137 | @Callable(i) | |
140 | 138 | func lockShareTokens (pool) = { | |
141 | - | let $ | |
142 | - | let pmtAmount = $ | |
143 | - | let pmtAssetId = $ | |
139 | + | let $t061246199 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
140 | + | let pmtAmount = $t061246199._1 | |
141 | + | let pmtAssetId = $t061246199._2 | |
144 | 142 | if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
145 | 143 | then throw("Incorrect pmtAssetId") | |
146 | 144 | else { | |
147 | - | let $ | |
148 | - | let userNewInterest = $ | |
149 | - | let currentInterest = $ | |
150 | - | let claimAmount = $ | |
151 | - | let userShareTokensAmount = $ | |
145 | + | let $t062926390 = ClaimCalc(pool, i.caller) | |
146 | + | let userNewInterest = $t062926390._1 | |
147 | + | let currentInterest = $t062926390._2 | |
148 | + | let claimAmount = $t062926390._3 | |
149 | + | let userShareTokensAmount = $t062926390._4 | |
152 | 150 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
153 | 151 | [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), Reissue(SWOP, claimAmount, true), ScriptTransfer(i.caller, claimAmount, SWOP)] | |
154 | 152 | } | |
155 | 153 | } | |
156 | 154 | ||
157 | 155 | ||
158 | 156 | ||
159 | 157 | @Callable(i) | |
160 | 158 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
161 | - | let $ | |
162 | - | let userNewInterest = $ | |
163 | - | let currentInterest = $ | |
164 | - | let claimAmount = $ | |
165 | - | let userShareTokensAmount = $ | |
159 | + | let $t069747072 = ClaimCalc(pool, i.caller) | |
160 | + | let userNewInterest = $t069747072._1 | |
161 | + | let currentInterest = $t069747072._2 | |
162 | + | let claimAmount = $t069747072._3 | |
163 | + | let userShareTokensAmount = $t069747072._4 | |
166 | 164 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
167 | 165 | then throw("Withdraw amount more then user locked amount") | |
168 | 166 | else { | |
169 | 167 | let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount) | |
170 | 168 | let shareTokensId = fromBase58String(getStringValue(this, (pool + "share_asset_id"))) | |
171 | 169 | [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), Reissue(SWOP, claimAmount, true), ScriptTransfer(i.caller, claimAmount, SWOP), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
172 | 170 | } | |
173 | 171 | } | |
174 | 172 | ||
175 | 173 | ||
176 | 174 | ||
177 | 175 | @Callable(i) | |
178 | 176 | func claim (pool) = { | |
179 | 177 | let shareTokenLocked = getTotalShateTokenLocked(pool) | |
180 | - | let $ | |
181 | - | let lastInterestHeight = $ | |
182 | - | let lastInterest = $ | |
183 | - | let $ | |
184 | - | let currentRewardPerBlock = $ | |
185 | - | let rewardUpdateHeight = $ | |
186 | - | let previousRewardPerBlock = $ | |
187 | - | let $ | |
188 | - | let userLastInterest = $ | |
189 | - | let userShare = $ | |
178 | + | let $t079728037 = getLastInterestInfo(pool) | |
179 | + | let lastInterestHeight = $t079728037._1 | |
180 | + | let lastInterest = $t079728037._2 | |
181 | + | let $t080428131 = rewardInfo(pool) | |
182 | + | let currentRewardPerBlock = $t080428131._1 | |
183 | + | let rewardUpdateHeight = $t080428131._2 | |
184 | + | let previousRewardPerBlock = $t080428131._3 | |
185 | + | let $t081368205 = getUserInterestInfo(pool, i.caller) | |
186 | + | let userLastInterest = $t081368205._1 | |
187 | + | let userShare = $t081368205._2 | |
190 | 188 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock) | |
191 | 189 | let claimAmount = fraction(userShare, (currentInterest - (userLastInterest * scale8)), scale8) | |
192 | 190 | let userNewInterest = currentInterest | |
193 | 191 | [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry(((pool + "_") + keyLastInterest), currentInterest), IntegerEntry(((pool + "_") + keyLastInterestHeight), height), Reissue(SWOP, claimAmount, true), ScriptTransfer(i.caller, claimAmount, SWOP)] | |
194 | 192 | } | |
195 | 193 | ||
196 | 194 |
github/deemru/w8io/169f3d6 47.19 ms ◑