tx · HU2Hx4AZUzAG3iikZrfwy99VKtxEXNQz6TW5edU9HD8S 3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv: -0.02600000 Waves 2022.11.03 14:47 [2300896] smart account 3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv > SELF 0.00000000 Waves
{ "type": 13, "id": "HU2Hx4AZUzAG3iikZrfwy99VKtxEXNQz6TW5edU9HD8S", "fee": 2600000, "feeAssetId": null, "timestamp": 1667476046295, "version": 1, "sender": "3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv", "senderPublicKey": "39YkRD2qWXTcdNBr4CbDnm8g8SAB2FKVaDeGYahcFHHx", "proofs": [ "4bARo6QeVQuEwA1HzJXnWNu84m3Q6f1rauLLw32Tdj4QKC2ZwtvqMH6YTCc9vLJUj81STLXmLjKnaGzR8PLa1zK1" ], "script": "base64:AAIFAAAAAAAADxIIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJZHhDZmdQcm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RlVmVjdG9yBAAAAAJjaAUAAAACY2IFAAAAAmNoAwkAAAEAAAACBQAAAAJjYgIAAAAEVW5pdAgFAAAAAmNXAAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACY1cAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJjVwAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAmNZxuWf6w==", "chainId": 84, "height": 2300896, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 79EcLi4WQfppDH6DPMN5tjT892Gxt6Ner66Rb5gjLnwR Next: CBMxEUaiQgSCNSRxeAMFSTyeg5hHuYWmC8M3DLrCs6T5 Diff:
Old | New | Differences | |
---|---|---|---|
531 | 531 | let periodLenght = value(getInteger(keyPeriodLength())) | |
532 | 532 | let userPeriodAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
533 | 533 | let totalPeriodAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58))) | |
534 | - | makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(userPeriodAllowance), toString(totalPeriodAllowance), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(periodLenght)], SEP) | |
534 | + | 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)], SEP) | |
535 | 535 | } | |
536 | - | else makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft)], SEP) | |
536 | + | 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)], SEP) | |
537 | 537 | $Tuple2(nil, resultString) | |
538 | 538 | } | |
539 | 539 |
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 $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount]) | |
215 | 215 | else if ((claimedAssetId58 == idoAssetId58)) | |
216 | 216 | then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount]) | |
217 | 217 | else throw(("unsupported assetId: " + claimedAssetId58)) | |
218 | 218 | else throw("Strict value is not equal to itself.") | |
219 | 219 | } | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | func internalClaimV2 (priceAssetId58,userAddress58,outAmount,totalUserAvailableToClaim) = { | |
223 | 223 | let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58))) | |
224 | 224 | let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
225 | 225 | let periodLength = value(getInteger(keyPeriodLength())) | |
226 | 226 | let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0) | |
227 | 227 | let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0))) | |
228 | 228 | let $t01183513705 = if ((currentPeriod > 0)) | |
229 | 229 | then { | |
230 | 230 | let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod))) | |
231 | 231 | let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod))) | |
232 | 232 | let $t01209512800 = if ((height > lastPeriodEndHeight)) | |
233 | 233 | then { | |
234 | 234 | let updatedCurrentPeriod = (currentPeriod + 1) | |
235 | 235 | let periodStart = if ((height > (lastPeriodEndHeight + periodLength))) | |
236 | 236 | then { | |
237 | 237 | let blocksToLastPeriodStart = ((height - lastPeriodEndHeight) % periodLength) | |
238 | 238 | if ((blocksToLastPeriodStart == 0)) | |
239 | 239 | then ((height - periodLength) + 1) | |
240 | 240 | else (height - blocksToLastPeriodStart) | |
241 | 241 | } | |
242 | 242 | else (lastPeriodEndHeight + 1) | |
243 | 243 | let periodEnd = ((periodStart + periodLength) - 1) | |
244 | 244 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
245 | 245 | } | |
246 | 246 | else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight) | |
247 | 247 | let updatedCurrentPeriod = $t01209512800._1 | |
248 | 248 | let periodStart = $t01209512800._2 | |
249 | 249 | let periodEnd = $t01209512800._3 | |
250 | 250 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
251 | 251 | } | |
252 | 252 | else if (zeroPeriodEndHeighIsDefined) | |
253 | 253 | then { | |
254 | 254 | let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0))) | |
255 | 255 | let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0))) | |
256 | 256 | let $t01305513437 = if ((height > zeroPeriodEndHeight)) | |
257 | 257 | then { | |
258 | 258 | let updatedCurrentPeriod = (currentPeriod + 1) | |
259 | 259 | let periodStart = (zeroPeriodEndHeight + 1) | |
260 | 260 | let periodEnd = ((periodStart + periodLength) - 1) | |
261 | 261 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
262 | 262 | } | |
263 | 263 | else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight) | |
264 | 264 | let updatedCurrentPeriod = $t01305513437._1 | |
265 | 265 | let periodStart = $t01305513437._2 | |
266 | 266 | let periodEnd = $t01305513437._3 | |
267 | 267 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
268 | 268 | } | |
269 | 269 | else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1))) | |
270 | 270 | let updatedCurrentPeriod = $t01183513705._1 | |
271 | 271 | let periodStart = $t01183513705._2 | |
272 | 272 | let periodEnd = $t01183513705._3 | |
273 | 273 | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance) | |
274 | 274 | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
275 | 275 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
276 | 276 | let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim]) | |
277 | 277 | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
278 | 278 | let putOneTknV2PriceAssetAmount = scale8 | |
279 | 279 | let $t01446014713 = { | |
280 | 280 | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
281 | 281 | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
282 | 282 | then @ | |
283 | 283 | else throw("Couldn't cast Any to (Int, Int, Int)") | |
284 | 284 | } | |
285 | 285 | if (($t01446014713 == $t01446014713)) | |
286 | 286 | then { | |
287 | 287 | let bonus = $t01446014713._3 | |
288 | 288 | let feeAmount = $t01446014713._2 | |
289 | 289 | let lpAmount = $t01446014713._1 | |
290 | 290 | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
291 | 291 | let $t01477514993 = { | |
292 | 292 | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
293 | 293 | if ($isInstanceOf(@, "(Int, Int)")) | |
294 | 294 | then @ | |
295 | 295 | else throw("Couldn't cast Any to (Int, Int)") | |
296 | 296 | } | |
297 | 297 | if (($t01477514993 == $t01477514993)) | |
298 | 298 | then { | |
299 | 299 | let getOneTknV2FeeAmount = $t01477514993._2 | |
300 | 300 | let usdtAmount = $t01477514993._1 | |
301 | 301 | let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8) | |
302 | 302 | let endPeriodBlocksLeft = (periodEnd - height) | |
303 | 303 | $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd) | |
304 | 304 | } | |
305 | 305 | else throw("Strict value is not equal to itself.") | |
306 | 306 | } | |
307 | 307 | else throw("Strict value is not equal to itself.") | |
308 | 308 | } | |
309 | 309 | ||
310 | 310 | ||
311 | 311 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
312 | 312 | case s: String => | |
313 | 313 | fromBase58String(s) | |
314 | 314 | case _: Unit => | |
315 | 315 | unit | |
316 | 316 | case _ => | |
317 | 317 | throw("Match error") | |
318 | 318 | } | |
319 | 319 | ||
320 | 320 | ||
321 | 321 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
322 | 322 | case s: String => | |
323 | 323 | fromBase58String(s) | |
324 | 324 | case _: Unit => | |
325 | 325 | unit | |
326 | 326 | case _ => | |
327 | 327 | throw("Match error") | |
328 | 328 | } | |
329 | 329 | ||
330 | 330 | ||
331 | 331 | func mustManager (i) = { | |
332 | 332 | let pd = throw("Permission denied") | |
333 | 333 | match managerPublicKeyOrUnit() { | |
334 | 334 | case pk: ByteVector => | |
335 | 335 | if ((i.callerPublicKey == pk)) | |
336 | 336 | then true | |
337 | 337 | else pd | |
338 | 338 | case _: Unit => | |
339 | 339 | if ((i.caller == this)) | |
340 | 340 | then true | |
341 | 341 | else pd | |
342 | 342 | case _ => | |
343 | 343 | throw("Match error") | |
344 | 344 | } | |
345 | 345 | } | |
346 | 346 | ||
347 | 347 | ||
348 | 348 | @Callable(i) | |
349 | 349 | func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = { | |
350 | 350 | let priceMult = ((100 * 1000) * 1000) | |
351 | 351 | let idoEnd = (idoStart + idoDuration) | |
352 | 352 | if (isDefined(getString(keyConfig()))) | |
353 | 353 | then throw("already initialized") | |
354 | 354 | else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller))) | |
355 | 355 | then throw("not authorized") | |
356 | 356 | else if ((size(i.payments) != 1)) | |
357 | 357 | then throw("exactly 1 payment must be attached") | |
358 | 358 | else if ((idoEnd >= claimStart)) | |
359 | 359 | then throw("claimStart must be greater than idoEnd") | |
360 | 360 | else { | |
361 | 361 | let pmt = value(i.payments[0]) | |
362 | 362 | let idoAssetId = value(pmt.assetId) | |
363 | 363 | let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info") | |
364 | 364 | let idoAssetId58 = toBase58String(idoAssetId) | |
365 | 365 | let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN) | |
366 | 366 | let priceAssetId = fromBase58String(priceAssetId58) | |
367 | 367 | let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info") | |
368 | 368 | let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN) | |
369 | 369 | let origTotalsArray = readTotalsArrayOrDefault() | |
370 | 370 | let totalsDiff = [0, 0, 0, 0] | |
371 | 371 | [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart)] | |
372 | 372 | } | |
373 | 373 | } | |
374 | 374 | ||
375 | 375 | ||
376 | 376 | ||
377 | 377 | @Callable(i) | |
378 | 378 | func invest () = { | |
379 | 379 | let cfgArray = readConfigArray() | |
380 | 380 | let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart]) | |
381 | 381 | let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration]) | |
382 | 382 | let idoEnd = (idoStart + idoDuration) | |
383 | 383 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
384 | 384 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
385 | 385 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
386 | 386 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
387 | 387 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
388 | 388 | let idoAssetId = fromBase58String(idoAssetId58) | |
389 | 389 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
390 | 390 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
391 | 391 | let priceAssetId = fromBase58String(priceAssetId58) | |
392 | 392 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
393 | 393 | let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount]) | |
394 | 394 | let userAddress = toString(i.caller) | |
395 | 395 | if ((idoStart > height)) | |
396 | 396 | then throw("ido has not been started yet") | |
397 | 397 | else if ((height > idoEnd)) | |
398 | 398 | then throw("ido has been already ended") | |
399 | 399 | else if ((size(i.payments) != 1)) | |
400 | 400 | then throw("exactly 1 payment is expected") | |
401 | 401 | else { | |
402 | 402 | let pmt = value(i.payments[0]) | |
403 | 403 | let pmtAssetId = value(pmt.assetId) | |
404 | 404 | let pmtAmount = pmt.amount | |
405 | 405 | if ((pmtAssetId != priceAssetId)) | |
406 | 406 | then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected")) | |
407 | 407 | else { | |
408 | 408 | let origInvestorArray = readInvestorArrayOrDefault(userAddress) | |
409 | 409 | let origTotalsArray = readTotalsArrayOrDefault() | |
410 | 410 | let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount) | |
411 | 411 | let requiredIdoAssetAmount = (newPriceTotalAmount * 100) | |
412 | 412 | if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId))) | |
413 | 413 | then throw("IDO asset has been - sold consider to use smaller payment") | |
414 | 414 | else { | |
415 | 415 | let totalsDiff = [pmtAmount, pmtAmount, 0, 0] | |
416 | 416 | [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)] | |
417 | 417 | } | |
418 | 418 | } | |
419 | 419 | } | |
420 | 420 | } | |
421 | 421 | ||
422 | 422 | ||
423 | 423 | ||
424 | 424 | @Callable(i) | |
425 | 425 | func claim (claimedAssetId58,userAddress58) = { | |
426 | 426 | let callerAddress58 = toString(i.caller) | |
427 | 427 | if ((userAddress58 != callerAddress58)) | |
428 | 428 | then throw("not authorized") | |
429 | 429 | else { | |
430 | 430 | let cfgArray = readConfigArray() | |
431 | 431 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
432 | 432 | let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId) | |
433 | 433 | let totalsDiff = claimResultTuple._1 | |
434 | 434 | let outAmount = claimResultTuple._2 | |
435 | 435 | let outAssetId = claimResultTuple._3 | |
436 | 436 | let origInvestArray = claimResultTuple._4 | |
437 | 437 | let newClaimPeriodHeight = claimResultTuple._5 | |
438 | 438 | let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement] | |
439 | 439 | let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement] | |
440 | 440 | let entries = if ((claimedAssetId58 == priceAssetId58)) | |
441 | 441 | then { | |
442 | 442 | let $t02064921093 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
443 | 443 | let periodMinAvailableToClaim = $t02064921093._1 | |
444 | 444 | let periodTotalAvailableToClaim = $t02064921093._2 | |
445 | 445 | let periodUserAvailableToClaim = $t02064921093._3 | |
446 | 446 | let totalUserAvailableToClaim = $t02064921093._4 | |
447 | 447 | let usdtPriceAssetAllowableRatio = $t02064921093._5 | |
448 | 448 | let currentUsdtPriceAssetRatio = $t02064921093._6 | |
449 | 449 | let endPeriodBlocksLeft = $t02064921093._7 | |
450 | 450 | let updatedCurrentPeriod = $t02064921093._8 | |
451 | 451 | let periodStart = $t02064921093._9 | |
452 | 452 | let periodEnd = $t02064921093._10 | |
453 | 453 | let checks = [if ((periodUserAvailableToClaim > 0)) | |
454 | 454 | then true | |
455 | 455 | else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0)) | |
456 | 456 | then true | |
457 | 457 | else throwErr("unavailable to claim because total period allowance reached"), if ((periodMinAvailableToClaim > 0)) | |
458 | 458 | then true | |
459 | 459 | else throwErr("nothing to claim"), if ((usdtPriceAssetAllowableRatio > currentUsdtPriceAssetRatio)) | |
460 | 460 | then true | |
461 | 461 | else throwErr("unavailable to claim because usdn price lower than usdtPriceAssetAllowableRatio")] | |
462 | 462 | if ((checks == checks)) | |
463 | 463 | then { | |
464 | 464 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
465 | 465 | let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim) | |
466 | 466 | let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim) | |
467 | 467 | let priceAssetDecimals = value(assetInfo(fromBase58String(claimedAssetId58))).decimals | |
468 | 468 | let periodMinAvailableToClaimPriceAssetDecimals = fraction(periodMinAvailableToClaim, pow(10, 0, priceAssetDecimals, 0, 0, DOWN), scale8) | |
469 | 469 | let entries = if ((priceAssetBalance >= periodMinAvailableToClaim)) | |
470 | 470 | then [ScriptTransfer(i.caller, periodMinAvailableToClaimPriceAssetDecimals, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))] | |
471 | 471 | else { | |
472 | 472 | let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim) | |
473 | 473 | [ScriptTransfer(i.caller, periodMinAvailableToClaimPriceAssetDecimals, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)] | |
474 | 474 | } | |
475 | 475 | $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) | |
476 | 476 | } | |
477 | 477 | else throw("Strict value is not equal to itself.") | |
478 | 478 | } | |
479 | 479 | 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) | |
480 | 480 | entries | |
481 | 481 | } | |
482 | 482 | } | |
483 | 483 | ||
484 | 484 | ||
485 | 485 | ||
486 | 486 | @Callable(i) | |
487 | 487 | func claimREADONLY (claimedAssetId58,userAddress58) = { | |
488 | 488 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
489 | 489 | let totalsDiff = claimResultTuple._1 | |
490 | 490 | let outAmount = claimResultTuple._2 | |
491 | 491 | let outAssetId = claimResultTuple._3 | |
492 | 492 | let origInvestArray = claimResultTuple._4 | |
493 | 493 | let newClaimPeriodHeight = claimResultTuple._5 | |
494 | 494 | let availableToClaimArray = claimResultTuple._6 | |
495 | 495 | let availablePriceAmountToClaim = availableToClaimArray[0] | |
496 | 496 | let availableIdoAmountToClaim = availableToClaimArray[1] | |
497 | 497 | $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP)) | |
498 | 498 | } | |
499 | 499 | ||
500 | 500 | ||
501 | 501 | ||
502 | 502 | @Callable(i) | |
503 | 503 | func claimV2READONLY (claimedAssetId58,userAddress58) = { | |
504 | 504 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
505 | 505 | let totalsDiff = claimResultTuple._1 | |
506 | 506 | let outAmount = claimResultTuple._2 | |
507 | 507 | let outAssetId = claimResultTuple._3 | |
508 | 508 | let origInvestArray = claimResultTuple._4 | |
509 | 509 | let newClaimPeriodHeight = claimResultTuple._5 | |
510 | 510 | let availableToClaimArray = claimResultTuple._6 | |
511 | 511 | let availablePriceAmountToClaim = availableToClaimArray[0] | |
512 | 512 | let availableIdoAmountToClaim = availableToClaimArray[1] | |
513 | 513 | let cfgArray = readConfigArray() | |
514 | 514 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
515 | 515 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
516 | 516 | let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalance) | |
517 | 517 | let $t02742227834 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
518 | 518 | let periodMinAvailableToClaim = $t02742227834._1 | |
519 | 519 | let periodTotalAvailableToClaim = $t02742227834._2 | |
520 | 520 | let periodUserAvailableToClaim = $t02742227834._3 | |
521 | 521 | let totalUserAvailableToClaim = $t02742227834._4 | |
522 | 522 | let usdtPriceAssetAllowableRatio = $t02742227834._5 | |
523 | 523 | let currentUsdtPriceAssetRatio = $t02742227834._6 | |
524 | 524 | let endPeriodBlocksLeft = $t02742227834._7 | |
525 | 525 | let updatedCurrentPeriod = $t02742227834._8 | |
526 | 526 | let periodStart = $t02742227834._9 | |
527 | 527 | let periodEnd = $t02742227834._10 | |
528 | 528 | let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0) | |
529 | 529 | let resultString = if ((height > currentPeriodEndHeight)) | |
530 | 530 | then { | |
531 | 531 | let periodLenght = value(getInteger(keyPeriodLength())) | |
532 | 532 | let userPeriodAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
533 | 533 | let totalPeriodAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58))) | |
534 | - | makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(userPeriodAllowance), toString(totalPeriodAllowance), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(periodLenght)], SEP) | |
534 | + | 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)], SEP) | |
535 | 535 | } | |
536 | - | else makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft)], SEP) | |
536 | + | 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)], SEP) | |
537 | 537 | $Tuple2(nil, resultString) | |
538 | 538 | } | |
539 | 539 | ||
540 | 540 | ||
541 | 541 | ||
542 | 542 | @Callable(i) | |
543 | 543 | func setManager (pendingManagerPublicKey) = { | |
544 | 544 | let checkCaller = mustManager(i) | |
545 | 545 | if ((checkCaller == checkCaller)) | |
546 | 546 | then { | |
547 | 547 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
548 | 548 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
549 | 549 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
550 | 550 | else throw("Strict value is not equal to itself.") | |
551 | 551 | } | |
552 | 552 | else throw("Strict value is not equal to itself.") | |
553 | 553 | } | |
554 | 554 | ||
555 | 555 | ||
556 | 556 | ||
557 | 557 | @Callable(i) | |
558 | 558 | func confirmManager () = { | |
559 | 559 | let pm = pendingManagerPublicKeyOrUnit() | |
560 | 560 | let hasPM = if (isDefined(pm)) | |
561 | 561 | then true | |
562 | 562 | else throw("No pending manager") | |
563 | 563 | if ((hasPM == hasPM)) | |
564 | 564 | then { | |
565 | 565 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
566 | 566 | then true | |
567 | 567 | else throw("You are not pending manager") | |
568 | 568 | if ((checkPM == checkPM)) | |
569 | 569 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
570 | 570 | else throw("Strict value is not equal to itself.") | |
571 | 571 | } | |
572 | 572 | else throw("Strict value is not equal to itself.") | |
573 | 573 | } | |
574 | 574 | ||
575 | 575 | ||
576 | 576 | @Verifier(tx) | |
577 | 577 | func verify () = { | |
578 | 578 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
579 | 579 | case pk: ByteVector => | |
580 | 580 | pk | |
581 | 581 | case _: Unit => | |
582 | 582 | tx.senderPublicKey | |
583 | 583 | case _ => | |
584 | 584 | throw("Match error") | |
585 | 585 | } | |
586 | 586 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
587 | 587 | } | |
588 | 588 |
github/deemru/w8io/026f985 103.67 ms ◑