tx · 6Pyeu4rysR1tH9b9iEZTFzGJWscV4Mjwftqita2iRytZ

3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv:  -0.02500000 Waves

2022.11.02 20:43 [2299803] smart account 3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv > SELF 0.00000000 Waves

{ "type": 13, "id": "6Pyeu4rysR1tH9b9iEZTFzGJWscV4Mjwftqita2iRytZ", "fee": 2500000, "feeAssetId": null, "timestamp": 1667411078679, "version": 1, "sender": "3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv", "senderPublicKey": "39YkRD2qWXTcdNBr4CbDnm8g8SAB2FKVaDeGYahcFHHx", "proofs": [ "37t5dJoK1KqK3yympARiPrSkmRNtxowrLcQGY35LcNxRy6NFP8fmdnwePZBN2cBLps1J37NiK4tWhzrHwgZtGtoc" ], "script": "base64:AAIFAAAAAAAADfYIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJZHhDZmdQcmljZUFzc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gAAAApCeXRlVmVjdG9yBAAAAAJjZAUAAAACYnEFAAAAAmNkAwkAAAEAAAACBQAAAAJicQIAAAAEVW5pdAgFAAAAAmNNAAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACY00AAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJjTQAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAmNPLu11eA==", "chainId": 84, "height": 2299803, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: iVezS8psV1r55PtN5XbtJNZWqJh4tKZYsgsSNKrtzdN Next: BYFf18BfN9tf27BNhAQPMaJkRPWBMDL1uR8NNCwKgtco Diff:
OldNewDifferences
99 let BUFSCALE = toBigInt(1000000000000000000)
1010
1111 let scale8 = 100000000
12+
13+func throwErr (msg) = throw(makeString(["ido.ride:", msg], " "))
14+
1215
1316 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
1417 let bPriceAssetMULT = toBigInt(priceAssetMULT)
233236 let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
234237 let periodLength = value(getInteger(keyPeriodLength()))
235238 let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
236- let $t01187412792 = if ((currentPeriod > 0))
239+ let $t01194712865 = if ((currentPeriod > 0))
237240 then {
238241 let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight((currentPeriod - 1))))
239242 let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight((currentPeriod - 1))))
240- let $t01214212524 = if ((height > lastPeriodEndHeight))
243+ let $t01221512597 = if ((height > lastPeriodEndHeight))
241244 then {
242245 let updatedCurrentPeriod = (currentPeriod + 1)
243246 let periodStart = (lastPeriodEndHeight + 1)
245248 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
246249 }
247250 else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
248- let updatedCurrentPeriod = $t01214212524._1
249- let periodStart = $t01214212524._2
250- let periodEnd = $t01214212524._3
251+ let updatedCurrentPeriod = $t01221512597._1
252+ let periodStart = $t01221512597._2
253+ let periodEnd = $t01221512597._3
251254 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
252255 }
253256 else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
254- let updatedCurrentPeriod = $t01187412792._1
255- let periodStart = $t01187412792._2
256- let periodEnd = $t01187412792._3
257+ let updatedCurrentPeriod = $t01194712865._1
258+ let periodStart = $t01194712865._2
259+ let periodEnd = $t01194712865._3
257260 let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
258261 let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
259262 let periodMinAvailableToClaim = min([outAmount, periodTotalAvailableToClaim, periodUserAvailableToClaim])
260263 let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
261264 let putOneTknV2PriceAssetAmount = scale8
262- let $t01343513688 = {
265+ let $t01350813761 = {
263266 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
264267 if ($isInstanceOf(@, "(Int, Int, Int)"))
265268 then @
266269 else throw("Couldn't cast Any to (Int, Int, Int)")
267270 }
268- if (($t01343513688 == $t01343513688))
271+ if (($t01350813761 == $t01350813761))
269272 then {
270- let bonus = $t01343513688._3
271- let feeAmount = $t01343513688._2
272- let lpAmount = $t01343513688._1
273+ let bonus = $t01350813761._3
274+ let feeAmount = $t01350813761._2
275+ let lpAmount = $t01350813761._1
273276 let usdtAssetId = value(getString(keyUsdtAssetId()))
274- let $t01375013968 = {
277+ let $t01382314041 = {
275278 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
276279 if ($isInstanceOf(@, "(Int, Int)"))
277280 then @
278281 else throw("Couldn't cast Any to (Int, Int)")
279282 }
280- if (($t01375013968 == $t01375013968))
283+ if (($t01382314041 == $t01382314041))
281284 then {
282- let getOneTknV2FeeAmount = $t01375013968._2
283- let usdtAmount = $t01375013968._1
285+ let getOneTknV2FeeAmount = $t01382314041._2
286+ let usdtAmount = $t01382314041._1
284287 let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8)
285288 let endPeriodBlocksLeft = (periodEnd - height)
286289 $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd)
422425 let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
423426 let entries = if ((claimedAssetId58 == priceAssetId58))
424427 then {
425- let $t01962420068 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
426- let periodMinAvailableToClaim = $t01962420068._1
427- let periodTotalAvailableToClaim = $t01962420068._2
428- let periodUserAvailableToClaim = $t01962420068._3
429- let totalUserAvailableToClaim = $t01962420068._4
430- let usdtPriceAssetAllowableRatio = $t01962420068._5
431- let currentUsdtPriceAssetRatio = $t01962420068._6
432- let endPeriodBlocksLeft = $t01962420068._7
433- let updatedCurrentPeriod = $t01962420068._8
434- let periodStart = $t01962420068._9
435- let periodEnd = $t01962420068._10
436- let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
437- let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim)
438- let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim)
439- let entries = if ((priceAssetBalance >= periodMinAvailableToClaim))
440- then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))]
441- else {
442- let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim)
428+ let $t01969720141 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
429+ let periodMinAvailableToClaim = $t01969720141._1
430+ let periodTotalAvailableToClaim = $t01969720141._2
431+ let periodUserAvailableToClaim = $t01969720141._3
432+ let totalUserAvailableToClaim = $t01969720141._4
433+ let usdtPriceAssetAllowableRatio = $t01969720141._5
434+ let currentUsdtPriceAssetRatio = $t01969720141._6
435+ let endPeriodBlocksLeft = $t01969720141._7
436+ let updatedCurrentPeriod = $t01969720141._8
437+ let periodStart = $t01969720141._9
438+ let periodEnd = $t01969720141._10
439+ let checks = [if ((periodMinAvailableToClaim > 0))
440+ then true
441+ else throwErr("nothing to claim"), if ((periodUserAvailableToClaim > 0))
442+ then true
443+ else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0))
444+ then true
445+ else throwErr("unavailable to claim because total period allowance reached"), if ((usdtPriceAssetAllowableRatio > currentUsdtPriceAssetRatio))
446+ then true
447+ else throwErr("unavailable to claim because usdn price lower than usdtPriceAssetAllowableRatio")]
448+ if ((checks == checks))
449+ then {
450+ let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
451+ let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim)
452+ let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim)
453+ let entries = if ((priceAssetBalance >= periodMinAvailableToClaim))
454+ then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))]
455+ else {
456+ let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim)
443457 [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)]
458+ }
459+ $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)
444460 }
445- $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, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)] ++ entries), unit)
461+ else throw("Strict value is not equal to itself.")
446462 }
447463 else $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
448464 entries
480496 let availableIdoAmountToClaim = availableToClaimArray[1]
481497 let cfgArray = readConfigArray()
482498 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
483- let $t02534725759 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
484- let periodMinAvailableToClaim = $t02534725759._1
485- let periodTotalAvailableToClaim = $t02534725759._2
486- let periodUserAvailableToClaim = $t02534725759._3
487- let totalUserAvailableToClaim = $t02534725759._4
488- let usdtPriceAssetAllowableRatio = $t02534725759._5
489- let currentUsdtPriceAssetRatio = $t02534725759._6
490- let endPeriodBlocksLeft = $t02534725759._7
491- let updatedCurrentPeriod = $t02534725759._8
492- let periodStart = $t02534725759._9
493- let periodEnd = $t02534725759._10
499+ let $t02591426326 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
500+ let periodMinAvailableToClaim = $t02591426326._1
501+ let periodTotalAvailableToClaim = $t02591426326._2
502+ let periodUserAvailableToClaim = $t02591426326._3
503+ let totalUserAvailableToClaim = $t02591426326._4
504+ let usdtPriceAssetAllowableRatio = $t02591426326._5
505+ let currentUsdtPriceAssetRatio = $t02591426326._6
506+ let endPeriodBlocksLeft = $t02591426326._7
507+ let updatedCurrentPeriod = $t02591426326._8
508+ let periodStart = $t02591426326._9
509+ let periodEnd = $t02591426326._10
494510 let resultString = makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaim), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft)], SEP)
495511 $Tuple2(nil, resultString)
496512 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
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
12+
13+func throwErr (msg) = throw(makeString(["ido.ride:", msg], " "))
14+
1215
1316 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
1417 let bPriceAssetMULT = toBigInt(priceAssetMULT)
1518 let bIdoAssetMULT = toBigInt(idoAssetMULT)
1619 let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceAssetMULT)
1720 let bAmountAssetBUF = fraction(bPriceAssetBUF, toBigInt(priceMULT), toBigInt(price))
1821 toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE))
1922 }
2023
2124
2225 let IdxCfgIdoStart = 1
2326
2427 let IdxCfgIdoDuration = 2
2528
2629 let IdxCfgClaimStart = 3
2730
2831 let IdxCfgClaimDuration = 4
2932
3033 let IdxCfgPrice = 5
3134
3235 let IdxCfgPriceMult = 6
3336
3437 let IdxCfgIdoAssetId = 7
3538
3639 let IdxCfgIdoAssetMult = 8
3740
3841 let IdxCfgPriceAssetId = 9
3942
4043 let IdxCfgPriceAssetMult = 10
4144
4245 let IdxCfgMinInvestAmount = 11
4346
4447 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)
4548
4649
4750 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))
4851
4952
5053 let IdxInvTotalAmount = 1
5154
5255 let IdxInvRemainingAmount = 2
5356
5457 let IdxInvClaimedPriceAssetAmount = 3
5558
5659 let IdxInvClaimedIdoAssetAmount = 4
5760
5861 let IdxInvLastClaimedHeight = 5
5962
6063 func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP)
6164
6265
6366 func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight))
6467
6568
6669 func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP)
6770
6871
6972 func keyConfig () = "%s__config"
7073
7174
7275 func keyInvestor (userAddress) = ("%s__" + userAddress)
7376
7477
7578 func keyTotals () = "%s__totals"
7679
7780
7881 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
7982
8083
8184 func keyUSDNClaimDisabled () = "%s__usdnClaimDisabled"
8285
8386
8487 func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight"
8588
8689
8790 func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
8891
8992
9093 func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
9194
9295
9396 func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP)
9497
9598
9699 func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP)
97100
98101
99102 func keyUsdtPriceAssetAllowableRatio () = makeString(["%s", "usdtPriceAssetAllowableRatio"], SEP)
100103
101104
102105 func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP)
103106
104107
105108 func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP)
106109
107110
108111 func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP)
109112
110113
111114 func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP)
112115
113116
114117 func keyUsdtPriceAssetStablePool () = makeString(["%s", "usdtPriceAssetStablePool"], SEP)
115118
116119
117120 func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP)
118121
119122
120123 func keyPriceAssetBalance (address) = makeString(["%s%s", "priceAssetBalance", address], SEP)
121124
122125
123126 func keyManagerPublicKey () = "%s__managerPublicKey"
124127
125128
126129 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
127130
128131
129132 func readConfigArray () = split(getStringOrFail(keyConfig()), SEP)
130133
131134
132135 func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP)
133136
134137
135138 func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals())
136139
137140
138141 func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress))
139142
140143
141144 func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP)
142145
143146
144147 let IdxDiffTotalIncrement = 0
145148
146149 let IdxDiffRemainingPriceAmountIncrement = 1
147150
148151 let IdxDiffClaimedPriceAmountIncrement = 2
149152
150153 let IdxDiffClaimedIdoAssetAmountIncrement = 3
151154
152155 func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight) = {
153156 let totalAmount = parseIntValue(origArray[IdxInvTotalAmount])
154157 let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount])
155158 let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount])
156159 let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount])
157160 let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight])
158161 let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement])
159162 let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement])
160163 let newClaimedPriceAssetAmount = (claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement])
161164 let newClaimedIdoAssetAmount = (claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement])
162165 if ((0 > newRemainingAmount))
163166 then throw("invalid math")
164167 else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
165168 }
166169
167170
168171 func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
169172
170173
171174 func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
172175
173176
174177 func internalClaim (claimedAssetId58,userAddress,txId) = {
175178 let cfgArray = readConfigArray()
176179 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
177180 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
178181 let claimEnd = (claimStart + claimDuration)
179182 let price = parseIntValue(cfgArray[IdxCfgPrice])
180183 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
181184 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
182185 let idoAssetId = fromBase58String(idoAssetId58)
183186 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
184187 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
185188 let priceAssetId = fromBase58String(priceAssetId58)
186189 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
187190 let userAddress58 = toString(userAddress)
188191 let origInvestArray = readInvestorArrayOrFail(userAddress58)
189192 let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount])
190193 let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight])
191194 let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP))
192195 then claimStart
193196 else investLastClaimedHeightTMP
194197 let newClaimPeriodHeight = if ((height > claimEnd))
195198 then claimEnd
196199 else if ((claimStart > height))
197200 then claimStart
198201 else height
199202 let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight)
200203 let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration)
201204 let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult)
202205 let isUSDN = (claimedAssetId58 == priceAssetId58)
203206 let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false)
204207 let isUSDNClaimEnded = match getInteger(keyUSDNClaimEndHeight()) {
205208 case end: Int =>
206209 (height > end)
207210 case _: Unit =>
208211 false
209212 case _ =>
210213 throw("Match error")
211214 }
212215 let checks = [if (!(if (isUSDN)
213216 then isUSDNClaimDisabled
214217 else false))
215218 then true
216219 else throw("USDN claim is disabled"), if (!(if (isUSDN)
217220 then isUSDNClaimEnded
218221 else false))
219222 then true
220223 else throw("USDN claim is ended")]
221224 if ((checks == checks))
222225 then if ((claimedAssetId58 == priceAssetId58))
223226 then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
224227 else if ((claimedAssetId58 == idoAssetId58))
225228 then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
226229 else throw(("unsupported assetId: " + claimedAssetId58))
227230 else throw("Strict value is not equal to itself.")
228231 }
229232
230233
231234 func internalClaimV2 (priceAssetId58,userAddress58,outAmount,totalUserAvailableToClaim) = {
232235 let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
233236 let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
234237 let periodLength = value(getInteger(keyPeriodLength()))
235238 let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
236- let $t01187412792 = if ((currentPeriod > 0))
239+ let $t01194712865 = if ((currentPeriod > 0))
237240 then {
238241 let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight((currentPeriod - 1))))
239242 let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight((currentPeriod - 1))))
240- let $t01214212524 = if ((height > lastPeriodEndHeight))
243+ let $t01221512597 = if ((height > lastPeriodEndHeight))
241244 then {
242245 let updatedCurrentPeriod = (currentPeriod + 1)
243246 let periodStart = (lastPeriodEndHeight + 1)
244247 let periodEnd = ((periodStart + periodLength) - 1)
245248 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
246249 }
247250 else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
248- let updatedCurrentPeriod = $t01214212524._1
249- let periodStart = $t01214212524._2
250- let periodEnd = $t01214212524._3
251+ let updatedCurrentPeriod = $t01221512597._1
252+ let periodStart = $t01221512597._2
253+ let periodEnd = $t01221512597._3
251254 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
252255 }
253256 else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
254- let updatedCurrentPeriod = $t01187412792._1
255- let periodStart = $t01187412792._2
256- let periodEnd = $t01187412792._3
257+ let updatedCurrentPeriod = $t01194712865._1
258+ let periodStart = $t01194712865._2
259+ let periodEnd = $t01194712865._3
257260 let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
258261 let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
259262 let periodMinAvailableToClaim = min([outAmount, periodTotalAvailableToClaim, periodUserAvailableToClaim])
260263 let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
261264 let putOneTknV2PriceAssetAmount = scale8
262- let $t01343513688 = {
265+ let $t01350813761 = {
263266 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
264267 if ($isInstanceOf(@, "(Int, Int, Int)"))
265268 then @
266269 else throw("Couldn't cast Any to (Int, Int, Int)")
267270 }
268- if (($t01343513688 == $t01343513688))
271+ if (($t01350813761 == $t01350813761))
269272 then {
270- let bonus = $t01343513688._3
271- let feeAmount = $t01343513688._2
272- let lpAmount = $t01343513688._1
273+ let bonus = $t01350813761._3
274+ let feeAmount = $t01350813761._2
275+ let lpAmount = $t01350813761._1
273276 let usdtAssetId = value(getString(keyUsdtAssetId()))
274- let $t01375013968 = {
277+ let $t01382314041 = {
275278 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
276279 if ($isInstanceOf(@, "(Int, Int)"))
277280 then @
278281 else throw("Couldn't cast Any to (Int, Int)")
279282 }
280- if (($t01375013968 == $t01375013968))
283+ if (($t01382314041 == $t01382314041))
281284 then {
282- let getOneTknV2FeeAmount = $t01375013968._2
283- let usdtAmount = $t01375013968._1
285+ let getOneTknV2FeeAmount = $t01382314041._2
286+ let usdtAmount = $t01382314041._1
284287 let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8)
285288 let endPeriodBlocksLeft = (periodEnd - height)
286289 $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd)
287290 }
288291 else throw("Strict value is not equal to itself.")
289292 }
290293 else throw("Strict value is not equal to itself.")
291294 }
292295
293296
294297 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
295298 case s: String =>
296299 fromBase58String(s)
297300 case _: Unit =>
298301 unit
299302 case _ =>
300303 throw("Match error")
301304 }
302305
303306
304307 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
305308 case s: String =>
306309 fromBase58String(s)
307310 case _: Unit =>
308311 unit
309312 case _ =>
310313 throw("Match error")
311314 }
312315
313316
314317 func mustManager (i) = {
315318 let pd = throw("Permission denied")
316319 match managerPublicKeyOrUnit() {
317320 case pk: ByteVector =>
318321 if ((i.callerPublicKey == pk))
319322 then true
320323 else pd
321324 case _: Unit =>
322325 if ((i.caller == this))
323326 then true
324327 else pd
325328 case _ =>
326329 throw("Match error")
327330 }
328331 }
329332
330333
331334 @Callable(i)
332335 func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = {
333336 let priceMult = ((100 * 1000) * 1000)
334337 let idoEnd = (idoStart + idoDuration)
335338 if (isDefined(getString(keyConfig())))
336339 then throw("already initialized")
337340 else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller)))
338341 then throw("not authorized")
339342 else if ((size(i.payments) != 1))
340343 then throw("exactly 1 payment must be attached")
341344 else if ((idoEnd >= claimStart))
342345 then throw("claimStart must be greater than idoEnd")
343346 else {
344347 let pmt = value(i.payments[0])
345348 let idoAssetId = value(pmt.assetId)
346349 let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info")
347350 let idoAssetId58 = toBase58String(idoAssetId)
348351 let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN)
349352 let priceAssetId = fromBase58String(priceAssetId58)
350353 let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info")
351354 let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN)
352355 let origTotalsArray = readTotalsArrayOrDefault()
353356 let totalsDiff = [0, 0, 0, 0]
354357 [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart)]
355358 }
356359 }
357360
358361
359362
360363 @Callable(i)
361364 func invest () = {
362365 let cfgArray = readConfigArray()
363366 let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart])
364367 let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration])
365368 let idoEnd = (idoStart + idoDuration)
366369 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
367370 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
368371 let price = parseIntValue(cfgArray[IdxCfgPrice])
369372 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
370373 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
371374 let idoAssetId = fromBase58String(idoAssetId58)
372375 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
373376 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
374377 let priceAssetId = fromBase58String(priceAssetId58)
375378 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
376379 let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount])
377380 let userAddress = toString(i.caller)
378381 if ((idoStart > height))
379382 then throw("ido has not been started yet")
380383 else if ((height > idoEnd))
381384 then throw("ido has been already ended")
382385 else if ((size(i.payments) != 1))
383386 then throw("exactly 1 payment is expected")
384387 else {
385388 let pmt = value(i.payments[0])
386389 let pmtAssetId = value(pmt.assetId)
387390 let pmtAmount = pmt.amount
388391 if ((pmtAssetId != priceAssetId))
389392 then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected"))
390393 else {
391394 let origInvestorArray = readInvestorArrayOrDefault(userAddress)
392395 let origTotalsArray = readTotalsArrayOrDefault()
393396 let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount)
394397 let requiredIdoAssetAmount = (newPriceTotalAmount * 100)
395398 if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId)))
396399 then throw("IDO asset has been - sold consider to use smaller payment")
397400 else {
398401 let totalsDiff = [pmtAmount, pmtAmount, 0, 0]
399402 [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)]
400403 }
401404 }
402405 }
403406 }
404407
405408
406409
407410 @Callable(i)
408411 func claim (claimedAssetId58,userAddress58) = {
409412 let callerAddress58 = toString(i.caller)
410413 if ((userAddress58 != callerAddress58))
411414 then throw("not authorized")
412415 else {
413416 let cfgArray = readConfigArray()
414417 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
415418 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
416419 let totalsDiff = claimResultTuple._1
417420 let outAmount = claimResultTuple._2
418421 let outAssetId = claimResultTuple._3
419422 let origInvestArray = claimResultTuple._4
420423 let newClaimPeriodHeight = claimResultTuple._5
421424 let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
422425 let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
423426 let entries = if ((claimedAssetId58 == priceAssetId58))
424427 then {
425- let $t01962420068 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
426- let periodMinAvailableToClaim = $t01962420068._1
427- let periodTotalAvailableToClaim = $t01962420068._2
428- let periodUserAvailableToClaim = $t01962420068._3
429- let totalUserAvailableToClaim = $t01962420068._4
430- let usdtPriceAssetAllowableRatio = $t01962420068._5
431- let currentUsdtPriceAssetRatio = $t01962420068._6
432- let endPeriodBlocksLeft = $t01962420068._7
433- let updatedCurrentPeriod = $t01962420068._8
434- let periodStart = $t01962420068._9
435- let periodEnd = $t01962420068._10
436- let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
437- let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim)
438- let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim)
439- let entries = if ((priceAssetBalance >= periodMinAvailableToClaim))
440- then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))]
441- else {
442- let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim)
428+ let $t01969720141 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
429+ let periodMinAvailableToClaim = $t01969720141._1
430+ let periodTotalAvailableToClaim = $t01969720141._2
431+ let periodUserAvailableToClaim = $t01969720141._3
432+ let totalUserAvailableToClaim = $t01969720141._4
433+ let usdtPriceAssetAllowableRatio = $t01969720141._5
434+ let currentUsdtPriceAssetRatio = $t01969720141._6
435+ let endPeriodBlocksLeft = $t01969720141._7
436+ let updatedCurrentPeriod = $t01969720141._8
437+ let periodStart = $t01969720141._9
438+ let periodEnd = $t01969720141._10
439+ let checks = [if ((periodMinAvailableToClaim > 0))
440+ then true
441+ else throwErr("nothing to claim"), if ((periodUserAvailableToClaim > 0))
442+ then true
443+ else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0))
444+ then true
445+ else throwErr("unavailable to claim because total period allowance reached"), if ((usdtPriceAssetAllowableRatio > currentUsdtPriceAssetRatio))
446+ then true
447+ else throwErr("unavailable to claim because usdn price lower than usdtPriceAssetAllowableRatio")]
448+ if ((checks == checks))
449+ then {
450+ let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
451+ let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim)
452+ let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim)
453+ let entries = if ((priceAssetBalance >= periodMinAvailableToClaim))
454+ then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))]
455+ else {
456+ let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim)
443457 [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)]
458+ }
459+ $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)
444460 }
445- $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, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)] ++ entries), unit)
461+ else throw("Strict value is not equal to itself.")
446462 }
447463 else $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
448464 entries
449465 }
450466 }
451467
452468
453469
454470 @Callable(i)
455471 func claimREADONLY (claimedAssetId58,userAddress58) = {
456472 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
457473 let totalsDiff = claimResultTuple._1
458474 let outAmount = claimResultTuple._2
459475 let outAssetId = claimResultTuple._3
460476 let origInvestArray = claimResultTuple._4
461477 let newClaimPeriodHeight = claimResultTuple._5
462478 let availableToClaimArray = claimResultTuple._6
463479 let availablePriceAmountToClaim = availableToClaimArray[0]
464480 let availableIdoAmountToClaim = availableToClaimArray[1]
465481 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
466482 }
467483
468484
469485
470486 @Callable(i)
471487 func claimV2READONLY (claimedAssetId58,userAddress58) = {
472488 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
473489 let totalsDiff = claimResultTuple._1
474490 let outAmount = claimResultTuple._2
475491 let outAssetId = claimResultTuple._3
476492 let origInvestArray = claimResultTuple._4
477493 let newClaimPeriodHeight = claimResultTuple._5
478494 let availableToClaimArray = claimResultTuple._6
479495 let availablePriceAmountToClaim = availableToClaimArray[0]
480496 let availableIdoAmountToClaim = availableToClaimArray[1]
481497 let cfgArray = readConfigArray()
482498 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
483- let $t02534725759 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
484- let periodMinAvailableToClaim = $t02534725759._1
485- let periodTotalAvailableToClaim = $t02534725759._2
486- let periodUserAvailableToClaim = $t02534725759._3
487- let totalUserAvailableToClaim = $t02534725759._4
488- let usdtPriceAssetAllowableRatio = $t02534725759._5
489- let currentUsdtPriceAssetRatio = $t02534725759._6
490- let endPeriodBlocksLeft = $t02534725759._7
491- let updatedCurrentPeriod = $t02534725759._8
492- let periodStart = $t02534725759._9
493- let periodEnd = $t02534725759._10
499+ let $t02591426326 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
500+ let periodMinAvailableToClaim = $t02591426326._1
501+ let periodTotalAvailableToClaim = $t02591426326._2
502+ let periodUserAvailableToClaim = $t02591426326._3
503+ let totalUserAvailableToClaim = $t02591426326._4
504+ let usdtPriceAssetAllowableRatio = $t02591426326._5
505+ let currentUsdtPriceAssetRatio = $t02591426326._6
506+ let endPeriodBlocksLeft = $t02591426326._7
507+ let updatedCurrentPeriod = $t02591426326._8
508+ let periodStart = $t02591426326._9
509+ let periodEnd = $t02591426326._10
494510 let resultString = makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaim), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft)], SEP)
495511 $Tuple2(nil, resultString)
496512 }
497513
498514
499515
500516 @Callable(i)
501517 func setManager (pendingManagerPublicKey) = {
502518 let checkCaller = mustManager(i)
503519 if ((checkCaller == checkCaller))
504520 then {
505521 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
506522 if ((checkManagerPublicKey == checkManagerPublicKey))
507523 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
508524 else throw("Strict value is not equal to itself.")
509525 }
510526 else throw("Strict value is not equal to itself.")
511527 }
512528
513529
514530
515531 @Callable(i)
516532 func confirmManager () = {
517533 let pm = pendingManagerPublicKeyOrUnit()
518534 let hasPM = if (isDefined(pm))
519535 then true
520536 else throw("No pending manager")
521537 if ((hasPM == hasPM))
522538 then {
523539 let checkPM = if ((i.callerPublicKey == value(pm)))
524540 then true
525541 else throw("You are not pending manager")
526542 if ((checkPM == checkPM))
527543 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
528544 else throw("Strict value is not equal to itself.")
529545 }
530546 else throw("Strict value is not equal to itself.")
531547 }
532548
533549
534550 @Verifier(tx)
535551 func verify () = {
536552 let targetPublicKey = match managerPublicKeyOrUnit() {
537553 case pk: ByteVector =>
538554 pk
539555 case _: Unit =>
540556 tx.senderPublicKey
541557 case _ =>
542558 throw("Match error")
543559 }
544560 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
545561 }
546562

github/deemru/w8io/026f985 
71.82 ms