tx · 52PxxDhS39AfWmJC3nB4ZjYx541kTmwi7bEfBwrxN2wg

3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv:  -0.02500000 Waves

2022.11.02 21:05 [2299823] smart account 3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv > SELF 0.00000000 Waves

{ "type": 13, "id": "52PxxDhS39AfWmJC3nB4ZjYx541kTmwi7bEfBwrxN2wg", "fee": 2500000, "feeAssetId": null, "timestamp": 1667412322964, "version": 1, "sender": "3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv", "senderPublicKey": "39YkRD2qWXTcdNBr4CbDnm8g8SAB2FKVaDeGYahcFHHx", "proofs": [ "4yBLuoEfiMXTeLN8q5EMnJrzgV4A9QTnkJ6QDF5o73d4MUJ1NPZvNXZpzBGsYNP1958dr7YSdRQWLiBDH7NVzPWU" ], "script": "base64:AAIFAAAAAAAADkcIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJZHhDZmdQ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uAAAAAmNjAQAAAA5jb25maXJtTWFuYWdlcgAAAAAEAAAAAmNOCQEAAAACY2EAAAAABAAAAAJjTwMJAQAAAAlpc0RlZmluZWQAAAABBQAAAAJjTgYJAAACAAAAAQIAAAASTm8gcGVuZGluZyBtYW5hZ2VyAwkAAAAAAAACBQAAAAJjTwUAAAACY08EAAAAAmNQAwkAAAAAAAACCAUAAAACY2MAAAAPY2FsbGVyUHVibGljS2V5CQEAAAAFdmFsdWUAAAABBQAAAAJjTgYJAAACAAAAAQIAAAAbWW91IGFyZSBub3QgcGVuZGluZyBtYW5hZ2VyAwkAAAAAAAACBQAAAAJjUAUAAAACY1AJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAAAmFCAAAAAAkAAlgAAAABCQEAAAAFdmFsdWUAAAABBQAAAAJjTgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAACYUMAAAAABQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACY1EBAAAAAmNSAAAAAAQAAAACY1MEAAAAAmJxCQEAAAACYlkAAAAAAwkAAAEAAAACBQAAAAJicQIAAAAKQnl0ZVZlY3RvcgQAAAACY2UFAAAAAmJxBQAAAAJjZQMJAAABAAAAAgUAAAACYnECAAAABFVuaXQIBQAAAAJjUQAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAmNRAAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACY1EAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAJjU8iIAaY=", "chainId": 84, "height": 2299823, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BYFf18BfN9tf27BNhAQPMaJkRPWBMDL1uR8NNCwKgtco Next: Cy3hdSkUx6YmxG5dz5XdSYPLpyEd6bHuZtm9A481kpf7 Diff:
OldNewDifferences
259259 let periodEnd = $t01194712865._3
260260 let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
261261 let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
262- let periodMinAvailableToClaim = min([outAmount, periodTotalAvailableToClaim, periodUserAvailableToClaim])
262+ let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
263+ let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim])
263264 let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
264265 let putOneTknV2PriceAssetAmount = scale8
265- let $t01350813761 = {
266+ let $t01362013873 = {
266267 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
267268 if ($isInstanceOf(@, "(Int, Int, Int)"))
268269 then @
269270 else throw("Couldn't cast Any to (Int, Int, Int)")
270271 }
271- if (($t01350813761 == $t01350813761))
272+ if (($t01362013873 == $t01362013873))
272273 then {
273- let bonus = $t01350813761._3
274- let feeAmount = $t01350813761._2
275- let lpAmount = $t01350813761._1
274+ let bonus = $t01362013873._3
275+ let feeAmount = $t01362013873._2
276+ let lpAmount = $t01362013873._1
276277 let usdtAssetId = value(getString(keyUsdtAssetId()))
277- let $t01382314041 = {
278+ let $t01393514153 = {
278279 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
279280 if ($isInstanceOf(@, "(Int, Int)"))
280281 then @
281282 else throw("Couldn't cast Any to (Int, Int)")
282283 }
283- if (($t01382314041 == $t01382314041))
284+ if (($t01393514153 == $t01393514153))
284285 then {
285- let getOneTknV2FeeAmount = $t01382314041._2
286- let usdtAmount = $t01382314041._1
286+ let getOneTknV2FeeAmount = $t01393514153._2
287+ let usdtAmount = $t01393514153._1
287288 let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8)
288289 let endPeriodBlocksLeft = (periodEnd - height)
289290 $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd)
425426 let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
426427 let entries = if ((claimedAssetId58 == priceAssetId58))
427428 then {
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
429+ let $t01980920253 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
430+ let periodMinAvailableToClaim = $t01980920253._1
431+ let periodTotalAvailableToClaim = $t01980920253._2
432+ let periodUserAvailableToClaim = $t01980920253._3
433+ let totalUserAvailableToClaim = $t01980920253._4
434+ let usdtPriceAssetAllowableRatio = $t01980920253._5
435+ let currentUsdtPriceAssetRatio = $t01980920253._6
436+ let endPeriodBlocksLeft = $t01980920253._7
437+ let updatedCurrentPeriod = $t01980920253._8
438+ let periodStart = $t01980920253._9
439+ let periodEnd = $t01980920253._10
439440 let checks = [if ((periodMinAvailableToClaim > 0))
440441 then true
441442 else throwErr("nothing to claim"), if ((periodUserAvailableToClaim > 0))
496497 let availableIdoAmountToClaim = availableToClaimArray[1]
497498 let cfgArray = readConfigArray()
498499 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
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
500+ let $t02602626438 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
501+ let periodMinAvailableToClaim = $t02602626438._1
502+ let periodTotalAvailableToClaim = $t02602626438._2
503+ let periodUserAvailableToClaim = $t02602626438._3
504+ let totalUserAvailableToClaim = $t02602626438._4
505+ let usdtPriceAssetAllowableRatio = $t02602626438._5
506+ let currentUsdtPriceAssetRatio = $t02602626438._6
507+ let endPeriodBlocksLeft = $t02602626438._7
508+ let updatedCurrentPeriod = $t02602626438._8
509+ let periodStart = $t02602626438._9
510+ let periodEnd = $t02602626438._10
510511 let currentPeriodEndHeight = value(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)))
511512 let resultString = if ((height > currentPeriodEndHeight))
512513 then {
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
1212
1313 func throwErr (msg) = throw(makeString(["ido.ride:", msg], " "))
1414
1515
1616 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
1717 let bPriceAssetMULT = toBigInt(priceAssetMULT)
1818 let bIdoAssetMULT = toBigInt(idoAssetMULT)
1919 let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceAssetMULT)
2020 let bAmountAssetBUF = fraction(bPriceAssetBUF, toBigInt(priceMULT), toBigInt(price))
2121 toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE))
2222 }
2323
2424
2525 let IdxCfgIdoStart = 1
2626
2727 let IdxCfgIdoDuration = 2
2828
2929 let IdxCfgClaimStart = 3
3030
3131 let IdxCfgClaimDuration = 4
3232
3333 let IdxCfgPrice = 5
3434
3535 let IdxCfgPriceMult = 6
3636
3737 let IdxCfgIdoAssetId = 7
3838
3939 let IdxCfgIdoAssetMult = 8
4040
4141 let IdxCfgPriceAssetId = 9
4242
4343 let IdxCfgPriceAssetMult = 10
4444
4545 let IdxCfgMinInvestAmount = 11
4646
4747 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)
4848
4949
5050 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))
5151
5252
5353 let IdxInvTotalAmount = 1
5454
5555 let IdxInvRemainingAmount = 2
5656
5757 let IdxInvClaimedPriceAssetAmount = 3
5858
5959 let IdxInvClaimedIdoAssetAmount = 4
6060
6161 let IdxInvLastClaimedHeight = 5
6262
6363 func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP)
6464
6565
6666 func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight))
6767
6868
6969 func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP)
7070
7171
7272 func keyConfig () = "%s__config"
7373
7474
7575 func keyInvestor (userAddress) = ("%s__" + userAddress)
7676
7777
7878 func keyTotals () = "%s__totals"
7979
8080
8181 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
8282
8383
8484 func keyUSDNClaimDisabled () = "%s__usdnClaimDisabled"
8585
8686
8787 func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight"
8888
8989
9090 func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
9191
9292
9393 func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
9494
9595
9696 func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP)
9797
9898
9999 func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP)
100100
101101
102102 func keyUsdtPriceAssetAllowableRatio () = makeString(["%s", "usdtPriceAssetAllowableRatio"], SEP)
103103
104104
105105 func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP)
106106
107107
108108 func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP)
109109
110110
111111 func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP)
112112
113113
114114 func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP)
115115
116116
117117 func keyUsdtPriceAssetStablePool () = makeString(["%s", "usdtPriceAssetStablePool"], SEP)
118118
119119
120120 func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP)
121121
122122
123123 func keyPriceAssetBalance (address) = makeString(["%s%s", "priceAssetBalance", address], SEP)
124124
125125
126126 func keyManagerPublicKey () = "%s__managerPublicKey"
127127
128128
129129 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
130130
131131
132132 func readConfigArray () = split(getStringOrFail(keyConfig()), SEP)
133133
134134
135135 func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP)
136136
137137
138138 func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals())
139139
140140
141141 func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress))
142142
143143
144144 func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP)
145145
146146
147147 let IdxDiffTotalIncrement = 0
148148
149149 let IdxDiffRemainingPriceAmountIncrement = 1
150150
151151 let IdxDiffClaimedPriceAmountIncrement = 2
152152
153153 let IdxDiffClaimedIdoAssetAmountIncrement = 3
154154
155155 func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight) = {
156156 let totalAmount = parseIntValue(origArray[IdxInvTotalAmount])
157157 let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount])
158158 let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount])
159159 let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount])
160160 let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight])
161161 let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement])
162162 let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement])
163163 let newClaimedPriceAssetAmount = (claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement])
164164 let newClaimedIdoAssetAmount = (claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement])
165165 if ((0 > newRemainingAmount))
166166 then throw("invalid math")
167167 else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
168168 }
169169
170170
171171 func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
172172
173173
174174 func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
175175
176176
177177 func internalClaim (claimedAssetId58,userAddress,txId) = {
178178 let cfgArray = readConfigArray()
179179 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
180180 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
181181 let claimEnd = (claimStart + claimDuration)
182182 let price = parseIntValue(cfgArray[IdxCfgPrice])
183183 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
184184 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
185185 let idoAssetId = fromBase58String(idoAssetId58)
186186 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
187187 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
188188 let priceAssetId = fromBase58String(priceAssetId58)
189189 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
190190 let userAddress58 = toString(userAddress)
191191 let origInvestArray = readInvestorArrayOrFail(userAddress58)
192192 let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount])
193193 let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight])
194194 let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP))
195195 then claimStart
196196 else investLastClaimedHeightTMP
197197 let newClaimPeriodHeight = if ((height > claimEnd))
198198 then claimEnd
199199 else if ((claimStart > height))
200200 then claimStart
201201 else height
202202 let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight)
203203 let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration)
204204 let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult)
205205 let isUSDN = (claimedAssetId58 == priceAssetId58)
206206 let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false)
207207 let isUSDNClaimEnded = match getInteger(keyUSDNClaimEndHeight()) {
208208 case end: Int =>
209209 (height > end)
210210 case _: Unit =>
211211 false
212212 case _ =>
213213 throw("Match error")
214214 }
215215 let checks = [if (!(if (isUSDN)
216216 then isUSDNClaimDisabled
217217 else false))
218218 then true
219219 else throw("USDN claim is disabled"), if (!(if (isUSDN)
220220 then isUSDNClaimEnded
221221 else false))
222222 then true
223223 else throw("USDN claim is ended")]
224224 if ((checks == checks))
225225 then if ((claimedAssetId58 == priceAssetId58))
226226 then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
227227 else if ((claimedAssetId58 == idoAssetId58))
228228 then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
229229 else throw(("unsupported assetId: " + claimedAssetId58))
230230 else throw("Strict value is not equal to itself.")
231231 }
232232
233233
234234 func internalClaimV2 (priceAssetId58,userAddress58,outAmount,totalUserAvailableToClaim) = {
235235 let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
236236 let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
237237 let periodLength = value(getInteger(keyPeriodLength()))
238238 let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
239239 let $t01194712865 = if ((currentPeriod > 0))
240240 then {
241241 let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight((currentPeriod - 1))))
242242 let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight((currentPeriod - 1))))
243243 let $t01221512597 = if ((height > lastPeriodEndHeight))
244244 then {
245245 let updatedCurrentPeriod = (currentPeriod + 1)
246246 let periodStart = (lastPeriodEndHeight + 1)
247247 let periodEnd = ((periodStart + periodLength) - 1)
248248 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
249249 }
250250 else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
251251 let updatedCurrentPeriod = $t01221512597._1
252252 let periodStart = $t01221512597._2
253253 let periodEnd = $t01221512597._3
254254 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
255255 }
256256 else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
257257 let updatedCurrentPeriod = $t01194712865._1
258258 let periodStart = $t01194712865._2
259259 let periodEnd = $t01194712865._3
260260 let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
261261 let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
262- let periodMinAvailableToClaim = min([outAmount, periodTotalAvailableToClaim, periodUserAvailableToClaim])
262+ let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
263+ let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim])
263264 let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
264265 let putOneTknV2PriceAssetAmount = scale8
265- let $t01350813761 = {
266+ let $t01362013873 = {
266267 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
267268 if ($isInstanceOf(@, "(Int, Int, Int)"))
268269 then @
269270 else throw("Couldn't cast Any to (Int, Int, Int)")
270271 }
271- if (($t01350813761 == $t01350813761))
272+ if (($t01362013873 == $t01362013873))
272273 then {
273- let bonus = $t01350813761._3
274- let feeAmount = $t01350813761._2
275- let lpAmount = $t01350813761._1
274+ let bonus = $t01362013873._3
275+ let feeAmount = $t01362013873._2
276+ let lpAmount = $t01362013873._1
276277 let usdtAssetId = value(getString(keyUsdtAssetId()))
277- let $t01382314041 = {
278+ let $t01393514153 = {
278279 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
279280 if ($isInstanceOf(@, "(Int, Int)"))
280281 then @
281282 else throw("Couldn't cast Any to (Int, Int)")
282283 }
283- if (($t01382314041 == $t01382314041))
284+ if (($t01393514153 == $t01393514153))
284285 then {
285- let getOneTknV2FeeAmount = $t01382314041._2
286- let usdtAmount = $t01382314041._1
286+ let getOneTknV2FeeAmount = $t01393514153._2
287+ let usdtAmount = $t01393514153._1
287288 let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8)
288289 let endPeriodBlocksLeft = (periodEnd - height)
289290 $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd)
290291 }
291292 else throw("Strict value is not equal to itself.")
292293 }
293294 else throw("Strict value is not equal to itself.")
294295 }
295296
296297
297298 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
298299 case s: String =>
299300 fromBase58String(s)
300301 case _: Unit =>
301302 unit
302303 case _ =>
303304 throw("Match error")
304305 }
305306
306307
307308 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
308309 case s: String =>
309310 fromBase58String(s)
310311 case _: Unit =>
311312 unit
312313 case _ =>
313314 throw("Match error")
314315 }
315316
316317
317318 func mustManager (i) = {
318319 let pd = throw("Permission denied")
319320 match managerPublicKeyOrUnit() {
320321 case pk: ByteVector =>
321322 if ((i.callerPublicKey == pk))
322323 then true
323324 else pd
324325 case _: Unit =>
325326 if ((i.caller == this))
326327 then true
327328 else pd
328329 case _ =>
329330 throw("Match error")
330331 }
331332 }
332333
333334
334335 @Callable(i)
335336 func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = {
336337 let priceMult = ((100 * 1000) * 1000)
337338 let idoEnd = (idoStart + idoDuration)
338339 if (isDefined(getString(keyConfig())))
339340 then throw("already initialized")
340341 else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller)))
341342 then throw("not authorized")
342343 else if ((size(i.payments) != 1))
343344 then throw("exactly 1 payment must be attached")
344345 else if ((idoEnd >= claimStart))
345346 then throw("claimStart must be greater than idoEnd")
346347 else {
347348 let pmt = value(i.payments[0])
348349 let idoAssetId = value(pmt.assetId)
349350 let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info")
350351 let idoAssetId58 = toBase58String(idoAssetId)
351352 let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN)
352353 let priceAssetId = fromBase58String(priceAssetId58)
353354 let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info")
354355 let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN)
355356 let origTotalsArray = readTotalsArrayOrDefault()
356357 let totalsDiff = [0, 0, 0, 0]
357358 [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart)]
358359 }
359360 }
360361
361362
362363
363364 @Callable(i)
364365 func invest () = {
365366 let cfgArray = readConfigArray()
366367 let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart])
367368 let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration])
368369 let idoEnd = (idoStart + idoDuration)
369370 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
370371 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
371372 let price = parseIntValue(cfgArray[IdxCfgPrice])
372373 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
373374 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
374375 let idoAssetId = fromBase58String(idoAssetId58)
375376 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
376377 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
377378 let priceAssetId = fromBase58String(priceAssetId58)
378379 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
379380 let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount])
380381 let userAddress = toString(i.caller)
381382 if ((idoStart > height))
382383 then throw("ido has not been started yet")
383384 else if ((height > idoEnd))
384385 then throw("ido has been already ended")
385386 else if ((size(i.payments) != 1))
386387 then throw("exactly 1 payment is expected")
387388 else {
388389 let pmt = value(i.payments[0])
389390 let pmtAssetId = value(pmt.assetId)
390391 let pmtAmount = pmt.amount
391392 if ((pmtAssetId != priceAssetId))
392393 then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected"))
393394 else {
394395 let origInvestorArray = readInvestorArrayOrDefault(userAddress)
395396 let origTotalsArray = readTotalsArrayOrDefault()
396397 let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount)
397398 let requiredIdoAssetAmount = (newPriceTotalAmount * 100)
398399 if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId)))
399400 then throw("IDO asset has been - sold consider to use smaller payment")
400401 else {
401402 let totalsDiff = [pmtAmount, pmtAmount, 0, 0]
402403 [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)]
403404 }
404405 }
405406 }
406407 }
407408
408409
409410
410411 @Callable(i)
411412 func claim (claimedAssetId58,userAddress58) = {
412413 let callerAddress58 = toString(i.caller)
413414 if ((userAddress58 != callerAddress58))
414415 then throw("not authorized")
415416 else {
416417 let cfgArray = readConfigArray()
417418 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
418419 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
419420 let totalsDiff = claimResultTuple._1
420421 let outAmount = claimResultTuple._2
421422 let outAssetId = claimResultTuple._3
422423 let origInvestArray = claimResultTuple._4
423424 let newClaimPeriodHeight = claimResultTuple._5
424425 let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
425426 let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
426427 let entries = if ((claimedAssetId58 == priceAssetId58))
427428 then {
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
429+ let $t01980920253 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
430+ let periodMinAvailableToClaim = $t01980920253._1
431+ let periodTotalAvailableToClaim = $t01980920253._2
432+ let periodUserAvailableToClaim = $t01980920253._3
433+ let totalUserAvailableToClaim = $t01980920253._4
434+ let usdtPriceAssetAllowableRatio = $t01980920253._5
435+ let currentUsdtPriceAssetRatio = $t01980920253._6
436+ let endPeriodBlocksLeft = $t01980920253._7
437+ let updatedCurrentPeriod = $t01980920253._8
438+ let periodStart = $t01980920253._9
439+ let periodEnd = $t01980920253._10
439440 let checks = [if ((periodMinAvailableToClaim > 0))
440441 then true
441442 else throwErr("nothing to claim"), if ((periodUserAvailableToClaim > 0))
442443 then true
443444 else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0))
444445 then true
445446 else throwErr("unavailable to claim because total period allowance reached"), if ((usdtPriceAssetAllowableRatio > currentUsdtPriceAssetRatio))
446447 then true
447448 else throwErr("unavailable to claim because usdn price lower than usdtPriceAssetAllowableRatio")]
448449 if ((checks == checks))
449450 then {
450451 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
451452 let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim)
452453 let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim)
453454 let entries = if ((priceAssetBalance >= periodMinAvailableToClaim))
454455 then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))]
455456 else {
456457 let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim)
457458 [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)]
458459 }
459460 $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)
460461 }
461462 else throw("Strict value is not equal to itself.")
462463 }
463464 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)
464465 entries
465466 }
466467 }
467468
468469
469470
470471 @Callable(i)
471472 func claimREADONLY (claimedAssetId58,userAddress58) = {
472473 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
473474 let totalsDiff = claimResultTuple._1
474475 let outAmount = claimResultTuple._2
475476 let outAssetId = claimResultTuple._3
476477 let origInvestArray = claimResultTuple._4
477478 let newClaimPeriodHeight = claimResultTuple._5
478479 let availableToClaimArray = claimResultTuple._6
479480 let availablePriceAmountToClaim = availableToClaimArray[0]
480481 let availableIdoAmountToClaim = availableToClaimArray[1]
481482 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
482483 }
483484
484485
485486
486487 @Callable(i)
487488 func claimV2READONLY (claimedAssetId58,userAddress58) = {
488489 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
489490 let totalsDiff = claimResultTuple._1
490491 let outAmount = claimResultTuple._2
491492 let outAssetId = claimResultTuple._3
492493 let origInvestArray = claimResultTuple._4
493494 let newClaimPeriodHeight = claimResultTuple._5
494495 let availableToClaimArray = claimResultTuple._6
495496 let availablePriceAmountToClaim = availableToClaimArray[0]
496497 let availableIdoAmountToClaim = availableToClaimArray[1]
497498 let cfgArray = readConfigArray()
498499 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
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
500+ let $t02602626438 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
501+ let periodMinAvailableToClaim = $t02602626438._1
502+ let periodTotalAvailableToClaim = $t02602626438._2
503+ let periodUserAvailableToClaim = $t02602626438._3
504+ let totalUserAvailableToClaim = $t02602626438._4
505+ let usdtPriceAssetAllowableRatio = $t02602626438._5
506+ let currentUsdtPriceAssetRatio = $t02602626438._6
507+ let endPeriodBlocksLeft = $t02602626438._7
508+ let updatedCurrentPeriod = $t02602626438._8
509+ let periodStart = $t02602626438._9
510+ let periodEnd = $t02602626438._10
510511 let currentPeriodEndHeight = value(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)))
511512 let resultString = if ((height > currentPeriodEndHeight))
512513 then {
513514 let periodLenght = value(getInteger(keyPeriodLength()))
514515 let userPeriodAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
515516 let totalPeriodAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
516517 makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaim), toString(userPeriodAllowance), toString(totalPeriodAllowance), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(periodLenght)], SEP)
517518 }
518519 else makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaim), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft)], SEP)
519520 $Tuple2(nil, resultString)
520521 }
521522
522523
523524
524525 @Callable(i)
525526 func setManager (pendingManagerPublicKey) = {
526527 let checkCaller = mustManager(i)
527528 if ((checkCaller == checkCaller))
528529 then {
529530 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
530531 if ((checkManagerPublicKey == checkManagerPublicKey))
531532 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
532533 else throw("Strict value is not equal to itself.")
533534 }
534535 else throw("Strict value is not equal to itself.")
535536 }
536537
537538
538539
539540 @Callable(i)
540541 func confirmManager () = {
541542 let pm = pendingManagerPublicKeyOrUnit()
542543 let hasPM = if (isDefined(pm))
543544 then true
544545 else throw("No pending manager")
545546 if ((hasPM == hasPM))
546547 then {
547548 let checkPM = if ((i.callerPublicKey == value(pm)))
548549 then true
549550 else throw("You are not pending manager")
550551 if ((checkPM == checkPM))
551552 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
552553 else throw("Strict value is not equal to itself.")
553554 }
554555 else throw("Strict value is not equal to itself.")
555556 }
556557
557558
558559 @Verifier(tx)
559560 func verify () = {
560561 let targetPublicKey = match managerPublicKeyOrUnit() {
561562 case pk: ByteVector =>
562563 pk
563564 case _: Unit =>
564565 tx.senderPublicKey
565566 case _ =>
566567 throw("Match error")
567568 }
568569 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
569570 }
570571

github/deemru/w8io/026f985 
75.94 ms