tx · PRJmjby2ZNY38NmUi3xT9REgFgXeBiJc7Qsy7sduBVr

3N9q1aaLDRJf2zTTccfVqD5bSF9hQydZvP1:  -0.01400000 Waves

2020.12.12 22:26 [1305867] smart account 3N9q1aaLDRJf2zTTccfVqD5bSF9hQydZvP1 > SELF 0.00000000 Waves

{ "type": 13, "id": "PRJmjby2ZNY38NmUi3xT9REgFgXeBiJc7Qsy7sduBVr", "fee": 1400000, "feeAssetId": null, "timestamp": 1607801213966, "version": 1, "sender": "3N9q1aaLDRJf2zTTccfVqD5bSF9hQydZvP1", "senderPublicKey": "82Sso9xbbsrJ73fRXMFvLEyaw7ZapdR75hNjSpxUUkiq", "proofs": [ "etvcV5VmeQGTinS6D9LcAJ17vnbnQ24uqutSEAK2JAKyeFAuEfYmX2ob94QFb5DyNPEPe51VxTswfRd3mm2cApF" ], "script": "base64:AAIEAAAAAAAAABoIAhIAEgMKAQgSAwoBCBIECgIIARIECgIIAQAAAB8AAAAADGFkbWluUHViS2V5MQEAAAAgELDi6uQgdVvao3EGz2pOOnWzKruRdXrpd4DobbWyZx8AAAAADGFkbWluUHViS2V5MgEAAAAgELDi6uQgdVvao3EGz2pOOnWzKruRdXrpd4DobbWyZx8AAAAADGFkbWluUHViS2V5MwEAAAAgELDi6uQgdVvao3EGz2pOOnWzKruRdXrpd4DobbWyZx8AAAAAFGFkbWluUHViS2V5U3RhcnRTdG9wAQAAACAQsOLq5CB1W9qjcQbPak46dbMqu5F1eul3gOhttbJnHwAAAAASYWRtaW5QdWJLZXlTdGFraW5nAQAAACAQsOLq5CB1W9qjcQbPak46dbMqu5F1eul3gOhttbJnHwAAAAAUa2V5U2hhcmVUb2tlbnNMb2NrZWQCAAAAGl90b3RhbF9zaGFyZV90b2tlbnNfbG9ja2VkAAAAABBrZXlDdXJyZW50UmV3YXJkAgAAAA9fY3VycmVudF9yZXdhcmQAAAAAFWtleVJld2FyZFVwZGF0ZUhlaWdodAIAAAAVX3Jld2FyZF91cGRhdGVfaGVpZ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JAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAOY2xhaW1BbW91bnRBc2sFAAAABFNXT1AFAAAAA25pbAAAAABix20m", "chainId": 84, "height": 1305867, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CYg8fAYNMmysbH6NRXgpuipz1RJQmMghs5yYHmhQ8TB5 Next: Ckhk43HZnRk1ovDFCMKk2W79krDWEWktZwhsQbFDUKuW Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let adminPubKey1 = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU'
55
66 let adminPubKey2 = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU'
77
88 let adminPubKey3 = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU'
99
1010 let adminPubKeyStartStop = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU'
1111
1212 let adminPubKeyStaking = base58'289xpUrYrKbLjaKkqH3XNhfecukcYRaDRT3JDrvkvQRU'
1313
1414 let keyShareTokensLocked = "_total_share_tokens_locked"
1515
1616 let keyCurrentReward = "_current_reward"
1717
1818 let keyRewardUpdateHeight = "_reward_update_height"
1919
2020 let keyPreviousReward = "_previous_reward"
2121
2222 let keyLastInterest = "_last_interest"
2323
2424 let keyLastInterestHeight = "_last_interest_height"
2525
2626 let keyUserShareTokensLocked = "_share_tokens_locked"
2727
2828 let keyUserLastInterest = "_last_interest"
2929
3030 let keySWOPid = "SWOP_id"
3131
3232 let keyPoolAddress = "_address"
3333
3434 let keyAvailableFunds = "_available_funds"
3535
3636 let votingAddress = Address(base58'3N5F5DCmWNzT8ZPe1tBfiXaVYzWJriaJZ9E')
3737
3838 let SWOP = fromBase58String(getStringValue(this, keySWOPid))
3939
4040 let heightRewardUpdate = getIntegerValue(this, "height_reward_update")
4141
4242 func throwOnlyAdmin () = throw("Only admin can call this function")
4343
4444
4545 func throwIsActive () = throw("DApp is already active")
4646
4747
4848 func getTotalShareTokenLocked (pool) = valueOrErrorMessage(getInteger(this, (pool + keyShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked))
4949
5050
5151 func getShareAssetId (pool) = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id"))
5252
5353
5454 func calcScaleValue (assetId1,assetId2) = {
5555 let assetId1Decimals = value(assetInfo(assetId1)).decimals
5656 let assetId2Decimals = value(assetInfo(assetId2)).decimals
5757 let sclaeDigits = ((assetId2Decimals - assetId1Decimals) + 8)
5858 pow(10, 0, sclaeDigits, 0, 0, HALFDOWN)
5959 }
6060
6161
6262 func userAvailableFunds (pool,user) = {
6363 let availableFunds = getInteger(this, ((((pool + "_") + toString(user)) + "_") + keyAvailableFunds))
6464 let avbF = match availableFunds {
6565 case avbF: Int =>
6666 avbF
6767 case avbF: Unit =>
6868 0
6969 case _ =>
7070 throw("Match error")
7171 }
7272 avbF
7373 }
7474
7575
7676 func rewardInfo (pool) = {
7777 let currentReward = valueOrErrorMessage(getInteger(votingAddress, (pool + keyCurrentReward)), (((("No data on the key: " + pool) + keyCurrentReward) + " at address ") + toString(votingAddress)))
7878 let rewardUpdateHeight = valueOrErrorMessage(getInteger(votingAddress, (pool + keyRewardUpdateHeight)), (((("No data on the key: " + pool) + keyRewardUpdateHeight) + " at address ") + toString(votingAddress)))
7979 let rewardPreviousAmount = valueOrErrorMessage(getInteger(votingAddress, (pool + keyRewardUpdateHeight)), (((("No data on the key: " + pool) + keyPreviousReward) + " at address ") + toString(votingAddress)))
8080 $Tuple3(currentReward, rewardUpdateHeight, rewardPreviousAmount)
8181 }
8282
8383
8484 func getLastInterestInfo (pool) = {
8585 let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (((("No data on the key: " + pool) + "_") + pool) + keyLastInterest))
8686 let lastInterestHeight = valueOrErrorMessage(getInteger(this, (pool + keyLastInterestHeight)), (("No data on the key: " + pool) + keyLastInterestHeight))
8787 $Tuple2(lastInterestHeight, lastInterest)
8888 }
8989
9090
9191 func getUserInterestInfo (pool,userAddres) = {
9292 let userLastInterest = getInteger(this, (((pool + "_") + toString(userAddres)) + keyUserLastInterest))
9393 let userShare = getInteger(this, (((pool + "_") + toString(userAddres)) + keyUserShareTokensLocked))
9494 let userLastInterestValue = match userLastInterest {
9595 case userLastInterest: Int =>
9696 userLastInterest
9797 case _ =>
9898 0
9999 }
100100 let userShareTokensAmount = match userShare {
101101 case userShare: Int =>
102102 userShare
103103 case _ =>
104104 0
105105 }
106106 $Tuple2(userLastInterestValue, userShareTokensAmount)
107107 }
108108
109109
110110 func calcInterest (lastInterestHeight,rewardUpdateHeight,lastInterest,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,shareAssetId,scaleValue) = if ((lastInterestHeight > rewardUpdateHeight))
111111 then if ((shareTokenLocked == 0))
112112 then 0
113113 else {
114114 let reward = (currentRewardPerBlock * (height - lastInterestHeight))
115115 (lastInterest + fraction(reward, scaleValue, shareTokenLocked))
116116 }
117117 else {
118118 let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight))
119119 let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked))
120120 let reward = (currentRewardPerBlock * (height - rewardUpdateHeight))
121121 (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked))
122122 }
123123
124124
125125 func ClaimCalc (pool,caller) = {
126126 let shareAssetId = getShareAssetId(pool)
127127 let scaleValue = calcScaleValue(SWOP, shareAssetId)
128128 let shareTokenLocked = getTotalShareTokenLocked(pool)
129129 let $t055385603 = getLastInterestInfo(pool)
130130 let lastInterestHeight = $t055385603._1
131131 let lastInterest = $t055385603._2
132132 let $t056085696 = rewardInfo(pool)
133133 let currentRewardPerBlock = $t056085696._1
134134 let rewardUpdateHeight = $t056085696._2
135135 let previousRewardPerBlock = $t056085696._3
136136 let $t057015780 = getUserInterestInfo(pool, caller)
137137 let userLastInterest = $t057015780._1
138138 let userShareTokensAmount = $t057015780._2
139139 let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue)
140140 let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue)
141141 let userNewInterest = currentInterest
142142 $Tuple4(userNewInterest, currentInterest, claimAmount, userShareTokensAmount)
143143 }
144144
145145
146146 func checkPmtAssetIdCorrect (pool,pmtAssetId) = {
147147 let poolAddres = value(addressFromString(getStringValue(this, (pool + keyPoolAddress))))
148148 let poolShareAssetId = fromBase58String(getStringValue(poolAddres, "share_asset_id"))
149149 if ((pmtAssetId == poolShareAssetId))
150150 then true
151151 else false
152152 }
153153
154154
155155 @Callable(i)
156156 func init () = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
157157 then throw("Only admin can call this function")
158158 else {
159159 let SWOPissue = Issue("SWOP", "SWOP protocol token", 1, 8, true)
160160 let SWOPid = calculateAssetId(SWOPissue)
161161 [Issue("SWOP", "SWOP protocol token", 1, 8, true), StringEntry(keySWOPid, toBase58String(SWOPid))]
162162 }
163163
164164
165165
166166 @Callable(i)
167167 func initPoolShareLocking (pool) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
168168 then throw("Only admin can call this function")
169169 else {
170170 let $t071437223 = rewardInfo(pool)
171171 let currentReward = $t071437223._1
172172 let rewardUpdateHeight = $t071437223._2
173173 let previousRewardPerBlock = $t071437223._3
174174 [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)]
175175 }
176176
177177
178178
179179 @Callable(i)
180180 func lockShareTokens (pool) = {
181181 let $t076737748 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
182182 let pmtAmount = $t076737748._1
183183 let pmtAssetId = $t076737748._2
184184 if (!(checkPmtAssetIdCorrect(pool, pmtAssetId)))
185185 then throw("Incorrect pmtAssetId")
186186 else {
187187 let $t078417939 = ClaimCalc(pool, i.caller)
188188 let userNewInterest = $t078417939._1
189189 let currentInterest = $t078417939._2
190190 let claimAmount = $t078417939._3
191191 let userShareTokensAmount = $t078417939._4
192192 let userShareAmountNew = (userShareTokensAmount + pmtAmount)
193193 let availableFundsNew = (userAvailableFunds(pool, i.caller) + claimAmount)
194194 let totalShareAmount = getTotalShareTokenLocked(pool)
195195 let totalShareAmountNew = (totalShareAmount + pmtAmount)
196196 [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), IntegerEntry(((((pool + "_") + toString(i.caller)) + "_") + keyAvailableFunds), availableFundsNew)]
197197 }
198198 }
199199
200200
201201
202202 @Callable(i)
203203 func withdrawShareTokens (pool,shareTokensWithdrawAmount) = {
204204 let $t088938991 = ClaimCalc(pool, i.caller)
205205 let userNewInterest = $t088938991._1
206206 let currentInterest = $t088938991._2
207207 let claimAmount = $t088938991._3
208208 let userShareTokensAmount = $t088938991._4
209209 if ((shareTokensWithdrawAmount > userShareTokensAmount))
210210 then throw("Withdraw amount more then user locked amount")
211211 else {
212212 let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount)
213213 let availableFundsNew = (userAvailableFunds(pool, i.caller) + claimAmount)
214214 let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id"))
215215 [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry(((((pool + "_") + toString(i.caller)) + "_") + keyAvailableFunds), availableFundsNew), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)]
216216 }
217217 }
218218
219219
220220
221221 @Callable(i)
222222 func claim (pool,claimAmountAsk) = {
223223 let shareTokenLocked = getTotalShareTokenLocked(pool)
224224 let $t01001010075 = getLastInterestInfo(pool)
225225 let lastInterestHeight = $t01001010075._1
226226 let lastInterest = $t01001010075._2
227227 let $t01008010244 = rewardInfo(pool)
228228 let currentRewardPerBlock = $t01008010244._1
229229 let rewardUpdateHeight = $t01008010244._2
230230 let previousRewardPerBlock = $t01008010244._3
231231 let $t01024910347 = ClaimCalc(pool, i.caller)
232232 let userNewInterest = $t01024910347._1
233233 let currentInterest = $t01024910347._2
234234 let claimAmount = $t01024910347._3
235235 let userShareTokensAmount = $t01024910347._4
236236 let availableFund = (userAvailableFunds(pool, i.caller) + claimAmount)
237237 if ((claimAmountAsk > availableFund))
238238 then throw(((("You ask more SWOP then you have. Available SWOP: " + toString(availableFund)) + ". You ask: ") + toString(claimAmountAsk)))
239239 else {
240240 let availableFundsNew = (availableFund - claimAmountAsk)
241241 [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry(((pool + "_") + keyLastInterest), currentInterest), IntegerEntry(((pool + "_") + keyLastInterestHeight), height), IntegerEntry(((((pool + "_") + toString(i.caller)) + "_") + keyAvailableFunds), availableFundsNew), Reissue(SWOP, claimAmountAsk, true), ScriptTransfer(i.caller, claimAmountAsk, SWOP)]
242242 }
243243 }
244244
245245

github/deemru/w8io/026f985 
37.18 ms