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