tx · 6qrvDNhEuVsToo6PAahMEfyniiTG32cFtvZYqeopzLYf 3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT: -0.20300000 Waves 2022.06.30 10:45 [2118884] smart account 3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT > SELF 0.00000000 Waves
{ "type": 13, "id": "6qrvDNhEuVsToo6PAahMEfyniiTG32cFtvZYqeopzLYf", "fee": 20300000, "feeAssetId": null, "timestamp": 1656575205327, "version": 2, "chainId": 84, "sender": "3MsxHxruYWoddB4HRiPBYAWtMXMtCF1V9XT", "senderPublicKey": "3ijdmxaYrpDFsKVbQH2kvB7i6JzHj9bep9bGWiQPra2D", "proofs": [ "3KBGKxZKFkiwPsWLHd9fjm3g4ESG4yCV4SXahMTdSqSjSYVfPwkQkKWmM4hv8sXjmJuUouKmMMTQjen7rPv1mXBB", "21gf2nCiHDJbT7Vv4h2YsxFLFHk6r9wfVKXuL6wrJt45t1deWxWX8E68Wqio5uNykKgupBmP8LayjeqawPkN9uk4" ], "script": "base64:BgIlCAISAwoBCBIDCgEIEgMKAQgSAwoBCBIECgIIARIDCgEIEgASAGYAFGtleVNoYXJlVG9rZW5zTG9ja2VkAhpfdG90YWxfc2hhcmVfdG9rZW5zX2xvY2tlZAALa1NoYXJlTGltaXQCHHNoYXJlX2xpbWl0X29uX2ZpcnN0X2hhcnZlc3QACWtleUFjdGl2ZQIGYWN0aXZlAA1rT3JhY2xlQWN0aXZlAhRhY3RpdmVfYWxsX2NvbnRyYWN0cwAIa2V5Q2F1c2UCDnNodXRkb3duX2NhdXNlABxrZXlSZXdhcmRQb29sRnJhY3Rpb25DdXJyZW50Ah1fY3VycmVudF9wb29sX2ZyYWN0aW9uX3Jld2FyZAAda2V5UmV3YXJkUG9vbEZyYWN0aW9uUHJldmlvdXMCHl9wcmV2aW91c19wb29sX2ZyYWN0aW9uX3Jld2FyZAAVa2V5SGVpZ2h0UG9vbEZyYWN0aW9uAhpfcG9vbF9yZXdhcmRfdXBk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kBRJhZG1pblB1YktleTNTaWduZWQAAiEGxxg=", "height": 2118884, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GtPPpj9uqMYgi57c6QfvDQnyV8yS2u4CnSFZSLrfYW4g Next: 4TSJTX4TAcaSJDXrZQXTW3aVNTKdMqijyFC7rBfsmvLt Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy' | |
5 | - | ||
6 | - | let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk' | |
7 | - | ||
8 | - | let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP' | |
9 | - | ||
10 | 4 | let keyShareTokensLocked = "_total_share_tokens_locked" | |
11 | 5 | ||
12 | 6 | let kShareLimit = "share_limit_on_first_harvest" | |
13 | 7 | ||
14 | 8 | let keyActive = "active" | |
9 | + | ||
10 | + | let kOracleActive = "active_all_contracts" | |
15 | 11 | ||
16 | 12 | let keyCause = "shutdown_cause" | |
17 | 13 | ||
73 | 69 | ||
74 | 70 | let keyTempCurSum = "sum_reward_current" | |
75 | 71 | ||
76 | - | let governanceAddress = Address(base58'3N5W8da2iiijVieA6qLGo7KzCJj8B19smWU') | |
77 | - | ||
78 | - | let wallet = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
79 | - | ||
80 | - | let votingAddress = Address(base58'3MrJgdL1GniipErHy44YF9idzLaUL2iX5DQ') | |
81 | - | ||
82 | - | let adminIncreaseInterestAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
83 | - | ||
84 | 72 | let oneWeekInBlock = 10106 | |
85 | 73 | ||
86 | 74 | let totalVoteShare = 10000000000 | |
96 | 84 | let scaleValue8 = 100000000 | |
97 | 85 | ||
98 | 86 | let scaleValue11 = 100000000000 | |
87 | + | ||
88 | + | let kAdminPubKey1 = "admin_pub_1" | |
89 | + | ||
90 | + | let kAdminPubKey2 = "admin_pub_2" | |
91 | + | ||
92 | + | let kAdminPubKey3 = "admin_pub_3" | |
93 | + | ||
94 | + | let kAdminInvokePubKey = "admin_invoke_pub" | |
95 | + | ||
96 | + | let kMoneyBoxAddress = "money_box_address" | |
97 | + | ||
98 | + | let kVotingAddress = "voting_address" | |
99 | + | ||
100 | + | let kGovAddress = "governance_address" | |
101 | + | ||
102 | + | let kFarmingAddress = "farming_address" | |
103 | + | ||
104 | + | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
105 | + | ||
106 | + | func getBase58FromOracle (key) = match getString(oracle, key) { | |
107 | + | case string: String => | |
108 | + | fromBase58String(string) | |
109 | + | case nothing => | |
110 | + | throw((key + "is empty")) | |
111 | + | } | |
112 | + | ||
113 | + | ||
114 | + | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
115 | + | ||
116 | + | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
117 | + | ||
118 | + | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
119 | + | ||
120 | + | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
121 | + | ||
122 | + | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
123 | + | ||
124 | + | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
125 | + | ||
126 | + | let adminInvokePubKey = getBase58FromOracle(kAdminInvokePubKey) | |
99 | 127 | ||
100 | 128 | func strAssetIdA (pool) = getStringValue(pool, keyAssetIdA) | |
101 | 129 | ||
135 | 163 | ||
136 | 164 | let minVotePower = valueOrErrorMessage(getInteger(votingAddress, kMinVotePower), "Empty kMinVotePower") | |
137 | 165 | ||
138 | - | let isActive = getBooleanValue(this, keyActive) | |
166 | + | let isActive = if (getBooleanValue(oracle, kOracleActive)) | |
167 | + | then getBooleanValue(this, keyActive) | |
168 | + | else false | |
139 | 169 | ||
140 | 170 | let currPeriod = (basePeriod + ((height - startHeight) / periodLength)) | |
141 | 171 | ||
215 | 245 | let assetId1Decimals = value(assetInfo(assetId1)).decimals | |
216 | 246 | let assetId2Decimals = value(assetInfo(assetId2)).decimals | |
217 | 247 | let scaleDigits = ((assetId2Decimals - assetId1Decimals) + 8) | |
218 | - | pow(10, 0, scaleDigits, 0, 0, | |
248 | + | pow(10, 0, scaleDigits, 0, 0, DOWN) | |
219 | 249 | } | |
220 | 250 | ||
221 | 251 | ||
223 | 253 | ||
224 | 254 | ||
225 | 255 | func rewardInfo (pool) = { | |
226 | - | let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger( | |
227 | - | let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger( | |
228 | - | let rewardPoolFractionCurrent = valueOrErrorMessage(getInteger( | |
229 | - | let rewardUpdateHeight = valueOrErrorMessage(getInteger( | |
230 | - | let poolRewardUpdateHeight = valueOrElse(getInteger( | |
231 | - | let rewardPoolFractionPrevious = valueOrErrorMessage(getInteger( | |
256 | + | let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger(govAddress, keyTotalRewardPerBlockCurrent), ((("No data on the key: " + keyTotalRewardPerBlockCurrent) + " at address ") + toString(govAddress))) | |
257 | + | let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger(govAddress, keyTotalRewardPerBlockPrevious), ((("No data on the key: " + keyTotalRewardPerBlockPrevious) + " at address ") + toString(govAddress))) | |
258 | + | let rewardPoolFractionCurrent = valueOrErrorMessage(getInteger(govAddress, (pool + keyRewardPoolFractionCurrent)), (((("No data on the key: " + pool) + keyRewardPoolFractionCurrent) + " at address ") + toString(govAddress))) | |
259 | + | let rewardUpdateHeight = valueOrErrorMessage(getInteger(govAddress, keyRewardUpdateHeight), ((("No data on the key: " + keyRewardUpdateHeight) + " at address ") + toString(govAddress))) | |
260 | + | let poolRewardUpdateHeight = valueOrElse(getInteger(govAddress, (pool + keyHeightPoolFraction)), 0) | |
261 | + | let rewardPoolFractionPrevious = valueOrErrorMessage(getInteger(govAddress, (pool + keyRewardPoolFractionPrevious)), (((("No data on the key: " + pool) + keyRewardPoolFractionPrevious) + " at address ") + toString(govAddress))) | |
232 | 262 | let rewardPoolCurrent = fraction(totalRewardPerBlockCurrent, rewardPoolFractionCurrent, totalVoteShare) | |
233 | 263 | let rewardPoolPrevious = fraction(totalRewardPerBlockPrevious, rewardPoolFractionPrevious, totalVoteShare) | |
234 | 264 | if (if ((rewardPoolCurrent > totalRewardPerBlockCurrent)) | |
320 | 350 | let shareAssetId = getShareAssetId(pool) | |
321 | 351 | let scaleValue = calcScaleValue(SWOP, shareAssetId) | |
322 | 352 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
323 | - | let $ | |
324 | - | let lastInterestHeight = $ | |
325 | - | let lastInterest = $ | |
326 | - | let $ | |
327 | - | let currentRewardPerBlock = $ | |
328 | - | let rewardUpdateHeight = $ | |
329 | - | let previousRewardPerBlock = $ | |
330 | - | let poolRewardUpdateHeight = $ | |
331 | - | let $ | |
332 | - | let userLastInterest = $ | |
333 | - | let userShareTokensAmount = $ | |
353 | + | let $t01353813603 = getLastInterestInfo(pool) | |
354 | + | let lastInterestHeight = $t01353813603._1 | |
355 | + | let lastInterest = $t01353813603._2 | |
356 | + | let $t01360813720 = rewardInfo(pool) | |
357 | + | let currentRewardPerBlock = $t01360813720._1 | |
358 | + | let rewardUpdateHeight = $t01360813720._2 | |
359 | + | let previousRewardPerBlock = $t01360813720._3 | |
360 | + | let poolRewardUpdateHeight = $t01360813720._4 | |
361 | + | let $t01372513804 = getUserInterestInfo(pool, caller) | |
362 | + | let userLastInterest = $t01372513804._1 | |
363 | + | let userShareTokensAmount = $t01372513804._2 | |
334 | 364 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, poolRewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue, pmtAmount) | |
335 | 365 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue) | |
336 | 366 | let userNewInterest = currentInterest | |
339 | 369 | ||
340 | 370 | ||
341 | 371 | func calculateProtocolReward (pool) = { | |
342 | - | let $ | |
343 | - | let lastInterestHeight = $ | |
344 | - | let lastInterest = $ | |
345 | - | let $ | |
346 | - | let currentRewardPerBlock = $ | |
347 | - | let rewardUpdateHeight = $ | |
348 | - | let previousRewardPerBlock = $ | |
349 | - | let poolRewardUpdateHeight = $ | |
372 | + | let $t01432214387 = getLastInterestInfo(pool) | |
373 | + | let lastInterestHeight = $t01432214387._1 | |
374 | + | let lastInterest = $t01432214387._2 | |
375 | + | let $t01439214503 = rewardInfo(pool) | |
376 | + | let currentRewardPerBlock = $t01439214503._1 | |
377 | + | let rewardUpdateHeight = $t01439214503._2 | |
378 | + | let previousRewardPerBlock = $t01439214503._3 | |
379 | + | let poolRewardUpdateHeight = $t01439214503._4 | |
350 | 380 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
351 | 381 | if (if ((shareTokenLocked == 0)) | |
352 | 382 | then (poolRewardUpdateHeight == 0) | |
431 | 461 | func initPoolShareFarming (pool) = if ((i.caller != this)) | |
432 | 462 | then throw("Only the DApp itself can call this function") | |
433 | 463 | else { | |
434 | - | let $ | |
435 | - | let currentReward = $ | |
436 | - | let rewardUpdateHeight = $ | |
437 | - | let previousRewardPerBlock = $ | |
438 | - | let poolRewardUpdateHeight = $ | |
464 | + | let $t01748517588 = rewardInfo(pool) | |
465 | + | let currentReward = $t01748517588._1 | |
466 | + | let rewardUpdateHeight = $t01748517588._2 | |
467 | + | let previousRewardPerBlock = $t01748517588._3 | |
468 | + | let poolRewardUpdateHeight = $t01748517588._4 | |
439 | 469 | [IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyLastInterestHeight), height)] | |
440 | 470 | } | |
441 | 471 | ||
442 | 472 | ||
443 | 473 | ||
444 | 474 | @Callable(i) | |
445 | - | func updatePoolInterest (pool) = if ((i.caller != | |
475 | + | func updatePoolInterest (pool) = if ((i.caller != moneyBoxAddress)) | |
446 | 476 | then throw("Only the Admin itself can call this function") | |
447 | 477 | else if (!(isActive)) | |
448 | 478 | then throw("DApp is inactive at this moment") | |
449 | 479 | else { | |
450 | - | let $ | |
451 | - | let userNewInterest = $ | |
452 | - | let currentInterest = $ | |
453 | - | let claimAmount = $ | |
454 | - | let userShareTokensAmount = $ | |
455 | - | let $ | |
456 | - | let currentReward = $ | |
457 | - | let rewardUpdateHeight = $ | |
458 | - | let previousRewardPerBlock = $ | |
459 | - | let poolRewardUpdateHeight = $ | |
480 | + | let $t01800618139 = claimCalc(pool, addressFromPublicKey(adminInvokePubKey), 0) | |
481 | + | let userNewInterest = $t01800618139._1 | |
482 | + | let currentInterest = $t01800618139._2 | |
483 | + | let claimAmount = $t01800618139._3 | |
484 | + | let userShareTokensAmount = $t01800618139._4 | |
485 | + | let $t01814418247 = rewardInfo(pool) | |
486 | + | let currentReward = $t01814418247._1 | |
487 | + | let rewardUpdateHeight = $t01814418247._2 | |
488 | + | let previousRewardPerBlock = $t01814418247._3 | |
489 | + | let poolRewardUpdateHeight = $t01814418247._4 | |
460 | 490 | [IntegerEntry((pool + keyLastInterest), userNewInterest), IntegerEntry((pool + keyLastInterestHeight), height)] | |
461 | 491 | } | |
462 | 492 | ||
464 | 494 | ||
465 | 495 | @Callable(i) | |
466 | 496 | func lockShareTokens (pool) = { | |
467 | - | let $ | |
468 | - | let pmtAmount = $ | |
469 | - | let pmtAssetId = $ | |
470 | - | let $ | |
471 | - | let pmtStrAssetId = $ | |
472 | - | let pmtAssetName = $ | |
473 | - | let pmtDecimals = $ | |
474 | - | let $ | |
475 | - | let userNewInterest = $ | |
476 | - | let currentInterest = $ | |
477 | - | let claimAmount = $ | |
478 | - | let userShareTokensAmount = $ | |
497 | + | let $t01843918514 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
498 | + | let pmtAmount = $t01843918514._1 | |
499 | + | let pmtAssetId = $t01843918514._2 | |
500 | + | let $t01851918592 = getAssetInfo(pmtAssetId) | |
501 | + | let pmtStrAssetId = $t01851918592._1 | |
502 | + | let pmtAssetName = $t01851918592._2 | |
503 | + | let pmtDecimals = $t01851918592._3 | |
504 | + | let $t01859718711 = claimCalc(pool, i.originCaller, pmtAmount) | |
505 | + | let userNewInterest = $t01859718711._1 | |
506 | + | let currentInterest = $t01859718711._2 | |
507 | + | let claimAmount = $t01859718711._3 | |
508 | + | let userShareTokensAmount = $t01859718711._4 | |
479 | 509 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
480 | - | let availableFundsNew = (userAvailableSWOP(pool, i. | |
510 | + | let availableFundsNew = (userAvailableSWOP(pool, i.originCaller) + claimAmount) | |
481 | 511 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
482 | 512 | let totalShareAmountNew = (totalShareAmount + pmtAmount) | |
483 | - | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i. | |
513 | + | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.originCaller) | |
484 | 514 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
485 | - | 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)] | |
486 | - | let harvestPeriod = ((((getHeightFirstHarvest(Address(fromBase58String(pool))) - startHeight) + 1) / periodLength) - 1) | |
487 | - | let amountOfVoting = split(getStringValue(votingAddress, (((toString(i.caller) + "_") + pool) + "_user_pool_struc")), "_") | |
488 | - | let amountPoolStract = split(getStringValue(votingAddress, (pool + "_pool_struc")), "_") | |
489 | - | let amountActiveVoteUserPoolStract = split(valueOrElse(getString(votingAddress, (((toString(i.caller) + "_") + pool) + kHarvestUserPoolActiveVoteStrucVoting)), ""), "_") | |
490 | - | let amountPoolActiveVoteStract = split(valueOrElse(getString(votingAddress, (pool + kHarvestPoolActiveVoteStrucVoting)), ""), "_") | |
491 | - | let userShareTokenLocked = userShareTokensAmount | |
492 | - | let userPoolActiveVote = if ((toString(currPeriod) == amountOfVoting[2])) | |
493 | - | then valueOrElse(parseInt(amountActiveVoteUserPoolStract[0]), 0) | |
494 | - | else valueOrElse(parseInt(amountOfVoting[1]), 0) | |
495 | - | let poolActiveVote = if ((toString(currPeriod) == amountPoolStract[2])) | |
496 | - | then valueOrElse(parseInt(amountPoolActiveVoteStract[0]), 0) | |
497 | - | else valueOrElse(parseInt(amountPoolStract[1]), 0) | |
498 | - | let protocolReward = calculateProtocolReward(pool) | |
499 | - | let limitShareToken = getShareLimitToken(addressFromStringValue(pool)) | |
500 | - | let shareToken = (fraction(limitShareToken, userPoolActiveVote, poolActiveVote) - userShareTokenLocked) | |
501 | - | if ((fraction(99, (accountBalance(pmtAssetId) + pmtAmount), 100) > totalShareAmountNew)) | |
502 | - | then throw("Balance of share-token is greater than totalAmount") | |
503 | - | else throw("test error") | |
515 | + | let baseEntry = [IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyShareTokensLocked), totalShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserSWOPLastClaimedAmount), claimAmount), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyAvailableSWOP), availableFundsNew)] | |
516 | + | if ((0 >= pmtAmount)) | |
517 | + | then throw("You can't lock token") | |
518 | + | else if (!(isActive)) | |
519 | + | then throw("DApp is inactive at this moment") | |
520 | + | else if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
521 | + | then throw("Incorrect pmtAssetId") | |
522 | + | else if (if (isFirstHarvest(Address(fromBase58String(pool)))) | |
523 | + | then (getHeightFirstHarvest(Address(fromBase58String(pool))) > height) | |
524 | + | else false) | |
525 | + | then { | |
526 | + | let harvestPeriod = ((((getHeightFirstHarvest(Address(fromBase58String(pool))) - startHeight) + 1) / periodLength) - 1) | |
527 | + | let amountOfVoting = split(getStringValue(votingAddress, (((toString(i.originCaller) + "_") + pool) + "_user_pool_struc")), "_") | |
528 | + | let amountPoolStract = split(getStringValue(votingAddress, (pool + "_pool_struc")), "_") | |
529 | + | let amountActiveVoteUserPoolStract = split(valueOrElse(getString(votingAddress, (((toString(i.originCaller) + "_") + pool) + kHarvestUserPoolActiveVoteStrucVoting)), ""), "_") | |
530 | + | let amountPoolActiveVoteStract = split(valueOrElse(getString(votingAddress, (pool + kHarvestPoolActiveVoteStrucVoting)), ""), "_") | |
531 | + | let userShareTokenLocked = userShareTokensAmount | |
532 | + | let userPoolActiveVote = if ((toString(currPeriod) == amountOfVoting[2])) | |
533 | + | then valueOrElse(parseInt(amountActiveVoteUserPoolStract[0]), 0) | |
534 | + | else valueOrElse(parseInt(amountOfVoting[1]), 0) | |
535 | + | let poolActiveVote = if ((toString(currPeriod) == amountPoolStract[2])) | |
536 | + | then valueOrElse(parseInt(amountPoolActiveVoteStract[0]), 0) | |
537 | + | else valueOrElse(parseInt(amountPoolStract[1]), 0) | |
538 | + | let protocolReward = calculateProtocolReward(pool) | |
539 | + | if ((userPoolActiveVote != 0)) | |
540 | + | then { | |
541 | + | let limitShareToken = getShareLimitToken(addressFromStringValue(pool)) | |
542 | + | let shareToken = (fraction(limitShareToken, userPoolActiveVote, poolActiveVote) - userShareTokenLocked) | |
543 | + | if (if ((size(amountActiveVoteUserPoolStract) > 1)) | |
544 | + | then (valueOrElse(parseInt(amountActiveVoteUserPoolStract[1]), 0) >= harvestPeriod) | |
545 | + | else false) | |
546 | + | then throw("You can't share token") | |
547 | + | else if ((pmtAmount > limitShareToken)) | |
548 | + | then throw(("You can't share token more than " + toString(limitShareToken))) | |
549 | + | else if ((shareToken > 0)) | |
550 | + | then if ((fraction(99, (accountBalance(pmtAssetId) + pmtAmount), 100) > totalShareAmountNew)) | |
551 | + | then throw("Balance of share-token is greater than totalAmount") | |
552 | + | else if ((totalShareAmount == 0)) | |
553 | + | then (baseEntry ++ [Reissue(SWOP, protocolReward, true), ScriptTransfer(moneyBoxAddress, protocolReward, SWOP)]) | |
554 | + | else if ((shareToken >= pmtAmount)) | |
555 | + | then baseEntry | |
556 | + | else throw(("Your maximum share token is " + toString(shareToken))) | |
557 | + | else throw("You can't share token") | |
558 | + | } | |
559 | + | else throw("Your amount of token less than 0") | |
560 | + | } | |
561 | + | else baseEntry | |
504 | 562 | } | |
505 | 563 | ||
506 | 564 | ||
508 | 566 | @Callable(i) | |
509 | 567 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
510 | 568 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
511 | - | let $ | |
512 | - | let userNewInterest = $ | |
513 | - | let currentInterest = $ | |
514 | - | let claimAmount = $ | |
515 | - | let userShareTokensAmount = $ | |
569 | + | let $t02322023326 = claimCalc(pool, i.originCaller, 1) | |
570 | + | let userNewInterest = $t02322023326._1 | |
571 | + | let currentInterest = $t02322023326._2 | |
572 | + | let claimAmount = $t02322023326._3 | |
573 | + | let userShareTokensAmount = $t02322023326._4 | |
516 | 574 | let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount) | |
517 | - | let availableFundsNew = (userAvailableSWOP(pool, i. | |
575 | + | let availableFundsNew = (userAvailableSWOP(pool, i.originCaller) + claimAmount) | |
518 | 576 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
519 | 577 | let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount) | |
520 | - | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i. | |
578 | + | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.originCaller) | |
521 | 579 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
522 | 580 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
523 | 581 | then throw("Withdraw amount more then user locked amount") | |
527 | 585 | then throw("Withdraw amount more then user locked amount") | |
528 | 586 | else if ((fraction(99, (accountBalance(shareTokensId) - shareTokensWithdrawAmount), 100) > totalShareAmountNew)) | |
529 | 587 | then throw("Balance of share-token is greater than totalAmount") | |
530 | - | else [IntegerEntry((((pool + "_") + toString(i. | |
588 | + | else [IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((pool + keyShareTokensLocked), totalShareAmountNew), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyAvailableSWOP), availableFundsNew), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserSWOPLastClaimedAmount), claimAmount), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
531 | 589 | } | |
532 | 590 | ||
533 | 591 | ||
536 | 594 | func claim (pool) = { | |
537 | 595 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
538 | 596 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
539 | - | let $ | |
540 | - | let lastInterestHeight = $ | |
541 | - | let lastInterest = $ | |
542 | - | let $ | |
543 | - | let currentRewardPerBlock = $ | |
544 | - | let rewardUpdateHeight = $ | |
545 | - | let previousRewardPerBlock = $ | |
546 | - | let poolRewardUpdateHeight = $ | |
547 | - | let $ | |
548 | - | let userNewInterest = $ | |
549 | - | let currentInterest = $ | |
550 | - | let claimAmount = $ | |
551 | - | let userShareTokensAmount = $ | |
597 | + | let $t02537425439 = getLastInterestInfo(pool) | |
598 | + | let lastInterestHeight = $t02537425439._1 | |
599 | + | let lastInterest = $t02537425439._2 | |
600 | + | let $t02544425556 = rewardInfo(pool) | |
601 | + | let currentRewardPerBlock = $t02544425556._1 | |
602 | + | let rewardUpdateHeight = $t02544425556._2 | |
603 | + | let previousRewardPerBlock = $t02544425556._3 | |
604 | + | let poolRewardUpdateHeight = $t02544425556._4 | |
605 | + | let $t02556125661 = claimCalc(pool, i.caller, 1) | |
606 | + | let userNewInterest = $t02556125661._1 | |
607 | + | let currentInterest = $t02556125661._2 | |
608 | + | let claimAmount = $t02556125661._3 | |
609 | + | let userShareTokensAmount = $t02556125661._4 | |
552 | 610 | let availableFund = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
553 | 611 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
554 | 612 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let adminPubKey1 = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy' | |
5 | - | ||
6 | - | let adminPubKey2 = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk' | |
7 | - | ||
8 | - | let adminPubKey3 = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP' | |
9 | - | ||
10 | 4 | let keyShareTokensLocked = "_total_share_tokens_locked" | |
11 | 5 | ||
12 | 6 | let kShareLimit = "share_limit_on_first_harvest" | |
13 | 7 | ||
14 | 8 | let keyActive = "active" | |
9 | + | ||
10 | + | let kOracleActive = "active_all_contracts" | |
15 | 11 | ||
16 | 12 | let keyCause = "shutdown_cause" | |
17 | 13 | ||
18 | 14 | let keyRewardPoolFractionCurrent = "_current_pool_fraction_reward" | |
19 | 15 | ||
20 | 16 | let keyRewardPoolFractionPrevious = "_previous_pool_fraction_reward" | |
21 | 17 | ||
22 | 18 | let keyHeightPoolFraction = "_pool_reward_update_height" | |
23 | 19 | ||
24 | 20 | let keyTotalRewardPerBlockCurrent = "total_reward_per_block_current" | |
25 | 21 | ||
26 | 22 | let keyTotalRewardPerBlockPrevious = "total_reward_per_block_previous" | |
27 | 23 | ||
28 | 24 | let keyRewardUpdateHeight = "reward_update_height" | |
29 | 25 | ||
30 | 26 | let keyLastInterest = "_last_interest" | |
31 | 27 | ||
32 | 28 | let keyLastInterestHeight = "_last_interest_height" | |
33 | 29 | ||
34 | 30 | let keyUserShareTokensLocked = "_share_tokens_locked" | |
35 | 31 | ||
36 | 32 | let keyUserLastInterest = "_last_interest" | |
37 | 33 | ||
38 | 34 | let keySWOPid = "SWOP_id" | |
39 | 35 | ||
40 | 36 | let keyUserSWOPClaimedAmount = "_SWOP_claimed_amount" | |
41 | 37 | ||
42 | 38 | let keyUserSWOPLastClaimedAmount = "_SWOP_last_claimed_amount" | |
43 | 39 | ||
44 | 40 | let keyAvailableSWOP = "_available_SWOP" | |
45 | 41 | ||
46 | 42 | let keyFarmingStartHeight = "farming_start_height" | |
47 | 43 | ||
48 | 44 | let keyAPY = "apy" | |
49 | 45 | ||
50 | 46 | let kPreviousTotalVoteSWOP = "previous_total_vote_SWOP" | |
51 | 47 | ||
52 | 48 | let keySwopYearEmission = "swop_year_emission" | |
53 | 49 | ||
54 | 50 | let keyBalancecpmmA = "A_asset_balance" | |
55 | 51 | ||
56 | 52 | let keyBalancecpmmB = "B_asset_balance" | |
57 | 53 | ||
58 | 54 | let kHarvestPoolActiveVoteStrucVoting = "_harvest_pool_activeVote_struc" | |
59 | 55 | ||
60 | 56 | let kHarvestUserPoolActiveVoteStrucVoting = "_harvest_user_pool_activeVote_struc" | |
61 | 57 | ||
62 | 58 | let keyLimitShareFirstHarvest = "share_limit_on_first_harvest" | |
63 | 59 | ||
64 | 60 | let keyAssetIdA = "A_asset_id" | |
65 | 61 | ||
66 | 62 | let keyAssetIdB = "B_asset_id" | |
67 | 63 | ||
68 | 64 | let keyFirstHarvestHeight = "first_harvest_height" | |
69 | 65 | ||
70 | 66 | let keyfirstHarvestCpmm = "first_harvest" | |
71 | 67 | ||
72 | 68 | let keyTempPrevSum = "sum_reward_previous" | |
73 | 69 | ||
74 | 70 | let keyTempCurSum = "sum_reward_current" | |
75 | 71 | ||
76 | - | let governanceAddress = Address(base58'3N5W8da2iiijVieA6qLGo7KzCJj8B19smWU') | |
77 | - | ||
78 | - | let wallet = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
79 | - | ||
80 | - | let votingAddress = Address(base58'3MrJgdL1GniipErHy44YF9idzLaUL2iX5DQ') | |
81 | - | ||
82 | - | let adminIncreaseInterestAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
83 | - | ||
84 | 72 | let oneWeekInBlock = 10106 | |
85 | 73 | ||
86 | 74 | let totalVoteShare = 10000000000 | |
87 | 75 | ||
88 | 76 | let scaleValue1 = 10 | |
89 | 77 | ||
90 | 78 | let scaleValue3 = 1000 | |
91 | 79 | ||
92 | 80 | let scaleValue5 = 100000 | |
93 | 81 | ||
94 | 82 | let scaleValue6 = 1000000 | |
95 | 83 | ||
96 | 84 | let scaleValue8 = 100000000 | |
97 | 85 | ||
98 | 86 | let scaleValue11 = 100000000000 | |
87 | + | ||
88 | + | let kAdminPubKey1 = "admin_pub_1" | |
89 | + | ||
90 | + | let kAdminPubKey2 = "admin_pub_2" | |
91 | + | ||
92 | + | let kAdminPubKey3 = "admin_pub_3" | |
93 | + | ||
94 | + | let kAdminInvokePubKey = "admin_invoke_pub" | |
95 | + | ||
96 | + | let kMoneyBoxAddress = "money_box_address" | |
97 | + | ||
98 | + | let kVotingAddress = "voting_address" | |
99 | + | ||
100 | + | let kGovAddress = "governance_address" | |
101 | + | ||
102 | + | let kFarmingAddress = "farming_address" | |
103 | + | ||
104 | + | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
105 | + | ||
106 | + | func getBase58FromOracle (key) = match getString(oracle, key) { | |
107 | + | case string: String => | |
108 | + | fromBase58String(string) | |
109 | + | case nothing => | |
110 | + | throw((key + "is empty")) | |
111 | + | } | |
112 | + | ||
113 | + | ||
114 | + | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
115 | + | ||
116 | + | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
117 | + | ||
118 | + | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
119 | + | ||
120 | + | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
121 | + | ||
122 | + | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
123 | + | ||
124 | + | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
125 | + | ||
126 | + | let adminInvokePubKey = getBase58FromOracle(kAdminInvokePubKey) | |
99 | 127 | ||
100 | 128 | func strAssetIdA (pool) = getStringValue(pool, keyAssetIdA) | |
101 | 129 | ||
102 | 130 | ||
103 | 131 | func strAssetIdB (pool) = getStringValue(pool, keyAssetIdB) | |
104 | 132 | ||
105 | 133 | ||
106 | 134 | func assetIdA (pool) = if ((strAssetIdA(pool) == "WAVES")) | |
107 | 135 | then unit | |
108 | 136 | else fromBase58String(strAssetIdA(pool)) | |
109 | 137 | ||
110 | 138 | ||
111 | 139 | func assetIdB (pool) = if ((strAssetIdB(pool) == "WAVES")) | |
112 | 140 | then unit | |
113 | 141 | else fromBase58String(strAssetIdB(pool)) | |
114 | 142 | ||
115 | 143 | ||
116 | 144 | let kBasePeriod = "base_period" | |
117 | 145 | ||
118 | 146 | let kPeriodLength = "period_length" | |
119 | 147 | ||
120 | 148 | let kStartHeight = "start_height" | |
121 | 149 | ||
122 | 150 | let kFirstHarvestHeight = "first_harvest_height" | |
123 | 151 | ||
124 | 152 | let kDurationFullVotePower = "duration_full_vote_power" | |
125 | 153 | ||
126 | 154 | let kMinVotePower = "min_vote_power" | |
127 | 155 | ||
128 | 156 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
129 | 157 | ||
130 | 158 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
131 | 159 | ||
132 | 160 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
133 | 161 | ||
134 | 162 | let durationFullVotePower = valueOrErrorMessage(getInteger(votingAddress, kDurationFullVotePower), "Empty kDurationFullVotePower") | |
135 | 163 | ||
136 | 164 | let minVotePower = valueOrErrorMessage(getInteger(votingAddress, kMinVotePower), "Empty kMinVotePower") | |
137 | 165 | ||
138 | - | let isActive = getBooleanValue(this, keyActive) | |
166 | + | let isActive = if (getBooleanValue(oracle, kOracleActive)) | |
167 | + | then getBooleanValue(this, keyActive) | |
168 | + | else false | |
139 | 169 | ||
140 | 170 | let currPeriod = (basePeriod + ((height - startHeight) / periodLength)) | |
141 | 171 | ||
142 | 172 | func getLimitToken (pool) = valueOrElse(getIntegerValue(pool, keyLimitShareFirstHarvest), 0) | |
143 | 173 | ||
144 | 174 | ||
145 | 175 | let APY = getIntegerValue(this, keyAPY) | |
146 | 176 | ||
147 | 177 | let SwopYearEmission = getIntegerValue(this, keySwopYearEmission) | |
148 | 178 | ||
149 | 179 | func assetNameA (pool) = match assetIdA(pool) { | |
150 | 180 | case id: ByteVector => | |
151 | 181 | value(assetInfo(id)).name | |
152 | 182 | case waves: Unit => | |
153 | 183 | "WAVES" | |
154 | 184 | case _ => | |
155 | 185 | throw("Match error") | |
156 | 186 | } | |
157 | 187 | ||
158 | 188 | ||
159 | 189 | func assetNameB (pool) = match assetIdB(pool) { | |
160 | 190 | case id: ByteVector => | |
161 | 191 | value(assetInfo(id)).name | |
162 | 192 | case waves: Unit => | |
163 | 193 | "WAVES" | |
164 | 194 | case _ => | |
165 | 195 | throw("Match error") | |
166 | 196 | } | |
167 | 197 | ||
168 | 198 | ||
169 | 199 | let SWOP = fromBase58String(getStringValue(this, keySWOPid)) | |
170 | 200 | ||
171 | 201 | func isFirstHarvest (pool) = valueOrElse(getBoolean(pool, keyfirstHarvestCpmm), false) | |
172 | 202 | ||
173 | 203 | ||
174 | 204 | func getHeightFirstHarvest (pool) = valueOrElse(getInteger(pool, keyFirstHarvestHeight), 0) | |
175 | 205 | ||
176 | 206 | ||
177 | 207 | func getBalanceA (pool) = valueOrErrorMessage(getInteger(pool, keyBalancecpmmA), ("No data on the key: " + keyBalancecpmmA)) | |
178 | 208 | ||
179 | 209 | ||
180 | 210 | func getBalanceB (pool) = valueOrErrorMessage(getInteger(pool, keyBalancecpmmB), ("No data on the key: " + keyBalancecpmmB)) | |
181 | 211 | ||
182 | 212 | ||
183 | 213 | func getShareLimitToken (pool) = valueOrErrorMessage(getInteger(pool, kShareLimit), ("No data on the key: " + kShareLimit)) | |
184 | 214 | ||
185 | 215 | ||
186 | 216 | func getTotalShareTokenLocked (pool) = valueOrErrorMessage(getInteger(this, (pool + keyShareTokensLocked)), (("No data on the key: " + pool) + keyShareTokensLocked)) | |
187 | 217 | ||
188 | 218 | ||
189 | 219 | func getShareAssetId (pool) = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
190 | 220 | ||
191 | 221 | ||
192 | 222 | func accountBalance (assetId) = match assetId { | |
193 | 223 | case id: ByteVector => | |
194 | 224 | assetBalance(this, id) | |
195 | 225 | case waves: Unit => | |
196 | 226 | wavesBalance(this).available | |
197 | 227 | case _ => | |
198 | 228 | throw("Match error") | |
199 | 229 | } | |
200 | 230 | ||
201 | 231 | ||
202 | 232 | func getAssetInfo (assetId) = match assetId { | |
203 | 233 | case id: ByteVector => | |
204 | 234 | let stringId = toBase58String(id) | |
205 | 235 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
206 | 236 | $Tuple3(stringId, info.name, info.decimals) | |
207 | 237 | case waves: Unit => | |
208 | 238 | $Tuple3("WAVES", "WAVES", 8) | |
209 | 239 | case _ => | |
210 | 240 | throw("Match error") | |
211 | 241 | } | |
212 | 242 | ||
213 | 243 | ||
214 | 244 | func calcScaleValue (assetId1,assetId2) = { | |
215 | 245 | let assetId1Decimals = value(assetInfo(assetId1)).decimals | |
216 | 246 | let assetId2Decimals = value(assetInfo(assetId2)).decimals | |
217 | 247 | let scaleDigits = ((assetId2Decimals - assetId1Decimals) + 8) | |
218 | - | pow(10, 0, scaleDigits, 0, 0, | |
248 | + | pow(10, 0, scaleDigits, 0, 0, DOWN) | |
219 | 249 | } | |
220 | 250 | ||
221 | 251 | ||
222 | 252 | func userAvailableSWOP (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyAvailableSWOP)), 0) | |
223 | 253 | ||
224 | 254 | ||
225 | 255 | func rewardInfo (pool) = { | |
226 | - | let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger( | |
227 | - | let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger( | |
228 | - | let rewardPoolFractionCurrent = valueOrErrorMessage(getInteger( | |
229 | - | let rewardUpdateHeight = valueOrErrorMessage(getInteger( | |
230 | - | let poolRewardUpdateHeight = valueOrElse(getInteger( | |
231 | - | let rewardPoolFractionPrevious = valueOrErrorMessage(getInteger( | |
256 | + | let totalRewardPerBlockCurrent = valueOrErrorMessage(getInteger(govAddress, keyTotalRewardPerBlockCurrent), ((("No data on the key: " + keyTotalRewardPerBlockCurrent) + " at address ") + toString(govAddress))) | |
257 | + | let totalRewardPerBlockPrevious = valueOrErrorMessage(getInteger(govAddress, keyTotalRewardPerBlockPrevious), ((("No data on the key: " + keyTotalRewardPerBlockPrevious) + " at address ") + toString(govAddress))) | |
258 | + | let rewardPoolFractionCurrent = valueOrErrorMessage(getInteger(govAddress, (pool + keyRewardPoolFractionCurrent)), (((("No data on the key: " + pool) + keyRewardPoolFractionCurrent) + " at address ") + toString(govAddress))) | |
259 | + | let rewardUpdateHeight = valueOrErrorMessage(getInteger(govAddress, keyRewardUpdateHeight), ((("No data on the key: " + keyRewardUpdateHeight) + " at address ") + toString(govAddress))) | |
260 | + | let poolRewardUpdateHeight = valueOrElse(getInteger(govAddress, (pool + keyHeightPoolFraction)), 0) | |
261 | + | let rewardPoolFractionPrevious = valueOrErrorMessage(getInteger(govAddress, (pool + keyRewardPoolFractionPrevious)), (((("No data on the key: " + pool) + keyRewardPoolFractionPrevious) + " at address ") + toString(govAddress))) | |
232 | 262 | let rewardPoolCurrent = fraction(totalRewardPerBlockCurrent, rewardPoolFractionCurrent, totalVoteShare) | |
233 | 263 | let rewardPoolPrevious = fraction(totalRewardPerBlockPrevious, rewardPoolFractionPrevious, totalVoteShare) | |
234 | 264 | if (if ((rewardPoolCurrent > totalRewardPerBlockCurrent)) | |
235 | 265 | then true | |
236 | 266 | else (rewardPoolPrevious > totalRewardPerBlockPrevious)) | |
237 | 267 | then throw("rewardPoolCurrent > totalRewardPerBlockCurrent or rewardPoolPrevious > totalRewardPerBlockPrevious") | |
238 | 268 | else $Tuple4(rewardPoolCurrent, rewardUpdateHeight, rewardPoolPrevious, poolRewardUpdateHeight) | |
239 | 269 | } | |
240 | 270 | ||
241 | 271 | ||
242 | 272 | func getLastInterestInfo (pool) = { | |
243 | 273 | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (("No data on the key: " + pool) + keyLastInterest)) | |
244 | 274 | let lastInterestHeight = valueOrElse(getInteger(this, (pool + keyLastInterestHeight)), height) | |
245 | 275 | $Tuple2(lastInterestHeight, lastInterest) | |
246 | 276 | } | |
247 | 277 | ||
248 | 278 | ||
249 | 279 | func getUserInterestInfo (pool,userAddress) = { | |
250 | 280 | let userLastInterest = getInteger(this, (((pool + "_") + toString(userAddress)) + keyUserLastInterest)) | |
251 | 281 | let userShare = getInteger(this, (((pool + "_") + toString(userAddress)) + keyUserShareTokensLocked)) | |
252 | 282 | let lastInterest = valueOrErrorMessage(getInteger(this, (pool + keyLastInterest)), (("No data on the key: " + pool) + keyLastInterest)) | |
253 | 283 | let userLastInterestValue = match userLastInterest { | |
254 | 284 | case userLastInterest: Int => | |
255 | 285 | userLastInterest | |
256 | 286 | case _ => | |
257 | 287 | lastInterest | |
258 | 288 | } | |
259 | 289 | let userShareTokensAmount = match userShare { | |
260 | 290 | case userShare: Int => | |
261 | 291 | userShare | |
262 | 292 | case _ => | |
263 | 293 | 0 | |
264 | 294 | } | |
265 | 295 | $Tuple2(userLastInterestValue, userShareTokensAmount) | |
266 | 296 | } | |
267 | 297 | ||
268 | 298 | ||
269 | 299 | func calcInterest (lastInterestHeight,rewardUpdateHeight,poolRewardUpdateHeight,lastInterest,currentRewardPerBlock,shareTokenLocked,previousRewardPerBlock,shareAssetId,scaleValue,pmtAmount) = if ((shareTokenLocked == 0)) | |
270 | 300 | then 0 | |
271 | 301 | else if ((poolRewardUpdateHeight != 0)) | |
272 | 302 | then if (if ((rewardUpdateHeight > height)) | |
273 | 303 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
274 | 304 | else false) | |
275 | 305 | then { | |
276 | 306 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
277 | 307 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
278 | 308 | } | |
279 | 309 | else if (if ((height > rewardUpdateHeight)) | |
280 | 310 | then (rewardUpdateHeight != poolRewardUpdateHeight) | |
281 | 311 | else false) | |
282 | 312 | then { | |
283 | 313 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
284 | 314 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
285 | 315 | } | |
286 | 316 | else if (if (if ((height > rewardUpdateHeight)) | |
287 | 317 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
288 | 318 | else false) | |
289 | 319 | then (lastInterestHeight > rewardUpdateHeight) | |
290 | 320 | else false) | |
291 | 321 | then { | |
292 | 322 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
293 | 323 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
294 | 324 | } | |
295 | 325 | else { | |
296 | 326 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
297 | 327 | let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked)) | |
298 | 328 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
299 | 329 | (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked)) | |
300 | 330 | } | |
301 | 331 | else if ((rewardUpdateHeight > height)) | |
302 | 332 | then { | |
303 | 333 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
304 | 334 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
305 | 335 | } | |
306 | 336 | else if ((lastInterestHeight > rewardUpdateHeight)) | |
307 | 337 | then { | |
308 | 338 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
309 | 339 | (lastInterest + fraction(reward, scaleValue, shareTokenLocked)) | |
310 | 340 | } | |
311 | 341 | else { | |
312 | 342 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
313 | 343 | let interestAfterUpdate = (lastInterest + fraction(rewardAfterLastInterestBeforeReawardUpdate, scaleValue, shareTokenLocked)) | |
314 | 344 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
315 | 345 | (interestAfterUpdate + fraction(reward, scaleValue, shareTokenLocked)) | |
316 | 346 | } | |
317 | 347 | ||
318 | 348 | ||
319 | 349 | func claimCalc (pool,caller,pmtAmount) = { | |
320 | 350 | let shareAssetId = getShareAssetId(pool) | |
321 | 351 | let scaleValue = calcScaleValue(SWOP, shareAssetId) | |
322 | 352 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
323 | - | let $ | |
324 | - | let lastInterestHeight = $ | |
325 | - | let lastInterest = $ | |
326 | - | let $ | |
327 | - | let currentRewardPerBlock = $ | |
328 | - | let rewardUpdateHeight = $ | |
329 | - | let previousRewardPerBlock = $ | |
330 | - | let poolRewardUpdateHeight = $ | |
331 | - | let $ | |
332 | - | let userLastInterest = $ | |
333 | - | let userShareTokensAmount = $ | |
353 | + | let $t01353813603 = getLastInterestInfo(pool) | |
354 | + | let lastInterestHeight = $t01353813603._1 | |
355 | + | let lastInterest = $t01353813603._2 | |
356 | + | let $t01360813720 = rewardInfo(pool) | |
357 | + | let currentRewardPerBlock = $t01360813720._1 | |
358 | + | let rewardUpdateHeight = $t01360813720._2 | |
359 | + | let previousRewardPerBlock = $t01360813720._3 | |
360 | + | let poolRewardUpdateHeight = $t01360813720._4 | |
361 | + | let $t01372513804 = getUserInterestInfo(pool, caller) | |
362 | + | let userLastInterest = $t01372513804._1 | |
363 | + | let userShareTokensAmount = $t01372513804._2 | |
334 | 364 | let currentInterest = calcInterest(lastInterestHeight, rewardUpdateHeight, poolRewardUpdateHeight, lastInterest, currentRewardPerBlock, shareTokenLocked, previousRewardPerBlock, shareAssetId, scaleValue, pmtAmount) | |
335 | 365 | let claimAmount = fraction(userShareTokensAmount, (currentInterest - userLastInterest), scaleValue) | |
336 | 366 | let userNewInterest = currentInterest | |
337 | 367 | $Tuple4(userNewInterest, currentInterest, claimAmount, userShareTokensAmount) | |
338 | 368 | } | |
339 | 369 | ||
340 | 370 | ||
341 | 371 | func calculateProtocolReward (pool) = { | |
342 | - | let $ | |
343 | - | let lastInterestHeight = $ | |
344 | - | let lastInterest = $ | |
345 | - | let $ | |
346 | - | let currentRewardPerBlock = $ | |
347 | - | let rewardUpdateHeight = $ | |
348 | - | let previousRewardPerBlock = $ | |
349 | - | let poolRewardUpdateHeight = $ | |
372 | + | let $t01432214387 = getLastInterestInfo(pool) | |
373 | + | let lastInterestHeight = $t01432214387._1 | |
374 | + | let lastInterest = $t01432214387._2 | |
375 | + | let $t01439214503 = rewardInfo(pool) | |
376 | + | let currentRewardPerBlock = $t01439214503._1 | |
377 | + | let rewardUpdateHeight = $t01439214503._2 | |
378 | + | let previousRewardPerBlock = $t01439214503._3 | |
379 | + | let poolRewardUpdateHeight = $t01439214503._4 | |
350 | 380 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
351 | 381 | if (if ((shareTokenLocked == 0)) | |
352 | 382 | then (poolRewardUpdateHeight == 0) | |
353 | 383 | else false) | |
354 | 384 | then if ((rewardUpdateHeight > height)) | |
355 | 385 | then { | |
356 | 386 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
357 | 387 | reward | |
358 | 388 | } | |
359 | 389 | else if ((lastInterestHeight > rewardUpdateHeight)) | |
360 | 390 | then { | |
361 | 391 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
362 | 392 | reward | |
363 | 393 | } | |
364 | 394 | else { | |
365 | 395 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
366 | 396 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
367 | 397 | (reward + rewardAfterLastInterestBeforeReawardUpdate) | |
368 | 398 | } | |
369 | 399 | else if (if ((shareTokenLocked == 0)) | |
370 | 400 | then (poolRewardUpdateHeight != 0) | |
371 | 401 | else false) | |
372 | 402 | then if (if ((rewardUpdateHeight > height)) | |
373 | 403 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
374 | 404 | else false) | |
375 | 405 | then { | |
376 | 406 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
377 | 407 | reward | |
378 | 408 | } | |
379 | 409 | else if (if ((height > rewardUpdateHeight)) | |
380 | 410 | then (rewardUpdateHeight != poolRewardUpdateHeight) | |
381 | 411 | else false) | |
382 | 412 | then { | |
383 | 413 | let reward = (previousRewardPerBlock * (height - lastInterestHeight)) | |
384 | 414 | reward | |
385 | 415 | } | |
386 | 416 | else if (if (if ((height > rewardUpdateHeight)) | |
387 | 417 | then (rewardUpdateHeight == poolRewardUpdateHeight) | |
388 | 418 | else false) | |
389 | 419 | then (lastInterestHeight > rewardUpdateHeight) | |
390 | 420 | else false) | |
391 | 421 | then { | |
392 | 422 | let reward = (currentRewardPerBlock * (height - lastInterestHeight)) | |
393 | 423 | reward | |
394 | 424 | } | |
395 | 425 | else { | |
396 | 426 | let rewardAfterLastInterestBeforeReawardUpdate = (previousRewardPerBlock * (rewardUpdateHeight - lastInterestHeight)) | |
397 | 427 | let reward = (currentRewardPerBlock * (height - rewardUpdateHeight)) | |
398 | 428 | (reward + rewardAfterLastInterestBeforeReawardUpdate) | |
399 | 429 | } | |
400 | 430 | else 0 | |
401 | 431 | } | |
402 | 432 | ||
403 | 433 | ||
404 | 434 | func checkPmtAssetIdCorrect (pool,pmtAssetId) = { | |
405 | 435 | let poolShareAssetId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
406 | 436 | if ((pmtAssetId == poolShareAssetId)) | |
407 | 437 | then true | |
408 | 438 | else false | |
409 | 439 | } | |
410 | 440 | ||
411 | 441 | ||
412 | 442 | func getUserSWOPClaimedAmount (pool,user) = valueOrElse(getInteger(this, (((pool + "_") + toString(user)) + keyUserSWOPClaimedAmount)), 0) | |
413 | 443 | ||
414 | 444 | ||
415 | 445 | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
416 | 446 | ||
417 | 447 | ||
418 | 448 | @Callable(i) | |
419 | 449 | func init (earlyLP) = if (isDefined(getString(this, keySWOPid))) | |
420 | 450 | then throw("SWOP already initialized") | |
421 | 451 | else { | |
422 | 452 | let initAmount = 100000000000000 | |
423 | 453 | let SWOPissue = Issue("SWOP", "SWOP protocol token", initAmount, 8, true) | |
424 | 454 | let SWOPid = calculateAssetId(SWOPissue) | |
425 | 455 | [BooleanEntry(keyActive, true), Issue("SWOP", "SWOP protocol token", initAmount, 8, true), StringEntry(keySWOPid, toBase58String(SWOPid))] | |
426 | 456 | } | |
427 | 457 | ||
428 | 458 | ||
429 | 459 | ||
430 | 460 | @Callable(i) | |
431 | 461 | func initPoolShareFarming (pool) = if ((i.caller != this)) | |
432 | 462 | then throw("Only the DApp itself can call this function") | |
433 | 463 | else { | |
434 | - | let $ | |
435 | - | let currentReward = $ | |
436 | - | let rewardUpdateHeight = $ | |
437 | - | let previousRewardPerBlock = $ | |
438 | - | let poolRewardUpdateHeight = $ | |
464 | + | let $t01748517588 = rewardInfo(pool) | |
465 | + | let currentReward = $t01748517588._1 | |
466 | + | let rewardUpdateHeight = $t01748517588._2 | |
467 | + | let previousRewardPerBlock = $t01748517588._3 | |
468 | + | let poolRewardUpdateHeight = $t01748517588._4 | |
439 | 469 | [IntegerEntry((pool + keyShareTokensLocked), 0), IntegerEntry((pool + keyLastInterest), 0), IntegerEntry((pool + keyLastInterestHeight), height)] | |
440 | 470 | } | |
441 | 471 | ||
442 | 472 | ||
443 | 473 | ||
444 | 474 | @Callable(i) | |
445 | - | func updatePoolInterest (pool) = if ((i.caller != | |
475 | + | func updatePoolInterest (pool) = if ((i.caller != moneyBoxAddress)) | |
446 | 476 | then throw("Only the Admin itself can call this function") | |
447 | 477 | else if (!(isActive)) | |
448 | 478 | then throw("DApp is inactive at this moment") | |
449 | 479 | else { | |
450 | - | let $ | |
451 | - | let userNewInterest = $ | |
452 | - | let currentInterest = $ | |
453 | - | let claimAmount = $ | |
454 | - | let userShareTokensAmount = $ | |
455 | - | let $ | |
456 | - | let currentReward = $ | |
457 | - | let rewardUpdateHeight = $ | |
458 | - | let previousRewardPerBlock = $ | |
459 | - | let poolRewardUpdateHeight = $ | |
480 | + | let $t01800618139 = claimCalc(pool, addressFromPublicKey(adminInvokePubKey), 0) | |
481 | + | let userNewInterest = $t01800618139._1 | |
482 | + | let currentInterest = $t01800618139._2 | |
483 | + | let claimAmount = $t01800618139._3 | |
484 | + | let userShareTokensAmount = $t01800618139._4 | |
485 | + | let $t01814418247 = rewardInfo(pool) | |
486 | + | let currentReward = $t01814418247._1 | |
487 | + | let rewardUpdateHeight = $t01814418247._2 | |
488 | + | let previousRewardPerBlock = $t01814418247._3 | |
489 | + | let poolRewardUpdateHeight = $t01814418247._4 | |
460 | 490 | [IntegerEntry((pool + keyLastInterest), userNewInterest), IntegerEntry((pool + keyLastInterestHeight), height)] | |
461 | 491 | } | |
462 | 492 | ||
463 | 493 | ||
464 | 494 | ||
465 | 495 | @Callable(i) | |
466 | 496 | func lockShareTokens (pool) = { | |
467 | - | let $ | |
468 | - | let pmtAmount = $ | |
469 | - | let pmtAssetId = $ | |
470 | - | let $ | |
471 | - | let pmtStrAssetId = $ | |
472 | - | let pmtAssetName = $ | |
473 | - | let pmtDecimals = $ | |
474 | - | let $ | |
475 | - | let userNewInterest = $ | |
476 | - | let currentInterest = $ | |
477 | - | let claimAmount = $ | |
478 | - | let userShareTokensAmount = $ | |
497 | + | let $t01843918514 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
498 | + | let pmtAmount = $t01843918514._1 | |
499 | + | let pmtAssetId = $t01843918514._2 | |
500 | + | let $t01851918592 = getAssetInfo(pmtAssetId) | |
501 | + | let pmtStrAssetId = $t01851918592._1 | |
502 | + | let pmtAssetName = $t01851918592._2 | |
503 | + | let pmtDecimals = $t01851918592._3 | |
504 | + | let $t01859718711 = claimCalc(pool, i.originCaller, pmtAmount) | |
505 | + | let userNewInterest = $t01859718711._1 | |
506 | + | let currentInterest = $t01859718711._2 | |
507 | + | let claimAmount = $t01859718711._3 | |
508 | + | let userShareTokensAmount = $t01859718711._4 | |
479 | 509 | let userShareAmountNew = (userShareTokensAmount + pmtAmount) | |
480 | - | let availableFundsNew = (userAvailableSWOP(pool, i. | |
510 | + | let availableFundsNew = (userAvailableSWOP(pool, i.originCaller) + claimAmount) | |
481 | 511 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
482 | 512 | let totalShareAmountNew = (totalShareAmount + pmtAmount) | |
483 | - | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i. | |
513 | + | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.originCaller) | |
484 | 514 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
485 | - | 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)] | |
486 | - | let harvestPeriod = ((((getHeightFirstHarvest(Address(fromBase58String(pool))) - startHeight) + 1) / periodLength) - 1) | |
487 | - | let amountOfVoting = split(getStringValue(votingAddress, (((toString(i.caller) + "_") + pool) + "_user_pool_struc")), "_") | |
488 | - | let amountPoolStract = split(getStringValue(votingAddress, (pool + "_pool_struc")), "_") | |
489 | - | let amountActiveVoteUserPoolStract = split(valueOrElse(getString(votingAddress, (((toString(i.caller) + "_") + pool) + kHarvestUserPoolActiveVoteStrucVoting)), ""), "_") | |
490 | - | let amountPoolActiveVoteStract = split(valueOrElse(getString(votingAddress, (pool + kHarvestPoolActiveVoteStrucVoting)), ""), "_") | |
491 | - | let userShareTokenLocked = userShareTokensAmount | |
492 | - | let userPoolActiveVote = if ((toString(currPeriod) == amountOfVoting[2])) | |
493 | - | then valueOrElse(parseInt(amountActiveVoteUserPoolStract[0]), 0) | |
494 | - | else valueOrElse(parseInt(amountOfVoting[1]), 0) | |
495 | - | let poolActiveVote = if ((toString(currPeriod) == amountPoolStract[2])) | |
496 | - | then valueOrElse(parseInt(amountPoolActiveVoteStract[0]), 0) | |
497 | - | else valueOrElse(parseInt(amountPoolStract[1]), 0) | |
498 | - | let protocolReward = calculateProtocolReward(pool) | |
499 | - | let limitShareToken = getShareLimitToken(addressFromStringValue(pool)) | |
500 | - | let shareToken = (fraction(limitShareToken, userPoolActiveVote, poolActiveVote) - userShareTokenLocked) | |
501 | - | if ((fraction(99, (accountBalance(pmtAssetId) + pmtAmount), 100) > totalShareAmountNew)) | |
502 | - | then throw("Balance of share-token is greater than totalAmount") | |
503 | - | else throw("test error") | |
515 | + | let baseEntry = [IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyShareTokensLocked), totalShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserSWOPLastClaimedAmount), claimAmount), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyAvailableSWOP), availableFundsNew)] | |
516 | + | if ((0 >= pmtAmount)) | |
517 | + | then throw("You can't lock token") | |
518 | + | else if (!(isActive)) | |
519 | + | then throw("DApp is inactive at this moment") | |
520 | + | else if (!(checkPmtAssetIdCorrect(pool, pmtAssetId))) | |
521 | + | then throw("Incorrect pmtAssetId") | |
522 | + | else if (if (isFirstHarvest(Address(fromBase58String(pool)))) | |
523 | + | then (getHeightFirstHarvest(Address(fromBase58String(pool))) > height) | |
524 | + | else false) | |
525 | + | then { | |
526 | + | let harvestPeriod = ((((getHeightFirstHarvest(Address(fromBase58String(pool))) - startHeight) + 1) / periodLength) - 1) | |
527 | + | let amountOfVoting = split(getStringValue(votingAddress, (((toString(i.originCaller) + "_") + pool) + "_user_pool_struc")), "_") | |
528 | + | let amountPoolStract = split(getStringValue(votingAddress, (pool + "_pool_struc")), "_") | |
529 | + | let amountActiveVoteUserPoolStract = split(valueOrElse(getString(votingAddress, (((toString(i.originCaller) + "_") + pool) + kHarvestUserPoolActiveVoteStrucVoting)), ""), "_") | |
530 | + | let amountPoolActiveVoteStract = split(valueOrElse(getString(votingAddress, (pool + kHarvestPoolActiveVoteStrucVoting)), ""), "_") | |
531 | + | let userShareTokenLocked = userShareTokensAmount | |
532 | + | let userPoolActiveVote = if ((toString(currPeriod) == amountOfVoting[2])) | |
533 | + | then valueOrElse(parseInt(amountActiveVoteUserPoolStract[0]), 0) | |
534 | + | else valueOrElse(parseInt(amountOfVoting[1]), 0) | |
535 | + | let poolActiveVote = if ((toString(currPeriod) == amountPoolStract[2])) | |
536 | + | then valueOrElse(parseInt(amountPoolActiveVoteStract[0]), 0) | |
537 | + | else valueOrElse(parseInt(amountPoolStract[1]), 0) | |
538 | + | let protocolReward = calculateProtocolReward(pool) | |
539 | + | if ((userPoolActiveVote != 0)) | |
540 | + | then { | |
541 | + | let limitShareToken = getShareLimitToken(addressFromStringValue(pool)) | |
542 | + | let shareToken = (fraction(limitShareToken, userPoolActiveVote, poolActiveVote) - userShareTokenLocked) | |
543 | + | if (if ((size(amountActiveVoteUserPoolStract) > 1)) | |
544 | + | then (valueOrElse(parseInt(amountActiveVoteUserPoolStract[1]), 0) >= harvestPeriod) | |
545 | + | else false) | |
546 | + | then throw("You can't share token") | |
547 | + | else if ((pmtAmount > limitShareToken)) | |
548 | + | then throw(("You can't share token more than " + toString(limitShareToken))) | |
549 | + | else if ((shareToken > 0)) | |
550 | + | then if ((fraction(99, (accountBalance(pmtAssetId) + pmtAmount), 100) > totalShareAmountNew)) | |
551 | + | then throw("Balance of share-token is greater than totalAmount") | |
552 | + | else if ((totalShareAmount == 0)) | |
553 | + | then (baseEntry ++ [Reissue(SWOP, protocolReward, true), ScriptTransfer(moneyBoxAddress, protocolReward, SWOP)]) | |
554 | + | else if ((shareToken >= pmtAmount)) | |
555 | + | then baseEntry | |
556 | + | else throw(("Your maximum share token is " + toString(shareToken))) | |
557 | + | else throw("You can't share token") | |
558 | + | } | |
559 | + | else throw("Your amount of token less than 0") | |
560 | + | } | |
561 | + | else baseEntry | |
504 | 562 | } | |
505 | 563 | ||
506 | 564 | ||
507 | 565 | ||
508 | 566 | @Callable(i) | |
509 | 567 | func withdrawShareTokens (pool,shareTokensWithdrawAmount) = { | |
510 | 568 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
511 | - | let $ | |
512 | - | let userNewInterest = $ | |
513 | - | let currentInterest = $ | |
514 | - | let claimAmount = $ | |
515 | - | let userShareTokensAmount = $ | |
569 | + | let $t02322023326 = claimCalc(pool, i.originCaller, 1) | |
570 | + | let userNewInterest = $t02322023326._1 | |
571 | + | let currentInterest = $t02322023326._2 | |
572 | + | let claimAmount = $t02322023326._3 | |
573 | + | let userShareTokensAmount = $t02322023326._4 | |
516 | 574 | let userShareAmountNew = (userShareTokensAmount - shareTokensWithdrawAmount) | |
517 | - | let availableFundsNew = (userAvailableSWOP(pool, i. | |
575 | + | let availableFundsNew = (userAvailableSWOP(pool, i.originCaller) + claimAmount) | |
518 | 576 | let totalShareAmount = getTotalShareTokenLocked(pool) | |
519 | 577 | let totalShareAmountNew = (totalShareAmount - shareTokensWithdrawAmount) | |
520 | - | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i. | |
578 | + | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.originCaller) | |
521 | 579 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
522 | 580 | if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
523 | 581 | then throw("Withdraw amount more then user locked amount") | |
524 | 582 | else if (!(isActive)) | |
525 | 583 | then throw("DApp is inactive at this moment") | |
526 | 584 | else if ((shareTokensWithdrawAmount > userShareTokensAmount)) | |
527 | 585 | then throw("Withdraw amount more then user locked amount") | |
528 | 586 | else if ((fraction(99, (accountBalance(shareTokensId) - shareTokensWithdrawAmount), 100) > totalShareAmountNew)) | |
529 | 587 | then throw("Balance of share-token is greater than totalAmount") | |
530 | - | else [IntegerEntry((((pool + "_") + toString(i. | |
588 | + | else [IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserLastInterest), userNewInterest), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserShareTokensLocked), userShareAmountNew), IntegerEntry((pool + keyLastInterest), currentInterest), IntegerEntry((pool + keyLastInterestHeight), height), IntegerEntry((pool + keyShareTokensLocked), totalShareAmountNew), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyAvailableSWOP), availableFundsNew), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((((pool + "_") + toString(i.originCaller)) + keyUserSWOPLastClaimedAmount), claimAmount), ScriptTransfer(i.caller, shareTokensWithdrawAmount, shareTokensId)] | |
531 | 589 | } | |
532 | 590 | ||
533 | 591 | ||
534 | 592 | ||
535 | 593 | @Callable(i) | |
536 | 594 | func claim (pool) = { | |
537 | 595 | let shareTokensId = fromBase58String(getStringValue(value(addressFromString(pool)), "share_asset_id")) | |
538 | 596 | let shareTokenLocked = getTotalShareTokenLocked(pool) | |
539 | - | let $ | |
540 | - | let lastInterestHeight = $ | |
541 | - | let lastInterest = $ | |
542 | - | let $ | |
543 | - | let currentRewardPerBlock = $ | |
544 | - | let rewardUpdateHeight = $ | |
545 | - | let previousRewardPerBlock = $ | |
546 | - | let poolRewardUpdateHeight = $ | |
547 | - | let $ | |
548 | - | let userNewInterest = $ | |
549 | - | let currentInterest = $ | |
550 | - | let claimAmount = $ | |
551 | - | let userShareTokensAmount = $ | |
597 | + | let $t02537425439 = getLastInterestInfo(pool) | |
598 | + | let lastInterestHeight = $t02537425439._1 | |
599 | + | let lastInterest = $t02537425439._2 | |
600 | + | let $t02544425556 = rewardInfo(pool) | |
601 | + | let currentRewardPerBlock = $t02544425556._1 | |
602 | + | let rewardUpdateHeight = $t02544425556._2 | |
603 | + | let previousRewardPerBlock = $t02544425556._3 | |
604 | + | let poolRewardUpdateHeight = $t02544425556._4 | |
605 | + | let $t02556125661 = claimCalc(pool, i.caller, 1) | |
606 | + | let userNewInterest = $t02556125661._1 | |
607 | + | let currentInterest = $t02556125661._2 | |
608 | + | let claimAmount = $t02556125661._3 | |
609 | + | let userShareTokensAmount = $t02556125661._4 | |
552 | 610 | let availableFund = (userAvailableSWOP(pool, i.caller) + claimAmount) | |
553 | 611 | let userClaimedAmount = getUserSWOPClaimedAmount(pool, i.caller) | |
554 | 612 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
555 | 613 | if ((availableFund == 0)) | |
556 | 614 | then throw("You have 0 available SWOP") | |
557 | 615 | else if (!(isActive)) | |
558 | 616 | then throw("DApp is inactive at this moment") | |
559 | 617 | else if ((availableFund == 0)) | |
560 | 618 | then throw("You have 0 available SWOP") | |
561 | 619 | else if ((fraction(99, accountBalance(shareTokensId), 100) > shareTokenLocked)) | |
562 | 620 | then throw("Balance of share-token is greater than totalAmount") | |
563 | 621 | 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)] | |
564 | 622 | } | |
565 | 623 | ||
566 | 624 | ||
567 | 625 | ||
568 | 626 | @Callable(i) | |
569 | 627 | func shutdown () = if (!(isActive)) | |
570 | 628 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
571 | 629 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
572 | 630 | then throw("Only admin can call this function") | |
573 | 631 | else suspend("Paused by admin") | |
574 | 632 | ||
575 | 633 | ||
576 | 634 | ||
577 | 635 | @Callable(i) | |
578 | 636 | func activate () = if (isActive) | |
579 | 637 | then throw("DApp is already active") | |
580 | 638 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))) | |
581 | 639 | then throw("Only admin can call this function") | |
582 | 640 | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
583 | 641 | ||
584 | 642 | ||
585 | 643 | @Verifier(tx) | |
586 | 644 | func verify () = match tx { | |
587 | 645 | case _ => | |
588 | 646 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
589 | 647 | then 1 | |
590 | 648 | else 0 | |
591 | 649 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
592 | 650 | then 1 | |
593 | 651 | else 0 | |
594 | 652 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
595 | 653 | then 1 | |
596 | 654 | else 0 | |
597 | 655 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
598 | 656 | } | |
599 | 657 |
github/deemru/w8io/169f3d6 100.55 ms ◑