tx · DxvhVLHzdYaUYCXvd5L28WacPAnaeqFHhA1C9TDcsZa 3MsjAKkxKjxVU4gC1BpJ1jKmAZyRufUCErC: -0.01400000 Waves 2021.04.28 11:08 [1502046] smart account 3MsjAKkxKjxVU4gC1BpJ1jKmAZyRufUCErC > SELF 0.00000000 Waves
{ "type": 13, "id": "DxvhVLHzdYaUYCXvd5L28WacPAnaeqFHhA1C9TDcsZa", "fee": 1400000, "feeAssetId": null, "timestamp": 1619597366408, "version": 2, "chainId": 84, "sender": "3MsjAKkxKjxVU4gC1BpJ1jKmAZyRufUCErC", "senderPublicKey": "FQ5JNhUjFS3Ty3nSykXrGWHDt4NvXJDCv4JQiJ3dXmKa", "proofs": [ "4VAVjZeMKpoCTM8PPDstNipMAR5sDBzJPwmfaBtQFTWAd7y2Pz5gAhJab65es4AZThCz8TCN7DnJVxXQ59owqxPt" ], "script": "base64:AAIEAAAAAAAAACEIAhIDCgEIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgMKAQgAAABKAAAAAAxhZG1pblB1YktleTEBAAAAILoJ1zuJWaTRXaD/8bsz0KrhOWkPy+K9kdY77k9eqOATAAAAAAxhZG1pblB1YktleTIBAAAAIMKRRJmz0rC0DSKlkVi9iLyhN7sIy//djOaU71sWDn5AAAAAAAxhZG1pblB1YktleTMBAAAAII4eFy54sQc79EhOejMoYHYod/yZ5ZIwoyDCz6ir6Q5VAAAAABRrZXlTaGFyZVRva2Vuc0xvY2tlZAIAAAAaX3RvdGFsX3NoYXJlX3Rva2Vuc19sb2NrZWQAAAAAHGtleVJld2FyZFBvb2xGcmFjdGlvbkN1cnJlbnQCAAAAHV9jdXJyZW50X3Bvb2xfZnJhY3Rpb25fcmV3YXJkAAAAAB1rZXlSZXdhcmRQb29sRnJhY3Rpb25QcmV2aW91cwIAAAAeX3ByZXZpb3VzX3Bvb2xfZnJhY3Rpb25fcmV3YXJkAAAAAB1rZXlUb3RhbFJld2FyZFBlckJsb2NrQ3VycmVudAIAAAAedG90YWx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AgAAAAFfCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgUAAAAQa2V5QXZhaWxhYmxlU1dPUAAAAAAAAAAAAAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgUAAAAEcG9vbAIAAAABXwkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIFAAAAGGtleVVzZXJTV09QQ2xhaW1lZEFtb3VudAUAAAAUdXNlckNsYWltZWRBbW91bnROZXcJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAABHBvb2wCAAAAAV8JAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyBQAAABxrZXlVc2VyU1dPUExhc3RDbGFpbWVkQW1vdW50BQAAAAtjbGFpbUFtb3VudAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADWF2YWlsYWJsZUZ1bmQFAAAABFNXT1AFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4CQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleR7TTqU=", "height": 1502046, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BfriY1aHoJmeqHCRgQBssfrfdtn213LV8xynCtetdqmR Next: 5SfFbPUiv9VipdnQKBN3QmB6ZiaaQv8tAaZWNbQhtT7P Diff:
Old | New | Differences | |
---|---|---|---|
39 | 39 | ||
40 | 40 | let keyAPY = "apy" | |
41 | 41 | ||
42 | - | let kPreviousTotalVoteSWOP = "previous_total_ | |
42 | + | let kPreviousTotalVoteSWOP = "previous_total_struc" | |
43 | 43 | ||
44 | 44 | let keySwopYearEmission = "swop_year_emission" | |
45 | 45 | ||
237 | 237 | let shareAssetId = getShareAssetId(pool) | |
238 | 238 | let scaleValue = calcScaleValue(SWOP, shareAssetId) | |
239 | 239 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
240 | - | let $ | |
241 | - | let lastInterestHeight = $ | |
242 | - | let lastInterest = $ | |
243 | - | let $ | |
244 | - | let currentRewardPerBlock = $ | |
245 | - | let rewardUpdateHeight = $ | |
246 | - | let previousRewardPerBlock = $ | |
247 | - | let $ | |
248 | - | let userLastInterest = $ | |
249 | - | let userShareTokensAmount = $ | |
240 | + | let $t01012110186 = getLastInterestInfo(pool) | |
241 | + | let lastInterestHeight = $t01012110186._1 | |
242 | + | let lastInterest = $t01012110186._2 | |
243 | + | let $t01019110279 = rewardInfo(pool) | |
244 | + | let currentRewardPerBlock = $t01019110279._1 | |
245 | + | let rewardUpdateHeight = $t01019110279._2 | |
246 | + | let previousRewardPerBlock = $t01019110279._3 | |
247 | + | let $t01028410363 = getUserInterestInfo(pool, caller) | |
248 | + | let userLastInterest = $t01028410363._1 | |
249 | + | let userShareTokensAmount = $t01028410363._2 | |
250 | 250 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue, pmtAmount) | |
251 | 251 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue) | |
252 | 252 | let userNewInterest = currentInterest | |
255 | 255 | ||
256 | 256 | ||
257 | 257 | func calculateProtocolReward (pool) = { | |
258 | - | let $ | |
259 | - | let lastInterestHeight = $ | |
260 | - | let lastInterest = $ | |
261 | - | let $ | |
262 | - | let currentRewardPerBlock = $ | |
263 | - | let rewardUpdateHeight = $ | |
264 | - | let previousRewardPerBlock = $ | |
258 | + | let $t01083710902 = getLastInterestInfo(pool) | |
259 | + | let lastInterestHeight = $t01083710902._1 | |
260 | + | let lastInterest = $t01083710902._2 | |
261 | + | let $t01090810996 = rewardInfo(pool) | |
262 | + | let currentRewardPerBlock = $t01090810996._1 | |
263 | + | let rewardUpdateHeight = $t01090810996._2 | |
264 | + | let previousRewardPerBlock = $t01090810996._3 | |
265 | 265 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
266 | 266 | if ((shareTokenLocked == 0)) | |
267 | 267 | then 0 | |
310 | 310 | func initPoolShareFarming (pool) = if ((i.caller != this)) | |
311 | 311 | then throw("Only the DApp itself can call this function") | |
312 | 312 | else { | |
313 | - | let $ | |
314 | - | let currentReward = $ | |
315 | - | let rewardUpdateHeight = $ | |
316 | - | let previousRewardPerBlock = $ | |
313 | + | let $t01293113011 = rewardInfo(pool) | |
314 | + | let currentReward = $t01293113011._1 | |
315 | + | let rewardUpdateHeight = $t01293113011._2 | |
316 | + | let previousRewardPerBlock = $t01293113011._3 | |
317 | 317 | [IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyLastInterestHeight), height)] | |
318 | 318 | } | |
319 | 319 | ||
323 | 323 | func updatePoolInterest (pool) = if ((i.caller != wallet)) | |
324 | 324 | then throw("Only the Admin itself can call this function") | |
325 | 325 | else { | |
326 | - | let $ | |
327 | - | let userNewInterest = $ | |
328 | - | let currentInterest = $ | |
329 | - | let claimAmount = $ | |
330 | - | let userShareTokensAmount = $ | |
326 | + | let $t01336013480 = claimCalc(pool, adminIncreaseInterestAddress, 0) | |
327 | + | let userNewInterest = $t01336013480._1 | |
328 | + | let currentInterest = $t01336013480._2 | |
329 | + | let claimAmount = $t01336013480._3 | |
330 | + | let userShareTokensAmount = $t01336013480._4 | |
331 | 331 | [IntegerEntry((pool + keyLastInterest), userNewInterest)] | |
332 | 332 | } | |
333 | 333 | ||
335 | 335 | ||
336 | 336 | @Callable(i) | |
337 | 337 | func lockShareTokens (pool) = { | |
338 | - | let $ | |
339 | - | let pmtAmount = $ | |
340 | - | let pmtAssetId = $ | |
341 | - | let $ | |
342 | - | let userNewInterest = $ | |
343 | - | let currentInterest = $ | |
344 | - | let claimAmount = $ | |
345 | - | let userShareTokensAmount = $ | |
338 | + | let $t01361313688 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
339 | + | let pmtAmount = $t01361313688._1 | |
340 | + | let pmtAssetId = $t01361313688._2 | |
341 | + | let $t01369313801 = claimCalc(pool, i.caller, pmtAmount) | |
342 | + | let userNewInterest = $t01369313801._1 | |
343 | + | let currentInterest = $t01369313801._2 | |
344 | + | let claimAmount = $t01369313801._3 | |
345 | + | let userShareTokensAmount = $t01369313801._4 | |
346 | 346 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
347 | 347 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
348 | 348 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
401 | 401 | @Callable(i) | |
402 | 402 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
403 | 403 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
404 | - | let $ | |
405 | - | let userNewInterest = $ | |
406 | - | let currentInterest = $ | |
407 | - | let claimAmount = $ | |
408 | - | let userShareTokensAmount = $ | |
404 | + | let $t01831718417 = claimCalc(pool, i.caller, 1) | |
405 | + | let userNewInterest = $t01831718417._1 | |
406 | + | let currentInterest = $t01831718417._2 | |
407 | + | let claimAmount = $t01831718417._3 | |
408 | + | let userShareTokensAmount = $t01831718417._4 | |
409 | 409 | let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount) | |
410 | 410 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
411 | 411 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
422 | 422 | @Callable(i) | |
423 | 423 | func claim (pool) = { | |
424 | 424 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
425 | - | let $ | |
426 | - | let lastInterestHeight = $ | |
427 | - | let lastInterest = $ | |
428 | - | let $ | |
429 | - | let currentRewardPerBlock = $ | |
430 | - | let rewardUpdateHeight = $ | |
431 | - | let previousRewardPerBlock = $ | |
432 | - | let $ | |
433 | - | let userNewInterest = $ | |
434 | - | let currentInterest = $ | |
435 | - | let claimAmount = $ | |
436 | - | let userShareTokensAmount = $ | |
425 | + | let $t01991019975 = getLastInterestInfo(pool) | |
426 | + | let lastInterestHeight = $t01991019975._1 | |
427 | + | let lastInterest = $t01991019975._2 | |
428 | + | let $t01998020069 = rewardInfo(pool) | |
429 | + | let currentRewardPerBlock = $t01998020069._1 | |
430 | + | let rewardUpdateHeight = $t01998020069._2 | |
431 | + | let previousRewardPerBlock = $t01998020069._3 | |
432 | + | let $t02007420174 = claimCalc(pool, i.caller, 1) | |
433 | + | let userNewInterest = $t02007420174._1 | |
434 | + | let currentInterest = $t02007420174._2 | |
435 | + | let claimAmount = $t02007420174._3 | |
436 | + | let userShareTokensAmount = $t02007420174._4 | |
437 | 437 | let availableFund = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
438 | 438 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
439 | 439 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminPubKey1 = base58'DXDY2itiEcYBtGkVLnkpHtDFyWQUkoLJz79uJ7ECbMrA' | |
5 | 5 | ||
6 | 6 | let adminPubKey2 = base58'E6Wa1SGoktYcjHjsKrvjMiqJY3SWmGKcD8Q5L8kxSPS7' | |
7 | 7 | ||
8 | 8 | let adminPubKey3 = base58'AZmWJtuy4GeVrMmJH4hfFBRApe1StvhJSk4jcbT6bArQ' | |
9 | 9 | ||
10 | 10 | let keyShareTokensLocked = "_total_share_tokens_locked" | |
11 | 11 | ||
12 | 12 | let keyRewardPoolFractionCurrent = "_current_pool_fraction_reward" | |
13 | 13 | ||
14 | 14 | let keyRewardPoolFractionPrevious = "_previous_pool_fraction_reward" | |
15 | 15 | ||
16 | 16 | let keyTotalRewardPerBlockCurrent = "total_reward_per_block_current" | |
17 | 17 | ||
18 | 18 | let keyTotalRewardPerBlockPrevious = "total_reward_per_block_previous" | |
19 | 19 | ||
20 | 20 | let keyRewardUpdateHeight = "reward_update_height" | |
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 keyUserSWOPClaimedAmount = "_SWOP_claimed_amount" | |
33 | 33 | ||
34 | 34 | let keyUserSWOPLastClaimedAmount = "_SWOP_last_claimed_amount" | |
35 | 35 | ||
36 | 36 | let keyAvailableSWOP = "_available_SWOP" | |
37 | 37 | ||
38 | 38 | let keyFarmingStartHeight = "farming_start_height" | |
39 | 39 | ||
40 | 40 | let keyAPY = "apy" | |
41 | 41 | ||
42 | - | let kPreviousTotalVoteSWOP = "previous_total_ | |
42 | + | let kPreviousTotalVoteSWOP = "previous_total_struc" | |
43 | 43 | ||
44 | 44 | let keySwopYearEmission = "swop_year_emission" | |
45 | 45 | ||
46 | 46 | let keyBalancecpmmA = "A_asset_balance" | |
47 | 47 | ||
48 | 48 | let keyBalancecpmmB = "B_asset_balance" | |
49 | 49 | ||
50 | 50 | let keyAssetIdA = "A_asset_id" | |
51 | 51 | ||
52 | 52 | let keyAssetIdB = "B_asset_id" | |
53 | 53 | ||
54 | 54 | let keyFirstHarvestHeight = "first_harvest_height" | |
55 | 55 | ||
56 | 56 | let keyfirstHarvestCpmm = "first_harvest" | |
57 | 57 | ||
58 | 58 | let governanceAddress = Address(base58'3MzJZEn6jzxCPaHEfkrXd7FhbjTyVjdRPLS') | |
59 | 59 | ||
60 | 60 | let wallet = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
61 | 61 | ||
62 | 62 | let votingAddress = Address(base58'3N6CYoCsxrcXKe75pQvvV3JqJrwJjm1t4QN') | |
63 | 63 | ||
64 | 64 | let swopUsdnAddress = Address(base58'3N4kooq5242vPtJzBDrmukK6ptrjRRjEBWi') | |
65 | 65 | ||
66 | 66 | let wavesUsdnAddress = Address(base58'3MxtJmAsKsfof4X28MJPBtvRUyz1PbCnbhF') | |
67 | 67 | ||
68 | 68 | let adminIncreaseInterestAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
69 | 69 | ||
70 | 70 | let oneWeekInBlock = 10106 | |
71 | 71 | ||
72 | 72 | let totalVoteShare = 10000000000 | |
73 | 73 | ||
74 | 74 | let scaleValue6 = 1000000 | |
75 | 75 | ||
76 | 76 | let scaleValue8 = 100000000 | |
77 | 77 | ||
78 | 78 | func strAssetIdA (pool) = getStringValue(pool, keyAssetIdA) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func strAssetIdB (pool) = getStringValue(pool, keyAssetIdB) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func assetIdA (pool) = if ((strAssetIdA(pool) == "WAVES")) | |
85 | 85 | then unit | |
86 | 86 | else fromBase58String(strAssetIdA(pool)) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func assetIdB (pool) = if ((strAssetIdB(pool) == "WAVES")) | |
90 | 90 | then unit | |
91 | 91 | else fromBase58String(strAssetIdB(pool)) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | let kBasePeriod = "base_period" | |
95 | 95 | ||
96 | 96 | let kPeriodLength = "period_length" | |
97 | 97 | ||
98 | 98 | let kStartHeight = "start_height" | |
99 | 99 | ||
100 | 100 | let kFirstHarvestHeight = "first_harvest_height" | |
101 | 101 | ||
102 | 102 | let kDurationFullVotePower = "duration_full_vote_power" | |
103 | 103 | ||
104 | 104 | let kMinVotePower = "min_vote_power" | |
105 | 105 | ||
106 | 106 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
107 | 107 | ||
108 | 108 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
109 | 109 | ||
110 | 110 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
111 | 111 | ||
112 | 112 | let durationFullVotePower = valueOrErrorMessage(getInteger(votingAddress, kDurationFullVotePower), "Empty kDurationFullVotePower") | |
113 | 113 | ||
114 | 114 | let minVotePower = valueOrErrorMessage(getInteger(votingAddress, kMinVotePower), "Empty kMinVotePower") | |
115 | 115 | ||
116 | 116 | let currPeriod = (basePeriod + ((height - startHeight) / periodLength)) | |
117 | 117 | ||
118 | 118 | let APY = getIntegerValue(this, keyAPY) | |
119 | 119 | ||
120 | 120 | let SwopYearEmission = getIntegerValue(this, keySwopYearEmission) | |
121 | 121 | ||
122 | 122 | func assetNameA (pool) = match assetIdA(pool) { | |
123 | 123 | case id: ByteVector => | |
124 | 124 | value(assetInfo(id)).name | |
125 | 125 | case waves: Unit => | |
126 | 126 | "WAVES" | |
127 | 127 | case _ => | |
128 | 128 | throw("Match error") | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func assetNameB (pool) = match assetIdB(pool) { | |
133 | 133 | case id: ByteVector => | |
134 | 134 | value(assetInfo(id)).name | |
135 | 135 | case waves: Unit => | |
136 | 136 | "WAVES" | |
137 | 137 | case _ => | |
138 | 138 | throw("Match error") | |
139 | 139 | } | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | let SWOP = fromBase58String(getStringValue(this, keySWOPid)) | |
143 | 143 | ||
144 | 144 | func isFirstHarvest (pool) = valueOrElse(getBoolean(pool, keyfirstHarvestCpmm), false) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func getHeightFirstHarvest (pool) = valueOrElse(getInteger(pool, keyFirstHarvestHeight), 0) | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func getBalanceA (pool) = valueOrErrorMessage(getInteger(pool, keyBalancecpmmA), ("No data on the key: " + keyBalancecpmmA)) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func getBalanceB (pool) = valueOrErrorMessage(getInteger(pool, keyBalancecpmmB), ("No data on the key: " + keyBalancecpmmB)) | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func getTotalShareTokenLocked (pool) = valueOrErrorMessage(getInteger(this, (pool + keyShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked)) | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func getShareAssetId (pool) = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func calcScaleValue (assetId1,assetId2) = { | |
163 | 163 | let assetId1Decimals = value(assetInfo(assetId1)).decimals | |
164 | 164 | let assetId2Decimals = value(assetInfo(assetId2)).decimals | |
165 | 165 | let scaleDigits = ((assetId2Decimals - assetId1Decimals) + 8) | |
166 | 166 | pow(10, 0, scaleDigits, 0, 0, HALFDOWN) | |
167 | 167 | } | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func userAvailableSWOP (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyAvailableSWOP)), 0) | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | func rewardInfo (pool) = { | |
174 | 174 | let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger(governanceAddress, keyTotalRewardPerBlockCurrent), ((("No data on the key: " + keyTotalRewardPerBlockCurrent) + " at address ") + toString(governanceAddress))) | |
175 | 175 | let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger(governanceAddress, keyTotalRewardPerBlockPrevious), ((("No data on the key: " + keyTotalRewardPerBlockPrevious) + " at address ") + toString(governanceAddress))) | |
176 | 176 | let rewardPoolFractionCurrent = valueOrErrorMessage(getInteger(governanceAddress, (pool + keyRewardPoolFractionCurrent)), (((("No data on the key: " + pool) + keyRewardPoolFractionCurrent) + " at address ") + toString(governanceAddress))) | |
177 | 177 | let rewardUpdateHeight = valueOrErrorMessage(getInteger(governanceAddress, keyRewardUpdateHeight), ((("No data on the key: " + keyRewardUpdateHeight) + " at address ") + toString(governanceAddress))) | |
178 | 178 | let rewardPoolFractionPrevious = valueOrErrorMessage(getInteger(governanceAddress, (pool + keyRewardPoolFractionPrevious)), (((("No data on the key: " + pool) + keyRewardPoolFractionPrevious) + " at address ") + toString(governanceAddress))) | |
179 | 179 | let rewardPoolCurrent = fraction(totalRewardPerBlockCurrent, rewardPoolFractionCurrent, totalVoteShare) | |
180 | 180 | let rewardPoolPrevious = fraction(totalRewardPerBlockPrevious, rewardPoolFractionPrevious, totalVoteShare) | |
181 | 181 | if (if ((rewardPoolCurrent > totalRewardPerBlockCurrent)) | |
182 | 182 | then true | |
183 | 183 | else (rewardPoolPrevious > totalRewardPerBlockPrevious)) | |
184 | 184 | then throw("rewardPoolCurrent > totalRewardPerBlockCurrent or rewardPoolPrevious > totalRewardPerBlockPrevious") | |
185 | 185 | else $Tuple3(rewardPoolCurrent, rewardUpdateHeight, rewardPoolPrevious) | |
186 | 186 | } | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func getLastInterestInfo (pool) = { | |
190 | 190 | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (("No data on the key: " + pool) + keyLastInterest)) | |
191 | 191 | let lastInterestHeight = valueOrElse(getInteger(this, (pool + keyLastInterestHeight)), height) | |
192 | 192 | $Tuple2(lastInterestHeight, lastInterest) | |
193 | 193 | } | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | func getUserInterestInfo (pool,userAddress) = { | |
197 | 197 | let userLastInterest = getInteger(this, (((pool + "_") + toString(userAddress)) + keyUserLastInterest)) | |
198 | 198 | let userShare = getInteger(this, (((pool + "_") + toString(userAddress)) + keyUserShareTokensLocked)) | |
199 | 199 | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (("No data on the key: " + pool) + keyLastInterest)) | |
200 | 200 | let userLastInterestValue = match userLastInterest { | |
201 | 201 | case userLastInterest: Int => | |
202 | 202 | userLastInterest | |
203 | 203 | case _ => | |
204 | 204 | lastInterest | |
205 | 205 | } | |
206 | 206 | let userShareTokensAmount = match userShare { | |
207 | 207 | case userShare: Int => | |
208 | 208 | userShare | |
209 | 209 | case _ => | |
210 | 210 | 0 | |
211 | 211 | } | |
212 | 212 | $Tuple2(userLastInterestValue, userShareTokensAmount) | |
213 | 213 | } | |
214 | 214 | ||
215 | 215 | ||
216 | 216 | func calcInterest (lastInterestHeight,rewardUpdateHeight,lastInterest,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,shareAssetId,scaleValue,pmtAmount) = if ((shareTokenLocked == 0)) | |
217 | 217 | then 0 | |
218 | 218 | else if ((rewardUpdateHeight > height)) | |
219 | 219 | then { | |
220 | 220 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
221 | 221 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
222 | 222 | } | |
223 | 223 | else if ((lastInterestHeight > rewardUpdateHeight)) | |
224 | 224 | then { | |
225 | 225 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
226 | 226 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
227 | 227 | } | |
228 | 228 | else { | |
229 | 229 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
230 | 230 | let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked)) | |
231 | 231 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
232 | 232 | (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked)) | |
233 | 233 | } | |
234 | 234 | ||
235 | 235 | ||
236 | 236 | func claimCalc (pool,caller,pmtAmount) = { | |
237 | 237 | let shareAssetId = getShareAssetId(pool) | |
238 | 238 | let scaleValue = calcScaleValue(SWOP, shareAssetId) | |
239 | 239 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
240 | - | let $ | |
241 | - | let lastInterestHeight = $ | |
242 | - | let lastInterest = $ | |
243 | - | let $ | |
244 | - | let currentRewardPerBlock = $ | |
245 | - | let rewardUpdateHeight = $ | |
246 | - | let previousRewardPerBlock = $ | |
247 | - | let $ | |
248 | - | let userLastInterest = $ | |
249 | - | let userShareTokensAmount = $ | |
240 | + | let $t01012110186 = getLastInterestInfo(pool) | |
241 | + | let lastInterestHeight = $t01012110186._1 | |
242 | + | let lastInterest = $t01012110186._2 | |
243 | + | let $t01019110279 = rewardInfo(pool) | |
244 | + | let currentRewardPerBlock = $t01019110279._1 | |
245 | + | let rewardUpdateHeight = $t01019110279._2 | |
246 | + | let previousRewardPerBlock = $t01019110279._3 | |
247 | + | let $t01028410363 = getUserInterestInfo(pool, caller) | |
248 | + | let userLastInterest = $t01028410363._1 | |
249 | + | let userShareTokensAmount = $t01028410363._2 | |
250 | 250 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue, pmtAmount) | |
251 | 251 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue) | |
252 | 252 | let userNewInterest = currentInterest | |
253 | 253 | $Tuple4(userNewInterest, currentInterest, claimAmount, userShareTokensAmount) | |
254 | 254 | } | |
255 | 255 | ||
256 | 256 | ||
257 | 257 | func calculateProtocolReward (pool) = { | |
258 | - | let $ | |
259 | - | let lastInterestHeight = $ | |
260 | - | let lastInterest = $ | |
261 | - | let $ | |
262 | - | let currentRewardPerBlock = $ | |
263 | - | let rewardUpdateHeight = $ | |
264 | - | let previousRewardPerBlock = $ | |
258 | + | let $t01083710902 = getLastInterestInfo(pool) | |
259 | + | let lastInterestHeight = $t01083710902._1 | |
260 | + | let lastInterest = $t01083710902._2 | |
261 | + | let $t01090810996 = rewardInfo(pool) | |
262 | + | let currentRewardPerBlock = $t01090810996._1 | |
263 | + | let rewardUpdateHeight = $t01090810996._2 | |
264 | + | let previousRewardPerBlock = $t01090810996._3 | |
265 | 265 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
266 | 266 | if ((shareTokenLocked == 0)) | |
267 | 267 | then 0 | |
268 | 268 | else if ((rewardUpdateHeight > height)) | |
269 | 269 | then { | |
270 | 270 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
271 | 271 | reward | |
272 | 272 | } | |
273 | 273 | else if ((lastInterestHeight > rewardUpdateHeight)) | |
274 | 274 | then { | |
275 | 275 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
276 | 276 | reward | |
277 | 277 | } | |
278 | 278 | else { | |
279 | 279 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
280 | 280 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
281 | 281 | (reward + rewardAfterLastInterestBeforeReawardUpdate) | |
282 | 282 | } | |
283 | 283 | } | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | func checkPmtAssetIdCorrect (pool,pmtAssetId) = { | |
287 | 287 | let poolShareAssetId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
288 | 288 | if ((pmtAssetId == poolShareAssetId)) | |
289 | 289 | then true | |
290 | 290 | else false | |
291 | 291 | } | |
292 | 292 | ||
293 | 293 | ||
294 | 294 | func getUserSWOPClaimedAmount (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyUserSWOPClaimedAmount)), 0) | |
295 | 295 | ||
296 | 296 | ||
297 | 297 | @Callable(i) | |
298 | 298 | func init (earlyLP) = if (isDefined(getString(this, "keySWOPid"))) | |
299 | 299 | then throw("SWOP already initialized") | |
300 | 300 | else { | |
301 | 301 | let initAmount = 100000000000000 | |
302 | 302 | let SWOPissue = Issue("SWOP", "SWOP protocol token", initAmount, 8, true) | |
303 | 303 | let SWOPid = calculateAssetId(SWOPissue) | |
304 | 304 | [Issue("SWOP", "SWOP protocol token", initAmount, 8, true), StringEntry(keySWOPid, toBase58String(SWOPid))] | |
305 | 305 | } | |
306 | 306 | ||
307 | 307 | ||
308 | 308 | ||
309 | 309 | @Callable(i) | |
310 | 310 | func initPoolShareFarming (pool) = if ((i.caller != this)) | |
311 | 311 | then throw("Only the DApp itself can call this function") | |
312 | 312 | else { | |
313 | - | let $ | |
314 | - | let currentReward = $ | |
315 | - | let rewardUpdateHeight = $ | |
316 | - | let previousRewardPerBlock = $ | |
313 | + | let $t01293113011 = rewardInfo(pool) | |
314 | + | let currentReward = $t01293113011._1 | |
315 | + | let rewardUpdateHeight = $t01293113011._2 | |
316 | + | let previousRewardPerBlock = $t01293113011._3 | |
317 | 317 | [IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyLastInterestHeight), height)] | |
318 | 318 | } | |
319 | 319 | ||
320 | 320 | ||
321 | 321 | ||
322 | 322 | @Callable(i) | |
323 | 323 | func updatePoolInterest (pool) = if ((i.caller != wallet)) | |
324 | 324 | then throw("Only the Admin itself can call this function") | |
325 | 325 | else { | |
326 | - | let $ | |
327 | - | let userNewInterest = $ | |
328 | - | let currentInterest = $ | |
329 | - | let claimAmount = $ | |
330 | - | let userShareTokensAmount = $ | |
326 | + | let $t01336013480 = claimCalc(pool, adminIncreaseInterestAddress, 0) | |
327 | + | let userNewInterest = $t01336013480._1 | |
328 | + | let currentInterest = $t01336013480._2 | |
329 | + | let claimAmount = $t01336013480._3 | |
330 | + | let userShareTokensAmount = $t01336013480._4 | |
331 | 331 | [IntegerEntry((pool + keyLastInterest), userNewInterest)] | |
332 | 332 | } | |
333 | 333 | ||
334 | 334 | ||
335 | 335 | ||
336 | 336 | @Callable(i) | |
337 | 337 | func lockShareTokens (pool) = { | |
338 | - | let $ | |
339 | - | let pmtAmount = $ | |
340 | - | let pmtAssetId = $ | |
341 | - | let $ | |
342 | - | let userNewInterest = $ | |
343 | - | let currentInterest = $ | |
344 | - | let claimAmount = $ | |
345 | - | let userShareTokensAmount = $ | |
338 | + | let $t01361313688 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
339 | + | let pmtAmount = $t01361313688._1 | |
340 | + | let pmtAssetId = $t01361313688._2 | |
341 | + | let $t01369313801 = claimCalc(pool, i.caller, pmtAmount) | |
342 | + | let userNewInterest = $t01369313801._1 | |
343 | + | let currentInterest = $t01369313801._2 | |
344 | + | let claimAmount = $t01369313801._3 | |
345 | + | let userShareTokensAmount = $t01369313801._4 | |
346 | 346 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
347 | 347 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
348 | 348 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
349 | 349 | let totalShareAmountNew = (totalShareAmount + pmtAmount) | |
350 | 350 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
351 | 351 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
352 | 352 | let baseEntry = [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyShareTokensLocked), totalShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), availableFundsNew)] | |
353 | 353 | if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
354 | 354 | then throw("Incorrect pmtAssetId") | |
355 | 355 | else if (if (isFirstHarvest(Address(fromBase58String(pool)))) | |
356 | 356 | then (height > (getHeightFirstHarvest(Address(fromBase58String(pool))) * periodLength)) | |
357 | 357 | else false) | |
358 | 358 | then { | |
359 | 359 | let amountOfVoting = split(getStringValue(votingAddress, (((toString(this) + "_") + pool) + "_user_pool_struc")), "_") | |
360 | 360 | let previosTotalVoting = split(getStringValue(votingAddress, kPreviousTotalVoteSWOP), "_") | |
361 | 361 | let assetbalanceswopusdnA = valueOrElse(getIntegerValue(swopUsdnAddress, keyBalancecpmmA), 0) | |
362 | 362 | let assetbalanceswopusdnB = valueOrElse(getIntegerValue(swopUsdnAddress, keyBalancecpmmB), 0) | |
363 | 363 | let assetbalancewavesusdnA = valueOrElse(getIntegerValue(wavesUsdnAddress, keyBalancecpmmA), 0) | |
364 | 364 | let assetbalancewavesusdnB = valueOrElse(getIntegerValue(wavesUsdnAddress, keyBalancecpmmB), 0) | |
365 | 365 | let totalPeriod = previosTotalVoting[1] | |
366 | 366 | let previosTotal = previosTotalVoting[0] | |
367 | 367 | let userShareTokenLocked = userShareTokensAmount | |
368 | 368 | let userSwopVote = if ((toString(currPeriod) == amountOfVoting[2])) | |
369 | 369 | then valueOrElse(parseInt(amountOfVoting[1]), 0) | |
370 | 370 | else valueOrElse(parseInt(amountOfVoting[0]), 0) | |
371 | 371 | let swopRate = ((assetbalanceswopusdnA / scaleValue8) / (assetbalanceswopusdnB / scaleValue6)) | |
372 | 372 | let votingTotal = if ((currPeriod == valueOrElse(parseInt(totalPeriod), -1))) | |
373 | 373 | then valueOrElse(parseInt(previosTotal), 0) | |
374 | 374 | else valueOrElse(parseInt(totalPeriod), 0) | |
375 | 375 | let harvestPower = ((SwopYearEmission / votingTotal) / APY) | |
376 | 376 | let protocolReward = calculateProtocolReward(pool) | |
377 | 377 | if ((parseInt(amountOfVoting[1]) != 0)) | |
378 | 378 | then { | |
379 | 379 | let assetBalanceB = getBalanceB(Address(fromBase58String(pool))) | |
380 | 380 | let shareTokenRate = if ((assetNameB(Address(fromBase58String(pool))) == "USDN")) | |
381 | 381 | then ((2 * assetBalanceB) / totalShareAmount) | |
382 | 382 | else if ((assetNameA(Address(fromBase58String(pool))) == "SWOP")) | |
383 | 383 | then (((2 * assetBalanceB) * ((assetbalanceswopusdnB / scaleValue8) / (assetbalanceswopusdnA / scaleValue6))) / totalShareAmount) | |
384 | 384 | else if ((assetNameA(Address(fromBase58String(pool))) == "WAVES")) | |
385 | 385 | then (((2 * assetBalanceB) * ((assetbalancewavesusdnB / scaleValue8) / (assetbalancewavesusdnA / scaleValue6))) / totalShareAmount) | |
386 | 386 | else 0 | |
387 | 387 | let shareToken = ((((userSwopVote * swopRate) * harvestPower) / shareTokenRate) - userShareTokenLocked) | |
388 | 388 | if ((shareToken > 0)) | |
389 | 389 | then if ((totalShareAmountNew >= shareToken)) | |
390 | 390 | then (baseEntry ++ [ScriptTransfer(wallet, protocolReward, SWOP)]) | |
391 | 391 | else throw(("You maximum share token is " + toString(shareToken))) | |
392 | 392 | else throw("You can't share token") | |
393 | 393 | } | |
394 | 394 | else throw("Your amount of token less than 0") | |
395 | 395 | } | |
396 | 396 | else baseEntry | |
397 | 397 | } | |
398 | 398 | ||
399 | 399 | ||
400 | 400 | ||
401 | 401 | @Callable(i) | |
402 | 402 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
403 | 403 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
404 | - | let $ | |
405 | - | let userNewInterest = $ | |
406 | - | let currentInterest = $ | |
407 | - | let claimAmount = $ | |
408 | - | let userShareTokensAmount = $ | |
404 | + | let $t01831718417 = claimCalc(pool, i.caller, 1) | |
405 | + | let userNewInterest = $t01831718417._1 | |
406 | + | let currentInterest = $t01831718417._2 | |
407 | + | let claimAmount = $t01831718417._3 | |
408 | + | let userShareTokensAmount = $t01831718417._4 | |
409 | 409 | let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount) | |
410 | 410 | let availableFundsNew = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
411 | 411 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
412 | 412 | let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount) | |
413 | 413 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
414 | 414 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
415 | 415 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
416 | 416 | then throw("Withdraw amount more then user locked amount") | |
417 | 417 | else [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)) + keyAvailableSWOP), availableFundsNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
418 | 418 | } | |
419 | 419 | ||
420 | 420 | ||
421 | 421 | ||
422 | 422 | @Callable(i) | |
423 | 423 | func claim (pool) = { | |
424 | 424 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
425 | - | let $ | |
426 | - | let lastInterestHeight = $ | |
427 | - | let lastInterest = $ | |
428 | - | let $ | |
429 | - | let currentRewardPerBlock = $ | |
430 | - | let rewardUpdateHeight = $ | |
431 | - | let previousRewardPerBlock = $ | |
432 | - | let $ | |
433 | - | let userNewInterest = $ | |
434 | - | let currentInterest = $ | |
435 | - | let claimAmount = $ | |
436 | - | let userShareTokensAmount = $ | |
425 | + | let $t01991019975 = getLastInterestInfo(pool) | |
426 | + | let lastInterestHeight = $t01991019975._1 | |
427 | + | let lastInterest = $t01991019975._2 | |
428 | + | let $t01998020069 = rewardInfo(pool) | |
429 | + | let currentRewardPerBlock = $t01998020069._1 | |
430 | + | let rewardUpdateHeight = $t01998020069._2 | |
431 | + | let previousRewardPerBlock = $t01998020069._3 | |
432 | + | let $t02007420174 = claimCalc(pool, i.caller, 1) | |
433 | + | let userNewInterest = $t02007420174._1 | |
434 | + | let currentInterest = $t02007420174._2 | |
435 | + | let claimAmount = $t02007420174._3 | |
436 | + | let userShareTokensAmount = $t02007420174._4 | |
437 | 437 | let availableFund = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
438 | 438 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
439 | 439 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
440 | 440 | if ((availableFund == 0)) | |
441 | 441 | then throw("You have 0 available SWOP") | |
442 | 442 | else [IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserLastInterest), userNewInterest), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((((pool + "_") + toString(i.caller)) + keyAvailableSWOP), 0), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.caller)) + keyUserSWOPLastClaimedAmount), claimAmount), ScriptTransfer(i.caller, availableFund, SWOP)] | |
443 | 443 | } | |
444 | 444 | ||
445 | 445 | ||
446 | 446 | @Verifier(tx) | |
447 | 447 | func verify () = match tx { | |
448 | 448 | case _ => | |
449 | 449 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
450 | 450 | } | |
451 | 451 |
github/deemru/w8io/026f985 75.63 ms ◑