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