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