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