tx · 8voyBbNK7N3SXNsZfMDzyc3ZT5iv2anF3FjWUotpeGYU

3Mynj79w9PikhwUwMwFPk2vifkm8zkDt2Zt:  -0.01700000 Waves

2022.11.01 13:52 [2297955] smart account 3Mynj79w9PikhwUwMwFPk2vifkm8zkDt2Zt > SELF 0.00000000 Waves

{ "type": 13, "id": "8voyBbNK7N3SXNsZfMDzyc3ZT5iv2anF3FjWUotpeGYU", "fee": 1700000, "feeAssetId": null, "timestamp": 1667299960890, "version": 1, "sender": "3Mynj79w9PikhwUwMwFPk2vifkm8zkDt2Zt", "senderPublicKey": "5195SwZ4ifX6bBstZ6tN31kEQFVHaKpFYLc1GCa3Myrh", "proofs": [ "ExAoTQaLV4MiUiRFSC5QkzjBVXi3ErXK2p4TWSWG3mfPWo6mooJXgVUuVZZM5Cykasqom9w7EWwFmDbE167cWxC" ], "script": "base64:AAIFAAAAAAAACcYIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIdY29udmVydFByaWNlQXNzZXRJbnRvSWRvQXNzZXQiEHByaWNlQXNzZXRBbW91bnQiDnByaWNlQXNzZXRNVUxUIgVwcmljZSIJcHJpY2VNVUxUIgxpZG9Bc3NldE1VTFQiD2JQcmljZUFzc2V0TVVMVCINYklkb0Fzc2V0TVVMVCIOYlByaWNlQXNzZXRCVUYiD2JBbW91bnRBc3NldEJVRiIOSWR4Q2ZnSWRvU3RhcnQiEUlkeENmZ0lkb0R1cmF0aW9uIhBJZHhDZmdDbGFpbVN0YXJ0IhNJZHhDZmdDbGFpbUR1cmF0aW9uIgtJZHhDZmdQcmljZSIPSWR4Q2ZnUHJpY2VNdWx0IhBJZHhDZmdJZG9Bc3NldElkIhJJZHhDZmdJZG9Bc3NldE11bHQiEklkeENmZ1ByaWNlQXNzZXRJZCIUSWR4Q2ZnUHJpY2VBc3NldE11bHQiFUlkeENmZ01pbkludmVzdEFtb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AAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJiSgEAAAACYksAAAAABAAAAAJiTAQAAAACYVkJAQAAAAJiYgAAAAADCQAAAQAAAAIFAAAAAmFZAgAAAApCeXRlVmVjdG9yBAAAAAJiaAUAAAACYVkFAAAAAmJoAwkAAAEAAAACBQAAAAJhWQIAAAAEVW5pdAgFAAAAAmJKAAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACYkoAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJiSgAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAmJMmNTEJQ==", "chainId": 84, "height": 2297955, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Dx59e7chuVgNVHMbed79qyNQdbsx8fVBcuauCWPRKtFf Next: 7gHMLYbhBDXWsBx1p7fyP3bo9ytWYAeUxnFAT4MLdzym Diff:
OldNewDifferences
77 let SEP = "__"
88
99 let BUFSCALE = toBigInt(1000000000000000000)
10-
11-func throwErr (msg) = throw(makeString(["ido.ride:", msg], " "))
12-
1310
1411 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
1512 let bPriceAssetMULT = toBigInt(priceAssetMULT)
8380
8481
8582 func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight"
86-
87-
88-func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
89-
90-
91-func keyCurrnetPeriod () = makeString(["%s", "currentPeriod"], SEP)
92-
93-
94-func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP)
95-
96-
97-func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP)
98-
99-
100-func keyUsdtPriceAssetRatio () = makeString(["%s", "usdtUsdnRatio"], SEP)
101-
102-
103-func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP)
104-
105-
106-func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP)
107-
108-
109-func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP)
110-
111-
112-func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP)
11383
11484
11585 func keyManagerPublicKey () = "%s__managerPublicKey"
205175 then isUSDNClaimDisabled
206176 else false))
207177 then true
208- else throwErr("USDN claim is disabled"), if (!(if (isUSDN)
178+ else throw("USDN claim is disabled"), if (!(if (isUSDN)
209179 then isUSDNClaimEnded
210180 else false))
211181 then true
212- else throwErr("USDN claim is ended")]
182+ else throw("USDN claim is ended")]
213183 if ((checks == checks))
214- then {
215- let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
216- let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
217- let currentPeriod = valueOrElse(getInteger(keyCurrnetPeriod()), 0)
218- let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, currentPeriod)), totalPeriodPriceAssetAllowance)
219- let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, currentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
220- let availableClaimingPriceAssetAmount = min([claimingPriceAssetAmount, periodTotalAvailableToClaim, periodUserAvailableToClaim])
221- if ((claimedAssetId58 == priceAssetId58))
222- then $Tuple6([0, -(availableClaimingPriceAssetAmount), availableClaimingPriceAssetAmount, 0], availableClaimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [availableClaimingPriceAssetAmount, claimingIdoAssetAmount, periodTotalAvailableToClaim])
223- else if ((claimedAssetId58 == idoAssetId58))
224- then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [availableClaimingPriceAssetAmount, claimingIdoAssetAmount, periodTotalAvailableToClaim])
225- else throwErr(makeString(["unsupported assetId:", claimedAssetId58], " "))
226- }
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))
227189 else throw("Strict value is not equal to itself.")
228190 }
229191
345307 func claim (claimedAssetId58,userAddress58) = {
346308 let callerAddress58 = toString(i.caller)
347309 if ((userAddress58 != callerAddress58))
348- then throwErr("not authorized")
310+ then throw("not authorized")
349311 else {
350312 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
351313 let totalsDiff = claimResultTuple._1
373335 let availablePriceAmountToClaim = availableToClaimArray[0]
374336 let availableIdoAmountToClaim = availableToClaimArray[1]
375337 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
376- }
377-
378-
379-
380-@Callable(i)
381-func claimV2READONLY (claimedAssetId58,userAddress58) = {
382- let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
383- let totalsDiff = claimResultTuple._1
384- let outAmount = claimResultTuple._2
385- let outAssetId = claimResultTuple._3
386- let origInvestArray = claimResultTuple._4
387- let newClaimPeriodHeight = claimResultTuple._5
388- let availableToClaimArray = claimResultTuple._6
389- let resultString = makeString(["%d%d%d%d%d%d", "1000", "2000", "100000", "101000000", "100123456", "100"], SEP)
390- $Tuple2(nil, resultString)
391338 }
392339
393340
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-func throwErr (msg) = throw(makeString(["ido.ride:", msg], " "))
12-
1310
1411 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
1512 let bPriceAssetMULT = toBigInt(priceAssetMULT)
1613 let bIdoAssetMULT = toBigInt(idoAssetMULT)
1714 let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceAssetMULT)
1815 let bAmountAssetBUF = fraction(bPriceAssetBUF, toBigInt(priceMULT), toBigInt(price))
1916 toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE))
2017 }
2118
2219
2320 let IdxCfgIdoStart = 1
2421
2522 let IdxCfgIdoDuration = 2
2623
2724 let IdxCfgClaimStart = 3
2825
2926 let IdxCfgClaimDuration = 4
3027
3128 let IdxCfgPrice = 5
3229
3330 let IdxCfgPriceMult = 6
3431
3532 let IdxCfgIdoAssetId = 7
3633
3734 let IdxCfgIdoAssetMult = 8
3835
3936 let IdxCfgPriceAssetId = 9
4037
4138 let IdxCfgPriceAssetMult = 10
4239
4340 let IdxCfgMinInvestAmount = 11
4441
4542 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)
4643
4744
4845 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))
4946
5047
5148 let IdxInvTotalAmount = 1
5249
5350 let IdxInvRemainingAmount = 2
5451
5552 let IdxInvClaimedPriceAssetAmount = 3
5653
5754 let IdxInvClaimedIdoAssetAmount = 4
5855
5956 let IdxInvLastClaimedHeight = 5
6057
6158 func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP)
6259
6360
6461 func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight))
6562
6663
6764 func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP)
6865
6966
7067 func keyConfig () = "%s__config"
7168
7269
7370 func keyInvestor (userAddress) = ("%s__" + userAddress)
7471
7572
7673 func keyTotals () = "%s__totals"
7774
7875
7976 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
8077
8178
8279 func keyUSDNClaimDisabled () = "%s__usdnClaimDisabled"
8380
8481
8582 func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight"
86-
87-
88-func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
89-
90-
91-func keyCurrnetPeriod () = makeString(["%s", "currentPeriod"], SEP)
92-
93-
94-func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP)
95-
96-
97-func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP)
98-
99-
100-func keyUsdtPriceAssetRatio () = makeString(["%s", "usdtUsdnRatio"], SEP)
101-
102-
103-func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP)
104-
105-
106-func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP)
107-
108-
109-func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP)
110-
111-
112-func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP)
11383
11484
11585 func keyManagerPublicKey () = "%s__managerPublicKey"
11686
11787
11888 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
11989
12090
12191 func readConfigArray () = split(getStringOrFail(keyConfig()), SEP)
12292
12393
12494 func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP)
12595
12696
12797 func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals())
12898
12999
130100 func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress))
131101
132102
133103 func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP)
134104
135105
136106 let IdxDiffTotalIncrement = 0
137107
138108 let IdxDiffRemainingPriceAmountIncrement = 1
139109
140110 let IdxDiffClaimedPriceAmountIncrement = 2
141111
142112 let IdxDiffClaimedIdoAssetAmountIncrement = 3
143113
144114 func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight) = {
145115 let totalAmount = parseIntValue(origArray[IdxInvTotalAmount])
146116 let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount])
147117 let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount])
148118 let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount])
149119 let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight])
150120 let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement])
151121 let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement])
152122 let newClaimedPriceAssetAmount = (claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement])
153123 let newClaimedIdoAssetAmount = (claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement])
154124 if ((0 > newRemainingAmount))
155125 then throw("invalid math")
156126 else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
157127 }
158128
159129
160130 func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
161131
162132
163133 func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
164134
165135
166136 func internalClaim (claimedAssetId58,userAddress,txId) = {
167137 let cfgArray = readConfigArray()
168138 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
169139 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
170140 let claimEnd = (claimStart + claimDuration)
171141 let price = parseIntValue(cfgArray[IdxCfgPrice])
172142 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
173143 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
174144 let idoAssetId = fromBase58String(idoAssetId58)
175145 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
176146 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
177147 let priceAssetId = fromBase58String(priceAssetId58)
178148 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
179149 let userAddress58 = toString(userAddress)
180150 let origInvestArray = readInvestorArrayOrFail(userAddress58)
181151 let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount])
182152 let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight])
183153 let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP))
184154 then claimStart
185155 else investLastClaimedHeightTMP
186156 let newClaimPeriodHeight = if ((height > claimEnd))
187157 then claimEnd
188158 else if ((claimStart > height))
189159 then claimStart
190160 else height
191161 let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight)
192162 let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration)
193163 let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult)
194164 let isUSDN = (claimedAssetId58 == priceAssetId58)
195165 let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false)
196166 let isUSDNClaimEnded = match getInteger(keyUSDNClaimEndHeight()) {
197167 case end: Int =>
198168 (height > end)
199169 case _: Unit =>
200170 false
201171 case _ =>
202172 throw("Match error")
203173 }
204174 let checks = [if (!(if (isUSDN)
205175 then isUSDNClaimDisabled
206176 else false))
207177 then true
208- else throwErr("USDN claim is disabled"), if (!(if (isUSDN)
178+ else throw("USDN claim is disabled"), if (!(if (isUSDN)
209179 then isUSDNClaimEnded
210180 else false))
211181 then true
212- else throwErr("USDN claim is ended")]
182+ else throw("USDN claim is ended")]
213183 if ((checks == checks))
214- then {
215- let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
216- let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
217- let currentPeriod = valueOrElse(getInteger(keyCurrnetPeriod()), 0)
218- let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, currentPeriod)), totalPeriodPriceAssetAllowance)
219- let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, currentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
220- let availableClaimingPriceAssetAmount = min([claimingPriceAssetAmount, periodTotalAvailableToClaim, periodUserAvailableToClaim])
221- if ((claimedAssetId58 == priceAssetId58))
222- then $Tuple6([0, -(availableClaimingPriceAssetAmount), availableClaimingPriceAssetAmount, 0], availableClaimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [availableClaimingPriceAssetAmount, claimingIdoAssetAmount, periodTotalAvailableToClaim])
223- else if ((claimedAssetId58 == idoAssetId58))
224- then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [availableClaimingPriceAssetAmount, claimingIdoAssetAmount, periodTotalAvailableToClaim])
225- else throwErr(makeString(["unsupported assetId:", claimedAssetId58], " "))
226- }
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))
227189 else throw("Strict value is not equal to itself.")
228190 }
229191
230192
231193 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
232194 case s: String =>
233195 fromBase58String(s)
234196 case _: Unit =>
235197 unit
236198 case _ =>
237199 throw("Match error")
238200 }
239201
240202
241203 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
242204 case s: String =>
243205 fromBase58String(s)
244206 case _: Unit =>
245207 unit
246208 case _ =>
247209 throw("Match error")
248210 }
249211
250212
251213 func mustManager (i) = {
252214 let pd = throw("Permission denied")
253215 match managerPublicKeyOrUnit() {
254216 case pk: ByteVector =>
255217 if ((i.callerPublicKey == pk))
256218 then true
257219 else pd
258220 case _: Unit =>
259221 if ((i.caller == this))
260222 then true
261223 else pd
262224 case _ =>
263225 throw("Match error")
264226 }
265227 }
266228
267229
268230 @Callable(i)
269231 func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = {
270232 let priceMult = ((100 * 1000) * 1000)
271233 let idoEnd = (idoStart + idoDuration)
272234 if (isDefined(getString(keyConfig())))
273235 then throw("already initialized")
274236 else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller)))
275237 then throw("not authorized")
276238 else if ((size(i.payments) != 1))
277239 then throw("exactly 1 payment must be attached")
278240 else if ((idoEnd >= claimStart))
279241 then throw("claimStart must be greater than idoEnd")
280242 else {
281243 let pmt = value(i.payments[0])
282244 let idoAssetId = value(pmt.assetId)
283245 let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info")
284246 let idoAssetId58 = toBase58String(idoAssetId)
285247 let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN)
286248 let priceAssetId = fromBase58String(priceAssetId58)
287249 let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info")
288250 let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN)
289251 let origTotalsArray = readTotalsArrayOrDefault()
290252 let totalsDiff = [0, 0, 0, 0]
291253 [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart)]
292254 }
293255 }
294256
295257
296258
297259 @Callable(i)
298260 func invest () = {
299261 let cfgArray = readConfigArray()
300262 let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart])
301263 let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration])
302264 let idoEnd = (idoStart + idoDuration)
303265 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
304266 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
305267 let price = parseIntValue(cfgArray[IdxCfgPrice])
306268 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
307269 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
308270 let idoAssetId = fromBase58String(idoAssetId58)
309271 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
310272 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
311273 let priceAssetId = fromBase58String(priceAssetId58)
312274 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
313275 let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount])
314276 let userAddress = toString(i.caller)
315277 if ((idoStart > height))
316278 then throw("ido has not been started yet")
317279 else if ((height > idoEnd))
318280 then throw("ido has been already ended")
319281 else if ((size(i.payments) != 1))
320282 then throw("exactly 1 payment is expected")
321283 else {
322284 let pmt = value(i.payments[0])
323285 let pmtAssetId = value(pmt.assetId)
324286 let pmtAmount = pmt.amount
325287 if ((pmtAssetId != priceAssetId))
326288 then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected"))
327289 else {
328290 let origInvestorArray = readInvestorArrayOrDefault(userAddress)
329291 let origTotalsArray = readTotalsArrayOrDefault()
330292 let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount)
331293 let requiredIdoAssetAmount = (newPriceTotalAmount * 100)
332294 if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId)))
333295 then throw("IDO asset has been - sold consider to use smaller payment")
334296 else {
335297 let totalsDiff = [pmtAmount, pmtAmount, 0, 0]
336298 [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)]
337299 }
338300 }
339301 }
340302 }
341303
342304
343305
344306 @Callable(i)
345307 func claim (claimedAssetId58,userAddress58) = {
346308 let callerAddress58 = toString(i.caller)
347309 if ((userAddress58 != callerAddress58))
348- then throwErr("not authorized")
310+ then throw("not authorized")
349311 else {
350312 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
351313 let totalsDiff = claimResultTuple._1
352314 let outAmount = claimResultTuple._2
353315 let outAssetId = claimResultTuple._3
354316 let origInvestArray = claimResultTuple._4
355317 let newClaimPeriodHeight = claimResultTuple._5
356318 let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
357319 let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
358320 $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
359321 }
360322 }
361323
362324
363325
364326 @Callable(i)
365327 func claimREADONLY (claimedAssetId58,userAddress58) = {
366328 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
367329 let totalsDiff = claimResultTuple._1
368330 let outAmount = claimResultTuple._2
369331 let outAssetId = claimResultTuple._3
370332 let origInvestArray = claimResultTuple._4
371333 let newClaimPeriodHeight = claimResultTuple._5
372334 let availableToClaimArray = claimResultTuple._6
373335 let availablePriceAmountToClaim = availableToClaimArray[0]
374336 let availableIdoAmountToClaim = availableToClaimArray[1]
375337 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
376- }
377-
378-
379-
380-@Callable(i)
381-func claimV2READONLY (claimedAssetId58,userAddress58) = {
382- let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
383- let totalsDiff = claimResultTuple._1
384- let outAmount = claimResultTuple._2
385- let outAssetId = claimResultTuple._3
386- let origInvestArray = claimResultTuple._4
387- let newClaimPeriodHeight = claimResultTuple._5
388- let availableToClaimArray = claimResultTuple._6
389- let resultString = makeString(["%d%d%d%d%d%d", "1000", "2000", "100000", "101000000", "100123456", "100"], SEP)
390- $Tuple2(nil, resultString)
391338 }
392339
393340
394341
395342 @Callable(i)
396343 func setManager (pendingManagerPublicKey) = {
397344 let checkCaller = mustManager(i)
398345 if ((checkCaller == checkCaller))
399346 then {
400347 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
401348 if ((checkManagerPublicKey == checkManagerPublicKey))
402349 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
403350 else throw("Strict value is not equal to itself.")
404351 }
405352 else throw("Strict value is not equal to itself.")
406353 }
407354
408355
409356
410357 @Callable(i)
411358 func confirmManager () = {
412359 let pm = pendingManagerPublicKeyOrUnit()
413360 let hasPM = if (isDefined(pm))
414361 then true
415362 else throw("No pending manager")
416363 if ((hasPM == hasPM))
417364 then {
418365 let checkPM = if ((i.callerPublicKey == value(pm)))
419366 then true
420367 else throw("You are not pending manager")
421368 if ((checkPM == checkPM))
422369 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
423370 else throw("Strict value is not equal to itself.")
424371 }
425372 else throw("Strict value is not equal to itself.")
426373 }
427374
428375
429376 @Verifier(tx)
430377 func verify () = {
431378 let targetPublicKey = match managerPublicKeyOrUnit() {
432379 case pk: ByteVector =>
433380 pk
434381 case _: Unit =>
435382 tx.senderPublicKey
436383 case _ =>
437384 throw("Match error")
438385 }
439386 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
440387 }
441388

github/deemru/w8io/026f985 
62.42 ms