tx · 8T3pQizPopR5HWmexTvMCKAfQoMPGH3JzPd2wgqUJ1oH 3N7ZLGaqmnn1SL3ednj9YxuS7RUuM1uutDY: -0.02700000 Waves 2022.11.03 23:13 [2301386] smart account 3N7ZLGaqmnn1SL3ednj9YxuS7RUuM1uutDY > SELF 0.00000000 Waves
{ "type": 13, "id": "8T3pQizPopR5HWmexTvMCKAfQoMPGH3JzPd2wgqUJ1oH", "fee": 2700000, "feeAssetId": null, "timestamp": 1667506411117, "version": 1, "sender": "3N7ZLGaqmnn1SL3ednj9YxuS7RUuM1uutDY", "senderPublicKey": "H2pZpkPFhw2dBhpXkmx3e6baw4oTiBEHm4u4AVWA6zC5", "proofs": [ "2vdY6Ui4JYST6LwwnRTXyCNanEjHH2KevGmehKBatXwuJPmCunGVtDm1hwY5QU77VB2aWB5cdwptwiKSBYuqHh6C" ], "script": "base64:AAIFAAAAAAAAD0kIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJZHhDZmdQcmljZUF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mNpAQAAAA5jb25maXJtTWFuYWdlcgAAAAAEAAAAAmNXCQEAAAACY2cAAAAABAAAAAJjWAMJAQAAAAlpc0RlZmluZWQAAAABBQAAAAJjVwYJAAACAAAAAQIAAAASTm8gcGVuZGluZyBtYW5hZ2VyAwkAAAAAAAACBQAAAAJjWAUAAAACY1gEAAAAAmNZAwkAAAAAAAACCAUAAAACY2kAAAAPY2FsbGVyUHVibGljS2V5CQEAAAAFdmFsdWUAAAABBQAAAAJjVwYJAAACAAAAAQIAAAAbWW91IGFyZSBub3QgcGVuZGluZyBtYW5hZ2VyAwkAAAAAAAACBQAAAAJjWQUAAAACY1kJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAAAmFCAAAAAAkAAlgAAAABCQEAAAAFdmFsdWUAAAABBQAAAAJjVwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAACYUMAAAAABQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACY1oBAAAAAmRhAAAAAAQAAAACZGIEAAAAAmNlCQEAAAACY2QAAAAAAwkAAAEAAAACBQAAAAJjZQIAAAAKQnl0ZVZlY3RvcgQAAAACY2sFAAAAAmNlBQAAAAJjawMJAAABAAAAAgUAAAACY2UCAAAABFVuaXQIBQAAAAJjWgAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAmNaAAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACY1oAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAJkYtjkJFE=", "chainId": 84, "height": 2301386, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7xAgvMd9FLFPjggnwdkJ12VDB8W5n5eBWJV3nHd4HWbW Next: BmnHHAnwCvCjtLxumXemsHgaroU11A17LCkkWyf9P22r Diff:
Old | New | Differences | |
---|---|---|---|
302 | 302 | then { | |
303 | 303 | let getOneTknV2FeeAmount = $t01518315401._2 | |
304 | 304 | let usdtAmount = $t01518315401._1 | |
305 | - | let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, | |
305 | + | let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, scale8, usdtAmount) | |
306 | 306 | let err = throw(makeString([toString(putOneTknV2PriceAssetAmount), toString(usdtAmount), toString(currentUsdtPriceAssetRatio)], SEP)) | |
307 | 307 | if ((err == err)) | |
308 | 308 | then { |
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,priceAssetBalance) = { | |
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 cfgArray = readConfigArray() | |
164 | 164 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
165 | 165 | let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals | |
166 | 166 | let priceAssetBalancePriceAssetDecimals = fraction(priceAssetBalance, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN)) | |
167 | 167 | let newClaimedPriceAssetAmount = ((claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement]) - priceAssetBalance) | |
168 | 168 | let newClaimedIdoAssetAmount = ((claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement]) + priceAssetBalancePriceAssetDecimals) | |
169 | 169 | if ((0 > newRemainingAmount)) | |
170 | 170 | then throw("invalid math") | |
171 | 171 | else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight)) | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount)) | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount)) | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | func internalClaim (claimedAssetId58,userAddress,txId) = { | |
182 | 182 | let cfgArray = readConfigArray() | |
183 | 183 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
184 | 184 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
185 | 185 | let claimEnd = (claimStart + claimDuration) | |
186 | 186 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
187 | 187 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
188 | 188 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
189 | 189 | let idoAssetId = fromBase58String(idoAssetId58) | |
190 | 190 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
191 | 191 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
192 | 192 | let priceAssetId = fromBase58String(priceAssetId58) | |
193 | 193 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
194 | 194 | let userAddress58 = toString(userAddress) | |
195 | 195 | let origInvestArray = readInvestorArrayOrFail(userAddress58) | |
196 | 196 | let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount]) | |
197 | 197 | let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight]) | |
198 | 198 | let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP)) | |
199 | 199 | then claimStart | |
200 | 200 | else investLastClaimedHeightTMP | |
201 | 201 | let newClaimPeriodHeight = if ((height > claimEnd)) | |
202 | 202 | then claimEnd | |
203 | 203 | else if ((claimStart > height)) | |
204 | 204 | then claimStart | |
205 | 205 | else height | |
206 | 206 | let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight) | |
207 | 207 | let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration) | |
208 | 208 | let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult) | |
209 | 209 | let isUSDN = (claimedAssetId58 == priceAssetId58) | |
210 | 210 | let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false) | |
211 | 211 | let checks = [if (!(if (isUSDN) | |
212 | 212 | then isUSDNClaimDisabled | |
213 | 213 | else false)) | |
214 | 214 | then true | |
215 | 215 | else throw("USDN claim is disabled")] | |
216 | 216 | if ((checks == checks)) | |
217 | 217 | then if ((claimedAssetId58 == priceAssetId58)) | |
218 | 218 | then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount]) | |
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 $t01224314113 = 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 $t01250313208 = 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 = $t01250313208._1 | |
252 | 252 | let periodStart = $t01250313208._2 | |
253 | 253 | let periodEnd = $t01250313208._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 $t01346313845 = 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 = $t01346313845._1 | |
269 | 269 | let periodStart = $t01346313845._2 | |
270 | 270 | let periodEnd = $t01346313845._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 = $t01224314113._1 | |
275 | 275 | let periodStart = $t01224314113._2 | |
276 | 276 | let periodEnd = $t01224314113._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 $t01486815121 = { | |
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 (($t01486815121 == $t01486815121)) | |
290 | 290 | then { | |
291 | 291 | let bonus = $t01486815121._3 | |
292 | 292 | let feeAmount = $t01486815121._2 | |
293 | 293 | let lpAmount = $t01486815121._1 | |
294 | 294 | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
295 | 295 | let $t01518315401 = { | |
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 (($t01518315401 == $t01518315401)) | |
302 | 302 | then { | |
303 | 303 | let getOneTknV2FeeAmount = $t01518315401._2 | |
304 | 304 | let usdtAmount = $t01518315401._1 | |
305 | - | let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, | |
305 | + | let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, scale8, usdtAmount) | |
306 | 306 | let err = throw(makeString([toString(putOneTknV2PriceAssetAmount), toString(usdtAmount), toString(currentUsdtPriceAssetRatio)], SEP)) | |
307 | 307 | if ((err == err)) | |
308 | 308 | then { | |
309 | 309 | let endPeriodBlocksLeft = (periodEnd - height) | |
310 | 310 | $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd) | |
311 | 311 | } | |
312 | 312 | else throw("Strict value is not equal to itself.") | |
313 | 313 | } | |
314 | 314 | else throw("Strict value is not equal to itself.") | |
315 | 315 | } | |
316 | 316 | else throw("Strict value is not equal to itself.") | |
317 | 317 | } | |
318 | 318 | ||
319 | 319 | ||
320 | 320 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
321 | 321 | case s: String => | |
322 | 322 | fromBase58String(s) | |
323 | 323 | case _: Unit => | |
324 | 324 | unit | |
325 | 325 | case _ => | |
326 | 326 | throw("Match error") | |
327 | 327 | } | |
328 | 328 | ||
329 | 329 | ||
330 | 330 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
331 | 331 | case s: String => | |
332 | 332 | fromBase58String(s) | |
333 | 333 | case _: Unit => | |
334 | 334 | unit | |
335 | 335 | case _ => | |
336 | 336 | throw("Match error") | |
337 | 337 | } | |
338 | 338 | ||
339 | 339 | ||
340 | 340 | func mustManager (i) = { | |
341 | 341 | let pd = throw("Permission denied") | |
342 | 342 | match managerPublicKeyOrUnit() { | |
343 | 343 | case pk: ByteVector => | |
344 | 344 | if ((i.callerPublicKey == pk)) | |
345 | 345 | then true | |
346 | 346 | else pd | |
347 | 347 | case _: Unit => | |
348 | 348 | if ((i.caller == this)) | |
349 | 349 | then true | |
350 | 350 | else pd | |
351 | 351 | case _ => | |
352 | 352 | throw("Match error") | |
353 | 353 | } | |
354 | 354 | } | |
355 | 355 | ||
356 | 356 | ||
357 | 357 | @Callable(i) | |
358 | 358 | func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = { | |
359 | 359 | let priceMult = ((100 * 1000) * 1000) | |
360 | 360 | let idoEnd = (idoStart + idoDuration) | |
361 | 361 | if (isDefined(getString(keyConfig()))) | |
362 | 362 | then throw("already initialized") | |
363 | 363 | else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller))) | |
364 | 364 | then throw("not authorized") | |
365 | 365 | else if ((size(i.payments) != 1)) | |
366 | 366 | then throw("exactly 1 payment must be attached") | |
367 | 367 | else if ((idoEnd >= claimStart)) | |
368 | 368 | then throw("claimStart must be greater than idoEnd") | |
369 | 369 | else { | |
370 | 370 | let pmt = value(i.payments[0]) | |
371 | 371 | let idoAssetId = value(pmt.assetId) | |
372 | 372 | let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info") | |
373 | 373 | let idoAssetId58 = toBase58String(idoAssetId) | |
374 | 374 | let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN) | |
375 | 375 | let priceAssetId = fromBase58String(priceAssetId58) | |
376 | 376 | let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info") | |
377 | 377 | let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN) | |
378 | 378 | let origTotalsArray = readTotalsArrayOrDefault() | |
379 | 379 | let totalsDiff = [0, 0, 0, 0] | |
380 | 380 | [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart, 0)] | |
381 | 381 | } | |
382 | 382 | } | |
383 | 383 | ||
384 | 384 | ||
385 | 385 | ||
386 | 386 | @Callable(i) | |
387 | 387 | func invest () = { | |
388 | 388 | let cfgArray = readConfigArray() | |
389 | 389 | let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart]) | |
390 | 390 | let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration]) | |
391 | 391 | let idoEnd = (idoStart + idoDuration) | |
392 | 392 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
393 | 393 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
394 | 394 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
395 | 395 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
396 | 396 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
397 | 397 | let idoAssetId = fromBase58String(idoAssetId58) | |
398 | 398 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
399 | 399 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
400 | 400 | let priceAssetId = fromBase58String(priceAssetId58) | |
401 | 401 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
402 | 402 | let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount]) | |
403 | 403 | let userAddress = toString(i.caller) | |
404 | 404 | if ((idoStart > height)) | |
405 | 405 | then throw("ido has not been started yet") | |
406 | 406 | else if ((height > idoEnd)) | |
407 | 407 | then throw("ido has been already ended") | |
408 | 408 | else if ((size(i.payments) != 1)) | |
409 | 409 | then throw("exactly 1 payment is expected") | |
410 | 410 | else { | |
411 | 411 | let pmt = value(i.payments[0]) | |
412 | 412 | let pmtAssetId = value(pmt.assetId) | |
413 | 413 | let pmtAmount = pmt.amount | |
414 | 414 | if ((pmtAssetId != priceAssetId)) | |
415 | 415 | then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected")) | |
416 | 416 | else { | |
417 | 417 | let origInvestorArray = readInvestorArrayOrDefault(userAddress) | |
418 | 418 | let origTotalsArray = readTotalsArrayOrDefault() | |
419 | 419 | let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount) | |
420 | 420 | let requiredIdoAssetAmount = (newPriceTotalAmount * 100) | |
421 | 421 | if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId))) | |
422 | 422 | then throw("IDO asset has been - sold consider to use smaller payment") | |
423 | 423 | else { | |
424 | 424 | let totalsDiff = [pmtAmount, pmtAmount, 0, 0] | |
425 | 425 | [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart, 0), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart, 0), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)] | |
426 | 426 | } | |
427 | 427 | } | |
428 | 428 | } | |
429 | 429 | } | |
430 | 430 | ||
431 | 431 | ||
432 | 432 | ||
433 | 433 | @Callable(i) | |
434 | 434 | func claim (claimedAssetId58,userAddress58) = { | |
435 | 435 | let callerAddress58 = toString(i.caller) | |
436 | 436 | if ((userAddress58 != callerAddress58)) | |
437 | 437 | then throw("not authorized") | |
438 | 438 | else { | |
439 | 439 | let cfgArray = readConfigArray() | |
440 | 440 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
441 | 441 | let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId) | |
442 | 442 | let totalsDiff = claimResultTuple._1 | |
443 | 443 | let outAmount = claimResultTuple._2 | |
444 | 444 | let outAssetId = claimResultTuple._3 | |
445 | 445 | let origInvestArray = claimResultTuple._4 | |
446 | 446 | let newClaimPeriodHeight = claimResultTuple._5 | |
447 | 447 | let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement] | |
448 | 448 | let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement] | |
449 | 449 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
450 | 450 | let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals | |
451 | 451 | let entries = if ((claimedAssetId58 == priceAssetId58)) | |
452 | 452 | then { | |
453 | 453 | let $t02140821852 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
454 | 454 | let periodMinAvailableToClaim = $t02140821852._1 | |
455 | 455 | let periodTotalAvailableToClaim = $t02140821852._2 | |
456 | 456 | let periodUserAvailableToClaim = $t02140821852._3 | |
457 | 457 | let totalUserAvailableToClaim = $t02140821852._4 | |
458 | 458 | let usdtPriceAssetAllowableRatio = $t02140821852._5 | |
459 | 459 | let currentUsdtPriceAssetRatio = $t02140821852._6 | |
460 | 460 | let endPeriodBlocksLeft = $t02140821852._7 | |
461 | 461 | let updatedCurrentPeriod = $t02140821852._8 | |
462 | 462 | let periodStart = $t02140821852._9 | |
463 | 463 | let periodEnd = $t02140821852._10 | |
464 | 464 | let checks = [if ((periodUserAvailableToClaim > 0)) | |
465 | 465 | then true | |
466 | 466 | else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0)) | |
467 | 467 | then true | |
468 | 468 | else throwErr("unavailable to claim because total period allowance reached"), if ((periodMinAvailableToClaim > 0)) | |
469 | 469 | then true | |
470 | 470 | else throwErr("nothing to claim"), if ((usdtPriceAssetAllowableRatio > currentUsdtPriceAssetRatio)) | |
471 | 471 | then true | |
472 | 472 | else throwErr("unavailable to claim because usdn price lower than usdtPriceAssetAllowableRatio")] | |
473 | 473 | if ((checks == checks)) | |
474 | 474 | then { | |
475 | 475 | let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim) | |
476 | 476 | let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim) | |
477 | 477 | let entries = if ((priceAssetBalance >= periodMinAvailableToClaim)) | |
478 | 478 | then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))] | |
479 | 479 | else { | |
480 | 480 | let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim) | |
481 | 481 | [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight, 0), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight, 0), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)] | |
482 | 482 | } | |
483 | 483 | $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) | |
484 | 484 | } | |
485 | 485 | else throw("Strict value is not equal to itself.") | |
486 | 486 | } | |
487 | 487 | else { | |
488 | 488 | let priceAssetBalanceIdoDecimals = fraction(priceAssetBalance, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN)) | |
489 | 489 | $Tuple2([ScriptTransfer(i.caller, (outAmount + priceAssetBalanceIdoDecimals), outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), 0), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight, priceAssetBalance), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight, priceAssetBalance), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, (claimedIdoAssetAmountFromDiff + priceAssetBalanceIdoDecimals), i.transactionId)], unit) | |
490 | 490 | } | |
491 | 491 | entries | |
492 | 492 | } | |
493 | 493 | } | |
494 | 494 | ||
495 | 495 | ||
496 | 496 | ||
497 | 497 | @Callable(i) | |
498 | 498 | func claimREADONLY (claimedAssetId58,userAddress58) = { | |
499 | 499 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
500 | 500 | let totalsDiff = claimResultTuple._1 | |
501 | 501 | let outAmount = claimResultTuple._2 | |
502 | 502 | let outAssetId = claimResultTuple._3 | |
503 | 503 | let origInvestArray = claimResultTuple._4 | |
504 | 504 | let newClaimPeriodHeight = claimResultTuple._5 | |
505 | 505 | let availableToClaimArray = claimResultTuple._6 | |
506 | 506 | let availablePriceAmountToClaim = availableToClaimArray[0] | |
507 | 507 | let availableIdoAmountToClaim = availableToClaimArray[1] | |
508 | 508 | $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP)) | |
509 | 509 | } | |
510 | 510 | ||
511 | 511 | ||
512 | 512 | ||
513 | 513 | @Callable(i) | |
514 | 514 | func claimV2READONLY (claimedAssetId58,userAddress58) = { | |
515 | 515 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
516 | 516 | let totalsDiff = claimResultTuple._1 | |
517 | 517 | let outAmount = claimResultTuple._2 | |
518 | 518 | let outAssetId = claimResultTuple._3 | |
519 | 519 | let origInvestArray = claimResultTuple._4 | |
520 | 520 | let newClaimPeriodHeight = claimResultTuple._5 | |
521 | 521 | let availableToClaimArray = claimResultTuple._6 | |
522 | 522 | let availablePriceAmountToClaim = availableToClaimArray[0] | |
523 | 523 | let availableIdoAmountToClaim = availableToClaimArray[1] | |
524 | 524 | let cfgArray = readConfigArray() | |
525 | 525 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
526 | 526 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
527 | 527 | let priceAssetBalanceIdoDecimals = (priceAssetBalance * 100) | |
528 | 528 | let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalanceIdoDecimals) | |
529 | 529 | let $t02814528557 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
530 | 530 | let periodMinAvailableToClaim = $t02814528557._1 | |
531 | 531 | let periodTotalAvailableToClaim = $t02814528557._2 | |
532 | 532 | let periodUserAvailableToClaim = $t02814528557._3 | |
533 | 533 | let totalUserAvailableToClaim = $t02814528557._4 | |
534 | 534 | let usdtPriceAssetAllowableRatio = $t02814528557._5 | |
535 | 535 | let currentUsdtPriceAssetRatio = $t02814528557._6 | |
536 | 536 | let endPeriodBlocksLeft = $t02814528557._7 | |
537 | 537 | let updatedCurrentPeriod = $t02814528557._8 | |
538 | 538 | let periodStart = $t02814528557._9 | |
539 | 539 | let periodEnd = $t02814528557._10 | |
540 | 540 | let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0) | |
541 | 541 | let userTotalPriceAssetClaimed = (parseIntValue(readInvestorArrayOrFail(userAddress58)[IdxInvClaimedPriceAssetAmount]) - priceAssetBalance) | |
542 | 542 | let resultString = if ((height > currentPeriodEndHeight)) | |
543 | 543 | then { | |
544 | 544 | let periodLenght = value(getInteger(keyPeriodLength())) | |
545 | 545 | let userPeriodAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
546 | 546 | let totalPeriodAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58))) | |
547 | 547 | makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(userPeriodAllowance), toString(totalPeriodAllowance), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(periodLenght), toString(userTotalPriceAssetClaimed)], SEP) | |
548 | 548 | } | |
549 | 549 | else makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft), toString(userTotalPriceAssetClaimed)], SEP) | |
550 | 550 | $Tuple2(nil, resultString) | |
551 | 551 | } | |
552 | 552 | ||
553 | 553 | ||
554 | 554 | ||
555 | 555 | @Callable(i) | |
556 | 556 | func setManager (pendingManagerPublicKey) = { | |
557 | 557 | let checkCaller = mustManager(i) | |
558 | 558 | if ((checkCaller == checkCaller)) | |
559 | 559 | then { | |
560 | 560 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
561 | 561 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
562 | 562 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
563 | 563 | else throw("Strict value is not equal to itself.") | |
564 | 564 | } | |
565 | 565 | else throw("Strict value is not equal to itself.") | |
566 | 566 | } | |
567 | 567 | ||
568 | 568 | ||
569 | 569 | ||
570 | 570 | @Callable(i) | |
571 | 571 | func confirmManager () = { | |
572 | 572 | let pm = pendingManagerPublicKeyOrUnit() | |
573 | 573 | let hasPM = if (isDefined(pm)) | |
574 | 574 | then true | |
575 | 575 | else throw("No pending manager") | |
576 | 576 | if ((hasPM == hasPM)) | |
577 | 577 | then { | |
578 | 578 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
579 | 579 | then true | |
580 | 580 | else throw("You are not pending manager") | |
581 | 581 | if ((checkPM == checkPM)) | |
582 | 582 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
583 | 583 | else throw("Strict value is not equal to itself.") | |
584 | 584 | } | |
585 | 585 | else throw("Strict value is not equal to itself.") | |
586 | 586 | } | |
587 | 587 | ||
588 | 588 | ||
589 | 589 | @Verifier(tx) | |
590 | 590 | func verify () = { | |
591 | 591 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
592 | 592 | case pk: ByteVector => | |
593 | 593 | pk | |
594 | 594 | case _: Unit => | |
595 | 595 | tx.senderPublicKey | |
596 | 596 | case _ => | |
597 | 597 | throw("Match error") | |
598 | 598 | } | |
599 | 599 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
600 | 600 | } | |
601 | 601 |
github/deemru/w8io/026f985 63.81 ms ◑