tx · 2JsLCLr8TAHm522o8DVhYvuosqNLE3aH4L4nVTMzpnVX

3NCCBQA6ADQN4o5mP4UpyWQy3QgAc2f68X8:  -0.01400000 Waves

2020.12.17 14:54 [1312669] smart account 3NCCBQA6ADQN4o5mP4UpyWQy3QgAc2f68X8 > SELF 0.00000000 Waves

{ "type": 13, "id": "2JsLCLr8TAHm522o8DVhYvuosqNLE3aH4L4nVTMzpnVX", "fee": 1400000, "feeAssetId": null, "timestamp": 1608206133267, "version": 1, "sender": "3NCCBQA6ADQN4o5mP4UpyWQy3QgAc2f68X8", "senderPublicKey": "7nhhzx1b9hckmwzpZJ7SPQmdrVrDgcfGCgZn9qvMnXCJ", "proofs": [ "5N92i6zSWmnJudwDNvVAUrGsLZ1puFUZsSnJwS9fi2S1D2QkpUd5zVqxekHTWaCDS8EWyu5JkYAB3NkDidPDb2vB" ], "script": "base64:AAIEAAAAAAAAABoIAhIAEgMKAQgSAwoBCBIECgIIARIECgIIAQAAAB8AAAAADGFkbWluUHViS2V5MQEAAAAgELDi6uQgdVvao3EGz2pOOnWzKruRdXrpd4DobbWyZx8AAAAADGFkbWluUHViS2V5MgEAAAAgELDi6uQgdVvao3EGz2pOOnWzKruRdXrpd4DobbWyZx8AAAAADGFkbWluUHViS2V5MwEAAAAgELDi6uQgdVvao3EGz2pOOnWzKruRdXrpd4DobbWyZx8AAAAAFGFkbWluUHViS2V5U3RhcnRTdG9wAQAAACAQsOLq5CB1W9qjcQbPak46dbMqu5F1eul3gOhttbJnHwAAAAASYWRtaW5QdWJLZXlTdGFraW5nAQAAACAQsOLq5CB1W9qjcQbPak46dbMqu5F1eul3gOhttbJnHwAAAAAUa2V5U2hhcmVUb2tlbnNMb2NrZWQCAAAAGl90b3RhbF9zaGFyZV90b2tlbnNfbG9ja2VkAAAAABBrZXlDdXJyZW50UmV3YXJkAgAAAA9fY3VycmVudF9yZXdhcmQAAAAAFWtleVJld2FyZFVwZGF0ZUhlaWdodAIAAAAVX3Jld2FyZF91cGR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AAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAOY2xhaW1BbW91bnRBc2sFAAAABFNXT1AFAAAAA25pbAAAAAAzku02", "chainId": 84, "height": 1312669, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4iPcNWCpR5gcSy1PjL2b8fByoQJG8KwYreH6UjLcV1Va Next: none Diff:
OldNewDifferences
122122 }
123123
124124
125-func ClaimCalc (pool,caller) = {
125+func claimCalc (pool,caller) = {
126126 let shareAssetId = getShareAssetId(pool)
127127 let scaleValue = calcScaleValue(SWOP, shareAssetId)
128128 let shareTokenLocked = getTotalShareTokenLocked(pool)
129- let $t055385603 = getLastInterestInfo(pool)
130- let lastInterestHeight = $t055385603._1
131- let lastInterest = $t055385603._2
132- let $t056085696 = rewardInfo(pool)
133- let currentRewardPerBlock = $t056085696._1
134- let rewardUpdateHeight = $t056085696._2
135- let previousRewardPerBlock = $t056085696._3
136- let $t057015780 = getUserInterestInfo(pool, caller)
137- let userLastInterest = $t057015780._1
138- let userShareTokensAmount = $t057015780._2
129+ let $t055375602 = getLastInterestInfo(pool)
130+ let lastInterestHeight = $t055375602._1
131+ let lastInterest = $t055375602._2
132+ let $t056075695 = rewardInfo(pool)
133+ let currentRewardPerBlock = $t056075695._1
134+ let rewardUpdateHeight = $t056075695._2
135+ let previousRewardPerBlock = $t056075695._3
136+ let $t057005779 = getUserInterestInfo(pool, caller)
137+ let userLastInterest = $t057005779._1
138+ let userShareTokensAmount = $t057005779._2
139139 let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue)
140140 let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue)
141141 let userNewInterest = currentInterest
167167 func initPoolShareFarming (pool) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
168168 then throw("Only admin can call this function")
169169 else {
170- let $t071437223 = rewardInfo(pool)
171- let currentReward = $t071437223._1
172- let rewardUpdateHeight = $t071437223._2
173- let previousRewardPerBlock = $t071437223._3
170+ let $t071427222 = rewardInfo(pool)
171+ let currentReward = $t071427222._1
172+ let rewardUpdateHeight = $t071427222._2
173+ let previousRewardPerBlock = $t071427222._3
174174 [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)]
175175 }
176176
178178
179179 @Callable(i)
180180 func lockShareTokens (pool) = {
181- let $t076737748 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
182- let pmtAmount = $t076737748._1
183- let pmtAssetId = $t076737748._2
181+ let $t076727747 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
182+ let pmtAmount = $t076727747._1
183+ let pmtAssetId = $t076727747._2
184184 if (!(checkPmtAssetIdCorrect(pool, pmtAssetId)))
185185 then throw("Incorrect pmtAssetId")
186186 else {
187- let $t078417939 = ClaimCalc(pool, i.caller)
188- let userNewInterest = $t078417939._1
189- let currentInterest = $t078417939._2
190- let claimAmount = $t078417939._3
191- let userShareTokensAmount = $t078417939._4
187+ let $t078407938 = claimCalc(pool, i.caller)
188+ let userNewInterest = $t078407938._1
189+ let currentInterest = $t078407938._2
190+ let claimAmount = $t078407938._3
191+ let userShareTokensAmount = $t078407938._4
192192 let userShareAmountNew = (userShareTokensAmount + pmtAmount)
193193 let availableFundsNew = (userAvailableFunds(pool, i.caller) + claimAmount)
194194 let totalShareAmount = getTotalShareTokenLocked(pool)
201201
202202 @Callable(i)
203203 func withdrawShareTokens (pool,shareTokensWithdrawAmount) = {
204- let $t088928990 = ClaimCalc(pool, i.caller)
205- let userNewInterest = $t088928990._1
206- let currentInterest = $t088928990._2
207- let claimAmount = $t088928990._3
208- let userShareTokensAmount = $t088928990._4
204+ let $t088918989 = claimCalc(pool, i.caller)
205+ let userNewInterest = $t088918989._1
206+ let currentInterest = $t088918989._2
207+ let claimAmount = $t088918989._3
208+ let userShareTokensAmount = $t088918989._4
209209 if ((shareTokensWithdrawAmount > userShareTokensAmount))
210210 then throw("Withdraw amount more then user locked amount")
211211 else {
221221 @Callable(i)
222222 func claim (pool,claimAmountAsk) = {
223223 let shareTokenLocked = getTotalShareTokenLocked(pool)
224- let $t01000910074 = getLastInterestInfo(pool)
225- let lastInterestHeight = $t01000910074._1
226- let lastInterest = $t01000910074._2
227- let $t01007910243 = rewardInfo(pool)
228- let currentRewardPerBlock = $t01007910243._1
229- let rewardUpdateHeight = $t01007910243._2
230- let previousRewardPerBlock = $t01007910243._3
231- let $t01024810346 = ClaimCalc(pool, i.caller)
232- let userNewInterest = $t01024810346._1
233- let currentInterest = $t01024810346._2
234- let claimAmount = $t01024810346._3
235- let userShareTokensAmount = $t01024810346._4
224+ let $t01000810073 = getLastInterestInfo(pool)
225+ let lastInterestHeight = $t01000810073._1
226+ let lastInterest = $t01000810073._2
227+ let $t01007810242 = rewardInfo(pool)
228+ let currentRewardPerBlock = $t01007810242._1
229+ let rewardUpdateHeight = $t01007810242._2
230+ let previousRewardPerBlock = $t01007810242._3
231+ let $t01024710345 = claimCalc(pool, i.caller)
232+ let userNewInterest = $t01024710345._1
233+ let currentInterest = $t01024710345._2
234+ let claimAmount = $t01024710345._3
235+ let userShareTokensAmount = $t01024710345._4
236236 let availableFund = (userAvailableFunds(pool, i.caller) + claimAmount)
237237 if ((claimAmountAsk > availableFund))
238238 then throw(((("You ask more SWOP then you have. Available SWOP: " + toString(availableFund)) + ". You ask: ") + toString(claimAmountAsk)))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let adminPubKey1 = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU'
55
66 let adminPubKey2 = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU'
77
88 let adminPubKey3 = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU'
99
1010 let adminPubKeyStartStop = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU'
1111
1212 let adminPubKeyStaking = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU'
1313
1414 let keyShareTokensLocked = "_total_share_tokens_locked"
1515
1616 let keyCurrentReward = "_current_reward"
1717
1818 let keyRewardUpdateHeight = "_reward_update_height"
1919
2020 let keyPreviousReward = "_previous_reward"
2121
2222 let keyLastInterest = "_last_interest"
2323
2424 let keyLastInterestHeight = "_last_interest_height"
2525
2626 let keyUserShareTokensLocked = "_share_tokens_locked"
2727
2828 let keyUserLastInterest = "_last_interest"
2929
3030 let keySWOPid = "SWOP_id"
3131
3232 let keyPoolAddress = "_address"
3333
3434 let keyAvailableFunds = "_available_funds"
3535
3636 let votingAddress = Address(base58'3N5F5DCmWNzT8ZPe1tBfiXaVYzWJriaJZ9E')
3737
3838 let SWOP = fromBase58String(getStringValue(this, keySWOPid))
3939
4040 let heightRewardUpdate = getIntegerValue(this, "height_reward_update")
4141
4242 func throwOnlyAdmin () = throw("Only admin can call this function")
4343
4444
4545 func throwIsActive () = throw("DApp is already active")
4646
4747
4848 func getTotalShareTokenLocked (pool) = valueOrErrorMessage(getInteger(this, (pool + keyShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked))
4949
5050
5151 func getShareAssetId (pool) = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id"))
5252
5353
5454 func calcScaleValue (assetId1,assetId2) = {
5555 let assetId1Decimals = value(assetInfo(assetId1)).decimals
5656 let assetId2Decimals = value(assetInfo(assetId2)).decimals
5757 let sclaeDigits = ((assetId2Decimals - assetId1Decimals) + 8)
5858 pow(10, 0, sclaeDigits, 0, 0, HALFDOWN)
5959 }
6060
6161
6262 func userAvailableFunds (pool,user) = {
6363 let availableFunds = getInteger(this, ((((pool + "_") + toString(user)) + "_") + keyAvailableFunds))
6464 let avbF = match availableFunds {
6565 case avbF: Int =>
6666 avbF
6767 case avbF: Unit =>
6868 0
6969 case _ =>
7070 throw("Match error")
7171 }
7272 avbF
7373 }
7474
7575
7676 func rewardInfo (pool) = {
7777 let currentReward = valueOrErrorMessage(getInteger(votingAddress, (pool + keyCurrentReward)), (((("No data on the key: " + pool) + keyCurrentReward) + " at address ") + toString(votingAddress)))
7878 let rewardUpdateHeight = valueOrErrorMessage(getInteger(votingAddress, (pool + keyRewardUpdateHeight)), (((("No data on the key: " + pool) + keyRewardUpdateHeight) + " at address ") + toString(votingAddress)))
7979 let rewardPreviousAmount = valueOrErrorMessage(getInteger(votingAddress, (pool + keyRewardUpdateHeight)), (((("No data on the key: " + pool) + keyPreviousReward) + " at address ") + toString(votingAddress)))
8080 $Tuple3(currentReward, rewardUpdateHeight, rewardPreviousAmount)
8181 }
8282
8383
8484 func getLastInterestInfo (pool) = {
8585 let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (((("No data on the key: " + pool) + "_") + pool) + keyLastInterest))
8686 let lastInterestHeight = valueOrErrorMessage(getInteger(this, (pool + keyLastInterestHeight)), (("No data on the key: " + pool) + keyLastInterestHeight))
8787 $Tuple2(lastInterestHeight, lastInterest)
8888 }
8989
9090
9191 func getUserInterestInfo (pool,userAddres) = {
9292 let userLastInterest = getInteger(this, (((pool + "_") + toString(userAddres)) + keyUserLastInterest))
9393 let userShare = getInteger(this, (((pool + "_") + toString(userAddres)) + keyUserShareTokensLocked))
9494 let userLastInterestValue = match userLastInterest {
9595 case userLastInterest: Int =>
9696 userLastInterest
9797 case _ =>
9898 0
9999 }
100100 let userShareTokensAmount = match userShare {
101101 case userShare: Int =>
102102 userShare
103103 case _ =>
104104 0
105105 }
106106 $Tuple2(userLastInterestValue, userShareTokensAmount)
107107 }
108108
109109
110110 func calcInterest (lastInterestHeight,rewardUpdateHeight,lastInterest,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,shareAssetId,scaleValue) = if ((lastInterestHeight > rewardUpdateHeight))
111111 then if ((shareTokenLocked == 0))
112112 then 0
113113 else {
114114 let reward = (currentRewardPerBlock * (height - lastInterestHeight))
115115 (lastInterest + fraction(reward, scaleValue, shareTokenLocked))
116116 }
117117 else {
118118 let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight))
119119 let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked))
120120 let reward = (currentRewardPerBlock * (height - rewardUpdateHeight))
121121 (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked))
122122 }
123123
124124
125-func ClaimCalc (pool,caller) = {
125+func claimCalc (pool,caller) = {
126126 let shareAssetId = getShareAssetId(pool)
127127 let scaleValue = calcScaleValue(SWOP, shareAssetId)
128128 let shareTokenLocked = getTotalShareTokenLocked(pool)
129- let $t055385603 = getLastInterestInfo(pool)
130- let lastInterestHeight = $t055385603._1
131- let lastInterest = $t055385603._2
132- let $t056085696 = rewardInfo(pool)
133- let currentRewardPerBlock = $t056085696._1
134- let rewardUpdateHeight = $t056085696._2
135- let previousRewardPerBlock = $t056085696._3
136- let $t057015780 = getUserInterestInfo(pool, caller)
137- let userLastInterest = $t057015780._1
138- let userShareTokensAmount = $t057015780._2
129+ let $t055375602 = getLastInterestInfo(pool)
130+ let lastInterestHeight = $t055375602._1
131+ let lastInterest = $t055375602._2
132+ let $t056075695 = rewardInfo(pool)
133+ let currentRewardPerBlock = $t056075695._1
134+ let rewardUpdateHeight = $t056075695._2
135+ let previousRewardPerBlock = $t056075695._3
136+ let $t057005779 = getUserInterestInfo(pool, caller)
137+ let userLastInterest = $t057005779._1
138+ let userShareTokensAmount = $t057005779._2
139139 let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue)
140140 let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue)
141141 let userNewInterest = currentInterest
142142 $Tuple4(userNewInterest, currentInterest, claimAmount, userShareTokensAmount)
143143 }
144144
145145
146146 func checkPmtAssetIdCorrect (pool,pmtAssetId) = {
147147 let poolAddres = value(addressFromString(getStringValue(this, (pool + keyPoolAddress))))
148148 let poolShareAssetId = fromBase58String(getStringValue(poolAddres, "share_asset_id"))
149149 if ((pmtAssetId == poolShareAssetId))
150150 then true
151151 else false
152152 }
153153
154154
155155 @Callable(i)
156156 func init () = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
157157 then throw("Only admin can call this function")
158158 else {
159159 let SWOPissue = Issue("SWOP", "SWOP protocol token", 1, 8, true)
160160 let SWOPid = calculateAssetId(SWOPissue)
161161 [Issue("SWOP", "SWOP protocol token", 1, 8, true), StringEntry(keySWOPid, toBase58String(SWOPid))]
162162 }
163163
164164
165165
166166 @Callable(i)
167167 func initPoolShareFarming (pool) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
168168 then throw("Only admin can call this function")
169169 else {
170- let $t071437223 = rewardInfo(pool)
171- let currentReward = $t071437223._1
172- let rewardUpdateHeight = $t071437223._2
173- let previousRewardPerBlock = $t071437223._3
170+ let $t071427222 = rewardInfo(pool)
171+ let currentReward = $t071427222._1
172+ let rewardUpdateHeight = $t071427222._2
173+ let previousRewardPerBlock = $t071427222._3
174174 [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)]
175175 }
176176
177177
178178
179179 @Callable(i)
180180 func lockShareTokens (pool) = {
181- let $t076737748 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
182- let pmtAmount = $t076737748._1
183- let pmtAssetId = $t076737748._2
181+ let $t076727747 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
182+ let pmtAmount = $t076727747._1
183+ let pmtAssetId = $t076727747._2
184184 if (!(checkPmtAssetIdCorrect(pool, pmtAssetId)))
185185 then throw("Incorrect pmtAssetId")
186186 else {
187- let $t078417939 = ClaimCalc(pool, i.caller)
188- let userNewInterest = $t078417939._1
189- let currentInterest = $t078417939._2
190- let claimAmount = $t078417939._3
191- let userShareTokensAmount = $t078417939._4
187+ let $t078407938 = claimCalc(pool, i.caller)
188+ let userNewInterest = $t078407938._1
189+ let currentInterest = $t078407938._2
190+ let claimAmount = $t078407938._3
191+ let userShareTokensAmount = $t078407938._4
192192 let userShareAmountNew = (userShareTokensAmount + pmtAmount)
193193 let availableFundsNew = (userAvailableFunds(pool, i.caller) + claimAmount)
194194 let totalShareAmount = getTotalShareTokenLocked(pool)
195195 let totalShareAmountNew = (totalShareAmount + pmtAmount)
196196 [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)) + "_") + keyAvailableFunds), availableFundsNew)]
197197 }
198198 }
199199
200200
201201
202202 @Callable(i)
203203 func withdrawShareTokens (pool,shareTokensWithdrawAmount) = {
204- let $t088928990 = ClaimCalc(pool, i.caller)
205- let userNewInterest = $t088928990._1
206- let currentInterest = $t088928990._2
207- let claimAmount = $t088928990._3
208- let userShareTokensAmount = $t088928990._4
204+ let $t088918989 = claimCalc(pool, i.caller)
205+ let userNewInterest = $t088918989._1
206+ let currentInterest = $t088918989._2
207+ let claimAmount = $t088918989._3
208+ let userShareTokensAmount = $t088918989._4
209209 if ((shareTokensWithdrawAmount > userShareTokensAmount))
210210 then throw("Withdraw amount more then user locked amount")
211211 else {
212212 let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount)
213213 let availableFundsNew = (userAvailableFunds(pool, i.caller) + claimAmount)
214214 let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id"))
215215 [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry(((((pool + "_") + toString(i.caller)) + "_") + keyAvailableFunds), availableFundsNew), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)]
216216 }
217217 }
218218
219219
220220
221221 @Callable(i)
222222 func claim (pool,claimAmountAsk) = {
223223 let shareTokenLocked = getTotalShareTokenLocked(pool)
224- let $t01000910074 = getLastInterestInfo(pool)
225- let lastInterestHeight = $t01000910074._1
226- let lastInterest = $t01000910074._2
227- let $t01007910243 = rewardInfo(pool)
228- let currentRewardPerBlock = $t01007910243._1
229- let rewardUpdateHeight = $t01007910243._2
230- let previousRewardPerBlock = $t01007910243._3
231- let $t01024810346 = ClaimCalc(pool, i.caller)
232- let userNewInterest = $t01024810346._1
233- let currentInterest = $t01024810346._2
234- let claimAmount = $t01024810346._3
235- let userShareTokensAmount = $t01024810346._4
224+ let $t01000810073 = getLastInterestInfo(pool)
225+ let lastInterestHeight = $t01000810073._1
226+ let lastInterest = $t01000810073._2
227+ let $t01007810242 = rewardInfo(pool)
228+ let currentRewardPerBlock = $t01007810242._1
229+ let rewardUpdateHeight = $t01007810242._2
230+ let previousRewardPerBlock = $t01007810242._3
231+ let $t01024710345 = claimCalc(pool, i.caller)
232+ let userNewInterest = $t01024710345._1
233+ let currentInterest = $t01024710345._2
234+ let claimAmount = $t01024710345._3
235+ let userShareTokensAmount = $t01024710345._4
236236 let availableFund = (userAvailableFunds(pool, i.caller) + claimAmount)
237237 if ((claimAmountAsk > availableFund))
238238 then throw(((("You ask more SWOP then you have. Available SWOP: " + toString(availableFund)) + ". You ask: ") + toString(claimAmountAsk)))
239239 else {
240240 let availableFundsNew = (availableFund - claimAmountAsk)
241241 [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry(((pool + "_") + keyLastInterest), currentInterest), IntegerEntry(((pool + "_") + keyLastInterestHeight), height), IntegerEntry(((((pool + "_") + toString(i.caller)) + "_") + keyAvailableFunds), availableFundsNew), Reissue(SWOP, claimAmountAsk, true), ScriptTransfer(i.caller, claimAmountAsk, SWOP)]
242242 }
243243 }
244244
245245

github/deemru/w8io/026f985 
59.46 ms