tx · HEPpcKDrWqsx57tBHJsq5HUYDvgQ9PqY3Egx9KYKDo4S 3NBbSp7yXAeyAmM8uuoenTt3XFfCGQZsHon: -0.03000000 Waves 2023.05.04 13:10 [2562876] smart account 3NBbSp7yXAeyAmM8uuoenTt3XFfCGQZsHon > SELF 0.00000000 Waves
{ "type": 13, "id": "HEPpcKDrWqsx57tBHJsq5HUYDvgQ9PqY3Egx9KYKDo4S", "fee": 3000000, "feeAssetId": null, "timestamp": 1683195081185, "version": 2, "chainId": 84, "sender": "3NBbSp7yXAeyAmM8uuoenTt3XFfCGQZsHon", "senderPublicKey": "EdMvX1KG6dSSSsAqgamTtbKQho4ZLojCVgcBU4CDSeix", "proofs": [ "5zF8wzpw6b7YotzyNxmV8vGxAM1EbgTwvo75dDpp54AFeAAmbDynBFLSPwoTPBwtdgpqRTYsyZN2yDWQDotooJjt" ], "script": "base64:BgIzCAISAwoBCBIAEgQKAgIBEgQKAgIBEgcKBQgICAgIEgASBAoCCAgSABIECgIICBIDCgEIQQAJc2VwYXJhdG9yAgJfXwASc2hhcmVBc3NldERlY2ltYWxzAAgAC3dhdmVzU3RyaW5nAgVXQVZFUwAHc2NhbGUxOACAgJC7utat8A0ADXNjYWxlMThCaWdJbnQJALYCAQUHc2NhbGUxOAEHd3JhcEVycgEDbXNnCQC5CQIJAMwIAgIWbHBfc3Rha2luZ19wb29scy5yaWRlOgkAzAgCBQNtc2cFA25pbAIBIAEIdGhyb3dFcnIBA21zZwkAAgEJAQd3cmFwRXJyAQUDbXNnARJlcnJLZXlJc05vdERlZmluZWQCB2FkZHJlc3MDa2V5CQEHd3JhcEVycgEJALkJAgkAzAgCAgptYW5kYXRvcnkgCQDMCAIJAKUIAQUHYWRkcmVzcwkAzAgCAgEuCQDMCAIFA2tleQkAzAgCAg8gaXMgbm90IGRlZmluZWQFA25pbAIAAQxnZXRTdHJPckZhaWwCB2FkZHJlc3MDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUHYWR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uaWwFCnB1dEFjdGlvbnMFCmdldEFjdGlvbnMJAJQKAgUHYWN0aW9ucwkAnQMBBQlsYXN0UHJpY2UJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABA90YXJnZXRQdWJsaWNLZXkEByRtYXRjaDAJARZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAJwawUHJG1hdGNoMAUCcGsDCQABAgUHJG1hdGNoMAIEVW5pdAgFAnR4D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQ90YXJnZXRQdWJsaWNLZXkE5BN+", "height": 2562876, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J3xLZsKykoorj8hY2fMpGxY96db7LU9Zdkj2yBDbCcFn Next: 6UbA2vXAJ7Yx86rq3mLMaa36ArB2Uw9a5dLycxV1FiWg Diff:
Old | New | Differences | |
---|---|---|---|
364 | 364 | then { | |
365 | 365 | let baseAssetAmountToConvert = valueOrElse(getInteger(keyBaseAssetAmountToConvert(baseAssetId)), 0) | |
366 | 366 | let userBaseAssetAmountToConvert = valueOrElse(getInteger(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress)), 0) | |
367 | - | $Tuple2([IntegerEntry(keyBaseAssetAmountToConvert(baseAssetId), (baseAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress), (userBaseAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserBaseAssetAmountToConvertPeriod(baseAssetId, userAddress), period), | |
367 | + | $Tuple2([IntegerEntry(keyBaseAssetAmountToConvert(baseAssetId), (baseAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress), (userBaseAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserBaseAssetAmountToConvertPeriod(baseAssetId, userAddress), period), StringEntry(keyHistoryEntry(baseAssetId, "put", period, userAddress, i.transactionId), makeString([toString(pmt.amount), toString(lastBlock.timestamp), toString(userBaseAssetAmountToConvert)], separator))], unit) | |
368 | 368 | } | |
369 | 369 | else throw("Strict value is not equal to itself.") | |
370 | 370 | } | |
409 | 409 | then { | |
410 | 410 | let price = toBigInt(valueOrErrorMessage(getBinary(keyPricePeriodPut(baseAssetId, userBaseAssetAmountToConvertPeriod)), wrapErr("failed to get price"))) | |
411 | 411 | let shareAssetAmount = toInt(fraction(toBigInt(userBaseAssetAmountToConvert), scale18BigInt, price)) | |
412 | - | $Tuple2([IntegerEntry(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress), 0), DeleteEntry(keyUserBaseAssetAmountToConvertPeriod(baseAssetId, userAddress)), ScriptTransfer(userAddress, shareAssetAmount, shareAssetId), | |
412 | + | $Tuple2([IntegerEntry(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress), 0), DeleteEntry(keyUserBaseAssetAmountToConvertPeriod(baseAssetId, userAddress)), ScriptTransfer(userAddress, shareAssetAmount, shareAssetId), StringEntry(keyHistoryEntry(baseAssetId, "claimShareAsset", period, userAddress, i.transactionId), makeString([toString(shareAssetAmount), toString(lastBlock.timestamp), toString(price), toString(userBaseAssetAmountToConvert)], separator))], unit) | |
413 | 413 | } | |
414 | 414 | else throw("Strict value is not equal to itself.") | |
415 | 415 | } | |
439 | 439 | if ((baseAssetId == baseAssetId)) | |
440 | 440 | then { | |
441 | 441 | let userAddress = i.caller | |
442 | - | let $ | |
443 | - | let poolAddress = $ | |
444 | - | let lpAssetId = $ | |
442 | + | let $t01582016009 = valueOrErrorMessage(getPoolInfo(baseAssetId), wrapErr("invalid asset")) | |
443 | + | let poolAddress = $t01582016009._1 | |
444 | + | let lpAssetId = $t01582016009._2 | |
445 | 445 | let period = value(getInteger(keyPeriod(baseAssetId))) | |
446 | 446 | let userShareAssetAmountToConvertPeriodOption = getInteger(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress)) | |
447 | 447 | let claimBaseAssetInvocation = if ((userShareAssetAmountToConvertPeriodOption == unit)) | |
456 | 456 | then { | |
457 | 457 | let shareAssetAmountToConvert = valueOrElse(getInteger(keyShareAssetAmountToConvert(baseAssetId)), 0) | |
458 | 458 | let userShareAssetAmountToConvert = valueOrElse(getInteger(keyUserShareAssetAmountToConvert(baseAssetId, userAddress)), 0) | |
459 | - | $Tuple2([IntegerEntry(keyShareAssetAmountToConvert(baseAssetId), (shareAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserShareAssetAmountToConvert(baseAssetId, userAddress), (userShareAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress), period), | |
459 | + | $Tuple2([IntegerEntry(keyShareAssetAmountToConvert(baseAssetId), (shareAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserShareAssetAmountToConvert(baseAssetId, userAddress), (userShareAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress), period), StringEntry(keyHistoryEntry(baseAssetId, "get", period, userAddress, i.transactionId), makeString([toString(pmt.amount), toString(lastBlock.timestamp), toString(userShareAssetAmountToConvert)], separator))], unit) | |
460 | 460 | } | |
461 | 461 | else throw("Strict value is not equal to itself.") | |
462 | 462 | } | |
490 | 490 | if ((period == period)) | |
491 | 491 | then { | |
492 | 492 | let userShareAssetAmountToConvert = valueOrElse(getInteger(keyUserShareAssetAmountToConvert(baseAssetId, userAddress)), 0) | |
493 | - | let checkAmountToConvert = if ((userShareAssetAmountToConvert > 0)) | |
493 | + | let userShareAssetAmountToConvertPeriod = valueOrErrorMessage(getInteger(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress)), wrapErr("failed to get period")) | |
494 | + | let checkPeriod = if ((period > userShareAssetAmountToConvertPeriod)) | |
494 | 495 | then true | |
495 | - | else throwErr(" | |
496 | - | if (( | |
496 | + | else throwErr("invalid period") | |
497 | + | if ((checkPeriod == checkPeriod)) | |
497 | 498 | then { | |
498 | - | let userShareAssetAmountToConvertPeriod = valueOrErrorMessage(getInteger(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress)), wrapErr("failed to get period")) | |
499 | - | let checkPeriod = if ((period > userShareAssetAmountToConvertPeriod)) | |
500 | - | then true | |
501 | - | else throwErr("invalid period") | |
502 | - | if ((checkPeriod == checkPeriod)) | |
503 | - | then { | |
504 | - | let price = toBigInt(valueOrErrorMessage(getBinary(keyPricePeriodGet(baseAssetId, userShareAssetAmountToConvertPeriod)), wrapErr("failed to get price"))) | |
505 | - | let baseAssetAmount = toInt(fraction(toBigInt(userShareAssetAmountToConvert), price, scale18BigInt)) | |
506 | - | $Tuple2([IntegerEntry(keyUserShareAssetAmountToConvert(baseAssetId, userAddress), 0), DeleteEntry(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress)), ScriptTransfer(userAddress, baseAssetAmount, baseAssetId), IntegerEntry(keyHistoryEntry(baseAssetId, "claimBaseAsset", period, userAddress, i.transactionId), baseAssetAmount)], unit) | |
507 | - | } | |
508 | - | else throw("Strict value is not equal to itself.") | |
499 | + | let price = toBigInt(valueOrErrorMessage(getBinary(keyPricePeriodGet(baseAssetId, userShareAssetAmountToConvertPeriod)), wrapErr("failed to get price"))) | |
500 | + | let baseAssetAmount = toInt(fraction(toBigInt(userShareAssetAmountToConvert), price, scale18BigInt)) | |
501 | + | $Tuple2([IntegerEntry(keyUserShareAssetAmountToConvert(baseAssetId, userAddress), 0), DeleteEntry(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress)), ScriptTransfer(userAddress, baseAssetAmount, baseAssetId), StringEntry(keyHistoryEntry(baseAssetId, "claimBaseAsset", period, userAddress, i.transactionId), makeString([toString(baseAssetAmount), toString(lastBlock.timestamp), toString(price), toString(userShareAssetAmountToConvertPeriod)], separator))], unit) | |
509 | 502 | } | |
510 | 503 | else throw("Strict value is not equal to itself.") | |
511 | 504 | } | |
545 | 538 | } | |
546 | 539 | if ((checkDelay == checkDelay)) | |
547 | 540 | then { | |
548 | - | let $ | |
549 | - | let poolAddress = $ | |
550 | - | let lpAssetId = $ | |
541 | + | let $t02111321294 = valueOrErrorMessage(getPoolInfo(baseAssetId), wrapErr("invalid asset")) | |
542 | + | let poolAddress = $t02111321294._1 | |
543 | + | let lpAssetId = $t02111321294._2 | |
551 | 544 | let stakingReward = valueOrErrorMessage({ | |
552 | 545 | let @ = invoke(stakingContract, "claimWxDoNotThrow", [assetIdToString(lpAssetId)], nil) | |
553 | 546 | if ($isInstanceOf(@, "Int")) | |
687 | 680 | let price = calcPrice(lpAssetId, shareAssetId) | |
688 | 681 | if ((price == price)) | |
689 | 682 | then { | |
690 | - | let shareAssetAmount = toInt(fraction(toBigInt(lpAssetAmount), scale18BigInt, price, FLOOR)) | |
691 | - | let shareAssetReissue = if ((shareAssetInfo.issuer == this)) | |
692 | - | then invoke(this, "emit", [shareAssetId, shareAssetAmount], nil) | |
693 | - | else throwErr("invalid share asset issuer") | |
694 | - | if ((shareAssetReissue == shareAssetReissue)) | |
683 | + | let checkPrice = if ((value(toInt(price)) != 0)) | |
684 | + | then true | |
685 | + | else throw("price is ZERO") | |
686 | + | if ((checkPrice == checkPrice)) | |
695 | 687 | then { | |
696 | - | let pricePut = fraction(toBigInt(baseAssetAmountToConvert), scale18BigInt, toBigInt(shareAssetAmount)) | |
697 | - | let pricePutUpdateActions = [BinaryEntry(keyPricePeriodPut(baseAssetId, period), toBytes(pricePut)), StringEntry(keyPricePutHistory(baseAssetId), toString(pricePut))] | |
698 | - | pricePutUpdateActions | |
688 | + | let shareAssetAmount = toInt(fraction(toBigInt(lpAssetAmount), scale18BigInt, price, FLOOR)) | |
689 | + | let checkShareAssetAmount = if ((value(toInt(price)) != 0)) | |
690 | + | then true | |
691 | + | else throw("shareAssetAmount is ZERO") | |
692 | + | if ((checkShareAssetAmount == checkShareAssetAmount)) | |
693 | + | then { | |
694 | + | let shareAssetReissue = if ((shareAssetInfo.issuer == this)) | |
695 | + | then invoke(this, "emit", [shareAssetId, shareAssetAmount], nil) | |
696 | + | else throwErr("invalid share asset issuer") | |
697 | + | if ((shareAssetReissue == shareAssetReissue)) | |
698 | + | then { | |
699 | + | let pricePut = fraction(toBigInt(baseAssetAmountToConvert), scale18BigInt, toBigInt(shareAssetAmount)) | |
700 | + | let pricePutUpdateActions = [BinaryEntry(keyPricePeriodPut(baseAssetId, period), toBytes(pricePut)), StringEntry(keyPricePutHistory(baseAssetId), toString(pricePut))] | |
701 | + | pricePutUpdateActions | |
702 | + | } | |
703 | + | else throw("Strict value is not equal to itself.") | |
704 | + | } | |
705 | + | else throw("Strict value is not equal to itself.") | |
699 | 706 | } | |
700 | 707 | else throw("Strict value is not equal to itself.") | |
701 | 708 | } |
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 keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], 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 usdtAssetId = parseAssetId(getStrOrFail(this, keyUsdtAssetId())) | |
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(usdtAssetId) | |
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 | 273 | func emit (assetId,amount) = { | |
274 | 274 | let checkCaller = mustThis(i) | |
275 | 275 | if ((checkCaller == checkCaller)) | |
276 | 276 | then { | |
277 | 277 | let isReissuable = true | |
278 | 278 | $Tuple2([Reissue(assetId, amount, isReissuable)], amount) | |
279 | 279 | } | |
280 | 280 | else throw("Strict value is not equal to itself.") | |
281 | 281 | } | |
282 | 282 | ||
283 | 283 | ||
284 | 284 | ||
285 | 285 | @Callable(i) | |
286 | 286 | func burn (assetId,amount) = { | |
287 | 287 | let checkCaller = mustThis(i) | |
288 | 288 | if ((checkCaller == checkCaller)) | |
289 | 289 | then $Tuple2([Burn(assetId, amount)], amount) | |
290 | 290 | else throw("Strict value is not equal to itself.") | |
291 | 291 | } | |
292 | 292 | ||
293 | 293 | ||
294 | 294 | ||
295 | 295 | @Callable(i) | |
296 | 296 | func create (baseAssetIdStr,shareAssetIdStr,shareAssetName,shareAssetDescription,shareAssetLogo) = { | |
297 | 297 | let shareAssetLabel = "STAKING_LP" | |
298 | 298 | let baseAssetId = parseAssetId(baseAssetIdStr) | |
299 | 299 | let checks = [mustManager(i), if (isDefined(getPoolInfo(baseAssetId))) | |
300 | 300 | then true | |
301 | 301 | else throwErr("invalid base asset")] | |
302 | 302 | if ((checks == checks)) | |
303 | 303 | then { | |
304 | 304 | let commonState = [IntegerEntry(keyPeriod(baseAssetId), 0)] | |
305 | 305 | if ((shareAssetIdStr == "")) | |
306 | 306 | then { | |
307 | 307 | let shareAssetIssueAmount = 1 | |
308 | 308 | let shareAssetIssueAction = Issue(shareAssetName, shareAssetDescription, shareAssetIssueAmount, shareAssetDecimals, true) | |
309 | 309 | let calculatedShareAssetId = calculateAssetId(shareAssetIssueAction) | |
310 | 310 | let shareAssetBurnAction = Burn(calculatedShareAssetId, shareAssetIssueAmount) | |
311 | 311 | let calculatedShareAssetIdStr = toBase58String(calculatedShareAssetId) | |
312 | 312 | let createOrUpdate = invoke(assetsStoreContract, "createOrUpdate", [calculatedShareAssetIdStr, shareAssetLogo, false], nil) | |
313 | 313 | if ((createOrUpdate == createOrUpdate)) | |
314 | 314 | then { | |
315 | 315 | let addLabel = invoke(assetsStoreContract, "addLabel", [calculatedShareAssetIdStr, shareAssetLabel], nil) | |
316 | 316 | if ((addLabel == addLabel)) | |
317 | 317 | then $Tuple2((commonState ++ [shareAssetIssueAction, shareAssetBurnAction, StringEntry(keyShareAssetId(baseAssetId), calculatedShareAssetIdStr), StringEntry(keyBaseAssetId(calculatedShareAssetId), baseAssetIdStr)]), calculatedShareAssetIdStr) | |
318 | 318 | else throw("Strict value is not equal to itself.") | |
319 | 319 | } | |
320 | 320 | else throw("Strict value is not equal to itself.") | |
321 | 321 | } | |
322 | 322 | else { | |
323 | 323 | let shareAssetId = fromBase58String(shareAssetIdStr) | |
324 | 324 | let shareAssetInfo = valueOrErrorMessage(assetInfo(shareAssetId), wrapErr("invalid share asset id")) | |
325 | 325 | let checkIssuer = if ((shareAssetInfo.issuer == lpStakingContract)) | |
326 | 326 | then true | |
327 | 327 | else throwErr("invalid share asset id issuer") | |
328 | 328 | if ((checkIssuer == checkIssuer)) | |
329 | 329 | then $Tuple2((commonState ++ [StringEntry(keyShareAssetId(baseAssetId), shareAssetIdStr), StringEntry(keyBaseAssetId(shareAssetId), baseAssetIdStr)]), shareAssetIdStr) | |
330 | 330 | else throw("Strict value is not equal to itself.") | |
331 | 331 | } | |
332 | 332 | } | |
333 | 333 | else throw("Strict value is not equal to itself.") | |
334 | 334 | } | |
335 | 335 | ||
336 | 336 | ||
337 | 337 | ||
338 | 338 | @Callable(i) | |
339 | 339 | func put () = { | |
340 | 340 | let pmt = if ((size(i.payments) == 1)) | |
341 | 341 | then i.payments[0] | |
342 | 342 | else throwErr("exactly 1 payment is expected") | |
343 | 343 | let baseAssetId = pmt.assetId | |
344 | 344 | let userAddress = i.caller | |
345 | 345 | let checks = [shutdownCheck(i), if (isDefined(getString(keyShareAssetId(baseAssetId)))) | |
346 | 346 | then true | |
347 | 347 | else throwErr("invalid asset")] | |
348 | 348 | if ((checks == checks)) | |
349 | 349 | then { | |
350 | 350 | let $t01164011743 = valueOrErrorMessage(getPoolInfo(baseAssetId), wrapErr("invalid asset")) | |
351 | 351 | let poolAddress = $t01164011743._1 | |
352 | 352 | let lpAssetId = $t01164011743._2 | |
353 | 353 | let period = value(getInteger(keyPeriod(baseAssetId))) | |
354 | 354 | let userBaseAssetAmountToConvertPeriodOption = getInteger(keyUserBaseAssetAmountToConvertPeriod(baseAssetId, userAddress)) | |
355 | 355 | let claimShareAssetInvocation = if ((userBaseAssetAmountToConvertPeriodOption == unit)) | |
356 | 356 | then unit | |
357 | 357 | else { | |
358 | 358 | let userBaseAssetAmountToConvertPeriod = value(userBaseAssetAmountToConvertPeriodOption) | |
359 | 359 | if ((userBaseAssetAmountToConvertPeriod == period)) | |
360 | 360 | then unit | |
361 | 361 | else invoke(this, "claimShareAsset", [assetIdToString(baseAssetId), toString(userAddress)], nil) | |
362 | 362 | } | |
363 | 363 | if ((claimShareAssetInvocation == claimShareAssetInvocation)) | |
364 | 364 | then { | |
365 | 365 | let baseAssetAmountToConvert = valueOrElse(getInteger(keyBaseAssetAmountToConvert(baseAssetId)), 0) | |
366 | 366 | let userBaseAssetAmountToConvert = valueOrElse(getInteger(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress)), 0) | |
367 | - | $Tuple2([IntegerEntry(keyBaseAssetAmountToConvert(baseAssetId), (baseAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress), (userBaseAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserBaseAssetAmountToConvertPeriod(baseAssetId, userAddress), period), | |
367 | + | $Tuple2([IntegerEntry(keyBaseAssetAmountToConvert(baseAssetId), (baseAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress), (userBaseAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserBaseAssetAmountToConvertPeriod(baseAssetId, userAddress), period), StringEntry(keyHistoryEntry(baseAssetId, "put", period, userAddress, i.transactionId), makeString([toString(pmt.amount), toString(lastBlock.timestamp), toString(userBaseAssetAmountToConvert)], separator))], unit) | |
368 | 368 | } | |
369 | 369 | else throw("Strict value is not equal to itself.") | |
370 | 370 | } | |
371 | 371 | else throw("Strict value is not equal to itself.") | |
372 | 372 | } | |
373 | 373 | ||
374 | 374 | ||
375 | 375 | ||
376 | 376 | @Callable(i) | |
377 | 377 | func claimShareAsset (baseAssetIdStr,userAddressStr) = { | |
378 | 378 | let checks = [shutdownCheck(i)] | |
379 | 379 | if ((checks == checks)) | |
380 | 380 | then { | |
381 | 381 | let userAddress = if ((userAddressStr == "")) | |
382 | 382 | then i.caller | |
383 | 383 | else { | |
384 | 384 | let checkCaller = mustThis(i) | |
385 | 385 | if ((checkCaller == checkCaller)) | |
386 | 386 | then valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address")) | |
387 | 387 | else throw("Strict value is not equal to itself.") | |
388 | 388 | } | |
389 | 389 | if ((userAddress == userAddress)) | |
390 | 390 | then { | |
391 | 391 | let baseAssetId = parseAssetId(baseAssetIdStr) | |
392 | 392 | let shareAssetId = value(parseAssetId(valueOrErrorMessage(getString(keyShareAssetId(baseAssetId)), wrapErr("invalid base asset id")))) | |
393 | 393 | if ((shareAssetId == shareAssetId)) | |
394 | 394 | then { | |
395 | 395 | let period = valueOrErrorMessage(getInteger(keyPeriod(baseAssetId)), wrapErr("invalid period")) | |
396 | 396 | if ((period == period)) | |
397 | 397 | then { | |
398 | 398 | let userBaseAssetAmountToConvert = valueOrElse(getInteger(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress)), 0) | |
399 | 399 | let checkAmountToConvert = if ((userBaseAssetAmountToConvert > 0)) | |
400 | 400 | then true | |
401 | 401 | else throwErr("nothing to claim") | |
402 | 402 | if ((checkAmountToConvert == checkAmountToConvert)) | |
403 | 403 | then { | |
404 | 404 | let userBaseAssetAmountToConvertPeriod = valueOrErrorMessage(getInteger(keyUserBaseAssetAmountToConvertPeriod(baseAssetId, userAddress)), wrapErr("failed to get period")) | |
405 | 405 | let checkPeriod = if ((period > userBaseAssetAmountToConvertPeriod)) | |
406 | 406 | then true | |
407 | 407 | else throwErr("invalid period") | |
408 | 408 | if ((checkPeriod == checkPeriod)) | |
409 | 409 | then { | |
410 | 410 | let price = toBigInt(valueOrErrorMessage(getBinary(keyPricePeriodPut(baseAssetId, userBaseAssetAmountToConvertPeriod)), wrapErr("failed to get price"))) | |
411 | 411 | let shareAssetAmount = toInt(fraction(toBigInt(userBaseAssetAmountToConvert), scale18BigInt, price)) | |
412 | - | $Tuple2([IntegerEntry(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress), 0), DeleteEntry(keyUserBaseAssetAmountToConvertPeriod(baseAssetId, userAddress)), ScriptTransfer(userAddress, shareAssetAmount, shareAssetId), | |
412 | + | $Tuple2([IntegerEntry(keyUserBaseAssetAmountToConvert(baseAssetId, userAddress), 0), DeleteEntry(keyUserBaseAssetAmountToConvertPeriod(baseAssetId, userAddress)), ScriptTransfer(userAddress, shareAssetAmount, shareAssetId), StringEntry(keyHistoryEntry(baseAssetId, "claimShareAsset", period, userAddress, i.transactionId), makeString([toString(shareAssetAmount), toString(lastBlock.timestamp), toString(price), toString(userBaseAssetAmountToConvert)], separator))], unit) | |
413 | 413 | } | |
414 | 414 | else throw("Strict value is not equal to itself.") | |
415 | 415 | } | |
416 | 416 | else throw("Strict value is not equal to itself.") | |
417 | 417 | } | |
418 | 418 | else throw("Strict value is not equal to itself.") | |
419 | 419 | } | |
420 | 420 | else throw("Strict value is not equal to itself.") | |
421 | 421 | } | |
422 | 422 | else throw("Strict value is not equal to itself.") | |
423 | 423 | } | |
424 | 424 | else throw("Strict value is not equal to itself.") | |
425 | 425 | } | |
426 | 426 | ||
427 | 427 | ||
428 | 428 | ||
429 | 429 | @Callable(i) | |
430 | 430 | func get () = { | |
431 | 431 | let checks = [shutdownCheck(i)] | |
432 | 432 | if ((checks == checks)) | |
433 | 433 | then { | |
434 | 434 | let pmt = if ((size(i.payments) == 1)) | |
435 | 435 | then i.payments[0] | |
436 | 436 | else throwErr("exactly 1 payment is expected") | |
437 | 437 | let shareAssetId = pmt.assetId | |
438 | 438 | let baseAssetId = value(parseAssetId(valueOrErrorMessage(getString(keyBaseAssetId(shareAssetId)), wrapErr("invalid share asset id")))) | |
439 | 439 | if ((baseAssetId == baseAssetId)) | |
440 | 440 | then { | |
441 | 441 | let userAddress = i.caller | |
442 | - | let $ | |
443 | - | let poolAddress = $ | |
444 | - | let lpAssetId = $ | |
442 | + | let $t01582016009 = valueOrErrorMessage(getPoolInfo(baseAssetId), wrapErr("invalid asset")) | |
443 | + | let poolAddress = $t01582016009._1 | |
444 | + | let lpAssetId = $t01582016009._2 | |
445 | 445 | let period = value(getInteger(keyPeriod(baseAssetId))) | |
446 | 446 | let userShareAssetAmountToConvertPeriodOption = getInteger(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress)) | |
447 | 447 | let claimBaseAssetInvocation = if ((userShareAssetAmountToConvertPeriodOption == unit)) | |
448 | 448 | then unit | |
449 | 449 | else { | |
450 | 450 | let userShareAssetAmountToConvertPeriod = value(userShareAssetAmountToConvertPeriodOption) | |
451 | 451 | if ((userShareAssetAmountToConvertPeriod == period)) | |
452 | 452 | then unit | |
453 | 453 | else invoke(this, "claimBaseAsset", [assetIdToString(baseAssetId), toString(userAddress)], nil) | |
454 | 454 | } | |
455 | 455 | if ((claimBaseAssetInvocation == claimBaseAssetInvocation)) | |
456 | 456 | then { | |
457 | 457 | let shareAssetAmountToConvert = valueOrElse(getInteger(keyShareAssetAmountToConvert(baseAssetId)), 0) | |
458 | 458 | let userShareAssetAmountToConvert = valueOrElse(getInteger(keyUserShareAssetAmountToConvert(baseAssetId, userAddress)), 0) | |
459 | - | $Tuple2([IntegerEntry(keyShareAssetAmountToConvert(baseAssetId), (shareAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserShareAssetAmountToConvert(baseAssetId, userAddress), (userShareAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress), period), | |
459 | + | $Tuple2([IntegerEntry(keyShareAssetAmountToConvert(baseAssetId), (shareAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserShareAssetAmountToConvert(baseAssetId, userAddress), (userShareAssetAmountToConvert + pmt.amount)), IntegerEntry(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress), period), StringEntry(keyHistoryEntry(baseAssetId, "get", period, userAddress, i.transactionId), makeString([toString(pmt.amount), toString(lastBlock.timestamp), toString(userShareAssetAmountToConvert)], separator))], unit) | |
460 | 460 | } | |
461 | 461 | else throw("Strict value is not equal to itself.") | |
462 | 462 | } | |
463 | 463 | else throw("Strict value is not equal to itself.") | |
464 | 464 | } | |
465 | 465 | else throw("Strict value is not equal to itself.") | |
466 | 466 | } | |
467 | 467 | ||
468 | 468 | ||
469 | 469 | ||
470 | 470 | @Callable(i) | |
471 | 471 | func claimBaseAsset (baseAssetIdStr,userAddressStr) = { | |
472 | 472 | let checks = [shutdownCheck(i)] | |
473 | 473 | if ((checks == checks)) | |
474 | 474 | then { | |
475 | 475 | let userAddress = if ((userAddressStr == "")) | |
476 | 476 | then i.caller | |
477 | 477 | else { | |
478 | 478 | let checkCaller = mustThis(i) | |
479 | 479 | if ((checkCaller == checkCaller)) | |
480 | 480 | then valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address")) | |
481 | 481 | else throw("Strict value is not equal to itself.") | |
482 | 482 | } | |
483 | 483 | if ((userAddress == userAddress)) | |
484 | 484 | then { | |
485 | 485 | let baseAssetId = parseAssetId(baseAssetIdStr) | |
486 | 486 | let shareAssetId = value(parseAssetId(valueOrErrorMessage(getString(keyShareAssetId(baseAssetId)), wrapErr("invalid base asset id")))) | |
487 | 487 | if ((shareAssetId == shareAssetId)) | |
488 | 488 | then { | |
489 | 489 | let period = valueOrErrorMessage(getInteger(keyPeriod(baseAssetId)), wrapErr("invalid period")) | |
490 | 490 | if ((period == period)) | |
491 | 491 | then { | |
492 | 492 | let userShareAssetAmountToConvert = valueOrElse(getInteger(keyUserShareAssetAmountToConvert(baseAssetId, userAddress)), 0) | |
493 | - | let checkAmountToConvert = if ((userShareAssetAmountToConvert > 0)) | |
493 | + | let userShareAssetAmountToConvertPeriod = valueOrErrorMessage(getInteger(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress)), wrapErr("failed to get period")) | |
494 | + | let checkPeriod = if ((period > userShareAssetAmountToConvertPeriod)) | |
494 | 495 | then true | |
495 | - | else throwErr(" | |
496 | - | if (( | |
496 | + | else throwErr("invalid period") | |
497 | + | if ((checkPeriod == checkPeriod)) | |
497 | 498 | then { | |
498 | - | let userShareAssetAmountToConvertPeriod = valueOrErrorMessage(getInteger(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress)), wrapErr("failed to get period")) | |
499 | - | let checkPeriod = if ((period > userShareAssetAmountToConvertPeriod)) | |
500 | - | then true | |
501 | - | else throwErr("invalid period") | |
502 | - | if ((checkPeriod == checkPeriod)) | |
503 | - | then { | |
504 | - | let price = toBigInt(valueOrErrorMessage(getBinary(keyPricePeriodGet(baseAssetId, userShareAssetAmountToConvertPeriod)), wrapErr("failed to get price"))) | |
505 | - | let baseAssetAmount = toInt(fraction(toBigInt(userShareAssetAmountToConvert), price, scale18BigInt)) | |
506 | - | $Tuple2([IntegerEntry(keyUserShareAssetAmountToConvert(baseAssetId, userAddress), 0), DeleteEntry(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress)), ScriptTransfer(userAddress, baseAssetAmount, baseAssetId), IntegerEntry(keyHistoryEntry(baseAssetId, "claimBaseAsset", period, userAddress, i.transactionId), baseAssetAmount)], unit) | |
507 | - | } | |
508 | - | else throw("Strict value is not equal to itself.") | |
499 | + | let price = toBigInt(valueOrErrorMessage(getBinary(keyPricePeriodGet(baseAssetId, userShareAssetAmountToConvertPeriod)), wrapErr("failed to get price"))) | |
500 | + | let baseAssetAmount = toInt(fraction(toBigInt(userShareAssetAmountToConvert), price, scale18BigInt)) | |
501 | + | $Tuple2([IntegerEntry(keyUserShareAssetAmountToConvert(baseAssetId, userAddress), 0), DeleteEntry(keyUserShareAssetAmountToConvertPeriod(baseAssetId, userAddress)), ScriptTransfer(userAddress, baseAssetAmount, baseAssetId), StringEntry(keyHistoryEntry(baseAssetId, "claimBaseAsset", period, userAddress, i.transactionId), makeString([toString(baseAssetAmount), toString(lastBlock.timestamp), toString(price), toString(userShareAssetAmountToConvertPeriod)], separator))], unit) | |
509 | 502 | } | |
510 | 503 | else throw("Strict value is not equal to itself.") | |
511 | 504 | } | |
512 | 505 | else throw("Strict value is not equal to itself.") | |
513 | 506 | } | |
514 | 507 | else throw("Strict value is not equal to itself.") | |
515 | 508 | } | |
516 | 509 | else throw("Strict value is not equal to itself.") | |
517 | 510 | } | |
518 | 511 | else throw("Strict value is not equal to itself.") | |
519 | 512 | } | |
520 | 513 | ||
521 | 514 | ||
522 | 515 | ||
523 | 516 | @Callable(i) | |
524 | 517 | func finalize (baseAssetIdStr) = { | |
525 | 518 | let checks = [shutdownCheck(i)] | |
526 | 519 | if ((checks == checks)) | |
527 | 520 | then { | |
528 | 521 | let baseAssetId = parseAssetId(baseAssetIdStr) | |
529 | 522 | let shareAssetId = value(parseAssetId(valueOrErrorMessage(getString(keyShareAssetId(baseAssetId)), wrapErr("invalid base asset id")))) | |
530 | 523 | if ((shareAssetId == shareAssetId)) | |
531 | 524 | then { | |
532 | 525 | let shareAssetInfo = valueOrErrorMessage(assetInfo(shareAssetId), wrapErr("invalid share asset id")) | |
533 | 526 | let period = valueOrErrorMessage(getInteger(keyPeriod(baseAssetId)), wrapErr("invalid period")) | |
534 | 527 | if ((period == period)) | |
535 | 528 | then { | |
536 | 529 | let periodStartHeightOption = getInteger(keyPeriodStartHeight(baseAssetId, period)) | |
537 | 530 | let checkDelay = if ((periodStartHeightOption == unit)) | |
538 | 531 | then unit | |
539 | 532 | else { | |
540 | 533 | let delay = (height - value(periodStartHeightOption)) | |
541 | 534 | let blocksToWait = max([0, (minDelay - delay)]) | |
542 | 535 | if ((blocksToWait == 0)) | |
543 | 536 | then unit | |
544 | 537 | else throwErr(makeString(["finalization will be possible in ", toString(blocksToWait), " blocks"], "")) | |
545 | 538 | } | |
546 | 539 | if ((checkDelay == checkDelay)) | |
547 | 540 | then { | |
548 | - | let $ | |
549 | - | let poolAddress = $ | |
550 | - | let lpAssetId = $ | |
541 | + | let $t02111321294 = valueOrErrorMessage(getPoolInfo(baseAssetId), wrapErr("invalid asset")) | |
542 | + | let poolAddress = $t02111321294._1 | |
543 | + | let lpAssetId = $t02111321294._2 | |
551 | 544 | let stakingReward = valueOrErrorMessage({ | |
552 | 545 | let @ = invoke(stakingContract, "claimWxDoNotThrow", [assetIdToString(lpAssetId)], nil) | |
553 | 546 | if ($isInstanceOf(@, "Int")) | |
554 | 547 | then @ | |
555 | 548 | else unit | |
556 | 549 | }, wrapErr("invalid claimWx result")) | |
557 | 550 | if ((stakingReward == stakingReward)) | |
558 | 551 | then { | |
559 | 552 | let baseAssetAmountToConvert = valueOrElse(getInteger(keyBaseAssetAmountToConvert(baseAssetId)), 0) | |
560 | 553 | let shareAssetAmountToConvert = valueOrElse(getInteger(keyShareAssetAmountToConvert(baseAssetId)), 0) | |
561 | 554 | let checkFinalizationIsRequired = { | |
562 | 555 | let isFinalizationRequired = if (if ((stakingReward > 0)) | |
563 | 556 | then true | |
564 | 557 | else (baseAssetAmountToConvert > 0)) | |
565 | 558 | then true | |
566 | 559 | else (shareAssetAmountToConvert > 0) | |
567 | 560 | if (isFinalizationRequired) | |
568 | 561 | then true | |
569 | 562 | else throwErr("nothing to finalize") | |
570 | 563 | } | |
571 | 564 | if ((checkFinalizationIsRequired == checkFinalizationIsRequired)) | |
572 | 565 | then { | |
573 | 566 | let useStakingReward = if ((stakingReward > 0)) | |
574 | 567 | then { | |
575 | 568 | let lockPart = fraction(stakingReward, lockFraction, lockFractionMultiplier) | |
576 | 569 | let convertPart = (stakingReward - lockPart) | |
577 | 570 | let r = invoke(boostingContract, "userMaxDurationREADONLY", [toString(this)], nil) | |
578 | 571 | let lock = if ((lockPart > 0)) | |
579 | 572 | then match r { | |
580 | 573 | case _ => | |
581 | 574 | if (if (if ($isInstanceOf($match0._1, "String")) | |
582 | 575 | then $isInstanceOf($match0._2, "Int") | |
583 | 576 | else false) | |
584 | 577 | then $isInstanceOf($match0, "(String, Int)") | |
585 | 578 | else false) | |
586 | 579 | then { | |
587 | 580 | let function = $match0._1 | |
588 | 581 | let duration = $match0._2 | |
589 | 582 | if ((lockPart > 0)) | |
590 | 583 | then invoke(boostingContract, function, [duration], [AttachedPayment(wxAssetId, lockPart)]) | |
591 | 584 | else unit | |
592 | 585 | } | |
593 | 586 | else throwErr("invalid lock params") | |
594 | 587 | } | |
595 | 588 | else unit | |
596 | 589 | if ((lock == lock)) | |
597 | 590 | then { | |
598 | 591 | let convertedAmount = if ((convertPart > 0)) | |
599 | 592 | then { | |
600 | 593 | let inAssetId = wxAssetId | |
601 | 594 | let minimumToReceive = 0 | |
602 | 595 | let outAssetIdStr = assetIdToString(usdtAssetId) | |
603 | 596 | let targetAddress = toString(this) | |
604 | 597 | valueOrErrorMessage({ | |
605 | 598 | let @ = invoke(swapContract, "swap", [minimumToReceive, outAssetIdStr, targetAddress], [AttachedPayment(inAssetId, convertPart)]) | |
606 | 599 | if ($isInstanceOf(@, "Int")) | |
607 | 600 | then @ | |
608 | 601 | else unit | |
609 | 602 | }, wrapErr("invalid swap result")) | |
610 | 603 | } | |
611 | 604 | else 0 | |
612 | 605 | if ((convertedAmount == convertedAmount)) | |
613 | 606 | then { | |
614 | 607 | let lpAssetAmount = if ((convertedAmount > 0)) | |
615 | 608 | then { | |
616 | 609 | let minOutAmount = 0 | |
617 | 610 | let autoStake = true | |
618 | 611 | valueOrErrorMessage({ | |
619 | 612 | let @ = invoke(poolAddress, "putOneTknV2", [minOutAmount, autoStake], [AttachedPayment(usdtAssetId, convertedAmount)]) | |
620 | 613 | if ($isInstanceOf(@, "Int")) | |
621 | 614 | then @ | |
622 | 615 | else unit | |
623 | 616 | }, wrapErr("invalid putOneTknV2 result")) | |
624 | 617 | } | |
625 | 618 | else 0 | |
626 | 619 | if ((lpAssetAmount == lpAssetAmount)) | |
627 | 620 | then lpAssetAmount | |
628 | 621 | else throw("Strict value is not equal to itself.") | |
629 | 622 | } | |
630 | 623 | else throw("Strict value is not equal to itself.") | |
631 | 624 | } | |
632 | 625 | else throw("Strict value is not equal to itself.") | |
633 | 626 | } | |
634 | 627 | else unit | |
635 | 628 | if ((useStakingReward == useStakingReward)) | |
636 | 629 | then { | |
637 | 630 | let getActions = if ((shareAssetAmountToConvert > 0)) | |
638 | 631 | then { | |
639 | 632 | let price = calcPrice(lpAssetId, shareAssetId) | |
640 | 633 | if ((price == price)) | |
641 | 634 | then { | |
642 | 635 | let unstakeAmount = toInt(fraction(toBigInt(shareAssetAmountToConvert), price, scale18BigInt, FLOOR)) | |
643 | 636 | let baseAssetAmount = { | |
644 | 637 | let outAssetId = baseAssetId | |
645 | 638 | let minOutAmount = 0 | |
646 | 639 | valueOrErrorMessage({ | |
647 | 640 | let @ = invoke(poolAddress, "unstakeAndGetOneTknV2", [unstakeAmount, assetIdToString(outAssetId), minOutAmount], nil) | |
648 | 641 | if ($isInstanceOf(@, "Int")) | |
649 | 642 | then @ | |
650 | 643 | else unit | |
651 | 644 | }, wrapErr("invalid unstakeAndGetOneTknV2 result")) | |
652 | 645 | } | |
653 | 646 | if ((baseAssetAmount == baseAssetAmount)) | |
654 | 647 | then { | |
655 | 648 | let shareAssetBurn = if ((shareAssetInfo.issuer == this)) | |
656 | 649 | then invoke(this, "burn", [shareAssetId, shareAssetAmountToConvert], nil) | |
657 | 650 | else throwErr("invalid share asset issuer") | |
658 | 651 | if ((shareAssetBurn == shareAssetBurn)) | |
659 | 652 | then { | |
660 | 653 | let priceGet = fraction(toBigInt(baseAssetAmount), scale18BigInt, toBigInt(shareAssetAmountToConvert), FLOOR) | |
661 | 654 | let priceGetUpdateActions = [BinaryEntry(keyPricePeriodGet(baseAssetId, period), toBytes(priceGet)), StringEntry(keyPriceGetHistory(baseAssetId), toString(priceGet))] | |
662 | 655 | priceGetUpdateActions | |
663 | 656 | } | |
664 | 657 | else throw("Strict value is not equal to itself.") | |
665 | 658 | } | |
666 | 659 | else throw("Strict value is not equal to itself.") | |
667 | 660 | } | |
668 | 661 | else throw("Strict value is not equal to itself.") | |
669 | 662 | } | |
670 | 663 | else nil | |
671 | 664 | if ((getActions == getActions)) | |
672 | 665 | then { | |
673 | 666 | let putActions = if ((baseAssetAmountToConvert > 0)) | |
674 | 667 | then { | |
675 | 668 | let lpAssetAmount = { | |
676 | 669 | let minOutAmount = 0 | |
677 | 670 | let autoStake = true | |
678 | 671 | valueOrErrorMessage({ | |
679 | 672 | let @ = invoke(poolAddress, "putOneTknV2", [minOutAmount, autoStake], [AttachedPayment(baseAssetId, baseAssetAmountToConvert)]) | |
680 | 673 | if ($isInstanceOf(@, "Int")) | |
681 | 674 | then @ | |
682 | 675 | else unit | |
683 | 676 | }, wrapErr("invalid putOneTknV2 result")) | |
684 | 677 | } | |
685 | 678 | if ((lpAssetAmount == lpAssetAmount)) | |
686 | 679 | then { | |
687 | 680 | let price = calcPrice(lpAssetId, shareAssetId) | |
688 | 681 | if ((price == price)) | |
689 | 682 | then { | |
690 | - | let shareAssetAmount = toInt(fraction(toBigInt(lpAssetAmount), scale18BigInt, price, FLOOR)) | |
691 | - | let shareAssetReissue = if ((shareAssetInfo.issuer == this)) | |
692 | - | then invoke(this, "emit", [shareAssetId, shareAssetAmount], nil) | |
693 | - | else throwErr("invalid share asset issuer") | |
694 | - | if ((shareAssetReissue == shareAssetReissue)) | |
683 | + | let checkPrice = if ((value(toInt(price)) != 0)) | |
684 | + | then true | |
685 | + | else throw("price is ZERO") | |
686 | + | if ((checkPrice == checkPrice)) | |
695 | 687 | then { | |
696 | - | let pricePut = fraction(toBigInt(baseAssetAmountToConvert), scale18BigInt, toBigInt(shareAssetAmount)) | |
697 | - | let pricePutUpdateActions = [BinaryEntry(keyPricePeriodPut(baseAssetId, period), toBytes(pricePut)), StringEntry(keyPricePutHistory(baseAssetId), toString(pricePut))] | |
698 | - | pricePutUpdateActions | |
688 | + | let shareAssetAmount = toInt(fraction(toBigInt(lpAssetAmount), scale18BigInt, price, FLOOR)) | |
689 | + | let checkShareAssetAmount = if ((value(toInt(price)) != 0)) | |
690 | + | then true | |
691 | + | else throw("shareAssetAmount is ZERO") | |
692 | + | if ((checkShareAssetAmount == checkShareAssetAmount)) | |
693 | + | then { | |
694 | + | let shareAssetReissue = if ((shareAssetInfo.issuer == this)) | |
695 | + | then invoke(this, "emit", [shareAssetId, shareAssetAmount], nil) | |
696 | + | else throwErr("invalid share asset issuer") | |
697 | + | if ((shareAssetReissue == shareAssetReissue)) | |
698 | + | then { | |
699 | + | let pricePut = fraction(toBigInt(baseAssetAmountToConvert), scale18BigInt, toBigInt(shareAssetAmount)) | |
700 | + | let pricePutUpdateActions = [BinaryEntry(keyPricePeriodPut(baseAssetId, period), toBytes(pricePut)), StringEntry(keyPricePutHistory(baseAssetId), toString(pricePut))] | |
701 | + | pricePutUpdateActions | |
702 | + | } | |
703 | + | else throw("Strict value is not equal to itself.") | |
704 | + | } | |
705 | + | else throw("Strict value is not equal to itself.") | |
699 | 706 | } | |
700 | 707 | else throw("Strict value is not equal to itself.") | |
701 | 708 | } | |
702 | 709 | else throw("Strict value is not equal to itself.") | |
703 | 710 | } | |
704 | 711 | else throw("Strict value is not equal to itself.") | |
705 | 712 | } | |
706 | 713 | else nil | |
707 | 714 | if ((putActions == putActions)) | |
708 | 715 | then { | |
709 | 716 | let newPeriod = (period + 1) | |
710 | 717 | let lastPrice = calcPrice(lpAssetId, shareAssetId) | |
711 | 718 | 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) | |
712 | 719 | $Tuple2(actions, toBytes(lastPrice)) | |
713 | 720 | } | |
714 | 721 | else throw("Strict value is not equal to itself.") | |
715 | 722 | } | |
716 | 723 | else throw("Strict value is not equal to itself.") | |
717 | 724 | } | |
718 | 725 | else throw("Strict value is not equal to itself.") | |
719 | 726 | } | |
720 | 727 | else throw("Strict value is not equal to itself.") | |
721 | 728 | } | |
722 | 729 | else throw("Strict value is not equal to itself.") | |
723 | 730 | } | |
724 | 731 | else throw("Strict value is not equal to itself.") | |
725 | 732 | } | |
726 | 733 | else throw("Strict value is not equal to itself.") | |
727 | 734 | } | |
728 | 735 | else throw("Strict value is not equal to itself.") | |
729 | 736 | } | |
730 | 737 | else throw("Strict value is not equal to itself.") | |
731 | 738 | } | |
732 | 739 | ||
733 | 740 | ||
734 | 741 | @Verifier(tx) | |
735 | 742 | func verify () = { | |
736 | 743 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
737 | 744 | case pk: ByteVector => | |
738 | 745 | pk | |
739 | 746 | case _: Unit => | |
740 | 747 | tx.senderPublicKey | |
741 | 748 | case _ => | |
742 | 749 | throw("Match error") | |
743 | 750 | } | |
744 | 751 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
745 | 752 | } | |
746 | 753 |
github/deemru/w8io/026f985 101.60 ms ◑