tx · 323EnozLCPpZvFjr36yYGRNmqhJFwZPD8TsDfZ3ZZnsd

3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv:  -0.02400000 Waves

2022.11.02 16:24 [2299547] smart account 3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv > SELF 0.00000000 Waves

{ "type": 13, "id": "323EnozLCPpZvFjr36yYGRNmqhJFwZPD8TsDfZ3ZZnsd", "fee": 2400000, "feeAssetId": null, "timestamp": 1667395536630, "version": 1, "sender": "3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv", "senderPublicKey": "39YkRD2qWXTcdNBr4CbDnm8g8SAB2FKVaDeGYahcFHHx", "proofs": [ "fp6crBNUuagA4dXphMqLUEBkpD4BjrykRK9Du8rGBWs948kMRpwCRdM7GdEHVT7e5KR8ArKPgFzyhBEe5WQYjn1" ], "script": "base64:AAIFAAAAAAAADasIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJZHhDZmdQcmljZU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JTAQAAAA5jb25maXJtTWFuYWdlcgAAAAAEAAAAAmNCCQEAAAACYlEAAAAABAAAAAJjQwMJAQAAAAlpc0RlZmluZWQAAAABBQAAAAJjQgYJAAACAAAAAQIAAAASTm8gcGVuZGluZyBtYW5hZ2VyAwkAAAAAAAACBQAAAAJjQwUAAAACY0MEAAAAAmNEAwkAAAAAAAACCAUAAAACYlMAAAAPY2FsbGVyUHVibGljS2V5CQEAAAAFdmFsdWUAAAABBQAAAAJjQgYJAAACAAAAAQIAAAAbWW91IGFyZSBub3QgcGVuZGluZyBtYW5hZ2VyAwkAAAAAAAACBQAAAAJjRAUAAAACY0QJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAAAmF6AAAAAAkAAlgAAAABCQEAAAAFdmFsdWUAAAABBQAAAAJjQgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAACYUEAAAAABQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACY0UBAAAAAmNGAAAAAAQAAAACY0cEAAAAAmJvCQEAAAACYk8AAAAAAwkAAAEAAAACBQAAAAJibwIAAAAKQnl0ZVZlY3RvcgQAAAACYlUFAAAAAmJvBQAAAAJiVQMJAAABAAAAAgUAAAACYm8CAAAABFVuaXQIBQAAAAJjRQAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAmNFAAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACY0UAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAJjR81CuNU=", "chainId": 84, "height": 2299547, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3ZQ1FzYhuRtanVvCLvTZDi35rzHSoJHjvUjeH9Ruzexd Next: 2KFoyBoEN1QSqmexi7Z4j6PbkReDnfCcEBApjJYiFoHF Diff:
OldNewDifferences
77 let SEP = "__"
88
99 let BUFSCALE = toBigInt(1000000000000000000)
10+
11+let scale8 = 100000000
12+
13+func throwErr (msg) = throw(makeString(["ido.ride:", msg], " "))
14+
1015
1116 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
1217 let bPriceAssetMULT = toBigInt(priceAssetMULT)
8085
8186
8287 func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight"
88+
89+
90+func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
91+
92+
93+func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
94+
95+
96+func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP)
97+
98+
99+func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP)
100+
101+
102+func keyUsdtPriceAssetAllowableRatio () = makeString(["%s", "usdtPriceAssetAllowableRatio"], SEP)
103+
104+
105+func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP)
106+
107+
108+func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP)
109+
110+
111+func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP)
112+
113+
114+func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP)
115+
116+
117+func keyUsdtPriceAssetStablePool () = makeString(["%s", "usdtPriceAssetStablePool"], SEP)
118+
119+
120+func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP)
83121
84122
85123 func keyManagerPublicKey () = "%s__managerPublicKey"
159197 then claimStart
160198 else height
161199 let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight)
162- let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration)
163- let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult)
200+ let totalUserAvailableToClaim = fraction(investTotalAmount, claimingBlocks, claimDuration)
201+ let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(totalUserAvailableToClaim, priceAssetMult, price, priceMult, idoAssetMult)
164202 let isUSDN = (claimedAssetId58 == priceAssetId58)
165203 let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false)
166204 let isUSDNClaimEnded = match getInteger(keyUSDNClaimEndHeight()) {
175213 then isUSDNClaimDisabled
176214 else false))
177215 then true
178- else throw("USDN claim is disabled"), if (!(if (isUSDN)
216+ else throwErr("USDN claim is disabled"), if (!(if (isUSDN)
179217 then isUSDNClaimEnded
180218 else false))
181219 then true
182- else throw("USDN claim is ended")]
220+ else throwErr("USDN claim is ended")]
183221 if ((checks == checks))
184- then if ((claimedAssetId58 == priceAssetId58))
185- then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
186- else if ((claimedAssetId58 == idoAssetId58))
187- then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
188- else throw(("unsupported assetId: " + claimedAssetId58))
222+ then {
223+ let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
224+ let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
225+ let periodLength = value(getInteger(keyPeriodLength()))
226+ let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
227+ let $t01110111522 = if ((currentPeriod > 0))
228+ then $Tuple2(value(getInteger(keyPeriodStartHeight((currentPeriod - 1)))), valueOrElse(getInteger(keyPeriodEndHeight((currentPeriod - 1))), (height + periodLength)))
229+ else $Tuple2(valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), (height + periodLength)))
230+ let periodStart = $t01110111522._1
231+ let periodEnd = $t01110111522._2
232+ let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, currentPeriod)), totalPeriodPriceAssetAllowance)
233+ let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, currentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
234+ let availableClaimingPriceAssetAmount = min([totalUserAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim])
235+ let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
236+ let putOneTknV2PriceAssetAmount = scale8
237+ let $t01217612427 = {
238+ let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId], nil)
239+ if ($isInstanceOf(@, "(Int, Int, Int)"))
240+ then @
241+ else throw("Couldn't cast Any to (Int, Int, Int)")
242+ }
243+ if (($t01217612427 == $t01217612427))
244+ then {
245+ let bonus = $t01217612427._3
246+ let feeAmount = $t01217612427._2
247+ let lpAmount = $t01217612427._1
248+ let usdtAssetId = value(fromBase58String(value(getString(keyUsdtAssetId()))))
249+ let $t01251612734 = {
250+ let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
251+ if ($isInstanceOf(@, "(Int, Int)"))
252+ then @
253+ else throw("Couldn't cast Any to (Int, Int)")
254+ }
255+ if (($t01251612734 == $t01251612734))
256+ then {
257+ let getOneTknV2FeeAmount = $t01251612734._2
258+ let usdtAmount = $t01251612734._1
259+ let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8)
260+ let endPeriodBlocksLeft = (periodEnd - height)
261+ if ((claimedAssetId58 == priceAssetId58))
262+ then $Tuple6([0, -(availableClaimingPriceAssetAmount), availableClaimingPriceAssetAmount, 0], availableClaimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [currentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft])
263+ else if ((claimedAssetId58 == idoAssetId58))
264+ then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [currentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft])
265+ else throwErr(makeString(["unsupported assetId:", claimedAssetId58], " "))
266+ }
267+ else throw("Strict value is not equal to itself.")
268+ }
269+ else throw("Strict value is not equal to itself.")
270+ }
189271 else throw("Strict value is not equal to itself.")
190272 }
191273
233315 let idoEnd = (idoStart + idoDuration)
234316 if (isDefined(getString(keyConfig())))
235317 then throw("already initialized")
236- else if (("3N4nTJ5sSp5X5ChS2bBBmwNMn1eeRzT1FoP" != toString(i.caller)))
318+ else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller)))
237319 then throw("not authorized")
238320 else if ((size(i.payments) != 1))
239321 then throw("exactly 1 payment must be attached")
307389 func claim (claimedAssetId58,userAddress58) = {
308390 let callerAddress58 = toString(i.caller)
309391 if ((userAddress58 != callerAddress58))
310- then throw("not authorized")
392+ then throwErr("not authorized")
311393 else {
394+ let priceAssetId = readConfigArray()[IdxCfgPriceAssetId]
312395 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
313396 let totalsDiff = claimResultTuple._1
314397 let outAmount = claimResultTuple._2
315398 let outAssetId = claimResultTuple._3
316399 let origInvestArray = claimResultTuple._4
317400 let newClaimPeriodHeight = claimResultTuple._5
318- let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
319- let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
320- $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
401+ let availableToClaimArray = claimResultTuple._6
402+ let currentPeriod = availableToClaimArray[0]
403+ let periodStart = availableToClaimArray[1]
404+ let periodEnd = availableToClaimArray[2]
405+ let totalUserAvailableToClaim = availableToClaimArray[3]
406+ let periodAvailableIdoAmountToClaim = availableToClaimArray[4]
407+ let periodAvailableUserPriceAmountToClaim = availableToClaimArray[5]
408+ let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[6]
409+ let usdtPriceAssetAllowableRatio = availableToClaimArray[7]
410+ let currentPriceAssetRatio = availableToClaimArray[8]
411+ let endPriodBlocksLeft = availableToClaimArray[9]
412+ let checks = [if (if ((totalUserAvailableToClaim > 0))
413+ then true
414+ else (periodAvailableIdoAmountToClaim > 0))
415+ then true
416+ else throwErr("nothing to claim"), if ((periodAvailableUserPriceAmountToClaim > 0))
417+ then true
418+ else throwErr("unavailable to claim because user period allowance reached"), if ((periodAvailableTotalPriceAmountToClaim > 0))
419+ then true
420+ else throwErr("unavailable to claim because total period allowance reached")]
421+ if ((checks == checks))
422+ then {
423+ let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
424+ let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
425+ let updatedPeriodTotalAvailableToClaim = (periodAvailableTotalPriceAmountToClaim - claimedPriceAmountFromDiff)
426+ let updatedPeriodUserAvailableToClaim = (periodAvailableUserPriceAmountToClaim - claimedPriceAmountFromDiff)
427+ $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyCurrentPeriod(), currentPeriod), IntegerEntry(keyPeriodStartHeight(currentPeriod), periodStart), IntegerEntry(keyPeriodEndHeight(currentPeriod), periodEnd), IntegerEntry(keyPeriodTotalAvailableToClaim(priceAssetId, currentPeriod), updatedPeriodTotalAvailableToClaim), IntegerEntry(keyPeriodUserAvailableToClaim(priceAssetId, currentPeriod, userAddress58), updatedPeriodUserAvailableToClaim), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
428+ }
429+ else throw("Strict value is not equal to itself.")
321430 }
322431 }
323432
332441 let origInvestArray = claimResultTuple._4
333442 let newClaimPeriodHeight = claimResultTuple._5
334443 let availableToClaimArray = claimResultTuple._6
335- let availablePriceAmountToClaim = availableToClaimArray[0]
336- let availableIdoAmountToClaim = availableToClaimArray[1]
444+ let availableIdoAmountToClaim = availableToClaimArray[4]
445+ let availablePriceAmountToClaim = availableToClaimArray[5]
337446 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
447+ }
448+
449+
450+
451+@Callable(i)
452+func claimV2READONLY (claimedAssetId58,userAddress58) = {
453+ let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
454+ let totalsDiff = claimResultTuple._1
455+ let outAmount = claimResultTuple._2
456+ let outAssetId = claimResultTuple._3
457+ let origInvestArray = claimResultTuple._4
458+ let newClaimPeriodHeight = claimResultTuple._5
459+ let availableToClaimArray = claimResultTuple._6
460+ let currentPeriod = availableToClaimArray[0]
461+ let periodStart = availableToClaimArray[1]
462+ let periodEnd = availableToClaimArray[2]
463+ let totalUserAvailableToClaim = availableToClaimArray[3]
464+ let periodAvailableIdoAmountToClaim = availableToClaimArray[4]
465+ let periodAvailableUserPriceAmountToClaim = availableToClaimArray[5]
466+ let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[6]
467+ let usdtPriceAssetAllowableRatio = availableToClaimArray[7]
468+ let currentPriceAssetRatio = availableToClaimArray[8]
469+ let endPriodBlocksLeft = availableToClaimArray[9]
470+ let resultString = makeString(["%d%d%d%d%d%d%d", toString(totalUserAvailableToClaim), toString(periodAvailableIdoAmountToClaim), toString(periodAvailableUserPriceAmountToClaim), toString(periodAvailableTotalPriceAmountToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentPriceAssetRatio), toString(endPriodBlocksLeft)], SEP)
471+ $Tuple2(nil, resultString)
338472 }
339473
340474
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)
10+
11+let scale8 = 100000000
12+
13+func throwErr (msg) = throw(makeString(["ido.ride:", msg], " "))
14+
1015
1116 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
1217 let bPriceAssetMULT = toBigInt(priceAssetMULT)
1318 let bIdoAssetMULT = toBigInt(idoAssetMULT)
1419 let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceAssetMULT)
1520 let bAmountAssetBUF = fraction(bPriceAssetBUF, toBigInt(priceMULT), toBigInt(price))
1621 toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE))
1722 }
1823
1924
2025 let IdxCfgIdoStart = 1
2126
2227 let IdxCfgIdoDuration = 2
2328
2429 let IdxCfgClaimStart = 3
2530
2631 let IdxCfgClaimDuration = 4
2732
2833 let IdxCfgPrice = 5
2934
3035 let IdxCfgPriceMult = 6
3136
3237 let IdxCfgIdoAssetId = 7
3338
3439 let IdxCfgIdoAssetMult = 8
3540
3641 let IdxCfgPriceAssetId = 9
3742
3843 let IdxCfgPriceAssetMult = 10
3944
4045 let IdxCfgMinInvestAmount = 11
4146
4247 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)
4348
4449
4550 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))
4651
4752
4853 let IdxInvTotalAmount = 1
4954
5055 let IdxInvRemainingAmount = 2
5156
5257 let IdxInvClaimedPriceAssetAmount = 3
5358
5459 let IdxInvClaimedIdoAssetAmount = 4
5560
5661 let IdxInvLastClaimedHeight = 5
5762
5863 func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP)
5964
6065
6166 func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight))
6267
6368
6469 func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP)
6570
6671
6772 func keyConfig () = "%s__config"
6873
6974
7075 func keyInvestor (userAddress) = ("%s__" + userAddress)
7176
7277
7378 func keyTotals () = "%s__totals"
7479
7580
7681 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
7782
7883
7984 func keyUSDNClaimDisabled () = "%s__usdnClaimDisabled"
8085
8186
8287 func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight"
88+
89+
90+func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
91+
92+
93+func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
94+
95+
96+func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP)
97+
98+
99+func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP)
100+
101+
102+func keyUsdtPriceAssetAllowableRatio () = makeString(["%s", "usdtPriceAssetAllowableRatio"], SEP)
103+
104+
105+func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP)
106+
107+
108+func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP)
109+
110+
111+func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP)
112+
113+
114+func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP)
115+
116+
117+func keyUsdtPriceAssetStablePool () = makeString(["%s", "usdtPriceAssetStablePool"], SEP)
118+
119+
120+func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP)
83121
84122
85123 func keyManagerPublicKey () = "%s__managerPublicKey"
86124
87125
88126 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
89127
90128
91129 func readConfigArray () = split(getStringOrFail(keyConfig()), SEP)
92130
93131
94132 func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP)
95133
96134
97135 func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals())
98136
99137
100138 func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress))
101139
102140
103141 func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP)
104142
105143
106144 let IdxDiffTotalIncrement = 0
107145
108146 let IdxDiffRemainingPriceAmountIncrement = 1
109147
110148 let IdxDiffClaimedPriceAmountIncrement = 2
111149
112150 let IdxDiffClaimedIdoAssetAmountIncrement = 3
113151
114152 func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight) = {
115153 let totalAmount = parseIntValue(origArray[IdxInvTotalAmount])
116154 let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount])
117155 let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount])
118156 let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount])
119157 let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight])
120158 let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement])
121159 let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement])
122160 let newClaimedPriceAssetAmount = (claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement])
123161 let newClaimedIdoAssetAmount = (claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement])
124162 if ((0 > newRemainingAmount))
125163 then throw("invalid math")
126164 else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
127165 }
128166
129167
130168 func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
131169
132170
133171 func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
134172
135173
136174 func internalClaim (claimedAssetId58,userAddress,txId) = {
137175 let cfgArray = readConfigArray()
138176 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
139177 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
140178 let claimEnd = (claimStart + claimDuration)
141179 let price = parseIntValue(cfgArray[IdxCfgPrice])
142180 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
143181 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
144182 let idoAssetId = fromBase58String(idoAssetId58)
145183 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
146184 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
147185 let priceAssetId = fromBase58String(priceAssetId58)
148186 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
149187 let userAddress58 = toString(userAddress)
150188 let origInvestArray = readInvestorArrayOrFail(userAddress58)
151189 let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount])
152190 let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight])
153191 let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP))
154192 then claimStart
155193 else investLastClaimedHeightTMP
156194 let newClaimPeriodHeight = if ((height > claimEnd))
157195 then claimEnd
158196 else if ((claimStart > height))
159197 then claimStart
160198 else height
161199 let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight)
162- let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration)
163- let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult)
200+ let totalUserAvailableToClaim = fraction(investTotalAmount, claimingBlocks, claimDuration)
201+ let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(totalUserAvailableToClaim, priceAssetMult, price, priceMult, idoAssetMult)
164202 let isUSDN = (claimedAssetId58 == priceAssetId58)
165203 let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false)
166204 let isUSDNClaimEnded = match getInteger(keyUSDNClaimEndHeight()) {
167205 case end: Int =>
168206 (height > end)
169207 case _: Unit =>
170208 false
171209 case _ =>
172210 throw("Match error")
173211 }
174212 let checks = [if (!(if (isUSDN)
175213 then isUSDNClaimDisabled
176214 else false))
177215 then true
178- else throw("USDN claim is disabled"), if (!(if (isUSDN)
216+ else throwErr("USDN claim is disabled"), if (!(if (isUSDN)
179217 then isUSDNClaimEnded
180218 else false))
181219 then true
182- else throw("USDN claim is ended")]
220+ else throwErr("USDN claim is ended")]
183221 if ((checks == checks))
184- then if ((claimedAssetId58 == priceAssetId58))
185- then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
186- else if ((claimedAssetId58 == idoAssetId58))
187- then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
188- else throw(("unsupported assetId: " + claimedAssetId58))
222+ then {
223+ let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
224+ let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
225+ let periodLength = value(getInteger(keyPeriodLength()))
226+ let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
227+ let $t01110111522 = if ((currentPeriod > 0))
228+ then $Tuple2(value(getInteger(keyPeriodStartHeight((currentPeriod - 1)))), valueOrElse(getInteger(keyPeriodEndHeight((currentPeriod - 1))), (height + periodLength)))
229+ else $Tuple2(valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), (height + periodLength)))
230+ let periodStart = $t01110111522._1
231+ let periodEnd = $t01110111522._2
232+ let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, currentPeriod)), totalPeriodPriceAssetAllowance)
233+ let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, currentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
234+ let availableClaimingPriceAssetAmount = min([totalUserAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim])
235+ let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
236+ let putOneTknV2PriceAssetAmount = scale8
237+ let $t01217612427 = {
238+ let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId], nil)
239+ if ($isInstanceOf(@, "(Int, Int, Int)"))
240+ then @
241+ else throw("Couldn't cast Any to (Int, Int, Int)")
242+ }
243+ if (($t01217612427 == $t01217612427))
244+ then {
245+ let bonus = $t01217612427._3
246+ let feeAmount = $t01217612427._2
247+ let lpAmount = $t01217612427._1
248+ let usdtAssetId = value(fromBase58String(value(getString(keyUsdtAssetId()))))
249+ let $t01251612734 = {
250+ let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
251+ if ($isInstanceOf(@, "(Int, Int)"))
252+ then @
253+ else throw("Couldn't cast Any to (Int, Int)")
254+ }
255+ if (($t01251612734 == $t01251612734))
256+ then {
257+ let getOneTknV2FeeAmount = $t01251612734._2
258+ let usdtAmount = $t01251612734._1
259+ let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8)
260+ let endPeriodBlocksLeft = (periodEnd - height)
261+ if ((claimedAssetId58 == priceAssetId58))
262+ then $Tuple6([0, -(availableClaimingPriceAssetAmount), availableClaimingPriceAssetAmount, 0], availableClaimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [currentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft])
263+ else if ((claimedAssetId58 == idoAssetId58))
264+ then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [currentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft])
265+ else throwErr(makeString(["unsupported assetId:", claimedAssetId58], " "))
266+ }
267+ else throw("Strict value is not equal to itself.")
268+ }
269+ else throw("Strict value is not equal to itself.")
270+ }
189271 else throw("Strict value is not equal to itself.")
190272 }
191273
192274
193275 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
194276 case s: String =>
195277 fromBase58String(s)
196278 case _: Unit =>
197279 unit
198280 case _ =>
199281 throw("Match error")
200282 }
201283
202284
203285 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
204286 case s: String =>
205287 fromBase58String(s)
206288 case _: Unit =>
207289 unit
208290 case _ =>
209291 throw("Match error")
210292 }
211293
212294
213295 func mustManager (i) = {
214296 let pd = throw("Permission denied")
215297 match managerPublicKeyOrUnit() {
216298 case pk: ByteVector =>
217299 if ((i.callerPublicKey == pk))
218300 then true
219301 else pd
220302 case _: Unit =>
221303 if ((i.caller == this))
222304 then true
223305 else pd
224306 case _ =>
225307 throw("Match error")
226308 }
227309 }
228310
229311
230312 @Callable(i)
231313 func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = {
232314 let priceMult = ((100 * 1000) * 1000)
233315 let idoEnd = (idoStart + idoDuration)
234316 if (isDefined(getString(keyConfig())))
235317 then throw("already initialized")
236- else if (("3N4nTJ5sSp5X5ChS2bBBmwNMn1eeRzT1FoP" != toString(i.caller)))
318+ else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller)))
237319 then throw("not authorized")
238320 else if ((size(i.payments) != 1))
239321 then throw("exactly 1 payment must be attached")
240322 else if ((idoEnd >= claimStart))
241323 then throw("claimStart must be greater than idoEnd")
242324 else {
243325 let pmt = value(i.payments[0])
244326 let idoAssetId = value(pmt.assetId)
245327 let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info")
246328 let idoAssetId58 = toBase58String(idoAssetId)
247329 let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN)
248330 let priceAssetId = fromBase58String(priceAssetId58)
249331 let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info")
250332 let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN)
251333 let origTotalsArray = readTotalsArrayOrDefault()
252334 let totalsDiff = [0, 0, 0, 0]
253335 [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart)]
254336 }
255337 }
256338
257339
258340
259341 @Callable(i)
260342 func invest () = {
261343 let cfgArray = readConfigArray()
262344 let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart])
263345 let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration])
264346 let idoEnd = (idoStart + idoDuration)
265347 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
266348 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
267349 let price = parseIntValue(cfgArray[IdxCfgPrice])
268350 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
269351 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
270352 let idoAssetId = fromBase58String(idoAssetId58)
271353 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
272354 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
273355 let priceAssetId = fromBase58String(priceAssetId58)
274356 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
275357 let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount])
276358 let userAddress = toString(i.caller)
277359 if ((idoStart > height))
278360 then throw("ido has not been started yet")
279361 else if ((height > idoEnd))
280362 then throw("ido has been already ended")
281363 else if ((size(i.payments) != 1))
282364 then throw("exactly 1 payment is expected")
283365 else {
284366 let pmt = value(i.payments[0])
285367 let pmtAssetId = value(pmt.assetId)
286368 let pmtAmount = pmt.amount
287369 if ((pmtAssetId != priceAssetId))
288370 then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected"))
289371 else {
290372 let origInvestorArray = readInvestorArrayOrDefault(userAddress)
291373 let origTotalsArray = readTotalsArrayOrDefault()
292374 let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount)
293375 let requiredIdoAssetAmount = (newPriceTotalAmount * 100)
294376 if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId)))
295377 then throw("IDO asset has been - sold consider to use smaller payment")
296378 else {
297379 let totalsDiff = [pmtAmount, pmtAmount, 0, 0]
298380 [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)]
299381 }
300382 }
301383 }
302384 }
303385
304386
305387
306388 @Callable(i)
307389 func claim (claimedAssetId58,userAddress58) = {
308390 let callerAddress58 = toString(i.caller)
309391 if ((userAddress58 != callerAddress58))
310- then throw("not authorized")
392+ then throwErr("not authorized")
311393 else {
394+ let priceAssetId = readConfigArray()[IdxCfgPriceAssetId]
312395 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
313396 let totalsDiff = claimResultTuple._1
314397 let outAmount = claimResultTuple._2
315398 let outAssetId = claimResultTuple._3
316399 let origInvestArray = claimResultTuple._4
317400 let newClaimPeriodHeight = claimResultTuple._5
318- let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
319- let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
320- $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
401+ let availableToClaimArray = claimResultTuple._6
402+ let currentPeriod = availableToClaimArray[0]
403+ let periodStart = availableToClaimArray[1]
404+ let periodEnd = availableToClaimArray[2]
405+ let totalUserAvailableToClaim = availableToClaimArray[3]
406+ let periodAvailableIdoAmountToClaim = availableToClaimArray[4]
407+ let periodAvailableUserPriceAmountToClaim = availableToClaimArray[5]
408+ let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[6]
409+ let usdtPriceAssetAllowableRatio = availableToClaimArray[7]
410+ let currentPriceAssetRatio = availableToClaimArray[8]
411+ let endPriodBlocksLeft = availableToClaimArray[9]
412+ let checks = [if (if ((totalUserAvailableToClaim > 0))
413+ then true
414+ else (periodAvailableIdoAmountToClaim > 0))
415+ then true
416+ else throwErr("nothing to claim"), if ((periodAvailableUserPriceAmountToClaim > 0))
417+ then true
418+ else throwErr("unavailable to claim because user period allowance reached"), if ((periodAvailableTotalPriceAmountToClaim > 0))
419+ then true
420+ else throwErr("unavailable to claim because total period allowance reached")]
421+ if ((checks == checks))
422+ then {
423+ let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
424+ let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
425+ let updatedPeriodTotalAvailableToClaim = (periodAvailableTotalPriceAmountToClaim - claimedPriceAmountFromDiff)
426+ let updatedPeriodUserAvailableToClaim = (periodAvailableUserPriceAmountToClaim - claimedPriceAmountFromDiff)
427+ $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyCurrentPeriod(), currentPeriod), IntegerEntry(keyPeriodStartHeight(currentPeriod), periodStart), IntegerEntry(keyPeriodEndHeight(currentPeriod), periodEnd), IntegerEntry(keyPeriodTotalAvailableToClaim(priceAssetId, currentPeriod), updatedPeriodTotalAvailableToClaim), IntegerEntry(keyPeriodUserAvailableToClaim(priceAssetId, currentPeriod, userAddress58), updatedPeriodUserAvailableToClaim), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
428+ }
429+ else throw("Strict value is not equal to itself.")
321430 }
322431 }
323432
324433
325434
326435 @Callable(i)
327436 func claimREADONLY (claimedAssetId58,userAddress58) = {
328437 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
329438 let totalsDiff = claimResultTuple._1
330439 let outAmount = claimResultTuple._2
331440 let outAssetId = claimResultTuple._3
332441 let origInvestArray = claimResultTuple._4
333442 let newClaimPeriodHeight = claimResultTuple._5
334443 let availableToClaimArray = claimResultTuple._6
335- let availablePriceAmountToClaim = availableToClaimArray[0]
336- let availableIdoAmountToClaim = availableToClaimArray[1]
444+ let availableIdoAmountToClaim = availableToClaimArray[4]
445+ let availablePriceAmountToClaim = availableToClaimArray[5]
337446 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
447+ }
448+
449+
450+
451+@Callable(i)
452+func claimV2READONLY (claimedAssetId58,userAddress58) = {
453+ let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
454+ let totalsDiff = claimResultTuple._1
455+ let outAmount = claimResultTuple._2
456+ let outAssetId = claimResultTuple._3
457+ let origInvestArray = claimResultTuple._4
458+ let newClaimPeriodHeight = claimResultTuple._5
459+ let availableToClaimArray = claimResultTuple._6
460+ let currentPeriod = availableToClaimArray[0]
461+ let periodStart = availableToClaimArray[1]
462+ let periodEnd = availableToClaimArray[2]
463+ let totalUserAvailableToClaim = availableToClaimArray[3]
464+ let periodAvailableIdoAmountToClaim = availableToClaimArray[4]
465+ let periodAvailableUserPriceAmountToClaim = availableToClaimArray[5]
466+ let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[6]
467+ let usdtPriceAssetAllowableRatio = availableToClaimArray[7]
468+ let currentPriceAssetRatio = availableToClaimArray[8]
469+ let endPriodBlocksLeft = availableToClaimArray[9]
470+ let resultString = makeString(["%d%d%d%d%d%d%d", toString(totalUserAvailableToClaim), toString(periodAvailableIdoAmountToClaim), toString(periodAvailableUserPriceAmountToClaim), toString(periodAvailableTotalPriceAmountToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentPriceAssetRatio), toString(endPriodBlocksLeft)], SEP)
471+ $Tuple2(nil, resultString)
338472 }
339473
340474
341475
342476 @Callable(i)
343477 func setManager (pendingManagerPublicKey) = {
344478 let checkCaller = mustManager(i)
345479 if ((checkCaller == checkCaller))
346480 then {
347481 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
348482 if ((checkManagerPublicKey == checkManagerPublicKey))
349483 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
350484 else throw("Strict value is not equal to itself.")
351485 }
352486 else throw("Strict value is not equal to itself.")
353487 }
354488
355489
356490
357491 @Callable(i)
358492 func confirmManager () = {
359493 let pm = pendingManagerPublicKeyOrUnit()
360494 let hasPM = if (isDefined(pm))
361495 then true
362496 else throw("No pending manager")
363497 if ((hasPM == hasPM))
364498 then {
365499 let checkPM = if ((i.callerPublicKey == value(pm)))
366500 then true
367501 else throw("You are not pending manager")
368502 if ((checkPM == checkPM))
369503 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
370504 else throw("Strict value is not equal to itself.")
371505 }
372506 else throw("Strict value is not equal to itself.")
373507 }
374508
375509
376510 @Verifier(tx)
377511 func verify () = {
378512 let targetPublicKey = match managerPublicKeyOrUnit() {
379513 case pk: ByteVector =>
380514 pk
381515 case _: Unit =>
382516 tx.senderPublicKey
383517 case _ =>
384518 throw("Match error")
385519 }
386520 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
387521 }
388522

github/deemru/w8io/026f985 
52.07 ms