tx · 56SzMf9LWuB4o1CUSWaK3fpgpESzmVdRYBBiscuqq2yE

3MqzKJcjfKxqGWSA84WR4kQwZksM5vjxiFp:  -0.02200000 Waves

2023.05.02 09:51 [2559807] smart account 3MqzKJcjfKxqGWSA84WR4kQwZksM5vjxiFp > SELF 0.00000000 Waves

{ "type": 13, "id": "56SzMf9LWuB4o1CUSWaK3fpgpESzmVdRYBBiscuqq2yE", "fee": 2200000, "feeAssetId": null, "timestamp": 1683010336908, "version": 2, "chainId": 84, "sender": "3MqzKJcjfKxqGWSA84WR4kQwZksM5vjxiFp", "senderPublicKey": "bS6Cchmk25EdDcapkz8W5WkZgthTHHW6sSBbcidSrCb", "proofs": [ "RopuhtCcWAwAQbM2uufzDvPSmxF1RtJ3PEonuNPiaj7pSgowyXmqfpGY1x96PBk8pxPNsU7BXGBw3SGowZsy2Xu" ], "script": "base64:BgK1IggCEgkKBwEBAQEBCAESABIECgIICBIDCgEIEgQKAggIEgQKAggIIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIghhc1N0cmluZyIDdmFsIgckbWF0Y2gwIgZ2YWxTdHIiHWNvbnZlcnRQcmljZUFzc2V0SW50b0lkb0Fzc2V0IhBwcmljZUFzc2V0QW1vdW50Ig5wcmljZUFzc2V0TVVMVCIFcHJpY2UiCXByaWNlTVVMVCIMaWRvQXNzZXRNVUxUIg9iUHJpY2VBc3NldE1VTFQiDWJJZG9Bc3NldE1VTFQiDmJQcmljZUFzc2V0QlVGIg9iQW1vdW50QXNzZXRCVUYiDklkeENmZ0lkb1N0YXJ0IhFJZHhDZmdJZG9EdXJhdGlvbiIQSWR4Q2ZnQ2xhaW1TdGFydCITSWR4Q2ZnQ2xhaW1EdXJhdGlvbiILSWR4Q2ZnUHJpY2UiD0lkeENmZ1ByaWNlTXVsdCIQSWR4Q2ZnSWRvQXNzZXRJZCISSWR4Q2ZnSWRvQXNzZXRNdWx0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ECBQFqAgRVbml0CAUCZHcPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmR3CWJvZHlCeXRlcwkAkQMCCAUCZHcGcHJvb2ZzAAAFAmR5VOajIA==", "height": 2559807, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HNAZjp4N6gzhHXAGGALQMBHMmVB7DdPFK7Wkkc7pC3En Next: none Diff:
OldNewDifferences
140140 func keyManagerPublicKey () = "%s__managerPublicKey"
141141
142142
143-func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
143+func keyManagerVaultAddress () = "%s__managerVaultAddress"
144144
145145
146146 func readConfigArray () = split(getStringOrFail(keyConfig()), SEP)
156156
157157
158158 func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP)
159+
160+
161+func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress()))
159162
160163
161164 let IdxDiffTotalIncrement = 0
250253 let periodLength = value(getInteger(keyPeriodLength()))
251254 let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
252255 let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0)))
253- let $t01298714857 = if ((currentPeriod > 0))
256+ let $t01307714947 = if ((currentPeriod > 0))
254257 then {
255258 let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod)))
256259 let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod)))
257- let $t01324713952 = if ((height > lastPeriodEndHeight))
260+ let $t01333714042 = if ((height > lastPeriodEndHeight))
258261 then {
259262 let updatedCurrentPeriod = (currentPeriod + 1)
260263 let periodStart = if ((height > (lastPeriodEndHeight + periodLength)))
269272 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
270273 }
271274 else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
272- let updatedCurrentPeriod = $t01324713952._1
273- let periodStart = $t01324713952._2
274- let periodEnd = $t01324713952._3
275+ let updatedCurrentPeriod = $t01333714042._1
276+ let periodStart = $t01333714042._2
277+ let periodEnd = $t01333714042._3
275278 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
276279 }
277280 else if (zeroPeriodEndHeighIsDefined)
278281 then {
279282 let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0)))
280283 let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0)))
281- let $t01420714589 = if ((height > zeroPeriodEndHeight))
284+ let $t01429714679 = if ((height > zeroPeriodEndHeight))
282285 then {
283286 let updatedCurrentPeriod = (currentPeriod + 1)
284287 let periodStart = (zeroPeriodEndHeight + 1)
286289 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
287290 }
288291 else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight)
289- let updatedCurrentPeriod = $t01420714589._1
290- let periodStart = $t01420714589._2
291- let periodEnd = $t01420714589._3
292+ let updatedCurrentPeriod = $t01429714679._1
293+ let periodStart = $t01429714679._2
294+ let periodEnd = $t01429714679._3
292295 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
293296 }
294297 else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
295- let updatedCurrentPeriod = $t01298714857._1
296- let periodStart = $t01298714857._2
297- let periodEnd = $t01298714857._3
298+ let updatedCurrentPeriod = $t01307714947._1
299+ let periodStart = $t01307714947._2
300+ let periodEnd = $t01307714947._3
298301 let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
299302 let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
300303 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
301304 let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim])
302305 let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
303306 let putOneTknV2PriceAssetAmount = scale8
304- let $t01561215865 = {
307+ let $t01570215955 = {
305308 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
306309 if ($isInstanceOf(@, "(Int, Int, Int)"))
307310 then @
308311 else throw(($getType(@) + " couldn't be cast to (Int, Int, Int)"))
309312 }
310- if (($t01561215865 == $t01561215865))
313+ if (($t01570215955 == $t01570215955))
311314 then {
312- let bonus = $t01561215865._3
313- let feeAmount = $t01561215865._2
314- let lpAmount = $t01561215865._1
315+ let bonus = $t01570215955._3
316+ let feeAmount = $t01570215955._2
317+ let lpAmount = $t01570215955._1
315318 let usdtAssetId = value(getString(keyUsdtAssetId()))
316- let $t01592716145 = {
319+ let $t01601716235 = {
317320 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
318321 if ($isInstanceOf(@, "(Int, Int)"))
319322 then @
320323 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
321324 }
322- if (($t01592716145 == $t01592716145))
325+ if (($t01601716235 == $t01601716235))
323326 then {
324- let getOneTknV2FeeAmount = $t01592716145._2
325- let usdtAmount = $t01592716145._1
327+ let getOneTknV2FeeAmount = $t01601716235._2
328+ let usdtAmount = $t01601716235._1
326329 let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, scale8, usdtAmount)
327330 let endPeriodBlocksLeft = (periodEnd - height)
328331 $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd)
333336 }
334337
335338
336-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
337- case s: String =>
338- fromBase58String(s)
339- case _: Unit =>
340- unit
341- case _ =>
342- throw("Match error")
343-}
344-
345-
346-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
347- case s: String =>
348- fromBase58String(s)
349- case _: Unit =>
350- unit
351- case _ =>
352- throw("Match error")
353-}
339+func managerPublicKeyOrUnit () = {
340+ let managerVaultAddress = getManagerAddressOrFail()
341+ match getString(managerVaultAddress, keyManagerPublicKey()) {
342+ case s: String =>
343+ fromBase58String(s)
344+ case _: Unit =>
345+ unit
346+ case _ =>
347+ throw("Match error")
348+ }
349+ }
354350
355351
356352 func mustManager (i) = {
466462 let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals
467463 let entries = if ((claimedAssetId58 == priceAssetId58))
468464 then {
469- let $t02205422498 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
470- let periodMinAvailableToClaim = $t02205422498._1
471- let periodTotalAvailableToClaim = $t02205422498._2
472- let periodUserAvailableToClaim = $t02205422498._3
473- let totalUserAvailableToClaim = $t02205422498._4
474- let usdtPriceAssetAllowableRatio = $t02205422498._5
475- let currentUsdtPriceAssetRatio = $t02205422498._6
476- let endPeriodBlocksLeft = $t02205422498._7
477- let updatedCurrentPeriod = $t02205422498._8
478- let periodStart = $t02205422498._9
479- let periodEnd = $t02205422498._10
465+ let $t02207422518 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
466+ let periodMinAvailableToClaim = $t02207422518._1
467+ let periodTotalAvailableToClaim = $t02207422518._2
468+ let periodUserAvailableToClaim = $t02207422518._3
469+ let totalUserAvailableToClaim = $t02207422518._4
470+ let usdtPriceAssetAllowableRatio = $t02207422518._5
471+ let currentUsdtPriceAssetRatio = $t02207422518._6
472+ let endPeriodBlocksLeft = $t02207422518._7
473+ let updatedCurrentPeriod = $t02207422518._8
474+ let periodStart = $t02207422518._9
475+ let periodEnd = $t02207422518._10
480476 let checks = [if ((periodUserAvailableToClaim > 0))
481477 then true
482478 else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0))
611607 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
612608 let priceAssetBalanceIdoDecimals = (priceAssetBalance * 100)
613609 let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalanceIdoDecimals)
614- let $t03374934161 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
615- let periodMinAvailableToClaim = $t03374934161._1
616- let periodTotalAvailableToClaim = $t03374934161._2
617- let periodUserAvailableToClaim = $t03374934161._3
618- let totalUserAvailableToClaim = $t03374934161._4
619- let usdtPriceAssetAllowableRatio = $t03374934161._5
620- let currentUsdtPriceAssetRatio = $t03374934161._6
621- let endPeriodBlocksLeft = $t03374934161._7
622- let updatedCurrentPeriod = $t03374934161._8
623- let periodStart = $t03374934161._9
624- let periodEnd = $t03374934161._10
610+ let $t03376934181 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
611+ let periodMinAvailableToClaim = $t03376934181._1
612+ let periodTotalAvailableToClaim = $t03376934181._2
613+ let periodUserAvailableToClaim = $t03376934181._3
614+ let totalUserAvailableToClaim = $t03376934181._4
615+ let usdtPriceAssetAllowableRatio = $t03376934181._5
616+ let currentUsdtPriceAssetRatio = $t03376934181._6
617+ let endPeriodBlocksLeft = $t03376934181._7
618+ let updatedCurrentPeriod = $t03376934181._8
619+ let periodStart = $t03376934181._9
620+ let periodEnd = $t03376934181._10
625621 let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0)
626622 let userTotalPriceAssetClaimed = (parseIntValue(readInvestorArrayOrFail(userAddress58)[IdxInvClaimedPriceAssetAmount]) - priceAssetBalance)
627623 let resultString = if ((height > currentPeriodEndHeight))
633629 }
634630 else makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft), toString(userTotalPriceAssetClaimed)], SEP)
635631 $Tuple2(nil, resultString)
636- }
637-
638-
639-
640-@Callable(i)
641-func setManager (pendingManagerPublicKey) = {
642- let checkCaller = mustManager(i)
643- if ((checkCaller == checkCaller))
644- then {
645- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
646- if ((checkManagerPublicKey == checkManagerPublicKey))
647- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
648- else throw("Strict value is not equal to itself.")
649- }
650- else throw("Strict value is not equal to itself.")
651- }
652-
653-
654-
655-@Callable(i)
656-func confirmManager () = {
657- let pm = pendingManagerPublicKeyOrUnit()
658- let hasPM = if (isDefined(pm))
659- then true
660- else throw("No pending manager")
661- if ((hasPM == hasPM))
662- then {
663- let checkPM = if ((i.callerPublicKey == value(pm)))
664- then true
665- else throw("You are not pending manager")
666- if ((checkPM == checkPM))
667- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
668- else throw("Strict value is not equal to itself.")
669- }
670- else throw("Strict value is not equal to itself.")
671632 }
672633
673634
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
55
66
77 let SEP = "__"
88
99 let BUFSCALE = toBigInt(1000000000000000000)
1010
1111 let scale8 = 100000000
1212
1313 func throwErr (msg) = throw(makeString(["ido.ride:", msg], " "))
1414
1515
1616 func asString (val) = match val {
1717 case valStr: String =>
1818 valStr
1919 case _ =>
2020 throw("fail to cast into String")
2121 }
2222
2323
2424 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
2525 let bPriceAssetMULT = toBigInt(priceAssetMULT)
2626 let bIdoAssetMULT = toBigInt(idoAssetMULT)
2727 let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceAssetMULT)
2828 let bAmountAssetBUF = fraction(bPriceAssetBUF, toBigInt(priceMULT), toBigInt(price))
2929 toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE))
3030 }
3131
3232
3333 let IdxCfgIdoStart = 1
3434
3535 let IdxCfgIdoDuration = 2
3636
3737 let IdxCfgClaimStart = 3
3838
3939 let IdxCfgClaimDuration = 4
4040
4141 let IdxCfgPrice = 5
4242
4343 let IdxCfgPriceMult = 6
4444
4545 let IdxCfgIdoAssetId = 7
4646
4747 let IdxCfgIdoAssetMult = 8
4848
4949 let IdxCfgPriceAssetId = 9
5050
5151 let IdxCfgPriceAssetMult = 10
5252
5353 let IdxCfgMinInvestAmount = 11
5454
5555 func fromatConfigS (idoStart,idoDuration,claimStart,claimDuration,price,priceMult,idoAssetId58,idoAssetMult,priceAssetId58,priceAssetMult,minInvestAmount,totalIdoAssetToSell) = makeString(["%d%d%d%d%d%d%s%d%s%d%d%d", idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, totalIdoAssetToSell], SEP)
5656
5757
5858 func fromatConfig (idoStart,idoDuration,claimStart,claimDuration,price,priceMult,idoAssetId58,idoAssetMult,priceAssetId58,priceAssetMult,minInvestAmount,totalIdoAssetToSell) = fromatConfigS(toString(idoStart), toString(idoDuration), toString(claimStart), toString(claimDuration), toString(price), toString(priceMult), idoAssetId58, toString(idoAssetMult), priceAssetId58, toString(priceAssetMult), toString(minInvestAmount), toString(totalIdoAssetToSell))
5959
6060
6161 let IdxInvTotalAmount = 1
6262
6363 let IdxInvRemainingAmount = 2
6464
6565 let IdxInvClaimedPriceAssetAmount = 3
6666
6767 let IdxInvClaimedIdoAssetAmount = 4
6868
6969 let IdxInvLastClaimedHeight = 5
7070
7171 func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP)
7272
7373
7474 func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight))
7575
7676
7777 func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP)
7878
7979
8080 func keyConfig () = "%s__config"
8181
8282
8383 func keyInvestor (userAddress) = ("%s__" + userAddress)
8484
8585
8686 func keyTotals () = "%s__totals"
8787
8888
8989 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
9090
9191
9292 func keyUSDNClaimDisabled () = "%s__usdnClaimDisabled"
9393
9494
9595 func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight"
9696
9797
9898 func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
9999
100100
101101 func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
102102
103103
104104 func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP)
105105
106106
107107 func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP)
108108
109109
110110 func keyUsdtPriceAssetAllowableRatio () = makeString(["%s", "usdtPriceAssetAllowableRatio"], SEP)
111111
112112
113113 func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP)
114114
115115
116116 func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP)
117117
118118
119119 func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP)
120120
121121
122122 func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP)
123123
124124
125125 func keyUsdtPriceAssetStablePool () = makeString(["%s", "usdtPriceAssetStablePool"], SEP)
126126
127127
128128 func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP)
129129
130130
131131 func keyPriceAssetBalance (address) = makeString(["%s%s", "priceAssetBalance", address], SEP)
132132
133133
134134 func keyInvestorRemainingAmount (address) = makeString(["%s%s", "investorRemainingAmount", address], SEP)
135135
136136
137137 func keyTotalRemainingAmount () = makeString(["%s", "totalRemainingAmount"], SEP)
138138
139139
140140 func keyManagerPublicKey () = "%s__managerPublicKey"
141141
142142
143-func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
143+func keyManagerVaultAddress () = "%s__managerVaultAddress"
144144
145145
146146 func readConfigArray () = split(getStringOrFail(keyConfig()), SEP)
147147
148148
149149 func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP)
150150
151151
152152 func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals())
153153
154154
155155 func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress))
156156
157157
158158 func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP)
159+
160+
161+func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress()))
159162
160163
161164 let IdxDiffTotalIncrement = 0
162165
163166 let IdxDiffRemainingPriceAmountIncrement = 1
164167
165168 let IdxDiffClaimedPriceAmountIncrement = 2
166169
167170 let IdxDiffClaimedIdoAssetAmountIncrement = 3
168171
169172 func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight,priceAssetBalance) = {
170173 let totalAmount = parseIntValue(origArray[IdxInvTotalAmount])
171174 let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount])
172175 let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount])
173176 let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount])
174177 let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight])
175178 let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement])
176179 let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement])
177180 let cfgArray = readConfigArray()
178181 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
179182 let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals
180183 let priceAssetBalancePriceAssetDecimals = fraction(priceAssetBalance, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN))
181184 let newClaimedPriceAssetAmount = ((claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement]) - priceAssetBalance)
182185 let newClaimedIdoAssetAmount = ((claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement]) + priceAssetBalancePriceAssetDecimals)
183186 let entries = if ((0 > newRemainingAmount))
184187 then {
185188 let diff = ((newTotalAmount - newClaimedPriceAssetAmount) - newClaimedIdoAssetAmount)
186189 let newLogicRemainingAmount = if ((0 > diff))
187190 then 0
188191 else diff
189192 StringEntry(key, formatInvestor(newTotalAmount, newLogicRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
190193 }
191194 else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
192195 entries
193196 }
194197
195198
196199 func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
197200
198201
199202 func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
200203
201204
202205 func internalClaim (claimedAssetId58,userAddress,txId) = {
203206 let cfgArray = readConfigArray()
204207 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
205208 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
206209 let claimEnd = (claimStart + claimDuration)
207210 let price = parseIntValue(cfgArray[IdxCfgPrice])
208211 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
209212 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
210213 let idoAssetId = fromBase58String(idoAssetId58)
211214 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
212215 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
213216 let priceAssetId = fromBase58String(priceAssetId58)
214217 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
215218 let userAddress58 = toString(userAddress)
216219 let origInvestArray = readInvestorArrayOrFail(userAddress58)
217220 let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount])
218221 let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight])
219222 let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP))
220223 then claimStart
221224 else investLastClaimedHeightTMP
222225 let newClaimPeriodHeight = if ((height > claimEnd))
223226 then claimEnd
224227 else if ((claimStart > height))
225228 then claimStart
226229 else height
227230 let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight)
228231 let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration)
229232 let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult)
230233 let isUSDN = (claimedAssetId58 == priceAssetId58)
231234 let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false)
232235 let checks = [if (!(if (isUSDN)
233236 then isUSDNClaimDisabled
234237 else false))
235238 then true
236239 else throw("USDN claim is disabled")]
237240 if ((checks == checks))
238241 then if ((claimedAssetId58 == priceAssetId58))
239242 then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
240243 else if ((claimedAssetId58 == idoAssetId58))
241244 then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
242245 else throw(("unsupported assetId: " + claimedAssetId58))
243246 else throw("Strict value is not equal to itself.")
244247 }
245248
246249
247250 func internalClaimV2 (priceAssetId58,userAddress58,outAmount,totalUserAvailableToClaim) = {
248251 let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
249252 let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
250253 let periodLength = value(getInteger(keyPeriodLength()))
251254 let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
252255 let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0)))
253- let $t01298714857 = if ((currentPeriod > 0))
256+ let $t01307714947 = if ((currentPeriod > 0))
254257 then {
255258 let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod)))
256259 let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod)))
257- let $t01324713952 = if ((height > lastPeriodEndHeight))
260+ let $t01333714042 = if ((height > lastPeriodEndHeight))
258261 then {
259262 let updatedCurrentPeriod = (currentPeriod + 1)
260263 let periodStart = if ((height > (lastPeriodEndHeight + periodLength)))
261264 then {
262265 let blocksToLastPeriodStart = ((height - lastPeriodEndHeight) % periodLength)
263266 if ((blocksToLastPeriodStart == 0))
264267 then ((height - periodLength) + 1)
265268 else (height - blocksToLastPeriodStart)
266269 }
267270 else (lastPeriodEndHeight + 1)
268271 let periodEnd = ((periodStart + periodLength) - 1)
269272 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
270273 }
271274 else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
272- let updatedCurrentPeriod = $t01324713952._1
273- let periodStart = $t01324713952._2
274- let periodEnd = $t01324713952._3
275+ let updatedCurrentPeriod = $t01333714042._1
276+ let periodStart = $t01333714042._2
277+ let periodEnd = $t01333714042._3
275278 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
276279 }
277280 else if (zeroPeriodEndHeighIsDefined)
278281 then {
279282 let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0)))
280283 let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0)))
281- let $t01420714589 = if ((height > zeroPeriodEndHeight))
284+ let $t01429714679 = if ((height > zeroPeriodEndHeight))
282285 then {
283286 let updatedCurrentPeriod = (currentPeriod + 1)
284287 let periodStart = (zeroPeriodEndHeight + 1)
285288 let periodEnd = ((periodStart + periodLength) - 1)
286289 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
287290 }
288291 else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight)
289- let updatedCurrentPeriod = $t01420714589._1
290- let periodStart = $t01420714589._2
291- let periodEnd = $t01420714589._3
292+ let updatedCurrentPeriod = $t01429714679._1
293+ let periodStart = $t01429714679._2
294+ let periodEnd = $t01429714679._3
292295 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
293296 }
294297 else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
295- let updatedCurrentPeriod = $t01298714857._1
296- let periodStart = $t01298714857._2
297- let periodEnd = $t01298714857._3
298+ let updatedCurrentPeriod = $t01307714947._1
299+ let periodStart = $t01307714947._2
300+ let periodEnd = $t01307714947._3
298301 let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
299302 let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
300303 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
301304 let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim])
302305 let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
303306 let putOneTknV2PriceAssetAmount = scale8
304- let $t01561215865 = {
307+ let $t01570215955 = {
305308 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
306309 if ($isInstanceOf(@, "(Int, Int, Int)"))
307310 then @
308311 else throw(($getType(@) + " couldn't be cast to (Int, Int, Int)"))
309312 }
310- if (($t01561215865 == $t01561215865))
313+ if (($t01570215955 == $t01570215955))
311314 then {
312- let bonus = $t01561215865._3
313- let feeAmount = $t01561215865._2
314- let lpAmount = $t01561215865._1
315+ let bonus = $t01570215955._3
316+ let feeAmount = $t01570215955._2
317+ let lpAmount = $t01570215955._1
315318 let usdtAssetId = value(getString(keyUsdtAssetId()))
316- let $t01592716145 = {
319+ let $t01601716235 = {
317320 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
318321 if ($isInstanceOf(@, "(Int, Int)"))
319322 then @
320323 else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
321324 }
322- if (($t01592716145 == $t01592716145))
325+ if (($t01601716235 == $t01601716235))
323326 then {
324- let getOneTknV2FeeAmount = $t01592716145._2
325- let usdtAmount = $t01592716145._1
327+ let getOneTknV2FeeAmount = $t01601716235._2
328+ let usdtAmount = $t01601716235._1
326329 let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, scale8, usdtAmount)
327330 let endPeriodBlocksLeft = (periodEnd - height)
328331 $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd)
329332 }
330333 else throw("Strict value is not equal to itself.")
331334 }
332335 else throw("Strict value is not equal to itself.")
333336 }
334337
335338
336-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
337- case s: String =>
338- fromBase58String(s)
339- case _: Unit =>
340- unit
341- case _ =>
342- throw("Match error")
343-}
344-
345-
346-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
347- case s: String =>
348- fromBase58String(s)
349- case _: Unit =>
350- unit
351- case _ =>
352- throw("Match error")
353-}
339+func managerPublicKeyOrUnit () = {
340+ let managerVaultAddress = getManagerAddressOrFail()
341+ match getString(managerVaultAddress, keyManagerPublicKey()) {
342+ case s: String =>
343+ fromBase58String(s)
344+ case _: Unit =>
345+ unit
346+ case _ =>
347+ throw("Match error")
348+ }
349+ }
354350
355351
356352 func mustManager (i) = {
357353 let pd = throw("Permission denied")
358354 match managerPublicKeyOrUnit() {
359355 case pk: ByteVector =>
360356 if ((i.callerPublicKey == pk))
361357 then true
362358 else pd
363359 case _: Unit =>
364360 if ((i.caller == this))
365361 then true
366362 else pd
367363 case _ =>
368364 throw("Match error")
369365 }
370366 }
371367
372368
373369 @Callable(i)
374370 func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = {
375371 let priceMult = ((100 * 1000) * 1000)
376372 let idoEnd = (idoStart + idoDuration)
377373 if (isDefined(getString(keyConfig())))
378374 then throw("already initialized")
379375 else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller)))
380376 then throw("not authorized")
381377 else if ((size(i.payments) != 1))
382378 then throw("exactly 1 payment must be attached")
383379 else if ((idoEnd >= claimStart))
384380 then throw("claimStart must be greater than idoEnd")
385381 else {
386382 let pmt = value(i.payments[0])
387383 let idoAssetId = value(pmt.assetId)
388384 let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info")
389385 let idoAssetId58 = toBase58String(idoAssetId)
390386 let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN)
391387 let priceAssetId = fromBase58String(priceAssetId58)
392388 let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info")
393389 let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN)
394390 let origTotalsArray = readTotalsArrayOrDefault()
395391 let totalsDiff = [0, 0, 0, 0]
396392 [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart, 0)]
397393 }
398394 }
399395
400396
401397
402398 @Callable(i)
403399 func invest () = {
404400 let cfgArray = readConfigArray()
405401 let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart])
406402 let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration])
407403 let idoEnd = (idoStart + idoDuration)
408404 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
409405 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
410406 let price = parseIntValue(cfgArray[IdxCfgPrice])
411407 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
412408 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
413409 let idoAssetId = fromBase58String(idoAssetId58)
414410 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
415411 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
416412 let priceAssetId = fromBase58String(priceAssetId58)
417413 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
418414 let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount])
419415 let userAddress = toString(i.caller)
420416 if ((idoStart > height))
421417 then throw("ido has not been started yet")
422418 else if ((height > idoEnd))
423419 then throw("ido has been already ended")
424420 else if ((size(i.payments) != 1))
425421 then throw("exactly 1 payment is expected")
426422 else {
427423 let pmt = value(i.payments[0])
428424 let pmtAssetId = value(pmt.assetId)
429425 let pmtAmount = pmt.amount
430426 if ((pmtAssetId != priceAssetId))
431427 then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected"))
432428 else {
433429 let origInvestorArray = readInvestorArrayOrDefault(userAddress)
434430 let origTotalsArray = readTotalsArrayOrDefault()
435431 let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount)
436432 let requiredIdoAssetAmount = (newPriceTotalAmount * 100)
437433 if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId)))
438434 then throw("IDO asset has been - sold consider to use smaller payment")
439435 else {
440436 let totalsDiff = [pmtAmount, pmtAmount, 0, 0]
441437 [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart, 0), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart, 0), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)]
442438 }
443439 }
444440 }
445441 }
446442
447443
448444
449445 @Callable(i)
450446 func claim (claimedAssetId58,userAddress58) = {
451447 let callerAddress58 = toString(i.caller)
452448 if ((userAddress58 != callerAddress58))
453449 then throw("not authorized")
454450 else {
455451 let cfgArray = readConfigArray()
456452 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
457453 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
458454 let totalsDiff = claimResultTuple._1
459455 let outAmount = claimResultTuple._2
460456 let outAssetId = claimResultTuple._3
461457 let origInvestArray = claimResultTuple._4
462458 let newClaimPeriodHeight = claimResultTuple._5
463459 let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
464460 let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
465461 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
466462 let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals
467463 let entries = if ((claimedAssetId58 == priceAssetId58))
468464 then {
469- let $t02205422498 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
470- let periodMinAvailableToClaim = $t02205422498._1
471- let periodTotalAvailableToClaim = $t02205422498._2
472- let periodUserAvailableToClaim = $t02205422498._3
473- let totalUserAvailableToClaim = $t02205422498._4
474- let usdtPriceAssetAllowableRatio = $t02205422498._5
475- let currentUsdtPriceAssetRatio = $t02205422498._6
476- let endPeriodBlocksLeft = $t02205422498._7
477- let updatedCurrentPeriod = $t02205422498._8
478- let periodStart = $t02205422498._9
479- let periodEnd = $t02205422498._10
465+ let $t02207422518 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
466+ let periodMinAvailableToClaim = $t02207422518._1
467+ let periodTotalAvailableToClaim = $t02207422518._2
468+ let periodUserAvailableToClaim = $t02207422518._3
469+ let totalUserAvailableToClaim = $t02207422518._4
470+ let usdtPriceAssetAllowableRatio = $t02207422518._5
471+ let currentUsdtPriceAssetRatio = $t02207422518._6
472+ let endPeriodBlocksLeft = $t02207422518._7
473+ let updatedCurrentPeriod = $t02207422518._8
474+ let periodStart = $t02207422518._9
475+ let periodEnd = $t02207422518._10
480476 let checks = [if ((periodUserAvailableToClaim > 0))
481477 then true
482478 else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0))
483479 then true
484480 else throwErr("unavailable to claim because total period allowance reached"), if ((periodMinAvailableToClaim > 0))
485481 then true
486482 else throwErr("nothing to claim"), if ((usdtPriceAssetAllowableRatio > currentUsdtPriceAssetRatio))
487483 then true
488484 else throwErr("unavailable to claim because usdn price lower than usdtPriceAssetAllowableRatio")]
489485 if ((checks == checks))
490486 then {
491487 let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim)
492488 let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim)
493489 let entries = if ((priceAssetBalance > periodMinAvailableToClaim))
494490 then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))]
495491 else {
496492 let evaluateResult = split(asString(invoke(this, "claimREADONLY", [priceAssetId58, userAddress58], nil)), SEP)
497493 if ((evaluateResult == evaluateResult))
498494 then {
499495 let availablePriceAmountToClaim = parseIntValue(evaluateResult[3])
500496 let lastClaimEntries = if ((availablePriceAmountToClaim == periodMinAvailableToClaim))
501497 then {
502498 let investorTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount])
503499 let investorRemainingAmount = parseIntValue(origInvestArray[IdxInvRemainingAmount])
504500 let investorPriceAssetBalance = parseIntValue(origInvestArray[IdxInvClaimedPriceAssetAmount])
505501 let investorIdoAssetBalance = parseIntValue(origInvestArray[IdxInvClaimedIdoAssetAmount])
506502 let investorLastClaimedHeight = parseIntValue(origInvestArray[IdxInvLastClaimedHeight])
507503 let newInvestArray = [toString(investorTotalAmount), "0", toString(investorPriceAssetBalance), toString(investorIdoAssetBalance), toString(investorLastClaimedHeight)]
508504 let totals = readTotalsArrayOrDefault()
509505 let totalsTotalAmount = parseIntValue(totals[IdxInvTotalAmount])
510506 let totalsRemainingAmount = parseIntValue(totals[IdxInvRemainingAmount])
511507 let totalsClaimedPriceAssetAmount = parseIntValue(totals[IdxInvClaimedPriceAssetAmount])
512508 let totalsClaimedIdoAssetAmount = parseIntValue(totals[IdxInvClaimedIdoAssetAmount])
513509 let totalsLastClaimedHeight = parseIntValue(totals[IdxInvLastClaimedHeight])
514510 let newTotalsRemainingAmount = (totalsRemainingAmount - investorRemainingAmount)
515511 let newTotalArray = [toString(totalsTotalAmount), toString(newTotalsRemainingAmount), toString(totalsClaimedPriceAssetAmount), toString(totalsClaimedIdoAssetAmount), toString(totalsLastClaimedHeight)]
516512 let newTotalRemainingAmount = (valueOrElse(getInteger(keyTotalRemainingAmount()), 0) + investorRemainingAmount)
517513 [StringEntry(keyInvestorRemainingAmount(userAddress58), toString(investorRemainingAmount)), StringEntry(keyTotalRemainingAmount(), toString(newTotalRemainingAmount)), TotalsEntry(keyInvestor(userAddress58), newInvestArray, totalsDiff, newClaimPeriodHeight, 0), TotalsEntry(keyTotals(), newTotalArray, totalsDiff, newClaimPeriodHeight, 0)]
518514 }
519515 else [TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight, 0), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight, 0)]
520516 let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim)
521517 ([ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)] ++ lastClaimEntries)
522518 }
523519 else throw("Strict value is not equal to itself.")
524520 }
525521 $Tuple2(([IntegerEntry(keyCurrentPeriod(), updatedCurrentPeriod), IntegerEntry(keyPeriodStartHeight(updatedCurrentPeriod), periodStart), IntegerEntry(keyPeriodEndHeight(updatedCurrentPeriod), periodEnd), IntegerEntry(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod), updatedPeriodTotalAvailableToClaim), IntegerEntry(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58), updatedPeriodUserAvailableToClaim), ClaimOperationHistoryEntry(userAddress58, periodMinAvailableToClaim, claimedIdoAssetAmountFromDiff, i.transactionId)] ++ entries), unit)
526522 }
527523 else throw("Strict value is not equal to itself.")
528524 }
529525 else {
530526 let priceAssetBalanceIdoDecimals = fraction(priceAssetBalance, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN))
531527 $Tuple2([ScriptTransfer(i.caller, (outAmount + priceAssetBalanceIdoDecimals), outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), 0), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight, priceAssetBalance), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight, priceAssetBalance), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, (claimedIdoAssetAmountFromDiff + priceAssetBalanceIdoDecimals), i.transactionId)], unit)
532528 }
533529 entries
534530 }
535531 }
536532
537533
538534
539535 @Callable(i)
540536 func cleanRemaingAmount (userAddress58) = {
541537 let priceAssetId58 = readConfigArray()[IdxCfgPriceAssetId]
542538 let evaluateResult = split(asString(invoke(this, "claimREADONLY", [priceAssetId58, userAddress58], nil)), SEP)
543539 if ((evaluateResult == evaluateResult))
544540 then {
545541 let availablePriceAmountToClaim = parseIntValue(evaluateResult[2])
546542 let checkUnclaimedAssets = if ((availablePriceAmountToClaim == 0))
547543 then true
548544 else throwErr("user have unclaimed assets")
549545 if ((checkUnclaimedAssets == checkUnclaimedAssets))
550546 then {
551547 let investor = split(value(getString(keyInvestor(userAddress58))), SEP)
552548 let investorTotalAmount = parseIntValue(investor[IdxInvTotalAmount])
553549 let investorRemainingAmount = parseIntValue(investor[IdxInvRemainingAmount])
554550 let investorPriceAssetBalance = parseIntValue(investor[IdxInvClaimedPriceAssetAmount])
555551 let investorIdoAssetBalance = parseIntValue(investor[IdxInvClaimedIdoAssetAmount])
556552 let investorLastClaimedHeight = parseIntValue(investor[IdxInvLastClaimedHeight])
557553 let investorRemainingAmountCheck = if ((investorRemainingAmount != 0))
558554 then true
559555 else throwErr("investorRemainingAmount already zero")
560556 if ((investorRemainingAmountCheck == investorRemainingAmountCheck))
561557 then {
562558 let newInvestor = makeString(["%d%d%d%d%d", toString(investorTotalAmount), "0", toString(investorPriceAssetBalance), toString(investorIdoAssetBalance), toString(investorLastClaimedHeight)], SEP)
563559 let totals = split(value(getString(keyTotals())), SEP)
564560 let totalsTotalAmount = parseIntValue(totals[IdxInvTotalAmount])
565561 let totalsRemainingAmount = parseIntValue(totals[IdxInvRemainingAmount])
566562 let totalsClaimedPriceAssetAmount = parseIntValue(totals[IdxInvClaimedPriceAssetAmount])
567563 let totalsClaimedIdoAssetAmount = parseIntValue(totals[IdxInvClaimedIdoAssetAmount])
568564 let totalsLastClaimedHeight = parseIntValue(totals[IdxInvLastClaimedHeight])
569565 let newTotals = makeString(["%d%d%d%d%d", toString(totalsTotalAmount), toString((totalsRemainingAmount - investorRemainingAmount)), toString(totalsClaimedPriceAssetAmount), toString(totalsClaimedIdoAssetAmount), toString(totalsLastClaimedHeight)], SEP)
570566 let newTotalRemainingAmount = (valueOrElse(getInteger(keyTotalRemainingAmount()), 0) + investorRemainingAmount)
571567 [StringEntry(keyInvestorRemainingAmount(userAddress58), toString(investorRemainingAmount)), StringEntry(keyTotalRemainingAmount(), toString(newTotalRemainingAmount)), StringEntry(keyInvestor(userAddress58), newInvestor), StringEntry(keyTotals(), newTotals)]
572568 }
573569 else throw("Strict value is not equal to itself.")
574570 }
575571 else throw("Strict value is not equal to itself.")
576572 }
577573 else throw("Strict value is not equal to itself.")
578574 }
579575
580576
581577
582578 @Callable(i)
583579 func claimREADONLY (claimedAssetId58,userAddress58) = {
584580 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
585581 let totalsDiff = claimResultTuple._1
586582 let outAmount = claimResultTuple._2
587583 let outAssetId = claimResultTuple._3
588584 let origInvestArray = claimResultTuple._4
589585 let newClaimPeriodHeight = claimResultTuple._5
590586 let availableToClaimArray = claimResultTuple._6
591587 let availablePriceAmountToClaim = availableToClaimArray[0]
592588 let availableIdoAmountToClaim = availableToClaimArray[1]
593589 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
594590 }
595591
596592
597593
598594 @Callable(i)
599595 func claimV2READONLY (claimedAssetId58,userAddress58) = {
600596 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
601597 let totalsDiff = claimResultTuple._1
602598 let outAmount = claimResultTuple._2
603599 let outAssetId = claimResultTuple._3
604600 let origInvestArray = claimResultTuple._4
605601 let newClaimPeriodHeight = claimResultTuple._5
606602 let availableToClaimArray = claimResultTuple._6
607603 let availablePriceAmountToClaim = availableToClaimArray[0]
608604 let availableIdoAmountToClaim = availableToClaimArray[1]
609605 let cfgArray = readConfigArray()
610606 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
611607 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
612608 let priceAssetBalanceIdoDecimals = (priceAssetBalance * 100)
613609 let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalanceIdoDecimals)
614- let $t03374934161 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
615- let periodMinAvailableToClaim = $t03374934161._1
616- let periodTotalAvailableToClaim = $t03374934161._2
617- let periodUserAvailableToClaim = $t03374934161._3
618- let totalUserAvailableToClaim = $t03374934161._4
619- let usdtPriceAssetAllowableRatio = $t03374934161._5
620- let currentUsdtPriceAssetRatio = $t03374934161._6
621- let endPeriodBlocksLeft = $t03374934161._7
622- let updatedCurrentPeriod = $t03374934161._8
623- let periodStart = $t03374934161._9
624- let periodEnd = $t03374934161._10
610+ let $t03376934181 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
611+ let periodMinAvailableToClaim = $t03376934181._1
612+ let periodTotalAvailableToClaim = $t03376934181._2
613+ let periodUserAvailableToClaim = $t03376934181._3
614+ let totalUserAvailableToClaim = $t03376934181._4
615+ let usdtPriceAssetAllowableRatio = $t03376934181._5
616+ let currentUsdtPriceAssetRatio = $t03376934181._6
617+ let endPeriodBlocksLeft = $t03376934181._7
618+ let updatedCurrentPeriod = $t03376934181._8
619+ let periodStart = $t03376934181._9
620+ let periodEnd = $t03376934181._10
625621 let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0)
626622 let userTotalPriceAssetClaimed = (parseIntValue(readInvestorArrayOrFail(userAddress58)[IdxInvClaimedPriceAssetAmount]) - priceAssetBalance)
627623 let resultString = if ((height > currentPeriodEndHeight))
628624 then {
629625 let periodLenght = value(getInteger(keyPeriodLength()))
630626 let userPeriodAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
631627 let totalPeriodAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
632628 makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(userPeriodAllowance), toString(totalPeriodAllowance), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(periodLenght), toString(userTotalPriceAssetClaimed)], SEP)
633629 }
634630 else makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft), toString(userTotalPriceAssetClaimed)], SEP)
635631 $Tuple2(nil, resultString)
636- }
637-
638-
639-
640-@Callable(i)
641-func setManager (pendingManagerPublicKey) = {
642- let checkCaller = mustManager(i)
643- if ((checkCaller == checkCaller))
644- then {
645- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
646- if ((checkManagerPublicKey == checkManagerPublicKey))
647- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
648- else throw("Strict value is not equal to itself.")
649- }
650- else throw("Strict value is not equal to itself.")
651- }
652-
653-
654-
655-@Callable(i)
656-func confirmManager () = {
657- let pm = pendingManagerPublicKeyOrUnit()
658- let hasPM = if (isDefined(pm))
659- then true
660- else throw("No pending manager")
661- if ((hasPM == hasPM))
662- then {
663- let checkPM = if ((i.callerPublicKey == value(pm)))
664- then true
665- else throw("You are not pending manager")
666- if ((checkPM == checkPM))
667- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
668- else throw("Strict value is not equal to itself.")
669- }
670- else throw("Strict value is not equal to itself.")
671632 }
672633
673634
674635 @Verifier(tx)
675636 func verify () = {
676637 let targetPublicKey = match managerPublicKeyOrUnit() {
677638 case pk: ByteVector =>
678639 pk
679640 case _: Unit =>
680641 tx.senderPublicKey
681642 case _ =>
682643 throw("Match error")
683644 }
684645 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
685646 }
686647

github/deemru/w8io/169f3d6 
442.22 ms