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