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