tx · CaXfwJr2hzYQj4TKt7WVBkcLhhmgufq2Htx3p3gfU2NG 3MvenppyAqkqbJvpemDnU6P5dvSJ9fvRxRg: -0.01400000 Waves 2020.12.12 18:44 [1305639] smart account 3MvenppyAqkqbJvpemDnU6P5dvSJ9fvRxRg > SELF 0.00000000 Waves
{ "type": 13, "id": "CaXfwJr2hzYQj4TKt7WVBkcLhhmgufq2Htx3p3gfU2NG", "fee": 1400000, "feeAssetId": null, "timestamp": 1607787917688, "version": 1, "sender": "3MvenppyAqkqbJvpemDnU6P5dvSJ9fvRxRg", "senderPublicKey": "38RJPSAs2g6F7P5zT5FJ6BAc1DyReFGja2vkw8rSz3ga", "proofs": [ "4eFzUGjXneCLan6qSGxLYtuw6FMidzXDdPhLfo5tTCLUZJWve9UcZNWC3DUSyf9jKtKTwSCnKZ9kYTy8yRgET82R" ], "script": "base64:AAIEAAAAAAAAABkIAhIAEgMKAQgSAwoBCBIECgIIARIDCgEIAAAAHAAAAAAMYWRtaW5QdWJLZXkxAQAAACAQsOLq5CB1W9qjcQbPak46dbMqu5F1eul3gOhttbJnHwAAAAAMYWRtaW5QdWJLZXkyAQAAACAQsOLq5CB1W9qjcQbPak46dbMqu5F1eul3gOhttbJnHwAAAAAMYWRtaW5QdWJLZXkzAQAAACAQsOLq5CB1W9qjcQbPak46dbMqu5F1eul3gOhttbJnHwAAAAAUYWRtaW5QdWJLZXlTdGFydFN0b3ABAAAAIBCw4urkIHVb2qNxBs9qTjp1syq7kXV66XeA6G21smcfAAAAABJhZG1pblB1YktleVN0YWtpbmcBAAAAIBCw4urkIHVb2qNxBs9qTjp1syq7kXV66XeA6G21smcfAAAAABRrZXlTaGFyZVRva2Vuc0xvY2tlZAIAAAAaX3RvdGFsX3NoYXJlX3Rva2Vuc19sb2NrZWQAAAAAEGtleUN1cnJlbnRSZXdhcmQCAAAAD19jdXJyZW50X3Jld2FyZAAAAAAVa2V5UmV3YXJkVXBkYXRlSGVpZ2h0AgAAABVfcmV3YXJkX3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RJbnRlcmVzdAgFAAAACyR0MDg5ODg5MDg2AAAAAl8yBAAAAAtjbGFpbUFtb3VudAgFAAAACyR0MDg5ODg5MDg2AAAAAl8zBAAAABV1c2VyU2hhcmVUb2tlbnNBbW91bnQIBQAAAAskdDA4OTg4OTA4NgAAAAJfNAMGCQAAAgAAAAEJAAEsAAAAAgIAAAAEMTExMQkAAaQAAAABBQAAAA91c2VyTmV3SW50ZXJlc3QJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAABHBvb2wCAAAAAV8JAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyBQAAABNrZXlVc2VyTGFzdEludGVyZXN0BQAAAA91c2VyTmV3SW50ZXJlc3QJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACBQAAAARwb29sAgAAAAFfBQAAAA9rZXlMYXN0SW50ZXJlc3QFAAAAD2N1cnJlbnRJbnRlcmVzdAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAABHBvb2wCAAAAAV8FAAAAFWtleUxhc3RJbnRlcmVzdEhlaWdodAUAAAAGaGVpZ2h0CQAETAAAAAIJAQAAAAdSZWlzc3VlAAAAAwUAAAAEU1dPUAUAAAALY2xhaW1BbW91bnQGCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAALY2xhaW1BbW91bnQFAAAABFNXT1AFAAAAA25pbAAAAAB7CQIH", "chainId": 84, "height": 1305639, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EXBNqBVAVRJXe896PxgPxBGkFG9VxoFbfifQyXybkaJq Next: 9JojQyMuebZ8NQPdeiu4MtUYpgcfzqt5LCumW2hgoi16 Diff:
Old | New | Differences | |
---|---|---|---|
88 | 88 | else { | |
89 | 89 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
90 | 90 | if (true) | |
91 | - | then throw(toString( | |
91 | + | then throw(toString(1)) | |
92 | 92 | else ((lastInterest * scale8) + fraction(reward, scale8, shareTokenLocked)) | |
93 | 93 | } | |
94 | 94 | else { | |
101 | 101 | ||
102 | 102 | func ClaimCalc (pool,caller) = { | |
103 | 103 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
104 | - | let $ | |
105 | - | let lastInterestHeight = $ | |
106 | - | let lastInterest = $ | |
107 | - | let $ | |
108 | - | let currentRewardPerBlock = $ | |
109 | - | let rewardUpdateHeight = $ | |
110 | - | let previousRewardPerBlock = $ | |
111 | - | let $ | |
112 | - | let userLastInterest = $ | |
113 | - | let userShareTokensAmount = $ | |
104 | + | let $t045954660 = getLastInterestInfo(pool) | |
105 | + | let lastInterestHeight = $t045954660._1 | |
106 | + | let lastInterest = $t045954660._2 | |
107 | + | let $t046654753 = rewardInfo(pool) | |
108 | + | let currentRewardPerBlock = $t046654753._1 | |
109 | + | let rewardUpdateHeight = $t046654753._2 | |
110 | + | let previousRewardPerBlock = $t046654753._3 | |
111 | + | let $t047584837 = getUserInterestInfo(pool, caller) | |
112 | + | let userLastInterest = $t047584837._1 | |
113 | + | let userShareTokensAmount = $t047584837._2 | |
114 | 114 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock) | |
115 | 115 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - (userLastInterest * scale8)), scale8) | |
116 | 116 | let userNewInterest = currentInterest | |
142 | 142 | func initPoolShareLocking (pool) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
143 | 143 | then throw("Only admin can call this function") | |
144 | 144 | else { | |
145 | - | let $ | |
146 | - | let currentReward = $ | |
147 | - | let rewardUpdateHeight = $ | |
148 | - | let previousRewardPerBlock = $ | |
145 | + | let $t061796259 = rewardInfo(pool) | |
146 | + | let currentReward = $t061796259._1 | |
147 | + | let rewardUpdateHeight = $t061796259._2 | |
148 | + | let previousRewardPerBlock = $t061796259._3 | |
149 | 149 | [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)] | |
150 | 150 | } | |
151 | 151 | ||
153 | 153 | ||
154 | 154 | @Callable(i) | |
155 | 155 | func lockShareTokens (pool) = { | |
156 | - | let $ | |
157 | - | let pmtAmount = $ | |
158 | - | let pmtAssetId = $ | |
156 | + | let $t067096784 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
157 | + | let pmtAmount = $t067096784._1 | |
158 | + | let pmtAssetId = $t067096784._2 | |
159 | 159 | if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
160 | 160 | then throw("Incorrect pmtAssetId") | |
161 | 161 | else { | |
162 | - | let $ | |
163 | - | let userNewInterest = $ | |
164 | - | let currentInterest = $ | |
165 | - | let claimAmount = $ | |
166 | - | let userShareTokensAmount = $ | |
162 | + | let $t068776975 = ClaimCalc(pool, i.caller) | |
163 | + | let userNewInterest = $t068776975._1 | |
164 | + | let currentInterest = $t068776975._2 | |
165 | + | let claimAmount = $t068776975._3 | |
166 | + | let userShareTokensAmount = $t068776975._4 | |
167 | 167 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
168 | 168 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
169 | 169 | let totalShareAmountNew = (totalShareAmount + pmtAmount) | |
175 | 175 | ||
176 | 176 | @Callable(i) | |
177 | 177 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
178 | - | let $ | |
179 | - | let userNewInterest = $ | |
180 | - | let currentInterest = $ | |
181 | - | let claimAmount = $ | |
182 | - | let userShareTokensAmount = $ | |
178 | + | let $t077517849 = ClaimCalc(pool, i.caller) | |
179 | + | let userNewInterest = $t077517849._1 | |
180 | + | let currentInterest = $t077517849._2 | |
181 | + | let claimAmount = $t077517849._3 | |
182 | + | let userShareTokensAmount = $t077517849._4 | |
183 | 183 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
184 | 184 | then throw("Withdraw amount more then user locked amount") | |
185 | 185 | else { | |
194 | 194 | @Callable(i) | |
195 | 195 | func claim (pool) = { | |
196 | 196 | let shareTokenLocked = getTotalShareTokenLocked(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 = $ | |
197 | + | let $t087498814 = getLastInterestInfo(pool) | |
198 | + | let lastInterestHeight = $t087498814._1 | |
199 | + | let lastInterest = $t087498814._2 | |
200 | + | let $t088198983 = rewardInfo(pool) | |
201 | + | let currentRewardPerBlock = $t088198983._1 | |
202 | + | let rewardUpdateHeight = $t088198983._2 | |
203 | + | let previousRewardPerBlock = $t088198983._3 | |
204 | + | let $t089889086 = ClaimCalc(pool, i.caller) | |
205 | + | let userNewInterest = $t089889086._1 | |
206 | + | let currentInterest = $t089889086._2 | |
207 | + | let claimAmount = $t089889086._3 | |
208 | + | let userShareTokensAmount = $t089889086._4 | |
209 | 209 | if (true) | |
210 | 210 | then throw(("1111" + toString(userNewInterest))) | |
211 | 211 | else [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry(((pool + "_") + keyLastInterest), currentInterest), IntegerEntry(((pool + "_") + keyLastInterestHeight), height), Reissue(SWOP, claimAmount, true), ScriptTransfer(i.caller, claimAmount, SWOP)] |
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 getTotalShareTokenLocked (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 | 87 | then 0 | |
88 | 88 | else { | |
89 | 89 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
90 | 90 | if (true) | |
91 | - | then throw(toString( | |
91 | + | then throw(toString(1)) | |
92 | 92 | else ((lastInterest * scale8) + fraction(reward, scale8, shareTokenLocked)) | |
93 | 93 | } | |
94 | 94 | else { | |
95 | 95 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
96 | 96 | let interestAfterUpdate = ((lastInterest * scale8) + fraction(rewardAfterLastInterestBeforeReawardUpdate, scale8, shareTokenLocked)) | |
97 | 97 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
98 | 98 | ((interestAfterUpdate * scale8) + fraction(reward, scale8, shareTokenLocked)) | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func ClaimCalc (pool,caller) = { | |
103 | 103 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
104 | - | let $ | |
105 | - | let lastInterestHeight = $ | |
106 | - | let lastInterest = $ | |
107 | - | let $ | |
108 | - | let currentRewardPerBlock = $ | |
109 | - | let rewardUpdateHeight = $ | |
110 | - | let previousRewardPerBlock = $ | |
111 | - | let $ | |
112 | - | let userLastInterest = $ | |
113 | - | let userShareTokensAmount = $ | |
104 | + | let $t045954660 = getLastInterestInfo(pool) | |
105 | + | let lastInterestHeight = $t045954660._1 | |
106 | + | let lastInterest = $t045954660._2 | |
107 | + | let $t046654753 = rewardInfo(pool) | |
108 | + | let currentRewardPerBlock = $t046654753._1 | |
109 | + | let rewardUpdateHeight = $t046654753._2 | |
110 | + | let previousRewardPerBlock = $t046654753._3 | |
111 | + | let $t047584837 = getUserInterestInfo(pool, caller) | |
112 | + | let userLastInterest = $t047584837._1 | |
113 | + | let userShareTokensAmount = $t047584837._2 | |
114 | 114 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock) | |
115 | 115 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - (userLastInterest * scale8)), scale8) | |
116 | 116 | let userNewInterest = currentInterest | |
117 | 117 | $Tuple4(userNewInterest, currentInterest, claimAmount, userShareTokensAmount) | |
118 | 118 | } | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func checkPmtAssetIdCorrect (pool,pmtAssetId) = { | |
122 | 122 | let poolAddres = value(addressFromString(getStringValue(this, (pool + keyPoolAddress)))) | |
123 | 123 | let poolShareAssetId = fromBase58String(getStringValue(poolAddres, "share_asset_id")) | |
124 | 124 | if ((pmtAssetId == poolShareAssetId)) | |
125 | 125 | then true | |
126 | 126 | else false | |
127 | 127 | } | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | @Callable(i) | |
131 | 131 | func init () = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
132 | 132 | then throw("Only admin can call this function") | |
133 | 133 | else { | |
134 | 134 | let SWOPissue = Issue("SWOP", "SWOP protocol token", 1, 8, true) | |
135 | 135 | let SWOPid = calculateAssetId(SWOPissue) | |
136 | 136 | [Issue("SWOP", "SWOP protocol token", 1, 8, true), StringEntry(keySWOPid, toBase58String(SWOPid))] | |
137 | 137 | } | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | ||
141 | 141 | @Callable(i) | |
142 | 142 | func initPoolShareLocking (pool) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
143 | 143 | then throw("Only admin can call this function") | |
144 | 144 | else { | |
145 | - | let $ | |
146 | - | let currentReward = $ | |
147 | - | let rewardUpdateHeight = $ | |
148 | - | let previousRewardPerBlock = $ | |
145 | + | let $t061796259 = rewardInfo(pool) | |
146 | + | let currentReward = $t061796259._1 | |
147 | + | let rewardUpdateHeight = $t061796259._2 | |
148 | + | let previousRewardPerBlock = $t061796259._3 | |
149 | 149 | [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)] | |
150 | 150 | } | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | ||
154 | 154 | @Callable(i) | |
155 | 155 | func lockShareTokens (pool) = { | |
156 | - | let $ | |
157 | - | let pmtAmount = $ | |
158 | - | let pmtAssetId = $ | |
156 | + | let $t067096784 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
157 | + | let pmtAmount = $t067096784._1 | |
158 | + | let pmtAssetId = $t067096784._2 | |
159 | 159 | if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
160 | 160 | then throw("Incorrect pmtAssetId") | |
161 | 161 | else { | |
162 | - | let $ | |
163 | - | let userNewInterest = $ | |
164 | - | let currentInterest = $ | |
165 | - | let claimAmount = $ | |
166 | - | let userShareTokensAmount = $ | |
162 | + | let $t068776975 = ClaimCalc(pool, i.caller) | |
163 | + | let userNewInterest = $t068776975._1 | |
164 | + | let currentInterest = $t068776975._2 | |
165 | + | let claimAmount = $t068776975._3 | |
166 | + | let userShareTokensAmount = $t068776975._4 | |
167 | 167 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
168 | 168 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
169 | 169 | let totalShareAmountNew = (totalShareAmount + pmtAmount) | |
170 | 170 | [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)] | |
171 | 171 | } | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | ||
176 | 176 | @Callable(i) | |
177 | 177 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
178 | - | let $ | |
179 | - | let userNewInterest = $ | |
180 | - | let currentInterest = $ | |
181 | - | let claimAmount = $ | |
182 | - | let userShareTokensAmount = $ | |
178 | + | let $t077517849 = ClaimCalc(pool, i.caller) | |
179 | + | let userNewInterest = $t077517849._1 | |
180 | + | let currentInterest = $t077517849._2 | |
181 | + | let claimAmount = $t077517849._3 | |
182 | + | let userShareTokensAmount = $t077517849._4 | |
183 | 183 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
184 | 184 | then throw("Withdraw amount more then user locked amount") | |
185 | 185 | else { | |
186 | 186 | let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount) | |
187 | 187 | let shareTokensId = fromBase58String(getStringValue(this, (pool + "share_asset_id"))) | |
188 | 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)] | |
189 | 189 | } | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | ||
194 | 194 | @Callable(i) | |
195 | 195 | func claim (pool) = { | |
196 | 196 | let shareTokenLocked = getTotalShareTokenLocked(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 = $ | |
197 | + | let $t087498814 = getLastInterestInfo(pool) | |
198 | + | let lastInterestHeight = $t087498814._1 | |
199 | + | let lastInterest = $t087498814._2 | |
200 | + | let $t088198983 = rewardInfo(pool) | |
201 | + | let currentRewardPerBlock = $t088198983._1 | |
202 | + | let rewardUpdateHeight = $t088198983._2 | |
203 | + | let previousRewardPerBlock = $t088198983._3 | |
204 | + | let $t089889086 = ClaimCalc(pool, i.caller) | |
205 | + | let userNewInterest = $t089889086._1 | |
206 | + | let currentInterest = $t089889086._2 | |
207 | + | let claimAmount = $t089889086._3 | |
208 | + | let userShareTokensAmount = $t089889086._4 | |
209 | 209 | if (true) | |
210 | 210 | then throw(("1111" + toString(userNewInterest))) | |
211 | 211 | else [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry(((pool + "_") + keyLastInterest), currentInterest), IntegerEntry(((pool + "_") + keyLastInterestHeight), height), Reissue(SWOP, claimAmount, true), ScriptTransfer(i.caller, claimAmount, SWOP)] | |
212 | 212 | } | |
213 | 213 | ||
214 | 214 |
github/deemru/w8io/169f3d6 73.91 ms ◑