tx · Gt88UggJwxKtQUPsE15emTGt1vg7P8xeJqxLfP4A9anP 3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv: -0.02700000 Waves 2022.11.03 15:38 [2300946] smart account 3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv > SELF 0.00000000 Waves
{ "type": 13, "id": "Gt88UggJwxKtQUPsE15emTGt1vg7P8xeJqxLfP4A9anP", "fee": 2700000, "feeAssetId": null, "timestamp": 1667479180001, "version": 1, "sender": "3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv", "senderPublicKey": "39YkRD2qWXTcdNBr4CbDnm8g8SAB2FKVaDeGYahcFHHx", "proofs": [ "2VDNBXXzLZhCtCiKYvxJKPs5bsS9rxUYGmhQqWAMJTcuMv4V22RzDGK647XkVGgDPsaontYy89rBM6MiTY5dsGjK" ], "script": "base64:AAIFAAAAAAAAD00IAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJZHhDZmdQcmljZUFzc2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FAAAAAmNoAAAAD2NhbGxlclB1YmxpY0tleQkBAAAABXZhbHVlAAAAAQUAAAACY1cGCQAAAgAAAAECAAAAG1lvdSBhcmUgbm90IHBlbmRpbmcgbWFuYWdlcgMJAAAAAAAAAgUAAAACY1kFAAAAAmNZCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAQAAAAJhQgAAAAAJAAJYAAAAAQkBAAAABXZhbHVlAAAAAQUAAAACY1cJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAAAmFDAAAAAAUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAmNaAQAAAAJkYQAAAAAEAAAAAmRiBAAAAAJjZAkBAAAAAmNjAAAAAAMJAAABAAAAAgUAAAACY2QCAAAACkJ5dGVWZWN0b3IEAAAAAmNqBQAAAAJjZAUAAAACY2oDCQAAAQAAAAIFAAAAAmNkAgAAAARVbml0CAUAAAACY1oAAAAPc2VuZGVyUHVibGljS2V5CQAAAgAAAAECAAAAC01hdGNoIGVycm9yCQAB9AAAAAMIBQAAAAJjWgAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAmNaAAAABnByb29mcwAAAAAAAAAAAAUAAAACZGIUWxUT", "chainId": 84, "height": 2300946, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GuP8Xv9mLH4Nfg6XJ7qwX6jG8MxyaMe8a4uKGCrTnG94 Next: 7LhLJWcj91pzMYpYEp2AJPeZB8t8ePTQBKm4HntUqc1s Diff:
Old | New | Differences | |
---|---|---|---|
470 | 470 | let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim) | |
471 | 471 | let priceAssetDecimals = value(assetInfo(fromBase58String(claimedAssetId58))).decimals | |
472 | 472 | let periodMinAvailableToClaimPriceAssetDecimals = fraction(periodMinAvailableToClaim, pow(10, 0, priceAssetDecimals, 0, 0, DOWN), scale8) | |
473 | - | let entries = if ((priceAssetBalance >= periodMinAvailableToClaim)) | |
474 | - | then [ScriptTransfer(i.caller, periodMinAvailableToClaimPriceAssetDecimals, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))] | |
475 | - | else { | |
476 | - | let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim) | |
473 | + | let err = throw("123") | |
474 | + | if ((err == err)) | |
475 | + | then { | |
476 | + | let entries = if ((priceAssetBalance >= periodMinAvailableToClaim)) | |
477 | + | then [ScriptTransfer(i.caller, periodMinAvailableToClaimPriceAssetDecimals, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))] | |
478 | + | else { | |
479 | + | let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim) | |
477 | 480 | [ScriptTransfer(i.caller, periodMinAvailableToClaimPriceAssetDecimals, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)] | |
481 | + | } | |
482 | + | $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, periodMinAvailableToClaimPriceAssetDecimals, claimedIdoAssetAmountFromDiff, i.transactionId)] ++ entries), unit) | |
478 | 483 | } | |
479 | - | | |
484 | + | else throw("Strict value is not equal to itself.") | |
480 | 485 | } | |
481 | 486 | else throw("Strict value is not equal to itself.") | |
482 | 487 | } | |
518 | 523 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
519 | 524 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
520 | 525 | let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalance) | |
521 | - | let $ | |
522 | - | let periodMinAvailableToClaim = $ | |
523 | - | let periodTotalAvailableToClaim = $ | |
524 | - | let periodUserAvailableToClaim = $ | |
525 | - | let totalUserAvailableToClaim = $ | |
526 | - | let usdtPriceAssetAllowableRatio = $ | |
527 | - | let currentUsdtPriceAssetRatio = $ | |
528 | - | let endPeriodBlocksLeft = $ | |
529 | - | let updatedCurrentPeriod = $ | |
530 | - | let periodStart = $ | |
531 | - | let periodEnd = $ | |
526 | + | let $t02777328185 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
527 | + | let periodMinAvailableToClaim = $t02777328185._1 | |
528 | + | let periodTotalAvailableToClaim = $t02777328185._2 | |
529 | + | let periodUserAvailableToClaim = $t02777328185._3 | |
530 | + | let totalUserAvailableToClaim = $t02777328185._4 | |
531 | + | let usdtPriceAssetAllowableRatio = $t02777328185._5 | |
532 | + | let currentUsdtPriceAssetRatio = $t02777328185._6 | |
533 | + | let endPeriodBlocksLeft = $t02777328185._7 | |
534 | + | let updatedCurrentPeriod = $t02777328185._8 | |
535 | + | let periodStart = $t02777328185._9 | |
536 | + | let periodEnd = $t02777328185._10 | |
532 | 537 | let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0) | |
533 | 538 | let decimals = value(assetInfo(fromBase58String(claimedAssetId58))).decimals | |
534 | 539 | let resultString = if ((height > currentPeriodEndHeight)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | let SEP = "__" | |
8 | 8 | ||
9 | 9 | let BUFSCALE = toBigInt(1000000000000000000) | |
10 | 10 | ||
11 | 11 | let scale8 = 100000000 | |
12 | 12 | ||
13 | 13 | func throwErr (msg) = throw(makeString(["ido.ride:", msg], " ")) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = { | |
17 | 17 | let bPriceAssetMULT = toBigInt(priceAssetMULT) | |
18 | 18 | let bIdoAssetMULT = toBigInt(idoAssetMULT) | |
19 | 19 | let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceAssetMULT) | |
20 | 20 | let bAmountAssetBUF = fraction(bPriceAssetBUF, toBigInt(priceMULT), toBigInt(price)) | |
21 | 21 | toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE)) | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | let IdxCfgIdoStart = 1 | |
26 | 26 | ||
27 | 27 | let IdxCfgIdoDuration = 2 | |
28 | 28 | ||
29 | 29 | let IdxCfgClaimStart = 3 | |
30 | 30 | ||
31 | 31 | let IdxCfgClaimDuration = 4 | |
32 | 32 | ||
33 | 33 | let IdxCfgPrice = 5 | |
34 | 34 | ||
35 | 35 | let IdxCfgPriceMult = 6 | |
36 | 36 | ||
37 | 37 | let IdxCfgIdoAssetId = 7 | |
38 | 38 | ||
39 | 39 | let IdxCfgIdoAssetMult = 8 | |
40 | 40 | ||
41 | 41 | let IdxCfgPriceAssetId = 9 | |
42 | 42 | ||
43 | 43 | let IdxCfgPriceAssetMult = 10 | |
44 | 44 | ||
45 | 45 | let IdxCfgMinInvestAmount = 11 | |
46 | 46 | ||
47 | 47 | 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) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | 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)) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | let IdxInvTotalAmount = 1 | |
54 | 54 | ||
55 | 55 | let IdxInvRemainingAmount = 2 | |
56 | 56 | ||
57 | 57 | let IdxInvClaimedPriceAssetAmount = 3 | |
58 | 58 | ||
59 | 59 | let IdxInvClaimedIdoAssetAmount = 4 | |
60 | 60 | ||
61 | 61 | let IdxInvLastClaimedHeight = 5 | |
62 | 62 | ||
63 | 63 | func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight)) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func keyConfig () = "%s__config" | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func keyInvestor (userAddress) = ("%s__" + userAddress) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func keyTotals () = "%s__totals" | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func keyUSDNClaimDisabled () = "%s__usdnClaimDisabled" | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyPeriodLength () = makeString(["%s", "periodLength"], SEP) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func keyUsdtPriceAssetAllowableRatio () = makeString(["%s", "usdtPriceAssetAllowableRatio"], SEP) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func keyUsdtPriceAssetStablePool () = makeString(["%s", "usdtPriceAssetStablePool"], SEP) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keyPriceAssetBalance (address) = makeString(["%s%s", "priceAssetBalance", address], SEP) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func readConfigArray () = split(getStringOrFail(keyConfig()), SEP) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals()) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress)) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | let IdxDiffTotalIncrement = 0 | |
148 | 148 | ||
149 | 149 | let IdxDiffRemainingPriceAmountIncrement = 1 | |
150 | 150 | ||
151 | 151 | let IdxDiffClaimedPriceAmountIncrement = 2 | |
152 | 152 | ||
153 | 153 | let IdxDiffClaimedIdoAssetAmountIncrement = 3 | |
154 | 154 | ||
155 | 155 | func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight) = { | |
156 | 156 | let totalAmount = parseIntValue(origArray[IdxInvTotalAmount]) | |
157 | 157 | let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount]) | |
158 | 158 | let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount]) | |
159 | 159 | let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount]) | |
160 | 160 | let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight]) | |
161 | 161 | let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement]) | |
162 | 162 | let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement]) | |
163 | 163 | let newClaimedPriceAssetAmount = (claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement]) | |
164 | 164 | let newClaimedIdoAssetAmount = (claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement]) | |
165 | 165 | if ((0 > newRemainingAmount)) | |
166 | 166 | then throw("invalid math") | |
167 | 167 | else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight)) | |
168 | 168 | } | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount)) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount)) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func internalClaim (claimedAssetId58,userAddress,txId) = { | |
178 | 178 | let cfgArray = readConfigArray() | |
179 | 179 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
180 | 180 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
181 | 181 | let claimEnd = (claimStart + claimDuration) | |
182 | 182 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
183 | 183 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
184 | 184 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
185 | 185 | let idoAssetId = fromBase58String(idoAssetId58) | |
186 | 186 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
187 | 187 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
188 | 188 | let priceAssetId = fromBase58String(priceAssetId58) | |
189 | 189 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
190 | 190 | let userAddress58 = toString(userAddress) | |
191 | 191 | let origInvestArray = readInvestorArrayOrFail(userAddress58) | |
192 | 192 | let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount]) | |
193 | 193 | let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight]) | |
194 | 194 | let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP)) | |
195 | 195 | then claimStart | |
196 | 196 | else investLastClaimedHeightTMP | |
197 | 197 | let newClaimPeriodHeight = if ((height > claimEnd)) | |
198 | 198 | then claimEnd | |
199 | 199 | else if ((claimStart > height)) | |
200 | 200 | then claimStart | |
201 | 201 | else height | |
202 | 202 | let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight) | |
203 | 203 | let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration) | |
204 | 204 | let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult) | |
205 | 205 | let isUSDN = (claimedAssetId58 == priceAssetId58) | |
206 | 206 | let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false) | |
207 | 207 | let checks = [if (!(if (isUSDN) | |
208 | 208 | then isUSDNClaimDisabled | |
209 | 209 | else false)) | |
210 | 210 | then true | |
211 | 211 | else throw("USDN claim is disabled")] | |
212 | 212 | if ((checks == checks)) | |
213 | 213 | then if ((claimedAssetId58 == priceAssetId58)) | |
214 | 214 | then { | |
215 | 215 | let priceAssetDecimals = value(assetInfo(fromBase58String(claimedAssetId58))).decimals | |
216 | 216 | let claimingPriceAssetAmountPriceAssetDecimals = fraction(claimingPriceAssetAmount, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN)) | |
217 | 217 | $Tuple6([0, -(claimingPriceAssetAmountPriceAssetDecimals), claimingPriceAssetAmountPriceAssetDecimals, 0], claimingPriceAssetAmountPriceAssetDecimals, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmountPriceAssetDecimals, claimingIdoAssetAmount]) | |
218 | 218 | } | |
219 | 219 | else if ((claimedAssetId58 == idoAssetId58)) | |
220 | 220 | then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount]) | |
221 | 221 | else throw(("unsupported assetId: " + claimedAssetId58)) | |
222 | 222 | else throw("Strict value is not equal to itself.") | |
223 | 223 | } | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func internalClaimV2 (priceAssetId58,userAddress58,outAmount,totalUserAvailableToClaim) = { | |
227 | 227 | let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58))) | |
228 | 228 | let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
229 | 229 | let periodLength = value(getInteger(keyPeriodLength())) | |
230 | 230 | let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0) | |
231 | 231 | let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0))) | |
232 | 232 | let $t01215314023 = if ((currentPeriod > 0)) | |
233 | 233 | then { | |
234 | 234 | let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod))) | |
235 | 235 | let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod))) | |
236 | 236 | let $t01241313118 = if ((height > lastPeriodEndHeight)) | |
237 | 237 | then { | |
238 | 238 | let updatedCurrentPeriod = (currentPeriod + 1) | |
239 | 239 | let periodStart = if ((height > (lastPeriodEndHeight + periodLength))) | |
240 | 240 | then { | |
241 | 241 | let blocksToLastPeriodStart = ((height - lastPeriodEndHeight) % periodLength) | |
242 | 242 | if ((blocksToLastPeriodStart == 0)) | |
243 | 243 | then ((height - periodLength) + 1) | |
244 | 244 | else (height - blocksToLastPeriodStart) | |
245 | 245 | } | |
246 | 246 | else (lastPeriodEndHeight + 1) | |
247 | 247 | let periodEnd = ((periodStart + periodLength) - 1) | |
248 | 248 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
249 | 249 | } | |
250 | 250 | else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight) | |
251 | 251 | let updatedCurrentPeriod = $t01241313118._1 | |
252 | 252 | let periodStart = $t01241313118._2 | |
253 | 253 | let periodEnd = $t01241313118._3 | |
254 | 254 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
255 | 255 | } | |
256 | 256 | else if (zeroPeriodEndHeighIsDefined) | |
257 | 257 | then { | |
258 | 258 | let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0))) | |
259 | 259 | let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0))) | |
260 | 260 | let $t01337313755 = if ((height > zeroPeriodEndHeight)) | |
261 | 261 | then { | |
262 | 262 | let updatedCurrentPeriod = (currentPeriod + 1) | |
263 | 263 | let periodStart = (zeroPeriodEndHeight + 1) | |
264 | 264 | let periodEnd = ((periodStart + periodLength) - 1) | |
265 | 265 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
266 | 266 | } | |
267 | 267 | else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight) | |
268 | 268 | let updatedCurrentPeriod = $t01337313755._1 | |
269 | 269 | let periodStart = $t01337313755._2 | |
270 | 270 | let periodEnd = $t01337313755._3 | |
271 | 271 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
272 | 272 | } | |
273 | 273 | else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1))) | |
274 | 274 | let updatedCurrentPeriod = $t01215314023._1 | |
275 | 275 | let periodStart = $t01215314023._2 | |
276 | 276 | let periodEnd = $t01215314023._3 | |
277 | 277 | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance) | |
278 | 278 | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
279 | 279 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
280 | 280 | let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim]) | |
281 | 281 | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
282 | 282 | let putOneTknV2PriceAssetAmount = scale8 | |
283 | 283 | let $t01477815031 = { | |
284 | 284 | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
285 | 285 | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
286 | 286 | then @ | |
287 | 287 | else throw("Couldn't cast Any to (Int, Int, Int)") | |
288 | 288 | } | |
289 | 289 | if (($t01477815031 == $t01477815031)) | |
290 | 290 | then { | |
291 | 291 | let bonus = $t01477815031._3 | |
292 | 292 | let feeAmount = $t01477815031._2 | |
293 | 293 | let lpAmount = $t01477815031._1 | |
294 | 294 | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
295 | 295 | let $t01509315311 = { | |
296 | 296 | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
297 | 297 | if ($isInstanceOf(@, "(Int, Int)")) | |
298 | 298 | then @ | |
299 | 299 | else throw("Couldn't cast Any to (Int, Int)") | |
300 | 300 | } | |
301 | 301 | if (($t01509315311 == $t01509315311)) | |
302 | 302 | then { | |
303 | 303 | let getOneTknV2FeeAmount = $t01509315311._2 | |
304 | 304 | let usdtAmount = $t01509315311._1 | |
305 | 305 | let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8) | |
306 | 306 | let endPeriodBlocksLeft = (periodEnd - height) | |
307 | 307 | $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd) | |
308 | 308 | } | |
309 | 309 | else throw("Strict value is not equal to itself.") | |
310 | 310 | } | |
311 | 311 | else throw("Strict value is not equal to itself.") | |
312 | 312 | } | |
313 | 313 | ||
314 | 314 | ||
315 | 315 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
316 | 316 | case s: String => | |
317 | 317 | fromBase58String(s) | |
318 | 318 | case _: Unit => | |
319 | 319 | unit | |
320 | 320 | case _ => | |
321 | 321 | throw("Match error") | |
322 | 322 | } | |
323 | 323 | ||
324 | 324 | ||
325 | 325 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
326 | 326 | case s: String => | |
327 | 327 | fromBase58String(s) | |
328 | 328 | case _: Unit => | |
329 | 329 | unit | |
330 | 330 | case _ => | |
331 | 331 | throw("Match error") | |
332 | 332 | } | |
333 | 333 | ||
334 | 334 | ||
335 | 335 | func mustManager (i) = { | |
336 | 336 | let pd = throw("Permission denied") | |
337 | 337 | match managerPublicKeyOrUnit() { | |
338 | 338 | case pk: ByteVector => | |
339 | 339 | if ((i.callerPublicKey == pk)) | |
340 | 340 | then true | |
341 | 341 | else pd | |
342 | 342 | case _: Unit => | |
343 | 343 | if ((i.caller == this)) | |
344 | 344 | then true | |
345 | 345 | else pd | |
346 | 346 | case _ => | |
347 | 347 | throw("Match error") | |
348 | 348 | } | |
349 | 349 | } | |
350 | 350 | ||
351 | 351 | ||
352 | 352 | @Callable(i) | |
353 | 353 | func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = { | |
354 | 354 | let priceMult = ((100 * 1000) * 1000) | |
355 | 355 | let idoEnd = (idoStart + idoDuration) | |
356 | 356 | if (isDefined(getString(keyConfig()))) | |
357 | 357 | then throw("already initialized") | |
358 | 358 | else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller))) | |
359 | 359 | then throw("not authorized") | |
360 | 360 | else if ((size(i.payments) != 1)) | |
361 | 361 | then throw("exactly 1 payment must be attached") | |
362 | 362 | else if ((idoEnd >= claimStart)) | |
363 | 363 | then throw("claimStart must be greater than idoEnd") | |
364 | 364 | else { | |
365 | 365 | let pmt = value(i.payments[0]) | |
366 | 366 | let idoAssetId = value(pmt.assetId) | |
367 | 367 | let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info") | |
368 | 368 | let idoAssetId58 = toBase58String(idoAssetId) | |
369 | 369 | let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN) | |
370 | 370 | let priceAssetId = fromBase58String(priceAssetId58) | |
371 | 371 | let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info") | |
372 | 372 | let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN) | |
373 | 373 | let origTotalsArray = readTotalsArrayOrDefault() | |
374 | 374 | let totalsDiff = [0, 0, 0, 0] | |
375 | 375 | [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart)] | |
376 | 376 | } | |
377 | 377 | } | |
378 | 378 | ||
379 | 379 | ||
380 | 380 | ||
381 | 381 | @Callable(i) | |
382 | 382 | func invest () = { | |
383 | 383 | let cfgArray = readConfigArray() | |
384 | 384 | let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart]) | |
385 | 385 | let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration]) | |
386 | 386 | let idoEnd = (idoStart + idoDuration) | |
387 | 387 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
388 | 388 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
389 | 389 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
390 | 390 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
391 | 391 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
392 | 392 | let idoAssetId = fromBase58String(idoAssetId58) | |
393 | 393 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
394 | 394 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
395 | 395 | let priceAssetId = fromBase58String(priceAssetId58) | |
396 | 396 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
397 | 397 | let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount]) | |
398 | 398 | let userAddress = toString(i.caller) | |
399 | 399 | if ((idoStart > height)) | |
400 | 400 | then throw("ido has not been started yet") | |
401 | 401 | else if ((height > idoEnd)) | |
402 | 402 | then throw("ido has been already ended") | |
403 | 403 | else if ((size(i.payments) != 1)) | |
404 | 404 | then throw("exactly 1 payment is expected") | |
405 | 405 | else { | |
406 | 406 | let pmt = value(i.payments[0]) | |
407 | 407 | let pmtAssetId = value(pmt.assetId) | |
408 | 408 | let pmtAmount = pmt.amount | |
409 | 409 | if ((pmtAssetId != priceAssetId)) | |
410 | 410 | then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected")) | |
411 | 411 | else { | |
412 | 412 | let origInvestorArray = readInvestorArrayOrDefault(userAddress) | |
413 | 413 | let origTotalsArray = readTotalsArrayOrDefault() | |
414 | 414 | let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount) | |
415 | 415 | let requiredIdoAssetAmount = (newPriceTotalAmount * 100) | |
416 | 416 | if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId))) | |
417 | 417 | then throw("IDO asset has been - sold consider to use smaller payment") | |
418 | 418 | else { | |
419 | 419 | let totalsDiff = [pmtAmount, pmtAmount, 0, 0] | |
420 | 420 | [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)] | |
421 | 421 | } | |
422 | 422 | } | |
423 | 423 | } | |
424 | 424 | } | |
425 | 425 | ||
426 | 426 | ||
427 | 427 | ||
428 | 428 | @Callable(i) | |
429 | 429 | func claim (claimedAssetId58,userAddress58) = { | |
430 | 430 | let callerAddress58 = toString(i.caller) | |
431 | 431 | if ((userAddress58 != callerAddress58)) | |
432 | 432 | then throw("not authorized") | |
433 | 433 | else { | |
434 | 434 | let cfgArray = readConfigArray() | |
435 | 435 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
436 | 436 | let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId) | |
437 | 437 | let totalsDiff = claimResultTuple._1 | |
438 | 438 | let outAmount = claimResultTuple._2 | |
439 | 439 | let outAssetId = claimResultTuple._3 | |
440 | 440 | let origInvestArray = claimResultTuple._4 | |
441 | 441 | let newClaimPeriodHeight = claimResultTuple._5 | |
442 | 442 | let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement] | |
443 | 443 | let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement] | |
444 | 444 | let entries = if ((claimedAssetId58 == priceAssetId58)) | |
445 | 445 | then { | |
446 | 446 | let $t02096721411 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
447 | 447 | let periodMinAvailableToClaim = $t02096721411._1 | |
448 | 448 | let periodTotalAvailableToClaim = $t02096721411._2 | |
449 | 449 | let periodUserAvailableToClaim = $t02096721411._3 | |
450 | 450 | let totalUserAvailableToClaim = $t02096721411._4 | |
451 | 451 | let usdtPriceAssetAllowableRatio = $t02096721411._5 | |
452 | 452 | let currentUsdtPriceAssetRatio = $t02096721411._6 | |
453 | 453 | let endPeriodBlocksLeft = $t02096721411._7 | |
454 | 454 | let updatedCurrentPeriod = $t02096721411._8 | |
455 | 455 | let periodStart = $t02096721411._9 | |
456 | 456 | let periodEnd = $t02096721411._10 | |
457 | 457 | let checks = [if ((periodUserAvailableToClaim > 0)) | |
458 | 458 | then true | |
459 | 459 | else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0)) | |
460 | 460 | then true | |
461 | 461 | else throwErr("unavailable to claim because total period allowance reached"), if ((periodMinAvailableToClaim > 0)) | |
462 | 462 | then true | |
463 | 463 | else throwErr("nothing to claim"), if ((usdtPriceAssetAllowableRatio > currentUsdtPriceAssetRatio)) | |
464 | 464 | then true | |
465 | 465 | else throwErr("unavailable to claim because usdn price lower than usdtPriceAssetAllowableRatio")] | |
466 | 466 | if ((checks == checks)) | |
467 | 467 | then { | |
468 | 468 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
469 | 469 | let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim) | |
470 | 470 | let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim) | |
471 | 471 | let priceAssetDecimals = value(assetInfo(fromBase58String(claimedAssetId58))).decimals | |
472 | 472 | let periodMinAvailableToClaimPriceAssetDecimals = fraction(periodMinAvailableToClaim, pow(10, 0, priceAssetDecimals, 0, 0, DOWN), scale8) | |
473 | - | let entries = if ((priceAssetBalance >= periodMinAvailableToClaim)) | |
474 | - | then [ScriptTransfer(i.caller, periodMinAvailableToClaimPriceAssetDecimals, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))] | |
475 | - | else { | |
476 | - | let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim) | |
473 | + | let err = throw("123") | |
474 | + | if ((err == err)) | |
475 | + | then { | |
476 | + | let entries = if ((priceAssetBalance >= periodMinAvailableToClaim)) | |
477 | + | then [ScriptTransfer(i.caller, periodMinAvailableToClaimPriceAssetDecimals, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))] | |
478 | + | else { | |
479 | + | let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim) | |
477 | 480 | [ScriptTransfer(i.caller, periodMinAvailableToClaimPriceAssetDecimals, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)] | |
481 | + | } | |
482 | + | $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, periodMinAvailableToClaimPriceAssetDecimals, claimedIdoAssetAmountFromDiff, i.transactionId)] ++ entries), unit) | |
478 | 483 | } | |
479 | - | | |
484 | + | else throw("Strict value is not equal to itself.") | |
480 | 485 | } | |
481 | 486 | else throw("Strict value is not equal to itself.") | |
482 | 487 | } | |
483 | 488 | else $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), 0), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit) | |
484 | 489 | entries | |
485 | 490 | } | |
486 | 491 | } | |
487 | 492 | ||
488 | 493 | ||
489 | 494 | ||
490 | 495 | @Callable(i) | |
491 | 496 | func claimREADONLY (claimedAssetId58,userAddress58) = { | |
492 | 497 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
493 | 498 | let totalsDiff = claimResultTuple._1 | |
494 | 499 | let outAmount = claimResultTuple._2 | |
495 | 500 | let outAssetId = claimResultTuple._3 | |
496 | 501 | let origInvestArray = claimResultTuple._4 | |
497 | 502 | let newClaimPeriodHeight = claimResultTuple._5 | |
498 | 503 | let availableToClaimArray = claimResultTuple._6 | |
499 | 504 | let availablePriceAmountToClaim = availableToClaimArray[0] | |
500 | 505 | let availableIdoAmountToClaim = availableToClaimArray[1] | |
501 | 506 | $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP)) | |
502 | 507 | } | |
503 | 508 | ||
504 | 509 | ||
505 | 510 | ||
506 | 511 | @Callable(i) | |
507 | 512 | func claimV2READONLY (claimedAssetId58,userAddress58) = { | |
508 | 513 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
509 | 514 | let totalsDiff = claimResultTuple._1 | |
510 | 515 | let outAmount = claimResultTuple._2 | |
511 | 516 | let outAssetId = claimResultTuple._3 | |
512 | 517 | let origInvestArray = claimResultTuple._4 | |
513 | 518 | let newClaimPeriodHeight = claimResultTuple._5 | |
514 | 519 | let availableToClaimArray = claimResultTuple._6 | |
515 | 520 | let availablePriceAmountToClaim = availableToClaimArray[0] | |
516 | 521 | let availableIdoAmountToClaim = availableToClaimArray[1] | |
517 | 522 | let cfgArray = readConfigArray() | |
518 | 523 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
519 | 524 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
520 | 525 | let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalance) | |
521 | - | let $ | |
522 | - | let periodMinAvailableToClaim = $ | |
523 | - | let periodTotalAvailableToClaim = $ | |
524 | - | let periodUserAvailableToClaim = $ | |
525 | - | let totalUserAvailableToClaim = $ | |
526 | - | let usdtPriceAssetAllowableRatio = $ | |
527 | - | let currentUsdtPriceAssetRatio = $ | |
528 | - | let endPeriodBlocksLeft = $ | |
529 | - | let updatedCurrentPeriod = $ | |
530 | - | let periodStart = $ | |
531 | - | let periodEnd = $ | |
526 | + | let $t02777328185 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
527 | + | let periodMinAvailableToClaim = $t02777328185._1 | |
528 | + | let periodTotalAvailableToClaim = $t02777328185._2 | |
529 | + | let periodUserAvailableToClaim = $t02777328185._3 | |
530 | + | let totalUserAvailableToClaim = $t02777328185._4 | |
531 | + | let usdtPriceAssetAllowableRatio = $t02777328185._5 | |
532 | + | let currentUsdtPriceAssetRatio = $t02777328185._6 | |
533 | + | let endPeriodBlocksLeft = $t02777328185._7 | |
534 | + | let updatedCurrentPeriod = $t02777328185._8 | |
535 | + | let periodStart = $t02777328185._9 | |
536 | + | let periodEnd = $t02777328185._10 | |
532 | 537 | let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0) | |
533 | 538 | let decimals = value(assetInfo(fromBase58String(claimedAssetId58))).decimals | |
534 | 539 | let resultString = if ((height > currentPeriodEndHeight)) | |
535 | 540 | then { | |
536 | 541 | let periodLenght = value(getInteger(keyPeriodLength())) | |
537 | 542 | let userPeriodAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
538 | 543 | let totalPeriodAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58))) | |
539 | 544 | makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(userPeriodAllowance), toString(totalPeriodAllowance), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(periodLenght), toString(outAmount), toString(periodMinAvailableToClaim), toString(periodUserAvailableToClaim), toString(decimals)], SEP) | |
540 | 545 | } | |
541 | 546 | else makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft), toString(outAmount), toString(periodMinAvailableToClaim), toString(periodUserAvailableToClaim), toString(decimals)], SEP) | |
542 | 547 | $Tuple2(nil, resultString) | |
543 | 548 | } | |
544 | 549 | ||
545 | 550 | ||
546 | 551 | ||
547 | 552 | @Callable(i) | |
548 | 553 | func setManager (pendingManagerPublicKey) = { | |
549 | 554 | let checkCaller = mustManager(i) | |
550 | 555 | if ((checkCaller == checkCaller)) | |
551 | 556 | then { | |
552 | 557 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
553 | 558 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
554 | 559 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
555 | 560 | else throw("Strict value is not equal to itself.") | |
556 | 561 | } | |
557 | 562 | else throw("Strict value is not equal to itself.") | |
558 | 563 | } | |
559 | 564 | ||
560 | 565 | ||
561 | 566 | ||
562 | 567 | @Callable(i) | |
563 | 568 | func confirmManager () = { | |
564 | 569 | let pm = pendingManagerPublicKeyOrUnit() | |
565 | 570 | let hasPM = if (isDefined(pm)) | |
566 | 571 | then true | |
567 | 572 | else throw("No pending manager") | |
568 | 573 | if ((hasPM == hasPM)) | |
569 | 574 | then { | |
570 | 575 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
571 | 576 | then true | |
572 | 577 | else throw("You are not pending manager") | |
573 | 578 | if ((checkPM == checkPM)) | |
574 | 579 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
575 | 580 | else throw("Strict value is not equal to itself.") | |
576 | 581 | } | |
577 | 582 | else throw("Strict value is not equal to itself.") | |
578 | 583 | } | |
579 | 584 | ||
580 | 585 | ||
581 | 586 | @Verifier(tx) | |
582 | 587 | func verify () = { | |
583 | 588 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
584 | 589 | case pk: ByteVector => | |
585 | 590 | pk | |
586 | 591 | case _: Unit => | |
587 | 592 | tx.senderPublicKey | |
588 | 593 | case _ => | |
589 | 594 | throw("Match error") | |
590 | 595 | } | |
591 | 596 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
592 | 597 | } | |
593 | 598 |
github/deemru/w8io/026f985 64.76 ms ◑