tx · G1hGBY1RUws1wpec24yn6bk1cy1PPXb6WbpR91Vb6mTq 3MvenppyAqkqbJvpemDnU6P5dvSJ9fvRxRg: -0.01400000 Waves 2020.12.12 16:46 [1305523] smart account 3MvenppyAqkqbJvpemDnU6P5dvSJ9fvRxRg > SELF 0.00000000 Waves
{ "type": 13, "id": "G1hGBY1RUws1wpec24yn6bk1cy1PPXb6WbpR91Vb6mTq", "fee": 1400000, "feeAssetId": null, "timestamp": 1607780831168, "version": 1, "sender": "3MvenppyAqkqbJvpemDnU6P5dvSJ9fvRxRg", "senderPublicKey": "38RJPSAs2g6F7P5zT5FJ6BAc1DyReFGja2vkw8rSz3ga", "proofs": [ "5bdCWdeepxmBnRJpkNtuzTfDpHyWjE5z62PB93GeuGNdXjeH6nSSu7t2gDfXzfuWkERmEdNYnWmBPK8hzNTvZXTN" ], "script": "base64:AAIEAAAAAAAAABcIAhIDCgEIEgMKAQgSBAoCCAESAwoBCAAAABsAAAAADGFkbWluUHViS2V5MQEAAAAgELDi6uQgdVvao3EGz2pOOnWzKruRdXrpd4DobbWyZx8AAAAADGFkbWluUHViS2V5MgEAAAAgELDi6uQgdVvao3EGz2pOOnWzKruRdXrpd4DobbWyZx8AAAAADGFkbWluUHViS2V5MwEAAAAgELDi6uQgdVvao3EGz2pOOnWzKruRdXrpd4DobbWyZx8AAAAAFGFkbWluUHViS2V5U3RhcnRTdG9wAQAAACAQsOLq5CB1W9qjcQbPak46dbMqu5F1eul3gOhttbJnHwAAAAASYWRtaW5QdWJLZXlTdGFraW5nAQAAACAQsOLq5CB1W9qjcQbPak46dbMqu5F1eul3gOhttbJnHwAAAAAUa2V5U2hhcmVUb2tlbnNMb2NrZWQCAAAAGl90b3RhbF9zaGFyZV90b2tlbnNfbG9ja2VkAAAAABBrZXlDdXJyZW50UmV3YXJkAgAAAA9fY3VycmVudF9yZXdhcmQAAAAAFWtleVJld2FyZFVwZGF0ZUhlaWdodAIAAAAVX3Jld2FyZF91cGRhdGVfaGVpZ2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naHQFAAAABmhlaWdodAkABEwAAAACCQEAAAAHUmVpc3N1ZQAAAAMFAAAABFNXT1AFAAAAC2NsYWltQW1vdW50BgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAC2NsYWltQW1vdW50BQAAAARTV09QBQAAAANuaWwAAAAAbpO51w==", "chainId": 84, "height": 1305523, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4oSjnik2Lg7jFYxa7iEt2YJSfWNBGoSFTBsj5WgYJR91 Next: MEHQBDdbEUf9oTLidacksBrnhqrBjrYmvLAGbV8gWGr Diff:
Old | New | Differences | |
---|---|---|---|
43 | 43 | func throwIsActive () = throw("DApp is already active") | |
44 | 44 | ||
45 | 45 | ||
46 | - | func | |
46 | + | func getTotalShateTokenLocked (pool) = valueOrErrorMessage(getInteger(this, (pool + keyUserShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked)) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func rewardInfo (pool) = { | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getLastInterestInfo (pool) = { | |
58 | - | let lastInterest = valueOrErrorMessage( | |
59 | - | let lastInterestHeight = valueOrErrorMessage( | |
58 | + | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (((("No data on the key: " + pool) + "_") + pool) + keyLastInterest)) | |
59 | + | let lastInterestHeight = valueOrErrorMessage(getInteger(this, (pool + keyLastInterestHeight)), (("No data on the key: " + pool) + keyLastInterestHeight)) | |
60 | 60 | $Tuple2(lastInterestHeight, lastInterest) | |
61 | 61 | } | |
62 | 62 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | func ClaimCalc (pool,caller) = { | |
97 | - | let shareTokenLocked = | |
98 | - | let $ | |
99 | - | let lastInterestHeight = $ | |
100 | - | let lastInterest = $ | |
101 | - | let $ | |
102 | - | let currentRewardPerBlock = $ | |
103 | - | let rewardUpdateHeight = $ | |
104 | - | let previousRewardPerBlock = $ | |
105 | - | let $ | |
106 | - | let userLastInterest = $ | |
107 | - | let userShareTokensAmount = $ | |
97 | + | let shareTokenLocked = getTotalShateTokenLocked(pool) | |
98 | + | let $t044354500 = getLastInterestInfo(pool) | |
99 | + | let lastInterestHeight = $t044354500._1 | |
100 | + | let lastInterest = $t044354500._2 | |
101 | + | let $t045054593 = rewardInfo(pool) | |
102 | + | let currentRewardPerBlock = $t045054593._1 | |
103 | + | let rewardUpdateHeight = $t045054593._2 | |
104 | + | let previousRewardPerBlock = $t045054593._3 | |
105 | + | let $t045984677 = getUserInterestInfo(pool, caller) | |
106 | + | let userLastInterest = $t045984677._1 | |
107 | + | let userShareTokensAmount = $t045984677._2 | |
108 | 108 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock) | |
109 | 109 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - (userLastInterest * scale8)), scale8) | |
110 | 110 | let userNewInterest = currentInterest | |
125 | 125 | func initPoolShareLocking (pool) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
126 | 126 | then throw("Only admin can call this function") | |
127 | 127 | else { | |
128 | - | let $ | |
129 | - | let currentReward = $ | |
130 | - | let rewardUpdateHeight = $ | |
131 | - | let previousRewardPerBlock = $ | |
128 | + | let $t055975677 = rewardInfo(pool) | |
129 | + | let currentReward = $t055975677._1 | |
130 | + | let rewardUpdateHeight = $t055975677._2 | |
131 | + | let previousRewardPerBlock = $t055975677._3 | |
132 | 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)] | |
133 | 133 | } | |
134 | 134 | ||
136 | 136 | ||
137 | 137 | @Callable(i) | |
138 | 138 | func lockShareTokens (pool) = { | |
139 | - | let $ | |
140 | - | let pmtAmount = $ | |
141 | - | let pmtAssetId = $ | |
139 | + | let $t061286203 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
140 | + | let pmtAmount = $t061286203._1 | |
141 | + | let pmtAssetId = $t061286203._2 | |
142 | 142 | if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
143 | 143 | then throw("Incorrect pmtAssetId") | |
144 | 144 | else { | |
145 | - | let $ | |
146 | - | let userNewInterest = $ | |
147 | - | let currentInterest = $ | |
148 | - | let claimAmount = $ | |
149 | - | let userShareTokensAmount = $ | |
145 | + | let $t062966394 = ClaimCalc(pool, i.caller) | |
146 | + | let userNewInterest = $t062966394._1 | |
147 | + | let currentInterest = $t062966394._2 | |
148 | + | let claimAmount = $t062966394._3 | |
149 | + | let userShareTokensAmount = $t062966394._4 | |
150 | 150 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
151 | 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)] | |
152 | 152 | } | |
156 | 156 | ||
157 | 157 | @Callable(i) | |
158 | 158 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
159 | - | let $ | |
160 | - | let userNewInterest = $ | |
161 | - | let currentInterest = $ | |
162 | - | let claimAmount = $ | |
163 | - | let userShareTokensAmount = $ | |
159 | + | let $t069787076 = ClaimCalc(pool, i.caller) | |
160 | + | let userNewInterest = $t069787076._1 | |
161 | + | let currentInterest = $t069787076._2 | |
162 | + | let claimAmount = $t069787076._3 | |
163 | + | let userShareTokensAmount = $t069787076._4 | |
164 | 164 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
165 | 165 | then throw("Withdraw amount more then user locked amount") | |
166 | 166 | else { | |
174 | 174 | ||
175 | 175 | @Callable(i) | |
176 | 176 | func claim (pool) = { | |
177 | - | let shareTokenLocked = | |
178 | - | let $ | |
179 | - | let lastInterestHeight = $ | |
180 | - | let lastInterest = $ | |
181 | - | let $ | |
182 | - | let currentRewardPerBlock = $ | |
183 | - | let rewardUpdateHeight = $ | |
184 | - | let previousRewardPerBlock = $ | |
185 | - | let $ | |
186 | - | let userLastInterest = $ | |
187 | - | let userShare = $ | |
177 | + | let shareTokenLocked = getTotalShateTokenLocked(pool) | |
178 | + | let $t079768041 = getLastInterestInfo(pool) | |
179 | + | let lastInterestHeight = $t079768041._1 | |
180 | + | let lastInterest = $t079768041._2 | |
181 | + | let $t080468135 = rewardInfo(pool) | |
182 | + | let currentRewardPerBlock = $t080468135._1 | |
183 | + | let rewardUpdateHeight = $t080468135._2 | |
184 | + | let previousRewardPerBlock = $t080468135._3 | |
185 | + | let $t081408209 = getUserInterestInfo(pool, i.caller) | |
186 | + | let userLastInterest = $t081408209._1 | |
187 | + | let userShare = $t081408209._2 | |
188 | 188 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock) | |
189 | 189 | let claimAmount = fraction(userShare, (currentInterest - (userLastInterest * scale8)), scale8) | |
190 | 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 | |
46 | + | func getTotalShateTokenLocked (pool) = valueOrErrorMessage(getInteger(this, (pool + keyUserShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked)) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func rewardInfo (pool) = { | |
50 | 50 | let currentReward = valueOrErrorMessage(getInteger(votingAddress, (pool + keyCurrentReward)), (((("No data on the key: " + pool) + keyCurrentReward) + " at address ") + toString(votingAddress))) | |
51 | 51 | let rewardUpdateHeight = valueOrErrorMessage(getInteger(votingAddress, (pool + keyRewardUpdateHeight)), (((("No data on the key: " + pool) + keyRewardUpdateHeight) + " at address ") + toString(votingAddress))) | |
52 | 52 | let rewardPreviousAmount = valueOrErrorMessage(getInteger(votingAddress, (pool + keyRewardUpdateHeight)), (((("No data on the key: " + pool) + keyPreviousReward) + " at address ") + toString(votingAddress))) | |
53 | 53 | $Tuple3(currentReward, rewardUpdateHeight, rewardPreviousAmount) | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getLastInterestInfo (pool) = { | |
58 | - | let lastInterest = valueOrErrorMessage( | |
59 | - | let lastInterestHeight = valueOrErrorMessage( | |
58 | + | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (((("No data on the key: " + pool) + "_") + pool) + keyLastInterest)) | |
59 | + | let lastInterestHeight = valueOrErrorMessage(getInteger(this, (pool + keyLastInterestHeight)), (("No data on the key: " + pool) + keyLastInterestHeight)) | |
60 | 60 | $Tuple2(lastInterestHeight, lastInterest) | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func getUserInterestInfo (pool,userAddres) = { | |
65 | 65 | let userLastInterest = getInteger(this, (((pool + "_") + toString(userAddres)) + keyUserLastInterest)) | |
66 | 66 | let userShare = getInteger(this, (((pool + "_") + toString(userAddres)) + keyUserShareTokensLocked)) | |
67 | 67 | let userLastInterestValue = match userLastInterest { | |
68 | 68 | case userLastInterest: Int => | |
69 | 69 | userLastInterest | |
70 | 70 | case _ => | |
71 | 71 | 0 | |
72 | 72 | } | |
73 | 73 | let userShareTokensAmount = match userShare { | |
74 | 74 | case userShare: Int => | |
75 | 75 | userShare | |
76 | 76 | case _ => | |
77 | 77 | 0 | |
78 | 78 | } | |
79 | 79 | $Tuple2(userLastInterestValue, userShareTokensAmount) | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func calcInterest (lastInterestHeight,rewardUpdateHeight,lastInterest,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock) = if ((lastInterestHeight > rewardUpdateHeight)) | |
84 | 84 | then { | |
85 | 85 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
86 | 86 | ((lastInterest * scale8) + fraction(reward, scale8, shareTokenLocked)) | |
87 | 87 | } | |
88 | 88 | else { | |
89 | 89 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
90 | 90 | let interestAfterUpdate = ((lastInterest * scale8) + fraction(rewardAfterLastInterestBeforeReawardUpdate, scale8, shareTokenLocked)) | |
91 | 91 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
92 | 92 | ((interestAfterUpdate * scale8) + fraction(reward, scale8, shareTokenLocked)) | |
93 | 93 | } | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func ClaimCalc (pool,caller) = { | |
97 | - | let shareTokenLocked = | |
98 | - | let $ | |
99 | - | let lastInterestHeight = $ | |
100 | - | let lastInterest = $ | |
101 | - | let $ | |
102 | - | let currentRewardPerBlock = $ | |
103 | - | let rewardUpdateHeight = $ | |
104 | - | let previousRewardPerBlock = $ | |
105 | - | let $ | |
106 | - | let userLastInterest = $ | |
107 | - | let userShareTokensAmount = $ | |
97 | + | let shareTokenLocked = getTotalShateTokenLocked(pool) | |
98 | + | let $t044354500 = getLastInterestInfo(pool) | |
99 | + | let lastInterestHeight = $t044354500._1 | |
100 | + | let lastInterest = $t044354500._2 | |
101 | + | let $t045054593 = rewardInfo(pool) | |
102 | + | let currentRewardPerBlock = $t045054593._1 | |
103 | + | let rewardUpdateHeight = $t045054593._2 | |
104 | + | let previousRewardPerBlock = $t045054593._3 | |
105 | + | let $t045984677 = getUserInterestInfo(pool, caller) | |
106 | + | let userLastInterest = $t045984677._1 | |
107 | + | let userShareTokensAmount = $t045984677._2 | |
108 | 108 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock) | |
109 | 109 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - (userLastInterest * scale8)), scale8) | |
110 | 110 | let userNewInterest = currentInterest | |
111 | 111 | $Tuple4(userNewInterest, currentInterest, claimAmount, userShareTokensAmount) | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func checkPmtAssetIdCorrect (pool,pmtAssetId) = { | |
116 | 116 | let poolAddres = value(addressFromString(getStringValue(this, (pool + keyPoolAddress)))) | |
117 | 117 | let poolShareAssetId = fromBase58String(getStringValue(poolAddres, "share_asset_id")) | |
118 | 118 | if ((pmtAssetId == poolShareAssetId)) | |
119 | 119 | then true | |
120 | 120 | else false | |
121 | 121 | } | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | @Callable(i) | |
125 | 125 | func initPoolShareLocking (pool) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
126 | 126 | then throw("Only admin can call this function") | |
127 | 127 | else { | |
128 | - | let $ | |
129 | - | let currentReward = $ | |
130 | - | let rewardUpdateHeight = $ | |
131 | - | let previousRewardPerBlock = $ | |
128 | + | let $t055975677 = rewardInfo(pool) | |
129 | + | let currentReward = $t055975677._1 | |
130 | + | let rewardUpdateHeight = $t055975677._2 | |
131 | + | let previousRewardPerBlock = $t055975677._3 | |
132 | 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)] | |
133 | 133 | } | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | ||
137 | 137 | @Callable(i) | |
138 | 138 | func lockShareTokens (pool) = { | |
139 | - | let $ | |
140 | - | let pmtAmount = $ | |
141 | - | let pmtAssetId = $ | |
139 | + | let $t061286203 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
140 | + | let pmtAmount = $t061286203._1 | |
141 | + | let pmtAssetId = $t061286203._2 | |
142 | 142 | if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
143 | 143 | then throw("Incorrect pmtAssetId") | |
144 | 144 | else { | |
145 | - | let $ | |
146 | - | let userNewInterest = $ | |
147 | - | let currentInterest = $ | |
148 | - | let claimAmount = $ | |
149 | - | let userShareTokensAmount = $ | |
145 | + | let $t062966394 = ClaimCalc(pool, i.caller) | |
146 | + | let userNewInterest = $t062966394._1 | |
147 | + | let currentInterest = $t062966394._2 | |
148 | + | let claimAmount = $t062966394._3 | |
149 | + | let userShareTokensAmount = $t062966394._4 | |
150 | 150 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
151 | 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)] | |
152 | 152 | } | |
153 | 153 | } | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | ||
157 | 157 | @Callable(i) | |
158 | 158 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
159 | - | let $ | |
160 | - | let userNewInterest = $ | |
161 | - | let currentInterest = $ | |
162 | - | let claimAmount = $ | |
163 | - | let userShareTokensAmount = $ | |
159 | + | let $t069787076 = ClaimCalc(pool, i.caller) | |
160 | + | let userNewInterest = $t069787076._1 | |
161 | + | let currentInterest = $t069787076._2 | |
162 | + | let claimAmount = $t069787076._3 | |
163 | + | let userShareTokensAmount = $t069787076._4 | |
164 | 164 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
165 | 165 | then throw("Withdraw amount more then user locked amount") | |
166 | 166 | else { | |
167 | 167 | let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount) | |
168 | 168 | let shareTokensId = fromBase58String(getStringValue(this, (pool + "share_asset_id"))) | |
169 | 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)] | |
170 | 170 | } | |
171 | 171 | } | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | ||
175 | 175 | @Callable(i) | |
176 | 176 | func claim (pool) = { | |
177 | - | let shareTokenLocked = | |
178 | - | let $ | |
179 | - | let lastInterestHeight = $ | |
180 | - | let lastInterest = $ | |
181 | - | let $ | |
182 | - | let currentRewardPerBlock = $ | |
183 | - | let rewardUpdateHeight = $ | |
184 | - | let previousRewardPerBlock = $ | |
185 | - | let $ | |
186 | - | let userLastInterest = $ | |
187 | - | let userShare = $ | |
177 | + | let shareTokenLocked = getTotalShateTokenLocked(pool) | |
178 | + | let $t079768041 = getLastInterestInfo(pool) | |
179 | + | let lastInterestHeight = $t079768041._1 | |
180 | + | let lastInterest = $t079768041._2 | |
181 | + | let $t080468135 = rewardInfo(pool) | |
182 | + | let currentRewardPerBlock = $t080468135._1 | |
183 | + | let rewardUpdateHeight = $t080468135._2 | |
184 | + | let previousRewardPerBlock = $t080468135._3 | |
185 | + | let $t081408209 = getUserInterestInfo(pool, i.caller) | |
186 | + | let userLastInterest = $t081408209._1 | |
187 | + | let userShare = $t081408209._2 | |
188 | 188 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock) | |
189 | 189 | let claimAmount = fraction(userShare, (currentInterest - (userLastInterest * scale8)), scale8) | |
190 | 190 | let userNewInterest = currentInterest | |
191 | 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)] | |
192 | 192 | } | |
193 | 193 | ||
194 | 194 |
github/deemru/w8io/169f3d6 53.04 ms ◑