tx · FxboGV6S6VJPZ1348nugTskhTgZ7ph7zfjH1LY9iziKM 3MyTUSFjgJWsmoQEBpeF3N1bmtdr2XMS1uU: -0.01400000 Waves 2020.12.12 20:39 [1305761] smart account 3MyTUSFjgJWsmoQEBpeF3N1bmtdr2XMS1uU > SELF 0.00000000 Waves
{ "type": 13, "id": "FxboGV6S6VJPZ1348nugTskhTgZ7ph7zfjH1LY9iziKM", "fee": 1400000, "feeAssetId": null, "timestamp": 1607794824932, "version": 1, "sender": "3MyTUSFjgJWsmoQEBpeF3N1bmtdr2XMS1uU", "senderPublicKey": "HNibf5h44NsszRrbctryRBWzFba3biyjEoufpZuraEha", "proofs": [ "5LE92Z6DanUD3HQZ816MYtRFrGC95CZ8mqyVyyU4CEwVxBCUHuFKNzF6opbEMa1UjSKGMr25q6Syve4jkPLX1wpE" ], "script": "base64:AAIEAAAAAAAAABkIAhIAEgMKAQgSAwoBCBIECgIIARIDCgEIAAAAHQAAAAAMYWRtaW5QdWJLZXkxAQAAACAQsOLq5CB1W9qjcQbPak46dbMqu5F1eul3gOhttbJnHwAAAAAMYWRtaW5QdWJLZXkyAQAAACAQsOLq5CB1W9qjcQbPak46dbMqu5F1eul3gOhttbJnHwAAAAAMYWRtaW5QdWJLZXkzAQAAACAQsOLq5CB1W9qjcQbPak46dbMqu5F1eul3gOhttbJnHwAAAAAUYWRtaW5QdWJLZXlTdGFydFN0b3ABAAAAIBCw4urkIHVb2qNxBs9qTjp1syq7kXV66XeA6G21smcfAAAAABJhZG1pblB1YktleVN0YWtpbmcBAAAAIBCw4urkIHVb2qNxBs9qTjp1syq7kXV66XeA6G21smcfAAAAABRrZXlTaGFyZVRva2Vuc0xvY2tlZAIAAAAaX3RvdGFsX3NoYXJlX3Rva2Vuc19sb2NrZWQAAAAAEGtleUN1cnJlbnRSZXdhcmQCAAAAD19jdXJyZW50X3Jld2FyZAAAAAAVa2V5UmV3YXJkVXBkYXRlSGVpZ2h0AgAAABVfcmV3YXJkX3VwZGF0Z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W50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAARwb29sAgAAAAFfCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgUAAAATa2V5VXNlckxhc3RJbnRlcmVzdAUAAAAPdXNlck5ld0ludGVyZXN0CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgUAAAAEcG9vbAIAAAABXwUAAAAPa2V5TGFzdEludGVyZXN0BQAAAA9jdXJyZW50SW50ZXJlc3QJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACBQAAAARwb29sAgAAAAFfBQAAABVrZXlMYXN0SW50ZXJlc3RIZWlnaHQFAAAABmhlaWdodAkABEwAAAACCQEAAAAHUmVpc3N1ZQAAAAMFAAAABFNXT1AFAAAAC2NsYWltQW1vdW50BgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAC2NsYWltQW1vdW50BQAAAARTV09QBQAAAANuaWwAAAAAMCAlBw==", "chainId": 84, "height": 1305761, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FfJZXb2J3hh4yAV8w9msJARgxcFUD5Y5pa2umG469Ps9 Next: 7ut8xRgyiRo6iAY2ememsD3GyWqiMyGJ3jwFtEjJS7ns Diff:
Old | New | Differences | |
---|---|---|---|
97 | 97 | else { | |
98 | 98 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
99 | 99 | if (true) | |
100 | - | then throw(toString(scaleValue)) | |
100 | + | then throw(((((toString(reward) + " ") + toString(scaleValue)) + " ") + toString(shareTokenLocked))) | |
101 | 101 | else (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
102 | 102 | } | |
103 | 103 | else { | |
112 | 112 | let shareAssetId = getShareAssetId(pool) | |
113 | 113 | let scaleValue = calcScaleValue(SWOP, shareAssetId) | |
114 | 114 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
115 | - | let $ | |
116 | - | let lastInterestHeight = $ | |
117 | - | let lastInterest = $ | |
118 | - | let $ | |
119 | - | let currentRewardPerBlock = $ | |
120 | - | let rewardUpdateHeight = $ | |
121 | - | let previousRewardPerBlock = $ | |
122 | - | let $ | |
123 | - | let userLastInterest = $ | |
124 | - | let userShareTokensAmount = $ | |
115 | + | let $t052425307 = getLastInterestInfo(pool) | |
116 | + | let lastInterestHeight = $t052425307._1 | |
117 | + | let lastInterest = $t052425307._2 | |
118 | + | let $t053125400 = rewardInfo(pool) | |
119 | + | let currentRewardPerBlock = $t053125400._1 | |
120 | + | let rewardUpdateHeight = $t053125400._2 | |
121 | + | let previousRewardPerBlock = $t053125400._3 | |
122 | + | let $t054055484 = getUserInterestInfo(pool, caller) | |
123 | + | let userLastInterest = $t054055484._1 | |
124 | + | let userShareTokensAmount = $t054055484._2 | |
125 | 125 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue) | |
126 | 126 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue) | |
127 | 127 | let userNewInterest = currentInterest | |
153 | 153 | func initPoolShareLocking (pool) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
154 | 154 | then throw("Only admin can call this function") | |
155 | 155 | else { | |
156 | - | let $ | |
157 | - | let currentReward = $ | |
158 | - | let rewardUpdateHeight = $ | |
159 | - | let previousRewardPerBlock = $ | |
156 | + | let $t068476927 = rewardInfo(pool) | |
157 | + | let currentReward = $t068476927._1 | |
158 | + | let rewardUpdateHeight = $t068476927._2 | |
159 | + | let previousRewardPerBlock = $t068476927._3 | |
160 | 160 | [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)] | |
161 | 161 | } | |
162 | 162 | ||
164 | 164 | ||
165 | 165 | @Callable(i) | |
166 | 166 | func lockShareTokens (pool) = { | |
167 | - | let $ | |
168 | - | let pmtAmount = $ | |
169 | - | let pmtAssetId = $ | |
167 | + | let $t073777452 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
168 | + | let pmtAmount = $t073777452._1 | |
169 | + | let pmtAssetId = $t073777452._2 | |
170 | 170 | if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
171 | 171 | then throw("Incorrect pmtAssetId") | |
172 | 172 | else { | |
173 | - | let $ | |
174 | - | let userNewInterest = $ | |
175 | - | let currentInterest = $ | |
176 | - | let claimAmount = $ | |
177 | - | let userShareTokensAmount = $ | |
173 | + | let $t075457643 = ClaimCalc(pool, i.caller) | |
174 | + | let userNewInterest = $t075457643._1 | |
175 | + | let currentInterest = $t075457643._2 | |
176 | + | let claimAmount = $t075457643._3 | |
177 | + | let userShareTokensAmount = $t075457643._4 | |
178 | 178 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
179 | 179 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
180 | 180 | let totalShareAmountNew = (totalShareAmount + pmtAmount) | |
186 | 186 | ||
187 | 187 | @Callable(i) | |
188 | 188 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
189 | - | let $ | |
190 | - | let userNewInterest = $ | |
191 | - | let currentInterest = $ | |
192 | - | let claimAmount = $ | |
193 | - | let userShareTokensAmount = $ | |
189 | + | let $t084198517 = ClaimCalc(pool, i.caller) | |
190 | + | let userNewInterest = $t084198517._1 | |
191 | + | let currentInterest = $t084198517._2 | |
192 | + | let claimAmount = $t084198517._3 | |
193 | + | let userShareTokensAmount = $t084198517._4 | |
194 | 194 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
195 | 195 | then throw("Withdraw amount more then user locked amount") | |
196 | 196 | else { | |
205 | 205 | @Callable(i) | |
206 | 206 | func claim (pool) = { | |
207 | 207 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
208 | - | let $ | |
209 | - | let lastInterestHeight = $ | |
210 | - | let lastInterest = $ | |
211 | - | let $ | |
212 | - | let currentRewardPerBlock = $ | |
213 | - | let rewardUpdateHeight = $ | |
214 | - | let previousRewardPerBlock = $ | |
215 | - | let $ | |
216 | - | let userNewInterest = $ | |
217 | - | let currentInterest = $ | |
218 | - | let claimAmount = $ | |
219 | - | let userShareTokensAmount = $ | |
208 | + | let $t094179482 = getLastInterestInfo(pool) | |
209 | + | let lastInterestHeight = $t094179482._1 | |
210 | + | let lastInterest = $t094179482._2 | |
211 | + | let $t094879651 = rewardInfo(pool) | |
212 | + | let currentRewardPerBlock = $t094879651._1 | |
213 | + | let rewardUpdateHeight = $t094879651._2 | |
214 | + | let previousRewardPerBlock = $t094879651._3 | |
215 | + | let $t0965610062 = ClaimCalc(pool, i.caller) | |
216 | + | let userNewInterest = $t0965610062._1 | |
217 | + | let currentInterest = $t0965610062._2 | |
218 | + | let claimAmount = $t0965610062._3 | |
219 | + | let userShareTokensAmount = $t0965610062._4 | |
220 | 220 | [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry(((pool + "_") + keyLastInterest), currentInterest), IntegerEntry(((pool + "_") + keyLastInterestHeight), height), Reissue(SWOP, claimAmount, true), ScriptTransfer(i.caller, claimAmount, SWOP)] | |
221 | 221 | } | |
222 | 222 |
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_interest" | |
29 | 29 | ||
30 | 30 | let keySWOPid = "SWOP_id" | |
31 | 31 | ||
32 | 32 | let keyPoolAddress = "_address" | |
33 | 33 | ||
34 | 34 | let votingAddress = Address(base58'3N5F5DCmWNzT8ZPe1tBfiXaVYzWJriaJZ9E') | |
35 | 35 | ||
36 | 36 | let SWOP = fromBase58String(getStringValue(this, keySWOPid)) | |
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 | 46 | func getTotalShareTokenLocked (pool) = valueOrErrorMessage(getInteger(this, (pool + keyShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked)) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func getShareAssetId (pool) = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func calcScaleValue (assetId1,assetId2) = { | |
53 | 53 | let assetId1Decimals = value(assetInfo(assetId1)).decimals | |
54 | 54 | let assetId2Decimals = value(assetInfo(assetId2)).decimals | |
55 | 55 | let sclaeDigits = ((assetId2Decimals - assetId1Decimals) + 8) | |
56 | 56 | pow(10, 0, sclaeDigits, 0, 0, HALFDOWN) | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func rewardInfo (pool) = { | |
61 | 61 | let currentReward = valueOrErrorMessage(getInteger(votingAddress, (pool + keyCurrentReward)), (((("No data on the key: " + pool) + keyCurrentReward) + " at address ") + toString(votingAddress))) | |
62 | 62 | let rewardUpdateHeight = valueOrErrorMessage(getInteger(votingAddress, (pool + keyRewardUpdateHeight)), (((("No data on the key: " + pool) + keyRewardUpdateHeight) + " at address ") + toString(votingAddress))) | |
63 | 63 | let rewardPreviousAmount = valueOrErrorMessage(getInteger(votingAddress, (pool + keyRewardUpdateHeight)), (((("No data on the key: " + pool) + keyPreviousReward) + " at address ") + toString(votingAddress))) | |
64 | 64 | $Tuple3(currentReward, rewardUpdateHeight, rewardPreviousAmount) | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func getLastInterestInfo (pool) = { | |
69 | 69 | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (((("No data on the key: " + pool) + "_") + pool) + keyLastInterest)) | |
70 | 70 | let lastInterestHeight = valueOrErrorMessage(getInteger(this, (pool + keyLastInterestHeight)), (("No data on the key: " + pool) + keyLastInterestHeight)) | |
71 | 71 | $Tuple2(lastInterestHeight, lastInterest) | |
72 | 72 | } | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func getUserInterestInfo (pool,userAddres) = { | |
76 | 76 | let userLastInterest = getInteger(this, (((pool + "_") + toString(userAddres)) + keyUserLastInterest)) | |
77 | 77 | let userShare = getInteger(this, (((pool + "_") + toString(userAddres)) + keyUserShareTokensLocked)) | |
78 | 78 | let userLastInterestValue = match userLastInterest { | |
79 | 79 | case userLastInterest: Int => | |
80 | 80 | userLastInterest | |
81 | 81 | case _ => | |
82 | 82 | 0 | |
83 | 83 | } | |
84 | 84 | let userShareTokensAmount = match userShare { | |
85 | 85 | case userShare: Int => | |
86 | 86 | userShare | |
87 | 87 | case _ => | |
88 | 88 | 0 | |
89 | 89 | } | |
90 | 90 | $Tuple2(userLastInterestValue, userShareTokensAmount) | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func calcInterest (lastInterestHeight,rewardUpdateHeight,lastInterest,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,shareAssetId,scaleValue) = if ((lastInterestHeight > rewardUpdateHeight)) | |
95 | 95 | then if ((shareTokenLocked == 0)) | |
96 | 96 | then 0 | |
97 | 97 | else { | |
98 | 98 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
99 | 99 | if (true) | |
100 | - | then throw(toString(scaleValue)) | |
100 | + | then throw(((((toString(reward) + " ") + toString(scaleValue)) + " ") + toString(shareTokenLocked))) | |
101 | 101 | else (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
102 | 102 | } | |
103 | 103 | else { | |
104 | 104 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
105 | 105 | let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked)) | |
106 | 106 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
107 | 107 | (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked)) | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func ClaimCalc (pool,caller) = { | |
112 | 112 | let shareAssetId = getShareAssetId(pool) | |
113 | 113 | let scaleValue = calcScaleValue(SWOP, shareAssetId) | |
114 | 114 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
115 | - | let $ | |
116 | - | let lastInterestHeight = $ | |
117 | - | let lastInterest = $ | |
118 | - | let $ | |
119 | - | let currentRewardPerBlock = $ | |
120 | - | let rewardUpdateHeight = $ | |
121 | - | let previousRewardPerBlock = $ | |
122 | - | let $ | |
123 | - | let userLastInterest = $ | |
124 | - | let userShareTokensAmount = $ | |
115 | + | let $t052425307 = getLastInterestInfo(pool) | |
116 | + | let lastInterestHeight = $t052425307._1 | |
117 | + | let lastInterest = $t052425307._2 | |
118 | + | let $t053125400 = rewardInfo(pool) | |
119 | + | let currentRewardPerBlock = $t053125400._1 | |
120 | + | let rewardUpdateHeight = $t053125400._2 | |
121 | + | let previousRewardPerBlock = $t053125400._3 | |
122 | + | let $t054055484 = getUserInterestInfo(pool, caller) | |
123 | + | let userLastInterest = $t054055484._1 | |
124 | + | let userShareTokensAmount = $t054055484._2 | |
125 | 125 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue) | |
126 | 126 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue) | |
127 | 127 | let userNewInterest = currentInterest | |
128 | 128 | $Tuple4(userNewInterest, currentInterest, claimAmount, userShareTokensAmount) | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func checkPmtAssetIdCorrect (pool,pmtAssetId) = { | |
133 | 133 | let poolAddres = value(addressFromString(getStringValue(this, (pool + keyPoolAddress)))) | |
134 | 134 | let poolShareAssetId = fromBase58String(getStringValue(poolAddres, "share_asset_id")) | |
135 | 135 | if ((pmtAssetId == poolShareAssetId)) | |
136 | 136 | then true | |
137 | 137 | else false | |
138 | 138 | } | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | @Callable(i) | |
142 | 142 | func init () = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
143 | 143 | then throw("Only admin can call this function") | |
144 | 144 | else { | |
145 | 145 | let SWOPissue = Issue("SWOP", "SWOP protocol token", 1, 8, true) | |
146 | 146 | let SWOPid = calculateAssetId(SWOPissue) | |
147 | 147 | [Issue("SWOP", "SWOP protocol token", 1, 8, true), StringEntry(keySWOPid, toBase58String(SWOPid))] | |
148 | 148 | } | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | ||
152 | 152 | @Callable(i) | |
153 | 153 | func initPoolShareLocking (pool) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
154 | 154 | then throw("Only admin can call this function") | |
155 | 155 | else { | |
156 | - | let $ | |
157 | - | let currentReward = $ | |
158 | - | let rewardUpdateHeight = $ | |
159 | - | let previousRewardPerBlock = $ | |
156 | + | let $t068476927 = rewardInfo(pool) | |
157 | + | let currentReward = $t068476927._1 | |
158 | + | let rewardUpdateHeight = $t068476927._2 | |
159 | + | let previousRewardPerBlock = $t068476927._3 | |
160 | 160 | [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)] | |
161 | 161 | } | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | ||
165 | 165 | @Callable(i) | |
166 | 166 | func lockShareTokens (pool) = { | |
167 | - | let $ | |
168 | - | let pmtAmount = $ | |
169 | - | let pmtAssetId = $ | |
167 | + | let $t073777452 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
168 | + | let pmtAmount = $t073777452._1 | |
169 | + | let pmtAssetId = $t073777452._2 | |
170 | 170 | if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
171 | 171 | then throw("Incorrect pmtAssetId") | |
172 | 172 | else { | |
173 | - | let $ | |
174 | - | let userNewInterest = $ | |
175 | - | let currentInterest = $ | |
176 | - | let claimAmount = $ | |
177 | - | let userShareTokensAmount = $ | |
173 | + | let $t075457643 = ClaimCalc(pool, i.caller) | |
174 | + | let userNewInterest = $t075457643._1 | |
175 | + | let currentInterest = $t075457643._2 | |
176 | + | let claimAmount = $t075457643._3 | |
177 | + | let userShareTokensAmount = $t075457643._4 | |
178 | 178 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
179 | 179 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
180 | 180 | let totalShareAmountNew = (totalShareAmount + pmtAmount) | |
181 | 181 | [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)] | |
182 | 182 | } | |
183 | 183 | } | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | ||
187 | 187 | @Callable(i) | |
188 | 188 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
189 | - | let $ | |
190 | - | let userNewInterest = $ | |
191 | - | let currentInterest = $ | |
192 | - | let claimAmount = $ | |
193 | - | let userShareTokensAmount = $ | |
189 | + | let $t084198517 = ClaimCalc(pool, i.caller) | |
190 | + | let userNewInterest = $t084198517._1 | |
191 | + | let currentInterest = $t084198517._2 | |
192 | + | let claimAmount = $t084198517._3 | |
193 | + | let userShareTokensAmount = $t084198517._4 | |
194 | 194 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
195 | 195 | then throw("Withdraw amount more then user locked amount") | |
196 | 196 | else { | |
197 | 197 | let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount) | |
198 | 198 | let shareTokensId = fromBase58String(getStringValue(this, (pool + "share_asset_id"))) | |
199 | 199 | [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)] | |
200 | 200 | } | |
201 | 201 | } | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | ||
205 | 205 | @Callable(i) | |
206 | 206 | func claim (pool) = { | |
207 | 207 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
208 | - | let $ | |
209 | - | let lastInterestHeight = $ | |
210 | - | let lastInterest = $ | |
211 | - | let $ | |
212 | - | let currentRewardPerBlock = $ | |
213 | - | let rewardUpdateHeight = $ | |
214 | - | let previousRewardPerBlock = $ | |
215 | - | let $ | |
216 | - | let userNewInterest = $ | |
217 | - | let currentInterest = $ | |
218 | - | let claimAmount = $ | |
219 | - | let userShareTokensAmount = $ | |
208 | + | let $t094179482 = getLastInterestInfo(pool) | |
209 | + | let lastInterestHeight = $t094179482._1 | |
210 | + | let lastInterest = $t094179482._2 | |
211 | + | let $t094879651 = rewardInfo(pool) | |
212 | + | let currentRewardPerBlock = $t094879651._1 | |
213 | + | let rewardUpdateHeight = $t094879651._2 | |
214 | + | let previousRewardPerBlock = $t094879651._3 | |
215 | + | let $t0965610062 = ClaimCalc(pool, i.caller) | |
216 | + | let userNewInterest = $t0965610062._1 | |
217 | + | let currentInterest = $t0965610062._2 | |
218 | + | let claimAmount = $t0965610062._3 | |
219 | + | let userShareTokensAmount = $t0965610062._4 | |
220 | 220 | [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry(((pool + "_") + keyLastInterest), currentInterest), IntegerEntry(((pool + "_") + keyLastInterestHeight), height), Reissue(SWOP, claimAmount, true), ScriptTransfer(i.caller, claimAmount, SWOP)] | |
221 | 221 | } | |
222 | 222 | ||
223 | 223 |
github/deemru/w8io/169f3d6 50.17 ms ◑