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