tx · EJyzmvU9wyzKFvUzVAr2ZNteMXwdKA3JepBmaqovpSBm 3N98Ngyaszw66EakvWRCiZ771ja2RDgNaxV: -0.02900000 Waves 2023.01.13 12:52 [2403024] smart account 3N98Ngyaszw66EakvWRCiZ771ja2RDgNaxV > SELF 0.00000000 Waves
{ "type": 13, "id": "EJyzmvU9wyzKFvUzVAr2ZNteMXwdKA3JepBmaqovpSBm", "fee": 2900000, "feeAssetId": null, "timestamp": 1673603573026, "version": 1, "sender": "3N98Ngyaszw66EakvWRCiZ771ja2RDgNaxV", "senderPublicKey": "F4oaTkX67vt2MEsXLJJ8a7gaURGjW7x8fkvGfdEiH5oy", "proofs": [ "gXUFMjLpsqjBKVEXZcmLfuqjxa7fguc4tNDu8WFDsfrMpxa1yKXaZXFRJVAcegXreQxTuyFk4RwNPWdY35hrGdV" ], "script": "base64:BgIzCAISAwoBCBIAEgQKAgIBEgQKAgIBEgcKBQgICAgIEgASBAoCCAgSABIECgIICBIDCgEIQQAJc2VwYXJhdG9yAgJfXwASc2hhcmVBc3NldERlY2ltYWxzAAgAC3dhdmVzU3RyaW5nAgVXQVZFUwAHc2NhbGUxOACAgJC7utat8A0ADXNjYWxlMThCaWdJbnQJALYCAQUHc2NhbGUxOAEHd3JhcEVycgEDbXNnCQC5CQIJAMwIAgIWbHBfc3Rha2luZ19wb29scy5yaWRlOgkAzAgCBQNtc2cFA25pbAIBIAEIdGhyb3dFcnIBA21zZwkAAgEJAQd3cmFwRXJyAQUDbXNnARJlcnJLZXlJc05vdERlZmluZWQCB2FkZHJlc3MDa2V5CQEHd3JhcEVycgEJALkJAgkAzAgCAgptYW5kYXRvcnkgCQDMCAIJAKUIAQUHYWRkcmVzcwkAzAgCAgEuCQDMCAIFA2tleQkAzAgCAg8gaXMgbm90IGRlZmluZWQFA25pbAIAAQxnZXRTdHJPckZhaWwCB2FkZHJlc3MDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUHYWRkcmVzcwUDa2V5CQ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yUHVibGljS2V5T3JVbml0AAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAJwawUHJG1hdGNoMAUCcGsDCQABAgUHJG1hdGNoMAIEVW5pdAgFAnR4D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQ90YXJnZXRQdWJsaWNLZXnwo/mk", "chainId": 84, "height": 2403024, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7BdaSHDCRUgc7XzSuat1P1rDJWjVzZCNdvVY9DkzqanA Next: GRmwVoE47idkiEzX845B8XUnpK2vGHmmYvKx1CJ25ovy Diff:
Old | New | Differences | |
---|---|---|---|
270 | 270 | ||
271 | 271 | ||
272 | 272 | @Callable(i) | |
273 | + | func emit (assetId,amount) = { | |
274 | + | let checkCaller = mustThis(i) | |
275 | + | if ((checkCaller == checkCaller)) | |
276 | + | then { | |
277 | + | let isReissuable = true | |
278 | + | $Tuple2([Reissue(assetId, amount, isReissuable)], amount) | |
279 | + | } | |
280 | + | else throw("Strict value is not equal to itself.") | |
281 | + | } | |
282 | + | ||
283 | + | ||
284 | + | ||
285 | + | @Callable(i) | |
286 | + | func burn (assetId,amount) = { | |
287 | + | let checkCaller = mustThis(i) | |
288 | + | if ((checkCaller == checkCaller)) | |
289 | + | then $Tuple2([Burn(assetId, amount)], amount) | |
290 | + | else throw("Strict value is not equal to itself.") | |
291 | + | } | |
292 | + | ||
293 | + | ||
294 | + | ||
295 | + | @Callable(i) | |
273 | 296 | func create (baseAssetIdStr,shareAssetIdStr,shareAssetName,shareAssetDescription,shareAssetLogo) = { | |
274 | 297 | let shareAssetLabel = "LP_STAKING_POOLS" | |
275 | 298 | let baseAssetId = parseAssetId(baseAssetIdStr) | |
324 | 347 | else throwErr("invalid asset")] | |
325 | 348 | if ((checks == checks)) | |
326 | 349 | then { | |
327 | - | let $ | |
328 | - | let poolAddress = $ | |
329 | - | let lpAssetId = $ | |
350 | + | let $t01164611749 = valueOrErrorMessage(getPoolInfo(baseAssetId), wrapErr("invalid asset")) | |
351 | + | let poolAddress = $t01164611749._1 | |
352 | + | let lpAssetId = $t01164611749._2 | |
330 | 353 | let period = value(getInteger(keyPeriod(baseAssetId))) | |
331 | 354 | let userBaseAssetAmountToConvertPeriodOption = getInteger(keyUserBaseAssetAmountToConvertPeriod(baseAssetId, userAddress)) | |
332 | 355 | let claimShareAssetInvocation = if ((userBaseAssetAmountToConvertPeriodOption == unit)) | |
416 | 439 | if ((baseAssetId == baseAssetId)) | |
417 | 440 | then { | |
418 | 441 | let userAddress = i.caller | |
419 | - | let $ | |
420 | - | let poolAddress = $ | |
421 | - | let lpAssetId = $ | |
442 | + | let $t01545015553 = valueOrErrorMessage(getPoolInfo(baseAssetId), wrapErr("invalid asset")) | |
443 | + | let poolAddress = $t01545015553._1 | |
444 | + | let lpAssetId = $t01545015553._2 | |
422 | 445 | let period = value(getInteger(keyPeriod(baseAssetId))) | |
423 | 446 | let userShareAssetAmountToConvertPeriodOption = getInteger(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress)) | |
424 | 447 | let claimBaseAssetInvocation = if ((userShareAssetAmountToConvertPeriodOption == unit)) | |
506 | 529 | let shareAssetId = value(parseAssetId(valueOrErrorMessage(getString(keyShareAssetId(baseAssetId)), wrapErr("invalid base asset id")))) | |
507 | 530 | if ((shareAssetId == shareAssetId)) | |
508 | 531 | then { | |
532 | + | let shareAssetInfo = valueOrErrorMessage(assetInfo(shareAssetId), wrapErr("invalid share asset id")) | |
509 | 533 | let period = valueOrErrorMessage(getInteger(keyPeriod(baseAssetId)), wrapErr("invalid period")) | |
510 | 534 | if ((period == period)) | |
511 | 535 | then { | |
521 | 545 | } | |
522 | 546 | if ((checkDelay == checkDelay)) | |
523 | 547 | then { | |
524 | - | let $ | |
525 | - | let poolAddress = $ | |
526 | - | let lpAssetId = $ | |
548 | + | let $t01959919780 = valueOrErrorMessage(getPoolInfo(baseAssetId), wrapErr("invalid asset")) | |
549 | + | let poolAddress = $t01959919780._1 | |
550 | + | let lpAssetId = $t01959919780._2 | |
527 | 551 | let stakingReward = valueOrErrorMessage({ | |
528 | 552 | let @ = invoke(stakingContract, "claimWxDoNotThrow", [assetIdToString(lpAssetId)], nil) | |
529 | 553 | if ($isInstanceOf(@, "Int")) | |
628 | 652 | } | |
629 | 653 | if ((baseAssetAmount == baseAssetAmount)) | |
630 | 654 | then { | |
631 | - | let shareAssetBurnActions = [Burn(shareAssetId, shareAssetAmountToConvert)] | |
632 | - | let priceGet = fraction(toBigInt(baseAssetAmount), scale18BigInt, toBigInt(shareAssetAmountToConvert), FLOOR) | |
633 | - | let priceGetUpdateActions = [BinaryEntry(keyPricePeriodGet(baseAssetId, period), toBytes(priceGet)), StringEntry(keyPriceGetHistory(baseAssetId), toString(priceGet))] | |
634 | - | (shareAssetBurnActions ++ priceGetUpdateActions) | |
655 | + | let shareAssetBurn = if ((shareAssetInfo.issuer == this)) | |
656 | + | then invoke(this, "burn", [shareAssetId, shareAssetAmountToConvert], nil) | |
657 | + | else if ((shareAssetInfo.issuer == lpStakingContract)) | |
658 | + | then invoke(lpStakingContract, "burn", [shareAssetId, shareAssetAmountToConvert], nil) | |
659 | + | else throwErr("invalid share asset issuer") | |
660 | + | if ((shareAssetBurn == shareAssetBurn)) | |
661 | + | then { | |
662 | + | let priceGet = fraction(toBigInt(baseAssetAmount), scale18BigInt, toBigInt(shareAssetAmountToConvert), FLOOR) | |
663 | + | let priceGetUpdateActions = [BinaryEntry(keyPricePeriodGet(baseAssetId, period), toBytes(priceGet)), StringEntry(keyPriceGetHistory(baseAssetId), toString(priceGet))] | |
664 | + | priceGetUpdateActions | |
665 | + | } | |
666 | + | else throw("Strict value is not equal to itself.") | |
635 | 667 | } | |
636 | 668 | else throw("Strict value is not equal to itself.") | |
637 | 669 | } | |
638 | 670 | else throw("Strict value is not equal to itself.") | |
639 | 671 | } | |
640 | 672 | else nil | |
641 | - | | |
673 | + | if ((getActions == getActions)) | |
642 | 674 | then { | |
643 | - | let lpAssetAmount = { | |
644 | - | let minOutAmount = 0 | |
645 | - | let autoStake = true | |
646 | - | valueOrErrorMessage({ | |
647 | - | let @ = invoke(poolAddress, "putOneTknV2", [minOutAmount, autoStake], [AttachedPayment(baseAssetId, baseAssetAmountToConvert)]) | |
648 | - | if ($isInstanceOf(@, "Int")) | |
649 | - | then @ | |
650 | - | else unit | |
651 | - | }, wrapErr("invalid putOneTknV2 result")) | |
652 | - | } | |
653 | - | if ((lpAssetAmount == lpAssetAmount)) | |
675 | + | let putActions = if ((baseAssetAmountToConvert > 0)) | |
654 | 676 | then { | |
655 | - | let price = calcPrice(lpAssetId, shareAssetId) | |
656 | - | if ((price == price)) | |
677 | + | let lpAssetAmount = { | |
678 | + | let minOutAmount = 0 | |
679 | + | let autoStake = true | |
680 | + | valueOrErrorMessage({ | |
681 | + | let @ = invoke(poolAddress, "putOneTknV2", [minOutAmount, autoStake], [AttachedPayment(baseAssetId, baseAssetAmountToConvert)]) | |
682 | + | if ($isInstanceOf(@, "Int")) | |
683 | + | then @ | |
684 | + | else unit | |
685 | + | }, wrapErr("invalid putOneTknV2 result")) | |
686 | + | } | |
687 | + | if ((lpAssetAmount == lpAssetAmount)) | |
657 | 688 | then { | |
658 | - | let shareAssetAmount = toInt(fraction(toBigInt(lpAssetAmount), scale18BigInt, price, FLOOR)) | |
659 | - | let isReissuable = true | |
660 | - | let shareAssetReissueActions = [Reissue(shareAssetId, shareAssetAmount, isReissuable)] | |
661 | - | let pricePut = fraction(toBigInt(baseAssetAmountToConvert), scale18BigInt, toBigInt(shareAssetAmount)) | |
662 | - | let pricePutUpdateActions = [BinaryEntry(keyPricePeriodPut(baseAssetId, period), toBytes(pricePut)), StringEntry(keyPricePutHistory(baseAssetId), toString(pricePut))] | |
663 | - | (shareAssetReissueActions ++ pricePutUpdateActions) | |
689 | + | let price = calcPrice(lpAssetId, shareAssetId) | |
690 | + | if ((price == price)) | |
691 | + | then { | |
692 | + | let shareAssetAmount = toInt(fraction(toBigInt(lpAssetAmount), scale18BigInt, price, FLOOR)) | |
693 | + | let shareAssetReissue = if ((shareAssetInfo.issuer == this)) | |
694 | + | then invoke(this, "emit", [shareAssetId, shareAssetAmount], nil) | |
695 | + | else if ((shareAssetInfo.issuer == lpStakingContract)) | |
696 | + | then invoke(lpStakingContract, "emit", [shareAssetId, shareAssetAmount], nil) | |
697 | + | else throwErr("invalid share asset issuer") | |
698 | + | if ((shareAssetReissue == shareAssetReissue)) | |
699 | + | then { | |
700 | + | let pricePut = fraction(toBigInt(baseAssetAmountToConvert), scale18BigInt, toBigInt(shareAssetAmount)) | |
701 | + | let pricePutUpdateActions = [BinaryEntry(keyPricePeriodPut(baseAssetId, period), toBytes(pricePut)), StringEntry(keyPricePutHistory(baseAssetId), toString(pricePut))] | |
702 | + | pricePutUpdateActions | |
703 | + | } | |
704 | + | else throw("Strict value is not equal to itself.") | |
705 | + | } | |
706 | + | else throw("Strict value is not equal to itself.") | |
664 | 707 | } | |
665 | 708 | else throw("Strict value is not equal to itself.") | |
666 | 709 | } | |
710 | + | else nil | |
711 | + | if ((putActions == putActions)) | |
712 | + | then { | |
713 | + | let newPeriod = (period + 1) | |
714 | + | let lastPrice = calcPrice(lpAssetId, shareAssetId) | |
715 | + | let actions = (([IntegerEntry(keyPeriod(baseAssetId), newPeriod), IntegerEntry(keyPeriodStartHeight(baseAssetId, newPeriod), height), IntegerEntry(keyShareAssetAmountToConvert(baseAssetId), 0), IntegerEntry(keyBaseAssetAmountToConvert(baseAssetId), 0), BinaryEntry(keyPricePeriod(baseAssetId, period), toBytes(lastPrice)), StringEntry(keyPriceHistory(baseAssetId), toString(lastPrice))] ++ putActions) ++ getActions) | |
716 | + | $Tuple2(actions, toBytes(lastPrice)) | |
717 | + | } | |
667 | 718 | else throw("Strict value is not equal to itself.") | |
668 | 719 | } | |
669 | - | else nil | |
670 | - | let newPeriod = (period + 1) | |
671 | - | let lastPrice = calcPrice(lpAssetId, shareAssetId) | |
672 | - | let actions = (([IntegerEntry(keyPeriod(baseAssetId), newPeriod), IntegerEntry(keyPeriodStartHeight(baseAssetId, newPeriod), height), IntegerEntry(keyShareAssetAmountToConvert(baseAssetId), 0), IntegerEntry(keyBaseAssetAmountToConvert(baseAssetId), 0), BinaryEntry(keyPricePeriod(baseAssetId, period), toBytes(lastPrice)), StringEntry(keyPriceHistory(baseAssetId), toString(lastPrice))] ++ putActions) ++ getActions) | |
673 | - | $Tuple2(actions, toBytes(lastPrice)) | |
720 | + | else throw("Strict value is not equal to itself.") | |
674 | 721 | } | |
675 | 722 | else throw("Strict value is not equal to itself.") | |
676 | 723 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let shareAssetDecimals = 8 | |
7 | 7 | ||
8 | 8 | let wavesString = "WAVES" | |
9 | 9 | ||
10 | 10 | let scale18 = 1000000000000000000 | |
11 | 11 | ||
12 | 12 | let scale18BigInt = toBigInt(scale18) | |
13 | 13 | ||
14 | 14 | func wrapErr (msg) = makeString(["lp_staking_pools.ride:", msg], " ") | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func throwErr (msg) = throw(wrapErr(msg)) | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func errKeyIsNotDefined (address,key) = wrapErr(makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func getStrOrFail (address,key) = valueOrErrorMessage(getString(address, key), errKeyIsNotDefined(address, key)) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), errKeyIsNotDefined(address, key)) | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func parseAssetId (input) = if ((input == wavesString)) | |
30 | 30 | then unit | |
31 | 31 | else fromBase58String(input) | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func assetIdToString (input) = if ((input == unit)) | |
35 | 35 | then wavesString | |
36 | 36 | else toBase58String(value(input)) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func ensurePositive (v) = if ((v >= 0)) | |
40 | 40 | then v | |
41 | 41 | else throwErr("value should be positive") | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func keyFactoryContract () = makeString(["%s", "factoryContract"], separator) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func keyLpStakingContract () = makeString(["%s", "lpStakingContract"], separator) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func keyStakingContract () = makeString(["%s", "stakingContract"], separator) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func keyBoostingContract () = makeString(["%s", "boostingContract"], separator) | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func keySwapContract () = makeString(["%s", "swapContract"], separator) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func keyAssetsStoreContract () = makeString(["%s", "assetsStoreContract"], separator) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func keyUsdnAssetId () = makeString(["%s", "usdnAssetId"], separator) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func keyWxAssetId () = makeString(["%s", "wxAssetId"], separator) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func keyShutdown () = makeString(["%s", "shutdown"], separator) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func keyMinDelay () = makeString(["%s", "minDelay"], separator) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func keyLockFraction () = makeString(["%s", "lockFraction"], separator) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func keyShareAssetId (baseAssetId) = makeString(["%s%s", assetIdToString(baseAssetId), "shareAssetId"], separator) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func keyBaseAssetId (shareAssetId) = makeString(["%s%s", assetIdToString(shareAssetId), "baseAssetId"], separator) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func keyPeriod (baseAssetId) = makeString(["%s%s", assetIdToString(baseAssetId), "period"], separator) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func keyPeriodStartHeight (baseAssetId,period) = makeString(["%s%s%d", assetIdToString(baseAssetId), "periodStartHeight", toString(period)], separator) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func keyBaseAssetAmountToConvert (baseAssetId) = makeString(["%s%s", assetIdToString(baseAssetId), "baseAssetAmountToConvert"], separator) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func keyShareAssetAmountToConvert (baseAssetId) = makeString(["%s%s", assetIdToString(baseAssetId), "shareAssetAmountToConvert"], separator) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func keyUserBaseAssetAmountToConvert (baseAssetId,userAddress) = makeString(["%s%s%s", assetIdToString(baseAssetId), toString(userAddress), "baseAssetAmountToConvert"], separator) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func keyUserBaseAssetAmountToConvertPeriod (baseAssetId,userAddress) = makeString(["%s%s%s%s", assetIdToString(baseAssetId), toString(userAddress), "baseAssetAmountToConvert", "period"], separator) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func keyUserShareAssetAmountToConvert (baseAssetId,userAddress) = makeString(["%s%s%s", assetIdToString(baseAssetId), toString(userAddress), "shareAssetAmountToConvert"], separator) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func keyUserShareAssetAmountToConvertPeriod (baseAssetId,userAddress) = makeString(["%s%s%s%s", assetIdToString(baseAssetId), toString(userAddress), "shareAssetAmountToConvert", "period"], separator) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func keyPricePeriod (baseAssetId,period) = makeString(["%s%s%d", assetIdToString(baseAssetId), "price", toString(period)], separator) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func keyPriceHistory (baseAssetId) = makeString(["%s%s%s%d%d", assetIdToString(baseAssetId), "price", "history", toString(lastBlock.height), toString(lastBlock.timestamp)], separator) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func keyPricePeriodPut (baseAssetId,period) = makeString(["%s%s%d%s", assetIdToString(baseAssetId), "price", toString(period), "put"], separator) | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func keyPricePutHistory (baseAssetId) = makeString(["%s%s%s%s%d%d", assetIdToString(baseAssetId), "price", "history", "put", toString(lastBlock.height), toString(lastBlock.timestamp)], separator) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func keyPricePeriodGet (baseAssetId,period) = makeString(["%s%s%d%s", assetIdToString(baseAssetId), "price", toString(period), "get"], separator) | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func keyPriceGetHistory (baseAssetId) = makeString(["%s%s%s%s%d%d", assetIdToString(baseAssetId), "price", "history", "get", toString(lastBlock.height), toString(lastBlock.timestamp)], separator) | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func keyHistoryEntry (baseAssetId,operation,period,userAddress,txId) = makeString(["%s%s%s%s", "history", operation, toString(userAddress), toBase58String(txId), toString(height)], separator) | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
135 | 135 | case s: String => | |
136 | 136 | fromBase58String(s) | |
137 | 137 | case _: Unit => | |
138 | 138 | unit | |
139 | 139 | case _ => | |
140 | 140 | throw("Match error") | |
141 | 141 | } | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
145 | 145 | case s: String => | |
146 | 146 | fromBase58String(s) | |
147 | 147 | case _: Unit => | |
148 | 148 | unit | |
149 | 149 | case _ => | |
150 | 150 | throw("Match error") | |
151 | 151 | } | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | let permissionDeniedError = throw("Permission denied") | |
155 | 155 | ||
156 | 156 | func mustThis (i) = if ((i.caller == this)) | |
157 | 157 | then true | |
158 | 158 | else permissionDeniedError | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | func mustManager (i) = match managerPublicKeyOrUnit() { | |
162 | 162 | case pk: ByteVector => | |
163 | 163 | if ((i.callerPublicKey == pk)) | |
164 | 164 | then true | |
165 | 165 | else permissionDeniedError | |
166 | 166 | case _: Unit => | |
167 | 167 | mustThis(i) | |
168 | 168 | case _ => | |
169 | 169 | throw("Match error") | |
170 | 170 | } | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | let shutdown = valueOrElse(getBoolean(keyShutdown()), false) | |
174 | 174 | ||
175 | 175 | func shutdownCheck (i) = if (if (!(shutdown)) | |
176 | 176 | then true | |
177 | 177 | else mustManager(i)) | |
178 | 178 | then true | |
179 | 179 | else throw("operation is disabled") | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | let factoryContract = addressFromStringValue(getStrOrFail(this, keyFactoryContract())) | |
183 | 183 | ||
184 | 184 | let lpStakingContract = addressFromStringValue(getStrOrFail(this, keyLpStakingContract())) | |
185 | 185 | ||
186 | 186 | let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract())) | |
187 | 187 | ||
188 | 188 | let boostingContract = addressFromStringValue(getStrOrFail(this, keyBoostingContract())) | |
189 | 189 | ||
190 | 190 | let swapContract = addressFromStringValue(getStrOrFail(this, keySwapContract())) | |
191 | 191 | ||
192 | 192 | let assetsStoreContract = addressFromStringValue(getStrOrFail(this, keyAssetsStoreContract())) | |
193 | 193 | ||
194 | 194 | let usdnAssetId = parseAssetId(getStrOrFail(this, keyUsdnAssetId())) | |
195 | 195 | ||
196 | 196 | let wxAssetId = parseAssetId(getStrOrFail(this, keyWxAssetId())) | |
197 | 197 | ||
198 | 198 | let minDelayDefault = 1440 | |
199 | 199 | ||
200 | 200 | let minDelay = valueOrElse(getInteger(this, keyMinDelay()), minDelayDefault) | |
201 | 201 | ||
202 | 202 | let lockFractionMultiplier = 100000000 | |
203 | 203 | ||
204 | 204 | let lockFractionDefault = fraction(1, lockFractionMultiplier, 2) | |
205 | 205 | ||
206 | 206 | let lockFraction = valueOrElse(getInteger(this, keyLockFraction()), lockFractionDefault) | |
207 | 207 | ||
208 | 208 | func getPoolInfo (amountAssetId) = { | |
209 | 209 | let amountAssetIdStr = assetIdToString(amountAssetId) | |
210 | 210 | let priceAssetIdStr = assetIdToString(usdnAssetId) | |
211 | 211 | let poolInfoOption = { | |
212 | 212 | let @ = invoke(factoryContract, "poolInfoREADONLY", [amountAssetIdStr, priceAssetIdStr], nil) | |
213 | 213 | if ($isInstanceOf(@, "(Address, ByteVector)")) | |
214 | 214 | then @ | |
215 | 215 | else unit | |
216 | 216 | } | |
217 | 217 | poolInfoOption | |
218 | 218 | } | |
219 | 219 | ||
220 | 220 | ||
221 | 221 | func calcPrice (lpAssetId,shareAssetId) = { | |
222 | 222 | let shareAssetInfo = valueOrErrorMessage(assetInfo(shareAssetId), "failed to get share asset info") | |
223 | 223 | let shareAssetEmission = shareAssetInfo.quantity | |
224 | 224 | let stakedAmount = ensurePositive(valueOrErrorMessage({ | |
225 | 225 | let @ = invoke(stakingContract, "stakedByUserREADONLY", [assetIdToString(lpAssetId), toString(this)], nil) | |
226 | 226 | if ($isInstanceOf(@, "Int")) | |
227 | 227 | then @ | |
228 | 228 | else unit | |
229 | 229 | }, wrapErr("invalid stakedByUserREADONLY result"))) | |
230 | 230 | let price = if ((shareAssetEmission == 0)) | |
231 | 231 | then scale18BigInt | |
232 | 232 | else fraction(toBigInt(stakedAmount), scale18BigInt, toBigInt(shareAssetEmission), FLOOR) | |
233 | 233 | price | |
234 | 234 | } | |
235 | 235 | ||
236 | 236 | ||
237 | 237 | @Callable(i) | |
238 | 238 | func setManager (pendingManagerPublicKey) = { | |
239 | 239 | let checkCaller = mustManager(i) | |
240 | 240 | if ((checkCaller == checkCaller)) | |
241 | 241 | then { | |
242 | 242 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
243 | 243 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
244 | 244 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
245 | 245 | else throw("Strict value is not equal to itself.") | |
246 | 246 | } | |
247 | 247 | else throw("Strict value is not equal to itself.") | |
248 | 248 | } | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | ||
252 | 252 | @Callable(i) | |
253 | 253 | func confirmManager () = { | |
254 | 254 | let pm = pendingManagerPublicKeyOrUnit() | |
255 | 255 | let hasPM = if (isDefined(pm)) | |
256 | 256 | then true | |
257 | 257 | else throwErr("no pending manager") | |
258 | 258 | if ((hasPM == hasPM)) | |
259 | 259 | then { | |
260 | 260 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
261 | 261 | then true | |
262 | 262 | else throwErr("you are not pending manager") | |
263 | 263 | if ((checkPM == checkPM)) | |
264 | 264 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
265 | 265 | else throw("Strict value is not equal to itself.") | |
266 | 266 | } | |
267 | 267 | else throw("Strict value is not equal to itself.") | |
268 | 268 | } | |
269 | 269 | ||
270 | 270 | ||
271 | 271 | ||
272 | 272 | @Callable(i) | |
273 | + | func emit (assetId,amount) = { | |
274 | + | let checkCaller = mustThis(i) | |
275 | + | if ((checkCaller == checkCaller)) | |
276 | + | then { | |
277 | + | let isReissuable = true | |
278 | + | $Tuple2([Reissue(assetId, amount, isReissuable)], amount) | |
279 | + | } | |
280 | + | else throw("Strict value is not equal to itself.") | |
281 | + | } | |
282 | + | ||
283 | + | ||
284 | + | ||
285 | + | @Callable(i) | |
286 | + | func burn (assetId,amount) = { | |
287 | + | let checkCaller = mustThis(i) | |
288 | + | if ((checkCaller == checkCaller)) | |
289 | + | then $Tuple2([Burn(assetId, amount)], amount) | |
290 | + | else throw("Strict value is not equal to itself.") | |
291 | + | } | |
292 | + | ||
293 | + | ||
294 | + | ||
295 | + | @Callable(i) | |
273 | 296 | func create (baseAssetIdStr,shareAssetIdStr,shareAssetName,shareAssetDescription,shareAssetLogo) = { | |
274 | 297 | let shareAssetLabel = "LP_STAKING_POOLS" | |
275 | 298 | let baseAssetId = parseAssetId(baseAssetIdStr) | |
276 | 299 | let checks = [mustManager(i), if (isDefined(getPoolInfo(baseAssetId))) | |
277 | 300 | then true | |
278 | 301 | else throwErr("invalid base asset")] | |
279 | 302 | if ((checks == checks)) | |
280 | 303 | then { | |
281 | 304 | let commonState = [IntegerEntry(keyPeriod(baseAssetId), 0)] | |
282 | 305 | if ((shareAssetIdStr == "")) | |
283 | 306 | then { | |
284 | 307 | let shareAssetIssueAmount = 1 | |
285 | 308 | let shareAssetIssueAction = Issue(shareAssetName, shareAssetDescription, shareAssetIssueAmount, shareAssetDecimals, true) | |
286 | 309 | let calculatedShareAssetId = calculateAssetId(shareAssetIssueAction) | |
287 | 310 | let shareAssetBurnAction = Burn(calculatedShareAssetId, shareAssetIssueAmount) | |
288 | 311 | let calculatedShareAssetIdStr = toBase58String(calculatedShareAssetId) | |
289 | 312 | let createOrUpdate = invoke(assetsStoreContract, "createOrUpdate", [calculatedShareAssetIdStr, shareAssetLogo, false], nil) | |
290 | 313 | if ((createOrUpdate == createOrUpdate)) | |
291 | 314 | then { | |
292 | 315 | let addLabel = invoke(assetsStoreContract, "addLabel", [calculatedShareAssetIdStr, shareAssetLabel], nil) | |
293 | 316 | if ((addLabel == addLabel)) | |
294 | 317 | then $Tuple2((commonState ++ [shareAssetIssueAction, shareAssetBurnAction, StringEntry(keyShareAssetId(baseAssetId), calculatedShareAssetIdStr), StringEntry(keyBaseAssetId(calculatedShareAssetId), baseAssetIdStr)]), calculatedShareAssetIdStr) | |
295 | 318 | else throw("Strict value is not equal to itself.") | |
296 | 319 | } | |
297 | 320 | else throw("Strict value is not equal to itself.") | |
298 | 321 | } | |
299 | 322 | else { | |
300 | 323 | let shareAssetId = fromBase58String(shareAssetIdStr) | |
301 | 324 | let shareAssetInfo = valueOrErrorMessage(assetInfo(shareAssetId), wrapErr("invalid share asset id")) | |
302 | 325 | let checkIssuer = if ((shareAssetInfo.issuer == lpStakingContract)) | |
303 | 326 | then true | |
304 | 327 | else throwErr("invalid share asset id issuer") | |
305 | 328 | if ((checkIssuer == checkIssuer)) | |
306 | 329 | then $Tuple2((commonState ++ [StringEntry(keyShareAssetId(baseAssetId), shareAssetIdStr), StringEntry(keyShareAssetId(shareAssetId), baseAssetIdStr)]), shareAssetIdStr) | |
307 | 330 | else throw("Strict value is not equal to itself.") | |
308 | 331 | } | |
309 | 332 | } | |
310 | 333 | else throw("Strict value is not equal to itself.") | |
311 | 334 | } | |
312 | 335 | ||
313 | 336 | ||
314 | 337 | ||
315 | 338 | @Callable(i) | |
316 | 339 | func put () = { | |
317 | 340 | let pmt = if ((size(i.payments) == 1)) | |
318 | 341 | then i.payments[0] | |
319 | 342 | else throwErr("exactly 1 payment is expected") | |
320 | 343 | let baseAssetId = pmt.assetId | |
321 | 344 | let userAddress = i.caller | |
322 | 345 | let checks = [shutdownCheck(i), if (isDefined(getString(keyShareAssetId(baseAssetId)))) | |
323 | 346 | then true | |
324 | 347 | else throwErr("invalid asset")] | |
325 | 348 | if ((checks == checks)) | |
326 | 349 | then { | |
327 | - | let $ | |
328 | - | let poolAddress = $ | |
329 | - | let lpAssetId = $ | |
350 | + | let $t01164611749 = valueOrErrorMessage(getPoolInfo(baseAssetId), wrapErr("invalid asset")) | |
351 | + | let poolAddress = $t01164611749._1 | |
352 | + | let lpAssetId = $t01164611749._2 | |
330 | 353 | let period = value(getInteger(keyPeriod(baseAssetId))) | |
331 | 354 | let userBaseAssetAmountToConvertPeriodOption = getInteger(keyUserBaseAssetAmountToConvertPeriod(baseAssetId, userAddress)) | |
332 | 355 | let claimShareAssetInvocation = if ((userBaseAssetAmountToConvertPeriodOption == unit)) | |
333 | 356 | then unit | |
334 | 357 | else { | |
335 | 358 | let userBaseAssetAmountToConvertPeriod = value(userBaseAssetAmountToConvertPeriodOption) | |
336 | 359 | if ((userBaseAssetAmountToConvertPeriod == period)) | |
337 | 360 | then unit | |
338 | 361 | else invoke(this, "claimShareAsset", [assetIdToString(baseAssetId), toString(userAddress)], nil) | |
339 | 362 | } | |
340 | 363 | if ((claimShareAssetInvocation == claimShareAssetInvocation)) | |
341 | 364 | then { | |
342 | 365 | let baseAssetAmountToConvert = valueOrElse(getInteger(keyBaseAssetAmountToConvert(baseAssetId)), 0) | |
343 | 366 | let userBaseAssetAmountToConvert = valueOrElse(getInteger(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress)), 0) | |
344 | 367 | $Tuple2([IntegerEntry(keyBaseAssetAmountToConvert(baseAssetId), (baseAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress), (userBaseAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserBaseAssetAmountToConvertPeriod(baseAssetId, userAddress), period), IntegerEntry(keyHistoryEntry(baseAssetId, "put", period, userAddress, i.transactionId), pmt.amount)], unit) | |
345 | 368 | } | |
346 | 369 | else throw("Strict value is not equal to itself.") | |
347 | 370 | } | |
348 | 371 | else throw("Strict value is not equal to itself.") | |
349 | 372 | } | |
350 | 373 | ||
351 | 374 | ||
352 | 375 | ||
353 | 376 | @Callable(i) | |
354 | 377 | func claimShareAsset (baseAssetIdStr,userAddressStr) = { | |
355 | 378 | let checks = [shutdownCheck(i)] | |
356 | 379 | if ((checks == checks)) | |
357 | 380 | then { | |
358 | 381 | let userAddress = if ((userAddressStr == "")) | |
359 | 382 | then i.caller | |
360 | 383 | else { | |
361 | 384 | let checkCaller = mustThis(i) | |
362 | 385 | if ((checkCaller == checkCaller)) | |
363 | 386 | then valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address")) | |
364 | 387 | else throw("Strict value is not equal to itself.") | |
365 | 388 | } | |
366 | 389 | if ((userAddress == userAddress)) | |
367 | 390 | then { | |
368 | 391 | let baseAssetId = parseAssetId(baseAssetIdStr) | |
369 | 392 | let shareAssetId = value(parseAssetId(valueOrErrorMessage(getString(keyShareAssetId(baseAssetId)), wrapErr("invalid base asset id")))) | |
370 | 393 | if ((shareAssetId == shareAssetId)) | |
371 | 394 | then { | |
372 | 395 | let period = valueOrErrorMessage(getInteger(keyPeriod(baseAssetId)), wrapErr("invalid period")) | |
373 | 396 | if ((period == period)) | |
374 | 397 | then { | |
375 | 398 | let userBaseAssetAmountToConvert = valueOrElse(getInteger(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress)), 0) | |
376 | 399 | let checkAmountToConvert = if ((userBaseAssetAmountToConvert > 0)) | |
377 | 400 | then true | |
378 | 401 | else throwErr("nothing to claim") | |
379 | 402 | if ((checkAmountToConvert == checkAmountToConvert)) | |
380 | 403 | then { | |
381 | 404 | let userBaseAssetAmountToConvertPeriod = valueOrErrorMessage(getInteger(keyUserBaseAssetAmountToConvertPeriod(baseAssetId, userAddress)), wrapErr("failed to get period")) | |
382 | 405 | let checkPeriod = if ((period > userBaseAssetAmountToConvertPeriod)) | |
383 | 406 | then true | |
384 | 407 | else throwErr("invalid period") | |
385 | 408 | if ((checkPeriod == checkPeriod)) | |
386 | 409 | then { | |
387 | 410 | let price = toBigInt(valueOrErrorMessage(getBinary(keyPricePeriodPut(baseAssetId, userBaseAssetAmountToConvertPeriod)), wrapErr("failed to get price"))) | |
388 | 411 | let shareAssetAmount = toInt(fraction(toBigInt(userBaseAssetAmountToConvert), scale18BigInt, price)) | |
389 | 412 | $Tuple2([IntegerEntry(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress), 0), ScriptTransfer(userAddress, shareAssetAmount, shareAssetId), IntegerEntry(keyHistoryEntry(baseAssetId, "claimShareAsset", period, userAddress, i.transactionId), shareAssetAmount)], unit) | |
390 | 413 | } | |
391 | 414 | else throw("Strict value is not equal to itself.") | |
392 | 415 | } | |
393 | 416 | else throw("Strict value is not equal to itself.") | |
394 | 417 | } | |
395 | 418 | else throw("Strict value is not equal to itself.") | |
396 | 419 | } | |
397 | 420 | else throw("Strict value is not equal to itself.") | |
398 | 421 | } | |
399 | 422 | else throw("Strict value is not equal to itself.") | |
400 | 423 | } | |
401 | 424 | else throw("Strict value is not equal to itself.") | |
402 | 425 | } | |
403 | 426 | ||
404 | 427 | ||
405 | 428 | ||
406 | 429 | @Callable(i) | |
407 | 430 | func get () = { | |
408 | 431 | let checks = [shutdownCheck(i)] | |
409 | 432 | if ((checks == checks)) | |
410 | 433 | then { | |
411 | 434 | let pmt = if ((size(i.payments) == 1)) | |
412 | 435 | then i.payments[0] | |
413 | 436 | else throwErr("exactly 1 payment is expected") | |
414 | 437 | let shareAssetId = pmt.assetId | |
415 | 438 | let baseAssetId = value(parseAssetId(valueOrErrorMessage(getString(keyBaseAssetId(shareAssetId)), wrapErr("invalid share asset id")))) | |
416 | 439 | if ((baseAssetId == baseAssetId)) | |
417 | 440 | then { | |
418 | 441 | let userAddress = i.caller | |
419 | - | let $ | |
420 | - | let poolAddress = $ | |
421 | - | let lpAssetId = $ | |
442 | + | let $t01545015553 = valueOrErrorMessage(getPoolInfo(baseAssetId), wrapErr("invalid asset")) | |
443 | + | let poolAddress = $t01545015553._1 | |
444 | + | let lpAssetId = $t01545015553._2 | |
422 | 445 | let period = value(getInteger(keyPeriod(baseAssetId))) | |
423 | 446 | let userShareAssetAmountToConvertPeriodOption = getInteger(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress)) | |
424 | 447 | let claimBaseAssetInvocation = if ((userShareAssetAmountToConvertPeriodOption == unit)) | |
425 | 448 | then unit | |
426 | 449 | else { | |
427 | 450 | let userShareAssetAmountToConvertPeriod = value(userShareAssetAmountToConvertPeriodOption) | |
428 | 451 | if ((userShareAssetAmountToConvertPeriod == period)) | |
429 | 452 | then unit | |
430 | 453 | else invoke(this, "claimBaseAsset", [userAddress], nil) | |
431 | 454 | } | |
432 | 455 | if ((claimBaseAssetInvocation == claimBaseAssetInvocation)) | |
433 | 456 | then { | |
434 | 457 | let shareAssetAmountToConvert = valueOrElse(getInteger(keyShareAssetAmountToConvert(baseAssetId)), 0) | |
435 | 458 | let userShareAssetAmountToConvert = valueOrElse(getInteger(keyUserShareAssetAmountToConvert(baseAssetId, userAddress)), 0) | |
436 | 459 | $Tuple2([IntegerEntry(keyShareAssetAmountToConvert(baseAssetId), (shareAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserShareAssetAmountToConvert(baseAssetId, userAddress), (userShareAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress), period), IntegerEntry(keyHistoryEntry(baseAssetId, "get", period, userAddress, i.transactionId), pmt.amount)], unit) | |
437 | 460 | } | |
438 | 461 | else throw("Strict value is not equal to itself.") | |
439 | 462 | } | |
440 | 463 | else throw("Strict value is not equal to itself.") | |
441 | 464 | } | |
442 | 465 | else throw("Strict value is not equal to itself.") | |
443 | 466 | } | |
444 | 467 | ||
445 | 468 | ||
446 | 469 | ||
447 | 470 | @Callable(i) | |
448 | 471 | func claimBaseAsset (baseAssetIdStr,userAddressStr) = { | |
449 | 472 | let checks = [shutdownCheck(i)] | |
450 | 473 | if ((checks == checks)) | |
451 | 474 | then { | |
452 | 475 | let userAddress = if ((userAddressStr == "")) | |
453 | 476 | then i.caller | |
454 | 477 | else { | |
455 | 478 | let checkCaller = mustThis(i) | |
456 | 479 | if ((checkCaller == checkCaller)) | |
457 | 480 | then valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address")) | |
458 | 481 | else throw("Strict value is not equal to itself.") | |
459 | 482 | } | |
460 | 483 | if ((userAddress == userAddress)) | |
461 | 484 | then { | |
462 | 485 | let baseAssetId = parseAssetId(baseAssetIdStr) | |
463 | 486 | let shareAssetId = value(parseAssetId(valueOrErrorMessage(getString(keyShareAssetId(baseAssetId)), wrapErr("invalid base asset id")))) | |
464 | 487 | if ((shareAssetId == shareAssetId)) | |
465 | 488 | then { | |
466 | 489 | let period = valueOrErrorMessage(getInteger(keyPeriod(baseAssetId)), wrapErr("invalid period")) | |
467 | 490 | if ((period == period)) | |
468 | 491 | then { | |
469 | 492 | let userShareAssetAmountToConvert = valueOrElse(getInteger(keyUserShareAssetAmountToConvert(baseAssetId, userAddress)), 0) | |
470 | 493 | let checkAmountToConvert = if ((userShareAssetAmountToConvert > 0)) | |
471 | 494 | then true | |
472 | 495 | else throwErr("nothing to claim") | |
473 | 496 | if ((checkAmountToConvert == checkAmountToConvert)) | |
474 | 497 | then { | |
475 | 498 | let userShareAssetAmountToConvertPeriod = valueOrErrorMessage(getInteger(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress)), wrapErr("failed to get period")) | |
476 | 499 | let checkPeriod = if ((period > userShareAssetAmountToConvertPeriod)) | |
477 | 500 | then true | |
478 | 501 | else throwErr("invalid period") | |
479 | 502 | if ((checkPeriod == checkPeriod)) | |
480 | 503 | then { | |
481 | 504 | let price = toBigInt(valueOrErrorMessage(getBinary(keyPricePeriodGet(baseAssetId, userShareAssetAmountToConvertPeriod)), wrapErr("failed to get price"))) | |
482 | 505 | let baseAssetAmount = toInt(fraction(toBigInt(userShareAssetAmountToConvert), price, scale18BigInt)) | |
483 | 506 | $Tuple2([IntegerEntry(keyUserShareAssetAmountToConvert(baseAssetId, userAddress), 0), ScriptTransfer(userAddress, baseAssetAmount, baseAssetId), IntegerEntry(keyHistoryEntry(baseAssetId, "claimBaseAsset", period, userAddress, i.transactionId), baseAssetAmount)], unit) | |
484 | 507 | } | |
485 | 508 | else throw("Strict value is not equal to itself.") | |
486 | 509 | } | |
487 | 510 | else throw("Strict value is not equal to itself.") | |
488 | 511 | } | |
489 | 512 | else throw("Strict value is not equal to itself.") | |
490 | 513 | } | |
491 | 514 | else throw("Strict value is not equal to itself.") | |
492 | 515 | } | |
493 | 516 | else throw("Strict value is not equal to itself.") | |
494 | 517 | } | |
495 | 518 | else throw("Strict value is not equal to itself.") | |
496 | 519 | } | |
497 | 520 | ||
498 | 521 | ||
499 | 522 | ||
500 | 523 | @Callable(i) | |
501 | 524 | func finalize (baseAssetIdStr) = { | |
502 | 525 | let checks = [shutdownCheck(i)] | |
503 | 526 | if ((checks == checks)) | |
504 | 527 | then { | |
505 | 528 | let baseAssetId = parseAssetId(baseAssetIdStr) | |
506 | 529 | let shareAssetId = value(parseAssetId(valueOrErrorMessage(getString(keyShareAssetId(baseAssetId)), wrapErr("invalid base asset id")))) | |
507 | 530 | if ((shareAssetId == shareAssetId)) | |
508 | 531 | then { | |
532 | + | let shareAssetInfo = valueOrErrorMessage(assetInfo(shareAssetId), wrapErr("invalid share asset id")) | |
509 | 533 | let period = valueOrErrorMessage(getInteger(keyPeriod(baseAssetId)), wrapErr("invalid period")) | |
510 | 534 | if ((period == period)) | |
511 | 535 | then { | |
512 | 536 | let periodStartHeightOption = getInteger(keyPeriodStartHeight(baseAssetId, period)) | |
513 | 537 | let checkDelay = if ((periodStartHeightOption == unit)) | |
514 | 538 | then unit | |
515 | 539 | else { | |
516 | 540 | let delay = (height - value(periodStartHeightOption)) | |
517 | 541 | let blocksToWait = max([0, (minDelay - delay)]) | |
518 | 542 | if ((blocksToWait == 0)) | |
519 | 543 | then unit | |
520 | 544 | else throwErr(makeString(["finalization will be possible in ", toString(blocksToWait), " blocks"], "")) | |
521 | 545 | } | |
522 | 546 | if ((checkDelay == checkDelay)) | |
523 | 547 | then { | |
524 | - | let $ | |
525 | - | let poolAddress = $ | |
526 | - | let lpAssetId = $ | |
548 | + | let $t01959919780 = valueOrErrorMessage(getPoolInfo(baseAssetId), wrapErr("invalid asset")) | |
549 | + | let poolAddress = $t01959919780._1 | |
550 | + | let lpAssetId = $t01959919780._2 | |
527 | 551 | let stakingReward = valueOrErrorMessage({ | |
528 | 552 | let @ = invoke(stakingContract, "claimWxDoNotThrow", [assetIdToString(lpAssetId)], nil) | |
529 | 553 | if ($isInstanceOf(@, "Int")) | |
530 | 554 | then @ | |
531 | 555 | else unit | |
532 | 556 | }, wrapErr("invalid claimWx result")) | |
533 | 557 | if ((stakingReward == stakingReward)) | |
534 | 558 | then { | |
535 | 559 | let baseAssetAmountToConvert = valueOrElse(getInteger(keyBaseAssetAmountToConvert(baseAssetId)), 0) | |
536 | 560 | let shareAssetAmountToConvert = valueOrElse(getInteger(keyShareAssetAmountToConvert(baseAssetId)), 0) | |
537 | 561 | let checkFinalizationIsRequired = { | |
538 | 562 | let isFinalizationRequired = if (if ((stakingReward > 0)) | |
539 | 563 | then true | |
540 | 564 | else (baseAssetAmountToConvert > 0)) | |
541 | 565 | then true | |
542 | 566 | else (shareAssetAmountToConvert > 0) | |
543 | 567 | if (isFinalizationRequired) | |
544 | 568 | then true | |
545 | 569 | else throwErr("nothing to finalize") | |
546 | 570 | } | |
547 | 571 | if ((checkFinalizationIsRequired == checkFinalizationIsRequired)) | |
548 | 572 | then { | |
549 | 573 | let useStakingReward = if ((stakingReward > 0)) | |
550 | 574 | then { | |
551 | 575 | let lockPart = fraction(stakingReward, lockFraction, lockFractionMultiplier) | |
552 | 576 | let convertPart = (stakingReward - lockPart) | |
553 | 577 | let r = invoke(boostingContract, "userMaxDurationREADONLY", [toString(this)], nil) | |
554 | 578 | let lock = if ((lockPart > 0)) | |
555 | 579 | then match r { | |
556 | 580 | case _ => | |
557 | 581 | if (if (if ($isInstanceOf($match0._1, "String")) | |
558 | 582 | then $isInstanceOf($match0._2, "Int") | |
559 | 583 | else false) | |
560 | 584 | then $isInstanceOf($match0, "(String, Int)") | |
561 | 585 | else false) | |
562 | 586 | then { | |
563 | 587 | let function = $match0._1 | |
564 | 588 | let duration = $match0._2 | |
565 | 589 | if ((lockPart > 0)) | |
566 | 590 | then invoke(boostingContract, function, [duration], [AttachedPayment(wxAssetId, lockPart)]) | |
567 | 591 | else unit | |
568 | 592 | } | |
569 | 593 | else throwErr("invalid lock params") | |
570 | 594 | } | |
571 | 595 | else unit | |
572 | 596 | if ((lock == lock)) | |
573 | 597 | then { | |
574 | 598 | let convertedAmount = if ((convertPart > 0)) | |
575 | 599 | then { | |
576 | 600 | let inAssetId = wxAssetId | |
577 | 601 | let minimumToReceive = 0 | |
578 | 602 | let outAssetIdStr = assetIdToString(usdnAssetId) | |
579 | 603 | let targetAddress = "" | |
580 | 604 | valueOrErrorMessage({ | |
581 | 605 | let @ = invoke(swapContract, "swap", [minimumToReceive, outAssetIdStr, targetAddress], [AttachedPayment(inAssetId, convertPart)]) | |
582 | 606 | if ($isInstanceOf(@, "Int")) | |
583 | 607 | then @ | |
584 | 608 | else unit | |
585 | 609 | }, wrapErr("invalid swap result")) | |
586 | 610 | } | |
587 | 611 | else 0 | |
588 | 612 | if ((convertedAmount == convertedAmount)) | |
589 | 613 | then { | |
590 | 614 | let lpAssetAmount = if ((convertedAmount > 0)) | |
591 | 615 | then { | |
592 | 616 | let minOutAmount = 0 | |
593 | 617 | let autoStake = true | |
594 | 618 | valueOrErrorMessage({ | |
595 | 619 | let @ = invoke(poolAddress, "putOneTknV2", [minOutAmount, autoStake], [AttachedPayment(usdnAssetId, convertedAmount)]) | |
596 | 620 | if ($isInstanceOf(@, "Int")) | |
597 | 621 | then @ | |
598 | 622 | else unit | |
599 | 623 | }, wrapErr("invalid putOneTknV2 result")) | |
600 | 624 | } | |
601 | 625 | else 0 | |
602 | 626 | if ((lpAssetAmount == lpAssetAmount)) | |
603 | 627 | then lpAssetAmount | |
604 | 628 | else throw("Strict value is not equal to itself.") | |
605 | 629 | } | |
606 | 630 | else throw("Strict value is not equal to itself.") | |
607 | 631 | } | |
608 | 632 | else throw("Strict value is not equal to itself.") | |
609 | 633 | } | |
610 | 634 | else unit | |
611 | 635 | if ((useStakingReward == useStakingReward)) | |
612 | 636 | then { | |
613 | 637 | let getActions = if ((shareAssetAmountToConvert > 0)) | |
614 | 638 | then { | |
615 | 639 | let price = calcPrice(lpAssetId, shareAssetId) | |
616 | 640 | if ((price == price)) | |
617 | 641 | then { | |
618 | 642 | let unstakeAmount = toInt(fraction(toBigInt(shareAssetAmountToConvert), price, scale18BigInt, FLOOR)) | |
619 | 643 | let baseAssetAmount = { | |
620 | 644 | let outAssetId = baseAssetId | |
621 | 645 | let minOutAmount = 0 | |
622 | 646 | valueOrErrorMessage({ | |
623 | 647 | let @ = invoke(poolAddress, "unstakeAndGetOneTknV2", [unstakeAmount, assetIdToString(outAssetId), minOutAmount], nil) | |
624 | 648 | if ($isInstanceOf(@, "Int")) | |
625 | 649 | then @ | |
626 | 650 | else unit | |
627 | 651 | }, wrapErr("invalid unstakeAndGetOneTknV2 result")) | |
628 | 652 | } | |
629 | 653 | if ((baseAssetAmount == baseAssetAmount)) | |
630 | 654 | then { | |
631 | - | let shareAssetBurnActions = [Burn(shareAssetId, shareAssetAmountToConvert)] | |
632 | - | let priceGet = fraction(toBigInt(baseAssetAmount), scale18BigInt, toBigInt(shareAssetAmountToConvert), FLOOR) | |
633 | - | let priceGetUpdateActions = [BinaryEntry(keyPricePeriodGet(baseAssetId, period), toBytes(priceGet)), StringEntry(keyPriceGetHistory(baseAssetId), toString(priceGet))] | |
634 | - | (shareAssetBurnActions ++ priceGetUpdateActions) | |
655 | + | let shareAssetBurn = if ((shareAssetInfo.issuer == this)) | |
656 | + | then invoke(this, "burn", [shareAssetId, shareAssetAmountToConvert], nil) | |
657 | + | else if ((shareAssetInfo.issuer == lpStakingContract)) | |
658 | + | then invoke(lpStakingContract, "burn", [shareAssetId, shareAssetAmountToConvert], nil) | |
659 | + | else throwErr("invalid share asset issuer") | |
660 | + | if ((shareAssetBurn == shareAssetBurn)) | |
661 | + | then { | |
662 | + | let priceGet = fraction(toBigInt(baseAssetAmount), scale18BigInt, toBigInt(shareAssetAmountToConvert), FLOOR) | |
663 | + | let priceGetUpdateActions = [BinaryEntry(keyPricePeriodGet(baseAssetId, period), toBytes(priceGet)), StringEntry(keyPriceGetHistory(baseAssetId), toString(priceGet))] | |
664 | + | priceGetUpdateActions | |
665 | + | } | |
666 | + | else throw("Strict value is not equal to itself.") | |
635 | 667 | } | |
636 | 668 | else throw("Strict value is not equal to itself.") | |
637 | 669 | } | |
638 | 670 | else throw("Strict value is not equal to itself.") | |
639 | 671 | } | |
640 | 672 | else nil | |
641 | - | | |
673 | + | if ((getActions == getActions)) | |
642 | 674 | then { | |
643 | - | let lpAssetAmount = { | |
644 | - | let minOutAmount = 0 | |
645 | - | let autoStake = true | |
646 | - | valueOrErrorMessage({ | |
647 | - | let @ = invoke(poolAddress, "putOneTknV2", [minOutAmount, autoStake], [AttachedPayment(baseAssetId, baseAssetAmountToConvert)]) | |
648 | - | if ($isInstanceOf(@, "Int")) | |
649 | - | then @ | |
650 | - | else unit | |
651 | - | }, wrapErr("invalid putOneTknV2 result")) | |
652 | - | } | |
653 | - | if ((lpAssetAmount == lpAssetAmount)) | |
675 | + | let putActions = if ((baseAssetAmountToConvert > 0)) | |
654 | 676 | then { | |
655 | - | let price = calcPrice(lpAssetId, shareAssetId) | |
656 | - | if ((price == price)) | |
677 | + | let lpAssetAmount = { | |
678 | + | let minOutAmount = 0 | |
679 | + | let autoStake = true | |
680 | + | valueOrErrorMessage({ | |
681 | + | let @ = invoke(poolAddress, "putOneTknV2", [minOutAmount, autoStake], [AttachedPayment(baseAssetId, baseAssetAmountToConvert)]) | |
682 | + | if ($isInstanceOf(@, "Int")) | |
683 | + | then @ | |
684 | + | else unit | |
685 | + | }, wrapErr("invalid putOneTknV2 result")) | |
686 | + | } | |
687 | + | if ((lpAssetAmount == lpAssetAmount)) | |
657 | 688 | then { | |
658 | - | let shareAssetAmount = toInt(fraction(toBigInt(lpAssetAmount), scale18BigInt, price, FLOOR)) | |
659 | - | let isReissuable = true | |
660 | - | let shareAssetReissueActions = [Reissue(shareAssetId, shareAssetAmount, isReissuable)] | |
661 | - | let pricePut = fraction(toBigInt(baseAssetAmountToConvert), scale18BigInt, toBigInt(shareAssetAmount)) | |
662 | - | let pricePutUpdateActions = [BinaryEntry(keyPricePeriodPut(baseAssetId, period), toBytes(pricePut)), StringEntry(keyPricePutHistory(baseAssetId), toString(pricePut))] | |
663 | - | (shareAssetReissueActions ++ pricePutUpdateActions) | |
689 | + | let price = calcPrice(lpAssetId, shareAssetId) | |
690 | + | if ((price == price)) | |
691 | + | then { | |
692 | + | let shareAssetAmount = toInt(fraction(toBigInt(lpAssetAmount), scale18BigInt, price, FLOOR)) | |
693 | + | let shareAssetReissue = if ((shareAssetInfo.issuer == this)) | |
694 | + | then invoke(this, "emit", [shareAssetId, shareAssetAmount], nil) | |
695 | + | else if ((shareAssetInfo.issuer == lpStakingContract)) | |
696 | + | then invoke(lpStakingContract, "emit", [shareAssetId, shareAssetAmount], nil) | |
697 | + | else throwErr("invalid share asset issuer") | |
698 | + | if ((shareAssetReissue == shareAssetReissue)) | |
699 | + | then { | |
700 | + | let pricePut = fraction(toBigInt(baseAssetAmountToConvert), scale18BigInt, toBigInt(shareAssetAmount)) | |
701 | + | let pricePutUpdateActions = [BinaryEntry(keyPricePeriodPut(baseAssetId, period), toBytes(pricePut)), StringEntry(keyPricePutHistory(baseAssetId), toString(pricePut))] | |
702 | + | pricePutUpdateActions | |
703 | + | } | |
704 | + | else throw("Strict value is not equal to itself.") | |
705 | + | } | |
706 | + | else throw("Strict value is not equal to itself.") | |
664 | 707 | } | |
665 | 708 | else throw("Strict value is not equal to itself.") | |
666 | 709 | } | |
710 | + | else nil | |
711 | + | if ((putActions == putActions)) | |
712 | + | then { | |
713 | + | let newPeriod = (period + 1) | |
714 | + | let lastPrice = calcPrice(lpAssetId, shareAssetId) | |
715 | + | let actions = (([IntegerEntry(keyPeriod(baseAssetId), newPeriod), IntegerEntry(keyPeriodStartHeight(baseAssetId, newPeriod), height), IntegerEntry(keyShareAssetAmountToConvert(baseAssetId), 0), IntegerEntry(keyBaseAssetAmountToConvert(baseAssetId), 0), BinaryEntry(keyPricePeriod(baseAssetId, period), toBytes(lastPrice)), StringEntry(keyPriceHistory(baseAssetId), toString(lastPrice))] ++ putActions) ++ getActions) | |
716 | + | $Tuple2(actions, toBytes(lastPrice)) | |
717 | + | } | |
667 | 718 | else throw("Strict value is not equal to itself.") | |
668 | 719 | } | |
669 | - | else nil | |
670 | - | let newPeriod = (period + 1) | |
671 | - | let lastPrice = calcPrice(lpAssetId, shareAssetId) | |
672 | - | let actions = (([IntegerEntry(keyPeriod(baseAssetId), newPeriod), IntegerEntry(keyPeriodStartHeight(baseAssetId, newPeriod), height), IntegerEntry(keyShareAssetAmountToConvert(baseAssetId), 0), IntegerEntry(keyBaseAssetAmountToConvert(baseAssetId), 0), BinaryEntry(keyPricePeriod(baseAssetId, period), toBytes(lastPrice)), StringEntry(keyPriceHistory(baseAssetId), toString(lastPrice))] ++ putActions) ++ getActions) | |
673 | - | $Tuple2(actions, toBytes(lastPrice)) | |
720 | + | else throw("Strict value is not equal to itself.") | |
674 | 721 | } | |
675 | 722 | else throw("Strict value is not equal to itself.") | |
676 | 723 | } | |
677 | 724 | else throw("Strict value is not equal to itself.") | |
678 | 725 | } | |
679 | 726 | else throw("Strict value is not equal to itself.") | |
680 | 727 | } | |
681 | 728 | else throw("Strict value is not equal to itself.") | |
682 | 729 | } | |
683 | 730 | else throw("Strict value is not equal to itself.") | |
684 | 731 | } | |
685 | 732 | else throw("Strict value is not equal to itself.") | |
686 | 733 | } | |
687 | 734 | else throw("Strict value is not equal to itself.") | |
688 | 735 | } | |
689 | 736 | ||
690 | 737 | ||
691 | 738 | @Verifier(tx) | |
692 | 739 | func verify () = { | |
693 | 740 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
694 | 741 | case pk: ByteVector => | |
695 | 742 | pk | |
696 | 743 | case _: Unit => | |
697 | 744 | tx.senderPublicKey | |
698 | 745 | case _ => | |
699 | 746 | throw("Match error") | |
700 | 747 | } | |
701 | 748 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
702 | 749 | } | |
703 | 750 |
github/deemru/w8io/fabc49c 72.40 ms ◑