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