tx · 2KFoyBoEN1QSqmexi7Z4j6PbkReDnfCcEBApjJYiFoHF 3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv: -0.02400000 Waves 2022.11.02 16:26 [2299549] smart account 3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv > SELF 0.00000000 Waves
{ "type": 13, "id": "2KFoyBoEN1QSqmexi7Z4j6PbkReDnfCcEBApjJYiFoHF", "fee": 2400000, "feeAssetId": null, "timestamp": 1667395668254, "version": 1, "sender": "3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv", "senderPublicKey": "39YkRD2qWXTcdNBr4CbDnm8g8SAB2FKVaDeGYahcFHHx", "proofs": [ "2AYyrxHbVBUHMueqh7Qg5sLirxmwRBAp9DoLxFBjsEhNxUjEZJwMW1pgdNmdsJKh3fxMcveFgSZxibGHi5qNwU11" ], "script": "base64:AAIFAAAAAAAADfwIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJZHhDZmdQcm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vIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJjSQEAAAACY0oAAAAABAAAAAJjSwQAAAACYm8JAQAAAAJiUwAAAAADCQAAAQAAAAIFAAAAAmJvAgAAAApCeXRlVmVjdG9yBAAAAAJiWQUAAAACYm8FAAAAAmJZAwkAAAEAAAACBQAAAAJibwIAAAAEVW5pdAgFAAAAAmNJAAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACY0kAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJjSQAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAmNLSHb+Gw==", "chainId": 84, "height": 2299549, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 323EnozLCPpZvFjr36yYGRNmqhJFwZPD8TsDfZ3ZZnsd Next: ZS1iqKrA77yiCHPZbuBfBNu8jVQzvGzjMZVcAxUHs7S Diff:
Old | New | Differences | |
---|---|---|---|
224 | 224 | let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
225 | 225 | let periodLength = value(getInteger(keyPeriodLength())) | |
226 | 226 | let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0) | |
227 | - | let $t01110111522 = if ((currentPeriod > 0)) | |
228 | - | then $Tuple2(value(getInteger(keyPeriodStartHeight((currentPeriod - 1)))), valueOrElse(getInteger(keyPeriodEndHeight((currentPeriod - 1))), (height + periodLength))) | |
229 | - | else $Tuple2(valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), (height + periodLength))) | |
230 | - | let periodStart = $t01110111522._1 | |
231 | - | let periodEnd = $t01110111522._2 | |
232 | - | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, currentPeriod)), totalPeriodPriceAssetAllowance) | |
233 | - | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, currentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
227 | + | let $t01110112019 = if ((currentPeriod > 0)) | |
228 | + | then { | |
229 | + | let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight((currentPeriod - 1)))) | |
230 | + | let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight((currentPeriod - 1)))) | |
231 | + | let $t01136911751 = if ((height > lastPeriodEndHeight)) | |
232 | + | then { | |
233 | + | let updatedCurrentPeriod = (currentPeriod + 1) | |
234 | + | let periodStart = (lastPeriodEndHeight + 1) | |
235 | + | let periodEnd = ((periodStart + periodLength) - 1) | |
236 | + | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
237 | + | } | |
238 | + | else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight) | |
239 | + | let updatedCurrentPeriod = $t01136911751._1 | |
240 | + | let periodStart = $t01136911751._2 | |
241 | + | let periodEnd = $t01136911751._3 | |
242 | + | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
243 | + | } | |
244 | + | else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1))) | |
245 | + | let updatedCurrentPeriod = $t01110112019._1 | |
246 | + | let periodStart = $t01110112019._2 | |
247 | + | let periodEnd = $t01110112019._3 | |
248 | + | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance) | |
249 | + | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
234 | 250 | let availableClaimingPriceAssetAmount = min([totalUserAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim]) | |
235 | 251 | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
236 | 252 | let putOneTknV2PriceAssetAmount = scale8 | |
237 | - | let $ | |
238 | - | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, | |
253 | + | let $t01268712940 = { | |
254 | + | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
239 | 255 | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
240 | 256 | then @ | |
241 | 257 | else throw("Couldn't cast Any to (Int, Int, Int)") | |
242 | 258 | } | |
243 | - | if (($ | |
259 | + | if (($t01268712940 == $t01268712940)) | |
244 | 260 | then { | |
245 | - | let bonus = $ | |
246 | - | let feeAmount = $ | |
247 | - | let lpAmount = $ | |
248 | - | let usdtAssetId = value( | |
249 | - | let $ | |
261 | + | let bonus = $t01268712940._3 | |
262 | + | let feeAmount = $t01268712940._2 | |
263 | + | let lpAmount = $t01268712940._1 | |
264 | + | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
265 | + | let $t01300213220 = { | |
250 | 266 | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
251 | 267 | if ($isInstanceOf(@, "(Int, Int)")) | |
252 | 268 | then @ | |
253 | 269 | else throw("Couldn't cast Any to (Int, Int)") | |
254 | 270 | } | |
255 | - | if (($ | |
271 | + | if (($t01300213220 == $t01300213220)) | |
256 | 272 | then { | |
257 | - | let getOneTknV2FeeAmount = $ | |
258 | - | let usdtAmount = $ | |
273 | + | let getOneTknV2FeeAmount = $t01300213220._2 | |
274 | + | let usdtAmount = $t01300213220._1 | |
259 | 275 | let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8) | |
260 | 276 | let endPeriodBlocksLeft = (periodEnd - height) | |
261 | 277 | if ((claimedAssetId58 == priceAssetId58)) | |
262 | - | then $Tuple6([0, -(availableClaimingPriceAssetAmount), availableClaimingPriceAssetAmount, 0], availableClaimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [ | |
278 | + | then $Tuple6([0, -(availableClaimingPriceAssetAmount), availableClaimingPriceAssetAmount, 0], availableClaimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [updatedCurrentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft]) | |
263 | 279 | else if ((claimedAssetId58 == idoAssetId58)) | |
264 | - | then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [ | |
280 | + | then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [updatedCurrentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft]) | |
265 | 281 | else throwErr(makeString(["unsupported assetId:", claimedAssetId58], " ")) | |
266 | 282 | } | |
267 | 283 | else throw("Strict value is not equal to itself.") |
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 keyManagerPublicKey () = "%s__managerPublicKey" | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func readConfigArray () = split(getStringOrFail(keyConfig()), SEP) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals()) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress)) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | let IdxDiffTotalIncrement = 0 | |
145 | 145 | ||
146 | 146 | let IdxDiffRemainingPriceAmountIncrement = 1 | |
147 | 147 | ||
148 | 148 | let IdxDiffClaimedPriceAmountIncrement = 2 | |
149 | 149 | ||
150 | 150 | let IdxDiffClaimedIdoAssetAmountIncrement = 3 | |
151 | 151 | ||
152 | 152 | func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight) = { | |
153 | 153 | let totalAmount = parseIntValue(origArray[IdxInvTotalAmount]) | |
154 | 154 | let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount]) | |
155 | 155 | let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount]) | |
156 | 156 | let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount]) | |
157 | 157 | let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight]) | |
158 | 158 | let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement]) | |
159 | 159 | let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement]) | |
160 | 160 | let newClaimedPriceAssetAmount = (claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement]) | |
161 | 161 | let newClaimedIdoAssetAmount = (claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement]) | |
162 | 162 | if ((0 > newRemainingAmount)) | |
163 | 163 | then throw("invalid math") | |
164 | 164 | else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight)) | |
165 | 165 | } | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount)) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount)) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func internalClaim (claimedAssetId58,userAddress,txId) = { | |
175 | 175 | let cfgArray = readConfigArray() | |
176 | 176 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
177 | 177 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
178 | 178 | let claimEnd = (claimStart + claimDuration) | |
179 | 179 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
180 | 180 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
181 | 181 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
182 | 182 | let idoAssetId = fromBase58String(idoAssetId58) | |
183 | 183 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
184 | 184 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
185 | 185 | let priceAssetId = fromBase58String(priceAssetId58) | |
186 | 186 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
187 | 187 | let userAddress58 = toString(userAddress) | |
188 | 188 | let origInvestArray = readInvestorArrayOrFail(userAddress58) | |
189 | 189 | let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount]) | |
190 | 190 | let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight]) | |
191 | 191 | let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP)) | |
192 | 192 | then claimStart | |
193 | 193 | else investLastClaimedHeightTMP | |
194 | 194 | let newClaimPeriodHeight = if ((height > claimEnd)) | |
195 | 195 | then claimEnd | |
196 | 196 | else if ((claimStart > height)) | |
197 | 197 | then claimStart | |
198 | 198 | else height | |
199 | 199 | let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight) | |
200 | 200 | let totalUserAvailableToClaim = fraction(investTotalAmount, claimingBlocks, claimDuration) | |
201 | 201 | let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(totalUserAvailableToClaim, priceAssetMult, price, priceMult, idoAssetMult) | |
202 | 202 | let isUSDN = (claimedAssetId58 == priceAssetId58) | |
203 | 203 | let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false) | |
204 | 204 | let isUSDNClaimEnded = match getInteger(keyUSDNClaimEndHeight()) { | |
205 | 205 | case end: Int => | |
206 | 206 | (height > end) | |
207 | 207 | case _: Unit => | |
208 | 208 | false | |
209 | 209 | case _ => | |
210 | 210 | throw("Match error") | |
211 | 211 | } | |
212 | 212 | let checks = [if (!(if (isUSDN) | |
213 | 213 | then isUSDNClaimDisabled | |
214 | 214 | else false)) | |
215 | 215 | then true | |
216 | 216 | else throwErr("USDN claim is disabled"), if (!(if (isUSDN) | |
217 | 217 | then isUSDNClaimEnded | |
218 | 218 | else false)) | |
219 | 219 | then true | |
220 | 220 | else throwErr("USDN claim is ended")] | |
221 | 221 | if ((checks == checks)) | |
222 | 222 | then { | |
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 | - | let $t01110111522 = if ((currentPeriod > 0)) | |
228 | - | then $Tuple2(value(getInteger(keyPeriodStartHeight((currentPeriod - 1)))), valueOrElse(getInteger(keyPeriodEndHeight((currentPeriod - 1))), (height + periodLength))) | |
229 | - | else $Tuple2(valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), (height + periodLength))) | |
230 | - | let periodStart = $t01110111522._1 | |
231 | - | let periodEnd = $t01110111522._2 | |
232 | - | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, currentPeriod)), totalPeriodPriceAssetAllowance) | |
233 | - | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, currentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
227 | + | let $t01110112019 = if ((currentPeriod > 0)) | |
228 | + | then { | |
229 | + | let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight((currentPeriod - 1)))) | |
230 | + | let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight((currentPeriod - 1)))) | |
231 | + | let $t01136911751 = if ((height > lastPeriodEndHeight)) | |
232 | + | then { | |
233 | + | let updatedCurrentPeriod = (currentPeriod + 1) | |
234 | + | let periodStart = (lastPeriodEndHeight + 1) | |
235 | + | let periodEnd = ((periodStart + periodLength) - 1) | |
236 | + | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
237 | + | } | |
238 | + | else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight) | |
239 | + | let updatedCurrentPeriod = $t01136911751._1 | |
240 | + | let periodStart = $t01136911751._2 | |
241 | + | let periodEnd = $t01136911751._3 | |
242 | + | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
243 | + | } | |
244 | + | else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1))) | |
245 | + | let updatedCurrentPeriod = $t01110112019._1 | |
246 | + | let periodStart = $t01110112019._2 | |
247 | + | let periodEnd = $t01110112019._3 | |
248 | + | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance) | |
249 | + | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
234 | 250 | let availableClaimingPriceAssetAmount = min([totalUserAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim]) | |
235 | 251 | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
236 | 252 | let putOneTknV2PriceAssetAmount = scale8 | |
237 | - | let $ | |
238 | - | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, | |
253 | + | let $t01268712940 = { | |
254 | + | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
239 | 255 | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
240 | 256 | then @ | |
241 | 257 | else throw("Couldn't cast Any to (Int, Int, Int)") | |
242 | 258 | } | |
243 | - | if (($ | |
259 | + | if (($t01268712940 == $t01268712940)) | |
244 | 260 | then { | |
245 | - | let bonus = $ | |
246 | - | let feeAmount = $ | |
247 | - | let lpAmount = $ | |
248 | - | let usdtAssetId = value( | |
249 | - | let $ | |
261 | + | let bonus = $t01268712940._3 | |
262 | + | let feeAmount = $t01268712940._2 | |
263 | + | let lpAmount = $t01268712940._1 | |
264 | + | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
265 | + | let $t01300213220 = { | |
250 | 266 | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
251 | 267 | if ($isInstanceOf(@, "(Int, Int)")) | |
252 | 268 | then @ | |
253 | 269 | else throw("Couldn't cast Any to (Int, Int)") | |
254 | 270 | } | |
255 | - | if (($ | |
271 | + | if (($t01300213220 == $t01300213220)) | |
256 | 272 | then { | |
257 | - | let getOneTknV2FeeAmount = $ | |
258 | - | let usdtAmount = $ | |
273 | + | let getOneTknV2FeeAmount = $t01300213220._2 | |
274 | + | let usdtAmount = $t01300213220._1 | |
259 | 275 | let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8) | |
260 | 276 | let endPeriodBlocksLeft = (periodEnd - height) | |
261 | 277 | if ((claimedAssetId58 == priceAssetId58)) | |
262 | - | then $Tuple6([0, -(availableClaimingPriceAssetAmount), availableClaimingPriceAssetAmount, 0], availableClaimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [ | |
278 | + | then $Tuple6([0, -(availableClaimingPriceAssetAmount), availableClaimingPriceAssetAmount, 0], availableClaimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [updatedCurrentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft]) | |
263 | 279 | else if ((claimedAssetId58 == idoAssetId58)) | |
264 | - | then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [ | |
280 | + | then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [updatedCurrentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft]) | |
265 | 281 | else throwErr(makeString(["unsupported assetId:", claimedAssetId58], " ")) | |
266 | 282 | } | |
267 | 283 | else throw("Strict value is not equal to itself.") | |
268 | 284 | } | |
269 | 285 | else throw("Strict value is not equal to itself.") | |
270 | 286 | } | |
271 | 287 | else throw("Strict value is not equal to itself.") | |
272 | 288 | } | |
273 | 289 | ||
274 | 290 | ||
275 | 291 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
276 | 292 | case s: String => | |
277 | 293 | fromBase58String(s) | |
278 | 294 | case _: Unit => | |
279 | 295 | unit | |
280 | 296 | case _ => | |
281 | 297 | throw("Match error") | |
282 | 298 | } | |
283 | 299 | ||
284 | 300 | ||
285 | 301 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
286 | 302 | case s: String => | |
287 | 303 | fromBase58String(s) | |
288 | 304 | case _: Unit => | |
289 | 305 | unit | |
290 | 306 | case _ => | |
291 | 307 | throw("Match error") | |
292 | 308 | } | |
293 | 309 | ||
294 | 310 | ||
295 | 311 | func mustManager (i) = { | |
296 | 312 | let pd = throw("Permission denied") | |
297 | 313 | match managerPublicKeyOrUnit() { | |
298 | 314 | case pk: ByteVector => | |
299 | 315 | if ((i.callerPublicKey == pk)) | |
300 | 316 | then true | |
301 | 317 | else pd | |
302 | 318 | case _: Unit => | |
303 | 319 | if ((i.caller == this)) | |
304 | 320 | then true | |
305 | 321 | else pd | |
306 | 322 | case _ => | |
307 | 323 | throw("Match error") | |
308 | 324 | } | |
309 | 325 | } | |
310 | 326 | ||
311 | 327 | ||
312 | 328 | @Callable(i) | |
313 | 329 | func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = { | |
314 | 330 | let priceMult = ((100 * 1000) * 1000) | |
315 | 331 | let idoEnd = (idoStart + idoDuration) | |
316 | 332 | if (isDefined(getString(keyConfig()))) | |
317 | 333 | then throw("already initialized") | |
318 | 334 | else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller))) | |
319 | 335 | then throw("not authorized") | |
320 | 336 | else if ((size(i.payments) != 1)) | |
321 | 337 | then throw("exactly 1 payment must be attached") | |
322 | 338 | else if ((idoEnd >= claimStart)) | |
323 | 339 | then throw("claimStart must be greater than idoEnd") | |
324 | 340 | else { | |
325 | 341 | let pmt = value(i.payments[0]) | |
326 | 342 | let idoAssetId = value(pmt.assetId) | |
327 | 343 | let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info") | |
328 | 344 | let idoAssetId58 = toBase58String(idoAssetId) | |
329 | 345 | let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN) | |
330 | 346 | let priceAssetId = fromBase58String(priceAssetId58) | |
331 | 347 | let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info") | |
332 | 348 | let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN) | |
333 | 349 | let origTotalsArray = readTotalsArrayOrDefault() | |
334 | 350 | let totalsDiff = [0, 0, 0, 0] | |
335 | 351 | [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart)] | |
336 | 352 | } | |
337 | 353 | } | |
338 | 354 | ||
339 | 355 | ||
340 | 356 | ||
341 | 357 | @Callable(i) | |
342 | 358 | func invest () = { | |
343 | 359 | let cfgArray = readConfigArray() | |
344 | 360 | let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart]) | |
345 | 361 | let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration]) | |
346 | 362 | let idoEnd = (idoStart + idoDuration) | |
347 | 363 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
348 | 364 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
349 | 365 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
350 | 366 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
351 | 367 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
352 | 368 | let idoAssetId = fromBase58String(idoAssetId58) | |
353 | 369 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
354 | 370 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
355 | 371 | let priceAssetId = fromBase58String(priceAssetId58) | |
356 | 372 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
357 | 373 | let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount]) | |
358 | 374 | let userAddress = toString(i.caller) | |
359 | 375 | if ((idoStart > height)) | |
360 | 376 | then throw("ido has not been started yet") | |
361 | 377 | else if ((height > idoEnd)) | |
362 | 378 | then throw("ido has been already ended") | |
363 | 379 | else if ((size(i.payments) != 1)) | |
364 | 380 | then throw("exactly 1 payment is expected") | |
365 | 381 | else { | |
366 | 382 | let pmt = value(i.payments[0]) | |
367 | 383 | let pmtAssetId = value(pmt.assetId) | |
368 | 384 | let pmtAmount = pmt.amount | |
369 | 385 | if ((pmtAssetId != priceAssetId)) | |
370 | 386 | then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected")) | |
371 | 387 | else { | |
372 | 388 | let origInvestorArray = readInvestorArrayOrDefault(userAddress) | |
373 | 389 | let origTotalsArray = readTotalsArrayOrDefault() | |
374 | 390 | let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount) | |
375 | 391 | let requiredIdoAssetAmount = (newPriceTotalAmount * 100) | |
376 | 392 | if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId))) | |
377 | 393 | then throw("IDO asset has been - sold consider to use smaller payment") | |
378 | 394 | else { | |
379 | 395 | let totalsDiff = [pmtAmount, pmtAmount, 0, 0] | |
380 | 396 | [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)] | |
381 | 397 | } | |
382 | 398 | } | |
383 | 399 | } | |
384 | 400 | } | |
385 | 401 | ||
386 | 402 | ||
387 | 403 | ||
388 | 404 | @Callable(i) | |
389 | 405 | func claim (claimedAssetId58,userAddress58) = { | |
390 | 406 | let callerAddress58 = toString(i.caller) | |
391 | 407 | if ((userAddress58 != callerAddress58)) | |
392 | 408 | then throwErr("not authorized") | |
393 | 409 | else { | |
394 | 410 | let priceAssetId = readConfigArray()[IdxCfgPriceAssetId] | |
395 | 411 | let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId) | |
396 | 412 | let totalsDiff = claimResultTuple._1 | |
397 | 413 | let outAmount = claimResultTuple._2 | |
398 | 414 | let outAssetId = claimResultTuple._3 | |
399 | 415 | let origInvestArray = claimResultTuple._4 | |
400 | 416 | let newClaimPeriodHeight = claimResultTuple._5 | |
401 | 417 | let availableToClaimArray = claimResultTuple._6 | |
402 | 418 | let currentPeriod = availableToClaimArray[0] | |
403 | 419 | let periodStart = availableToClaimArray[1] | |
404 | 420 | let periodEnd = availableToClaimArray[2] | |
405 | 421 | let totalUserAvailableToClaim = availableToClaimArray[3] | |
406 | 422 | let periodAvailableIdoAmountToClaim = availableToClaimArray[4] | |
407 | 423 | let periodAvailableUserPriceAmountToClaim = availableToClaimArray[5] | |
408 | 424 | let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[6] | |
409 | 425 | let usdtPriceAssetAllowableRatio = availableToClaimArray[7] | |
410 | 426 | let currentPriceAssetRatio = availableToClaimArray[8] | |
411 | 427 | let endPriodBlocksLeft = availableToClaimArray[9] | |
412 | 428 | let checks = [if (if ((totalUserAvailableToClaim > 0)) | |
413 | 429 | then true | |
414 | 430 | else (periodAvailableIdoAmountToClaim > 0)) | |
415 | 431 | then true | |
416 | 432 | else throwErr("nothing to claim"), if ((periodAvailableUserPriceAmountToClaim > 0)) | |
417 | 433 | then true | |
418 | 434 | else throwErr("unavailable to claim because user period allowance reached"), if ((periodAvailableTotalPriceAmountToClaim > 0)) | |
419 | 435 | then true | |
420 | 436 | else throwErr("unavailable to claim because total period allowance reached")] | |
421 | 437 | if ((checks == checks)) | |
422 | 438 | then { | |
423 | 439 | let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement] | |
424 | 440 | let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement] | |
425 | 441 | let updatedPeriodTotalAvailableToClaim = (periodAvailableTotalPriceAmountToClaim - claimedPriceAmountFromDiff) | |
426 | 442 | let updatedPeriodUserAvailableToClaim = (periodAvailableUserPriceAmountToClaim - claimedPriceAmountFromDiff) | |
427 | 443 | $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyCurrentPeriod(), currentPeriod), IntegerEntry(keyPeriodStartHeight(currentPeriod), periodStart), IntegerEntry(keyPeriodEndHeight(currentPeriod), periodEnd), IntegerEntry(keyPeriodTotalAvailableToClaim(priceAssetId, currentPeriod), updatedPeriodTotalAvailableToClaim), IntegerEntry(keyPeriodUserAvailableToClaim(priceAssetId, currentPeriod, userAddress58), updatedPeriodUserAvailableToClaim), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit) | |
428 | 444 | } | |
429 | 445 | else throw("Strict value is not equal to itself.") | |
430 | 446 | } | |
431 | 447 | } | |
432 | 448 | ||
433 | 449 | ||
434 | 450 | ||
435 | 451 | @Callable(i) | |
436 | 452 | func claimREADONLY (claimedAssetId58,userAddress58) = { | |
437 | 453 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
438 | 454 | let totalsDiff = claimResultTuple._1 | |
439 | 455 | let outAmount = claimResultTuple._2 | |
440 | 456 | let outAssetId = claimResultTuple._3 | |
441 | 457 | let origInvestArray = claimResultTuple._4 | |
442 | 458 | let newClaimPeriodHeight = claimResultTuple._5 | |
443 | 459 | let availableToClaimArray = claimResultTuple._6 | |
444 | 460 | let availableIdoAmountToClaim = availableToClaimArray[4] | |
445 | 461 | let availablePriceAmountToClaim = availableToClaimArray[5] | |
446 | 462 | $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP)) | |
447 | 463 | } | |
448 | 464 | ||
449 | 465 | ||
450 | 466 | ||
451 | 467 | @Callable(i) | |
452 | 468 | func claimV2READONLY (claimedAssetId58,userAddress58) = { | |
453 | 469 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
454 | 470 | let totalsDiff = claimResultTuple._1 | |
455 | 471 | let outAmount = claimResultTuple._2 | |
456 | 472 | let outAssetId = claimResultTuple._3 | |
457 | 473 | let origInvestArray = claimResultTuple._4 | |
458 | 474 | let newClaimPeriodHeight = claimResultTuple._5 | |
459 | 475 | let availableToClaimArray = claimResultTuple._6 | |
460 | 476 | let currentPeriod = availableToClaimArray[0] | |
461 | 477 | let periodStart = availableToClaimArray[1] | |
462 | 478 | let periodEnd = availableToClaimArray[2] | |
463 | 479 | let totalUserAvailableToClaim = availableToClaimArray[3] | |
464 | 480 | let periodAvailableIdoAmountToClaim = availableToClaimArray[4] | |
465 | 481 | let periodAvailableUserPriceAmountToClaim = availableToClaimArray[5] | |
466 | 482 | let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[6] | |
467 | 483 | let usdtPriceAssetAllowableRatio = availableToClaimArray[7] | |
468 | 484 | let currentPriceAssetRatio = availableToClaimArray[8] | |
469 | 485 | let endPriodBlocksLeft = availableToClaimArray[9] | |
470 | 486 | let resultString = makeString(["%d%d%d%d%d%d%d", toString(totalUserAvailableToClaim), toString(periodAvailableIdoAmountToClaim), toString(periodAvailableUserPriceAmountToClaim), toString(periodAvailableTotalPriceAmountToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentPriceAssetRatio), toString(endPriodBlocksLeft)], SEP) | |
471 | 487 | $Tuple2(nil, resultString) | |
472 | 488 | } | |
473 | 489 | ||
474 | 490 | ||
475 | 491 | ||
476 | 492 | @Callable(i) | |
477 | 493 | func setManager (pendingManagerPublicKey) = { | |
478 | 494 | let checkCaller = mustManager(i) | |
479 | 495 | if ((checkCaller == checkCaller)) | |
480 | 496 | then { | |
481 | 497 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
482 | 498 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
483 | 499 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
484 | 500 | else throw("Strict value is not equal to itself.") | |
485 | 501 | } | |
486 | 502 | else throw("Strict value is not equal to itself.") | |
487 | 503 | } | |
488 | 504 | ||
489 | 505 | ||
490 | 506 | ||
491 | 507 | @Callable(i) | |
492 | 508 | func confirmManager () = { | |
493 | 509 | let pm = pendingManagerPublicKeyOrUnit() | |
494 | 510 | let hasPM = if (isDefined(pm)) | |
495 | 511 | then true | |
496 | 512 | else throw("No pending manager") | |
497 | 513 | if ((hasPM == hasPM)) | |
498 | 514 | then { | |
499 | 515 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
500 | 516 | then true | |
501 | 517 | else throw("You are not pending manager") | |
502 | 518 | if ((checkPM == checkPM)) | |
503 | 519 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
504 | 520 | else throw("Strict value is not equal to itself.") | |
505 | 521 | } | |
506 | 522 | else throw("Strict value is not equal to itself.") | |
507 | 523 | } | |
508 | 524 | ||
509 | 525 | ||
510 | 526 | @Verifier(tx) | |
511 | 527 | func verify () = { | |
512 | 528 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
513 | 529 | case pk: ByteVector => | |
514 | 530 | pk | |
515 | 531 | case _: Unit => | |
516 | 532 | tx.senderPublicKey | |
517 | 533 | case _ => | |
518 | 534 | throw("Match error") | |
519 | 535 | } | |
520 | 536 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
521 | 537 | } | |
522 | 538 |
github/deemru/w8io/026f985 70.24 ms ◑