tx · 6pjRwXrrEcPcU2U94Ax2cuENuwahBQZwnd5F7Yo2DFz3 3NAkRz8VVS1aizMWiZ7Hxs3N9vrfhpR6579: -0.01400000 Waves 2021.04.12 18:24 [1479416] smart account 3NAkRz8VVS1aizMWiZ7Hxs3N9vrfhpR6579 > SELF 0.00000000 Waves
{ "type": 13, "id": "6pjRwXrrEcPcU2U94Ax2cuENuwahBQZwnd5F7Yo2DFz3", "fee": 1400000, "feeAssetId": null, "timestamp": 1618241147828, "version": 1, "sender": "3NAkRz8VVS1aizMWiZ7Hxs3N9vrfhpR6579", "senderPublicKey": "FfAdQadqxbreLcPRBWUwLEMjbdgTBwTq2VCwSD18LrG1", "proofs": [ "F3atJkFDNWDvxfWyjtqpqM3YSFgVveRWj1c6nbrtCxRXVE7yMQh2CoQxoZ8QRnSzjhyE5MZv4HP7Rp3nfZnC8C8" ], "script": "base64:AAIEAAAAAAAAADsIAhIQCg4ICAgBCAEBAQgBAQEBCBIDCgEBEgASABIFCgMICAgSBQoDCAgIEgMKAQgSBAoCCAESAwoBCAAAAE4AAAAAA1NFUAIAAAACX18BAAAAD2dldFN0cmluZ09yRmFpbAAAAAEAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5CQABLAAAAAICAAAAFU5vIGRhdGEgZm9yIHRoaXMua2V5PQUAAAADa2V5AQAAABBnZXRCb29sZWFuT3JGYWlsAAAAAQAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABBsAAAACBQAAAAR0aGlzBQAAAANrZXkJAAEsAAAAAgIAAAAVTm8gZGF0YSBmb3IgdGhpcy5rZXk9BQAAAANrZXkBAAAADGdldEludE9yRmFpbAAAAAEAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5CQABLAAAAAICAAAAFU5vIGRhdGEgZm9yIHRoa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WxhbmNlV0NPCQAETAAAAAIJAAGkAAAAAQUAAAANc2hhcmVFbWlzc2lvbgkABEwAAAACCQABpAAAAAEFAAAAGWN1cnJJdGVyVG90YWxJbkJhc2VBbW91bnQJAARMAAAAAgkAAaQAAAABBQAAABpjdXJySXRlclRvdGFsSW5TaGFyZUFtb3VudAkABEwAAAACCQABpAAAAAEFAAAAGHRvdGFsTG9ja2VkT3V0QmFzZUFtb3VudAkABEwAAAACCQABpAAAAAEFAAAAGXRvdGFsTG9ja2VkT3V0U2hhcmVBbW91bnQJAARMAAAAAgkAAaQAAAABBQAAABZkZWNpbWFsc011bHRCb3RoQXNzZXRzCQAETAAAAAIJAAGkAAAAAQUAAAAIcHJpY2VBVEgJAARMAAAAAgkAAaQAAAABBQAAABFwcmljZVJlY2FsY3VsYXRlZAkABEwAAAACCQABpAAAAAEFAAAADXRvcHVwTGFzdFRpbWUJAARMAAAAAgIAAAAXZW5kQ3VycmVudFN5c1BhcmFtc1JFU1QFAAAAA25pbAUAAAADU0VQCQAAAgAAAAEFAAAACHJlc3REYXRhAAAAAE0a1O4=", "chainId": 84, "height": 1479416, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Ejm9dCEZ8C5yuYQQ7q7LfCiRbvA9YtZSx1kpLsFbe3Eo Next: none Diff:
Old | New | Differences | |
---|---|---|---|
12 | 12 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), ("No data for this.key=" + key)) | |
13 | 13 | ||
14 | 14 | ||
15 | + | func IntE (key,val) = IntegerEntry(key, val) | |
16 | + | ||
17 | + | ||
18 | + | func StrE (key,val) = StringEntry(key, val) | |
19 | + | ||
20 | + | ||
15 | 21 | func failExecuteGet (msg,baseAssetStr,userAddressStr,submitTxIdStr,operationType) = throw(((((((((msg + ": baseAsset=") + baseAssetStr) + " userAddress=") + userAddressStr) + " submitTxId=") + submitTxIdStr) + " operation=") + operationType)) | |
16 | 22 | ||
17 | 23 | ||
19 | 25 | ||
20 | 26 | ||
21 | 27 | func failTopupManagerOnly (topupManagerAddress) = throw((("opertion denied: only topUpManager=" + topupManagerAddress) + " can send such transactions")) | |
28 | + | ||
29 | + | ||
30 | + | func failTopupMaxPriceDeviation (price,minAllowedPrice) = throw(((("topup is not allowed - max deviation from ATH price exceeds: newPrice=" + toString(price)) + " minAllowedPrice=") + toString(minAllowedPrice))) | |
22 | 31 | ||
23 | 32 | ||
24 | 33 | func convertShare2Base (shareAmount,price,priceMult) = fraction(shareAmount, price, priceMult) | |
33 | 42 | func keyNextInternalAssetId () = "%s__nextInternalAssetId" | |
34 | 43 | ||
35 | 44 | ||
36 | - | func keyPriceLast ( | |
45 | + | func keyPriceLast (innerBaseStr) = ("%s%s%d__price__last__" + innerBaseStr) | |
37 | 46 | ||
38 | 47 | ||
39 | - | func keyPriceATH ( | |
48 | + | func keyPriceATH (innerBaseStr) = ("%s%s%d__price__ath__" + innerBaseStr) | |
40 | 49 | ||
41 | 50 | ||
42 | - | func keyPriceByTopUpIdx ( | |
51 | + | func keyPriceByTopUpIdx (innerBaseStr,topUpIdx) = makeString(["%s%s%d%d__price__byTopUpIdx", innerBaseStr, toString(topUpIdx)], SEP) | |
43 | 52 | ||
44 | 53 | ||
45 | - | func keyPriceHistory ( | |
54 | + | func keyPriceHistory (innerBaseStr,h,timestamp) = makeString(["%s%s%d%d%d__price__history", innerBaseStr, toString(h), toString(timestamp)], SEP) | |
46 | 55 | ||
47 | 56 | ||
48 | - | func keyTotalLocked ( | |
57 | + | func keyTotalLocked (innerBaseStr) = ("%s%s%d__total__locked__" + innerBaseStr) | |
49 | 58 | ||
50 | 59 | ||
51 | - | func keyTotalLockedByUser ( | |
60 | + | func keyTotalLockedByUser (innerBaseStr,userAddressStr) = makeString(["%s%s%d%s__total__locked", innerBaseStr, userAddressStr], SEP) | |
52 | 61 | ||
53 | 62 | ||
54 | 63 | func keyMappingsInternal2baseAssetId (internalBaseAsset) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(internalBaseAsset)) | |
63 | 72 | func keyMappingsBaseAsset2shareId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2shareId__" + baseAssetStr) | |
64 | 73 | ||
65 | 74 | ||
66 | - | func keyShutdownSubmitOperation ( | |
75 | + | func keyShutdownSubmitOperation (innerBaseStr) = ("%s%s%d__shutdown__submit__" + innerBaseStr) | |
67 | 76 | ||
68 | 77 | ||
69 | - | func keyShutdownManager ( | |
78 | + | func keyShutdownManager (innerBaseStr) = ("%s%s%d__shutdown__manager__" + innerBaseStr) | |
70 | 79 | ||
71 | 80 | ||
72 | - | func keyTopUpCurrentIdx ( | |
81 | + | func keyTopUpCurrentIdx (innerBaseStr) = ("%s%s%d__topup__currentIdx__" + innerBaseStr) | |
73 | 82 | ||
74 | 83 | ||
75 | - | func keyTopUpLastHeight ( | |
84 | + | func keyTopUpLastHeight (innerBaseStr,sender) = makeString(["%s%s%s%d%s__topup__last__height", innerBaseStr, sender], SEP) | |
76 | 85 | ||
77 | 86 | ||
78 | - | func keyTopupMutext ( | |
87 | + | func keyTopupMutext (innerBaseStr) = ("%s%s%d__topup__mutex__" + innerBaseStr) | |
79 | 88 | ||
80 | 89 | ||
81 | - | func keyTopupLastTimestamp ( | |
90 | + | func keyTopupLastTimestamp (innerBaseStr) = ("%s%s%s%d__topup__last__timestamp__" + innerBaseStr) | |
82 | 91 | ||
83 | 92 | ||
84 | - | func keyTopupHistory ( | |
93 | + | func keyTopupHistory (innerBaseStr,topupIdx) = makeString(["%s%s%d%d__topup__history", innerBaseStr, toString(topupIdx)], SEP) | |
85 | 94 | ||
86 | 95 | ||
87 | - | func keyLimitsRemaining ( | |
96 | + | func keyLimitsRemaining (innerBaseStr) = ("%s%s%d__limits__remaining__" + innerBaseStr) | |
88 | 97 | ||
89 | 98 | ||
90 | 99 | let IdxCfgShareAssetId = 1 | |
113 | 122 | ||
114 | 123 | let IdxCfgAdminAddress = 13 | |
115 | 124 | ||
116 | - | func dataAssetCfg (shareAssetStr, | |
125 | + | func dataAssetCfg (shareAssetStr,innerBaseStr,decimalsMultBothAssets,decimalsMultPrice,getDelayInBlocks,topupIntervalInBlocks,topupMaxNegativePart,topupManagerAddress,submitLimitsBaseMax,submitLimitsBaseReset,submitLimitsShareMax,submitLimitsShareReset,adminAddress) = makeString(["%s%d%d%d%d%d%d%s%d%d%d%d", shareAssetStr, innerBaseStr, toString(decimalsMultBothAssets), toString(decimalsMultPrice), toString(getDelayInBlocks), toString(topupIntervalInBlocks), toString(topupMaxNegativePart), topupManagerAddress, toString(submitLimitsBaseMax), toString(submitLimitsBaseReset), toString(submitLimitsShareMax), toString(submitLimitsShareReset), adminAddress], SEP) | |
117 | 126 | ||
118 | 127 | ||
119 | 128 | let IdxTotalLockedInShare = 1 | |
136 | 145 | } | |
137 | 146 | ||
138 | 147 | ||
139 | - | func calcTotalLockedDiff (direction,operationType, | |
148 | + | func calcTotalLockedDiff (direction,operationType,innerBaseStr,price,priceMult,inAmount,baseAssetId,shareAssetId) = { | |
140 | 149 | let t = (direction + operationType) | |
150 | + | let emptyVect = fromBase58String("") | |
141 | 151 | if ((t == "submitP")) | |
142 | 152 | then { | |
143 | 153 | let totalDiff = dataTotalLockedInt(0, 0, inAmount, 0) | |
144 | 154 | let userDiff = totalDiff | |
145 | - | $ | |
155 | + | $Tuple5(totalDiff, userDiff, 0, emptyVect, false) | |
146 | 156 | } | |
147 | 157 | else if ((t == "submitG")) | |
148 | 158 | then { | |
149 | 159 | let totalDiff = dataTotalLockedInt(inAmount, 0, 0, 0) | |
150 | 160 | let userDiff = totalDiff | |
151 | - | $ | |
161 | + | $Tuple5(totalDiff, userDiff, 0, emptyVect, true) | |
152 | 162 | } | |
153 | 163 | else if ((t == "executeP")) | |
154 | 164 | then { | |
155 | 165 | let outAmount = convertBase2Share(inAmount, price, priceMult) | |
156 | 166 | let totalDiff = dataTotalLockedInt(0, 0, 0, outAmount) | |
157 | 167 | let userDiff = dataTotalLockedInt(0, 0, inAmount, 0) | |
158 | - | $ | |
168 | + | $Tuple5(totalDiff, userDiff, outAmount, shareAssetId, false) | |
159 | 169 | } | |
160 | 170 | else if ((t == "executeG")) | |
161 | 171 | then { | |
162 | 172 | let outAmount = convertShare2Base(inAmount, price, priceMult) | |
163 | 173 | let totalDiff = dataTotalLockedInt(0, outAmount, 0, 0) | |
164 | 174 | let userDiff = dataTotalLockedInt(inAmount, 0, 0, 0) | |
165 | - | $ | |
175 | + | $Tuple5(totalDiff, userDiff, outAmount, baseAssetId, false) | |
166 | 176 | } | |
167 | 177 | else if ((t == "topup")) | |
168 | 178 | then { | |
169 | - | let totalLockedArray = readTotalLocked(keyTotalLocked( | |
179 | + | let totalLockedArray = readTotalLocked(keyTotalLocked(innerBaseStr)) | |
170 | 180 | let totalLockedInBaseAmount = totalLockedArray[IdxTotalLockedInBase] | |
171 | 181 | let totalLockedInShareAmount = totalLockedArray[IdxTotalLockedInShare] | |
172 | 182 | let totalDiff = dataTotalLockedInt(totalLockedInShareAmount, (-1 * convertShare2Base(totalLockedInShareAmount, price, priceMult)), totalLockedInBaseAmount, (-1 * convertBase2Share(totalLockedInBaseAmount, price, priceMult))) | |
173 | - | $ | |
183 | + | $Tuple5(totalDiff, nil, 0, emptyVect, false) | |
174 | 184 | } | |
175 | 185 | else throw(("Unsupported Type " + t)) | |
176 | 186 | } | |
184 | 194 | else throw(("Unsupported action " + action)) | |
185 | 195 | ||
186 | 196 | let dataArray = readTotalLocked(key) | |
187 | - | | |
197 | + | StrE(key, dataTotalLocked(UPDATE(dataArray[IdxTotalLockedInShare], diff[IdxTotalLockedInShare]), UPDATE(dataArray[IdxTotalLockedOutBase], diff[IdxTotalLockedOutBase]), UPDATE(dataArray[IdxTotalLockedInBase], diff[IdxTotalLockedInBase]), UPDATE(dataArray[IdxTotalLockedOutShare], diff[IdxTotalLockedOutShare]))) | |
188 | 198 | } | |
189 | 199 | ||
190 | 200 | ||
191 | - | func keyOperation (operationType, | |
201 | + | func keyOperation (operationType,innerBaseStr,userAddress,txId) = makeString(["%s%d%s%s", operationType, innerBaseStr, userAddress, txId], SEP) | |
192 | 202 | ||
193 | 203 | ||
194 | 204 | let IdxOperStatus = 1 | |
228 | 238 | ||
229 | 239 | let IdxLimitsRemainingShare = 2 | |
230 | 240 | ||
231 | - | func RemainingLimitsStringEntry (key,baseRemainingLimit,shareRemainingLimit) = | |
241 | + | func RemainingLimitsStringEntry (key,baseRemainingLimit,shareRemainingLimit) = StrE(key, makeString(["%d%d", toString(baseRemainingLimit), toString(shareRemainingLimit)], SEP)) | |
232 | 242 | ||
233 | 243 | ||
234 | - | func TopupMutexIntEntry ( | |
244 | + | func TopupMutexIntEntry (innerBaseStr,acquiredHeight) = IntE(keyTopupMutext(innerBaseStr), acquiredHeight) | |
235 | 245 | ||
236 | 246 | ||
237 | - | func genericCalcPrice ( | |
238 | - | let totalLockedArray = readTotalLocked(keyTotalLocked( | |
247 | + | func genericCalcPrice (innerBaseStr,baseAssetId,topUpBaseAmount,shareAssetId,decimalsMultPrice) = { | |
248 | + | let totalLockedArray = readTotalLocked(keyTotalLocked(innerBaseStr)) | |
239 | 249 | let totalLockedOutBaseAmount = totalLockedArray[IdxTotalLockedOutBase] | |
240 | 250 | let currIterTotalInBaseAmount = totalLockedArray[IdxTotalLockedInBase] | |
241 | 251 | let baseAssetBalance = assetBalance(this, baseAssetId) | |
246 | 256 | if ((0 > baseAssetBalanceWCO)) | |
247 | 257 | then throw(((("baseAssetBalanceWco < 0: baseAssettBalance=" + toString(baseAssetBalance)) + " baseAssetBalanceWco=") + toString(baseAssetBalanceWCO))) | |
248 | 258 | else { | |
249 | - | let lastPrice = getIntOrFail(keyPriceLast( | |
259 | + | let lastPrice = getIntOrFail(keyPriceLast(innerBaseStr)) | |
250 | 260 | let price = if ((shareEmission == 0)) | |
251 | 261 | then lastPrice | |
252 | 262 | else fraction(baseAssetBalanceWCO, decimalsMultPrice, shareEmission) | |
255 | 265 | } | |
256 | 266 | ||
257 | 267 | ||
258 | - | func calcPrice ( | |
268 | + | func calcPrice (innerBaseStr,baseAssetId,shareAssetId,decimalsMultPrice) = genericCalcPrice(innerBaseStr, baseAssetId, 0, shareAssetId, decimalsMultPrice) | |
259 | 269 | ||
260 | 270 | ||
261 | 271 | func commonSubmit (operationType,i,inAmount,inAssetId,baseAssetStr) = { | |
266 | 276 | let shareAssetStr = cfgArray[IdxCfgShareAssetId] | |
267 | 277 | let shareAssetId = fromBase58String(shareAssetStr) | |
268 | 278 | let decimalsMultBothAssets = parseIntValue(cfgArray[IdxCfgDecimalsMultBothAssets]) | |
269 | - | let internalBaseAssetStr = cfgArray[IdxCfgInternalBaseAsset] | |
270 | - | let limitsKEY = keyLimitsRemaining(internalBaseAssetStr) | |
279 | + | let innerBaseStr = cfgArray[IdxCfgInternalBaseAsset] | |
280 | + | let getDelayBlocks = parseIntValue(cfgArray[IdxCfgGetDelayBlocks]) | |
281 | + | let limitsKEY = keyLimitsRemaining(innerBaseStr) | |
271 | 282 | let limitsCfgArray = split(getStringOrFail(limitsKEY), SEP) | |
272 | 283 | let limitsRemainingBase = parseIntValue(limitsCfgArray[IdxLimitsRemainingBase]) | |
273 | 284 | let limitsRemainingShare = parseIntValue(limitsCfgArray[IdxLimitsRemainingShare]) | |
274 | - | let isSubmitBlocked = valueOrElse(getBoolean(this, keyShutdownSubmitOperation( | |
285 | + | let isSubmitBlocked = valueOrElse(getBoolean(this, keyShutdownSubmitOperation(innerBaseStr)), false) | |
275 | 286 | if (isSubmitBlocked) | |
276 | 287 | then throw("submit operation is blocked") | |
277 | 288 | else { | |
278 | - | let operationsMutex = valueOrElse(getInteger(this, keyTopupMutext( | |
289 | + | let operationsMutex = valueOrElse(getInteger(this, keyTopupMutext(innerBaseStr)), 0) | |
279 | 290 | if (((operationsMutex + 60) > height)) | |
280 | 291 | then throw("submit operations are blocked by topup manager") | |
281 | 292 | else { | |
282 | - | let diffTuple = calcTotalLockedDiff("submit", operationType, | |
293 | + | let diffTuple = calcTotalLockedDiff("submit", operationType, innerBaseStr, 0, 0, inAmount, baseAssetId, shareAssetId) | |
283 | 294 | let limitsRemainingBaseNew = (limitsRemainingBase - diffTuple._2[IdxTotalLockedInBase]) | |
284 | 295 | let limitsRemainingShareNew = (limitsRemainingShare - diffTuple._2[IdxTotalLockedInShare]) | |
285 | 296 | if (if ((0 > limitsRemainingBaseNew)) | |
287 | 298 | else (0 > limitsRemainingShareNew)) | |
288 | 299 | then failSubmitLimitsExceeds(limitsRemainingBase, limitsRemainingShare, limitsRemainingBaseNew, limitsRemainingShareNew) | |
289 | 300 | else { | |
290 | - | let topUpCurrentIdx = getIntOrFail(keyTopUpCurrentIdx(internalBaseAssetStr)) | |
291 | - | ((([StringEntry(keyOperation(operationType, internalBaseAssetStr, userAddressStr, toBase58String(i.transactionId)), dataOperation("PENDING", inAmount, 0, 0, height, lastBlock.timestamp, 0, 0, (topUpCurrentIdx + 1)))] :+ TotalLockedStringEntry("INCREMENT", keyTotalLocked(internalBaseAssetStr), diffTuple._1)) :+ TotalLockedStringEntry("INCREMENT", keyTotalLockedByUser(internalBaseAssetStr, userAddressStr), diffTuple._2)) :+ RemainingLimitsStringEntry(limitsKEY, limitsRemainingBaseNew, limitsRemainingShareNew)) | |
301 | + | let topUpCurrentIdx = getIntOrFail(keyTopUpCurrentIdx(innerBaseStr)) | |
302 | + | let endHeight = if (diffTuple._5) | |
303 | + | then (height + getDelayBlocks) | |
304 | + | else height | |
305 | + | ((([StrE(keyOperation(operationType, innerBaseStr, userAddressStr, toBase58String(i.transactionId)), dataOperation("PENDING", inAmount, 0, 0, height, lastBlock.timestamp, endHeight, 0, (topUpCurrentIdx + 1)))] :+ TotalLockedStringEntry("INCREMENT", keyTotalLocked(innerBaseStr), diffTuple._1)) :+ TotalLockedStringEntry("INCREMENT", keyTotalLockedByUser(innerBaseStr, userAddressStr), diffTuple._2)) :+ RemainingLimitsStringEntry(limitsKEY, limitsRemainingBaseNew, limitsRemainingShareNew)) | |
292 | 306 | } | |
293 | 307 | } | |
294 | 308 | } | |
299 | 313 | let userAddress = addressFromStringValue(userAddressStr) | |
300 | 314 | let assetCfgArray = readAssetCfgOrFail(baseAssetStr) | |
301 | 315 | let shareAssetId = fromBase58String(assetCfgArray[IdxCfgShareAssetId]) | |
302 | - | let | |
316 | + | let innerBaseStr = assetCfgArray[IdxCfgInternalBaseAsset] | |
303 | 317 | let decimalsMultPrice = parseIntValue(assetCfgArray[IdxCfgDecimalsMultPrice]) | |
304 | 318 | let baseAssetId = fromBase58String(baseAssetStr) | |
305 | - | let operationKey = keyOperation(operationType, internalBaseAssetStr, userAddressStr, submitTxIdStr) | |
306 | - | let operationArray = split(getStringOrFail(operationKey), SEP) | |
307 | - | let status = operationArray[IdxOperStatus] | |
308 | - | let inAmount = parseIntValue(operationArray[IdxOperInAmount]) | |
309 | - | let topupUnlockIdx = parseIntValue(operationArray[IdxOperTopupUnlockIdx]) | |
310 | - | let currTopUpIdx = getIntOrFail(keyTopUpCurrentIdx(internalBaseAssetStr)) | |
311 | - | let priceByTopUpId = getIntOrFail(keyPriceByTopUpIdx(internalBaseAssetStr, topupUnlockIdx)) | |
319 | + | let opKey = keyOperation(operationType, innerBaseStr, userAddressStr, submitTxIdStr) | |
320 | + | let opArray = split(getStringOrFail(opKey), SEP) | |
321 | + | let status = opArray[IdxOperStatus] | |
322 | + | let inAmount = parseIntValue(opArray[IdxOperInAmount]) | |
323 | + | let topupUnlockIdx = parseIntValue(opArray[IdxOperTopupUnlockIdx]) | |
324 | + | let unlockHeight = parseIntValue(opArray[IdxOperEndHeight]) | |
325 | + | let currTopUpIdx = getIntOrFail(keyTopUpCurrentIdx(innerBaseStr)) | |
326 | + | let priceByTopUpId = getIntOrFail(keyPriceByTopUpIdx(innerBaseStr, topupUnlockIdx)) | |
312 | 327 | if ((status != "PENDING")) | |
313 | 328 | then failExecuteGet("Status is not PENDING", baseAssetStr, userAddressStr, submitTxIdStr, operationType) | |
314 | 329 | else if ((topupUnlockIdx > currTopUpIdx)) | |
315 | 330 | then failExecuteGet(((("OperLock[" + toString(topupUnlockIdx)) + "] > ") + toString(currTopUpIdx)), baseAssetStr, userAddressStr, submitTxIdStr, operationType) | |
316 | - | else { | |
317 | - | let diffTuple = calcTotalLockedDiff("execute", operationType, internalBaseAssetStr, priceByTopUpId, decimalsMultPrice, inAmount, baseAssetId, shareAssetId) | |
318 | - | let outAmount = diffTuple._3 | |
319 | - | let outTransferData = if ((diffTuple._4 == baseAssetId)) | |
320 | - | then [ScriptTransfer(userAddress, outAmount, baseAssetId)] | |
321 | - | else [ScriptTransfer(userAddress, outAmount, shareAssetId)] | |
322 | - | (((outTransferData :+ StringEntry(operationKey, dataOperationExecutionUpdate(operationArray, "FINISHED", priceByTopUpId, outAmount))) :+ TotalLockedStringEntry("DECREMENT", keyTotalLocked(internalBaseAssetStr), diffTuple._1)) :+ TotalLockedStringEntry("DECREMENT", keyTotalLockedByUser(internalBaseAssetStr, userAddressStr), diffTuple._2)) | |
323 | - | } | |
331 | + | else if ((unlockHeight > height)) | |
332 | + | then failExecuteGet(((("OperHeightLock[" + toString(unlockHeight)) + "] > ") + toString(height)), baseAssetStr, userAddressStr, submitTxIdStr, operationType) | |
333 | + | else { | |
334 | + | let diffTuple = calcTotalLockedDiff("execute", operationType, innerBaseStr, priceByTopUpId, decimalsMultPrice, inAmount, baseAssetId, shareAssetId) | |
335 | + | let outAmount = diffTuple._3 | |
336 | + | let outTransferData = if ((diffTuple._4 == baseAssetId)) | |
337 | + | then [ScriptTransfer(userAddress, outAmount, baseAssetId)] | |
338 | + | else [ScriptTransfer(userAddress, outAmount, shareAssetId)] | |
339 | + | (((outTransferData :+ StrE(opKey, dataOperationExecutionUpdate(opArray, "FINISHED", priceByTopUpId, outAmount))) :+ TotalLockedStringEntry("DECREMENT", keyTotalLocked(innerBaseStr), diffTuple._1)) :+ TotalLockedStringEntry("DECREMENT", keyTotalLockedByUser(innerBaseStr, userAddressStr), diffTuple._2)) | |
340 | + | } | |
324 | 341 | } | |
325 | 342 | ||
326 | 343 | ||
331 | 348 | let shareAssetId = fromBase58String(shareAssetStr) | |
332 | 349 | let decimalsMultBothAssetsVal = parseIntValue(cfgArray[IdxCfgDecimalsMultBothAssets]) | |
333 | 350 | let decimalsMultPriceVal = parseIntValue(cfgArray[IdxCfgDecimalsMultPrice]) | |
334 | - | let | |
335 | - | let priceAthKEY = keyPriceATH( | |
351 | + | let innerBaseStr = cfgArray[IdxCfgInternalBaseAsset] | |
352 | + | let priceAthKEY = keyPriceATH(innerBaseStr) | |
336 | 353 | let priceAthVal = valueOrElse(getInteger(this, priceAthKEY), 0) | |
337 | - | let priceLastKEY = keyPriceLast( | |
354 | + | let priceLastKEY = keyPriceLast(innerBaseStr) | |
338 | 355 | let priceLastVal = valueOrElse(getInteger(this, priceLastKEY), 0) | |
339 | - | let topupLastTimeKEY = keyTopupLastTimestamp( | |
356 | + | let topupLastTimeKEY = keyTopupLastTimestamp(innerBaseStr) | |
340 | 357 | let topupLastTimeVal = valueOrElse(getInteger(this, topupLastTimeKEY), 0) | |
341 | - | let sysState = calcPrice( | |
342 | - | $Tuple14( | |
358 | + | let sysState = calcPrice(innerBaseStr, baseAssetId, shareAssetId, decimalsMultPriceVal) | |
359 | + | $Tuple14(IntE("price", priceLastVal), IntE("decimalsMultPrice", decimalsMultPriceVal), IntE("baseAssetBalance", sysState._2), IntE("-1", sysState._3), IntE("baseAssetBalanceWCO", sysState._4), IntE("shareEmission", sysState._5), IntE("currIterTotalInBaseAmount", sysState._6), IntE("currIterTotalInShareAmount", sysState._7), IntE("totalLockedOutBaseAmount", sysState._8), IntE("totalLockedOutShareAmount", sysState._9), IntE("decimalsMultBothAssets", decimalsMultBothAssetsVal), IntE("priceATH", priceAthVal), IntE("priceRecalculated", sysState._1), IntE("topupLastTimestamp", topupLastTimeVal)) | |
343 | 360 | } | |
344 | 361 | ||
345 | 362 | ||
373 | 390 | let shareAssetId = calculateAssetId(shareAssetIssueAction) | |
374 | 391 | let shareAssetStr = toBase58String(shareAssetId) | |
375 | 392 | let internalBaseAssetId = valueOrElse(getInteger(this, keyNextInternalAssetId()), 0) | |
376 | - | let | |
377 | - | [ | |
393 | + | let innerBaseStr = toString(internalBaseAssetId) | |
394 | + | [StrE(keyAssetCfg(baseAssetStr), dataAssetCfg(shareAssetStr, innerBaseStr, decimalsMultBothAssets, decimalsMultPrice, getDelayinBlocks, topupIntervalInBlocks, topupMaxNegativePart, topupManagerAddress, submitLimitsBaseMax, submitLimitsBaseReset, submitLimitsShareMax, submitLimitsShareReset, adminAddress)), StrE(keyMappingsInternal2baseAssetId(internalBaseAssetId), baseAssetStr), StrE(keyMappingsBaseAsset2internalId(baseAssetStr), innerBaseStr), StrE(keyMappingsShare2baseAssetId(shareAssetStr), baseAssetStr), StrE(keyMappingsBaseAsset2shareId(baseAssetStr), shareAssetStr), BooleanEntry(keyShutdownSubmitOperation(innerBaseStr), false), StrE(keyShutdownManager(innerBaseStr), shutdownManagerAddress), IntE(keyNextInternalAssetId(), (internalBaseAssetId + 1)), IntE(keyPriceLast(innerBaseStr), startPrice), IntE(keyPriceATH(innerBaseStr), startPrice), IntE(keyPriceHistory(innerBaseStr, height, lastBlock.timestamp), startPrice), IntE(keyTopUpCurrentIdx(innerBaseStr), 0), RemainingLimitsStringEntry(keyLimitsRemaining(innerBaseStr), submitLimitsBaseMax, submitLimitsShareMax), shareAssetIssueAction, ScriptTransfer(addressFromStringValue(topupManagerAddress), shareInitAmount, shareAssetId)] | |
378 | 395 | } | |
379 | 396 | } | |
380 | 397 | ||
431 | 448 | func operationsMutex (baseAssetStr) = { | |
432 | 449 | let assetCfgArray = readAssetCfgOrFail(baseAssetStr) | |
433 | 450 | let topUpManagerAddressStr = assetCfgArray[IdxCfgTopupManagerAddress] | |
434 | - | let | |
451 | + | let innerBaseStr = assetCfgArray[IdxCfgInternalBaseAsset] | |
435 | 452 | if ((toString(i.caller) != topUpManagerAddressStr)) | |
436 | 453 | then failTopupManagerOnly(topUpManagerAddressStr) | |
437 | - | else [TopupMutexIntEntry( | |
454 | + | else [TopupMutexIntEntry(innerBaseStr, height)] | |
438 | 455 | } | |
439 | 456 | ||
440 | 457 | ||
442 | 459 | @Callable(i) | |
443 | 460 | func topUpBalance (baseAssetStr,income) = { | |
444 | 461 | let baseAssetId = fromBase58String(baseAssetStr) | |
445 | - | let | |
446 | - | let shareAssetId = fromBase58String( | |
447 | - | let priceMult = parseIntValue( | |
448 | - | let bothAssetMult = parseIntValue( | |
449 | - | let topupIntervalInBlocks = parseIntValue( | |
450 | - | let topupMaxNegativePart = parseIntValue( | |
451 | - | let | |
452 | - | let topUpManagerAddressStr = | |
453 | - | let submitLimitsBaseMax = parseIntValue( | |
454 | - | let submitLimitsShareMax = parseIntValue( | |
455 | - | let topUpCurrentIdxKEY = keyTopUpCurrentIdx( | |
462 | + | let cfg = readAssetCfgOrFail(baseAssetStr) | |
463 | + | let shareAssetId = fromBase58String(cfg[IdxCfgShareAssetId]) | |
464 | + | let priceMult = parseIntValue(cfg[IdxCfgDecimalsMultPrice]) | |
465 | + | let bothAssetMult = parseIntValue(cfg[IdxCfgDecimalsMultBothAssets]) | |
466 | + | let topupIntervalInBlocks = parseIntValue(cfg[IdxCfgTopupIntervalInBlocks]) | |
467 | + | let topupMaxNegativePart = parseIntValue(cfg[IdxCfgTopupMaxNegativePart]) | |
468 | + | let innerBaseStr = cfg[IdxCfgInternalBaseAsset] | |
469 | + | let topUpManagerAddressStr = cfg[IdxCfgTopupManagerAddress] | |
470 | + | let submitLimitsBaseMax = parseIntValue(cfg[IdxCfgSubmitLimitsBaseMax]) | |
471 | + | let submitLimitsShareMax = parseIntValue(cfg[IdxCfgSubmitLimitsShareMax]) | |
472 | + | let topUpCurrentIdxKEY = keyTopUpCurrentIdx(innerBaseStr) | |
456 | 473 | let prevTopUpIdx = getIntOrFail(topUpCurrentIdxKEY) | |
457 | 474 | let currentTopUpIdx = (prevTopUpIdx + 1) | |
458 | - | let valid = if ((income > 0)) | |
459 | - | then { | |
460 | - | let pmt = value(i.payments[0]) | |
461 | - | let pmtAssetId = value(pmt.assetId) | |
462 | - | if ((baseAssetId != pmtAssetId)) | |
463 | - | then throw("attached payment's asset id is NOT matched passed baseAssetStr") | |
464 | - | else if ((size(i.payments) > 1)) | |
465 | - | then throw("only one payment can be attached") | |
466 | - | else if ((pmt.amount != income)) | |
467 | - | then throw("attached payment.amount is NOT matched passed income argument") | |
468 | - | else true | |
469 | - | } | |
470 | - | else if ((0 > income)) | |
471 | - | then { | |
472 | - | let baseBalance = assetBalance(this, baseAssetId) | |
473 | - | let allowedAmount = fraction(topupMaxNegativePart, baseBalance, bothAssetMult) | |
474 | - | if ((-(income) > allowedAmount)) | |
475 | - | then throw(("topup negative income couldn't be greater than " + toString(allowedAmount))) | |
476 | - | else true | |
477 | - | } | |
478 | - | else throw("zero income is not allowed") | |
479 | - | let topUpLastHeightKEY = keyTopUpLastHeight(internalBaseAssetStr, toString(i.caller)) | |
475 | + | let topUpLastHeightKEY = keyTopUpLastHeight(innerBaseStr, toString(i.caller)) | |
480 | 476 | let topUpLastHeight = valueOrElse(getInteger(this, topUpLastHeightKEY), 0) | |
477 | + | let priceAthKEY = keyPriceATH(innerBaseStr) | |
478 | + | let prevPriceATH = valueOrElse(getInteger(this, priceAthKEY), 0) | |
481 | 479 | if ((toString(i.caller) != topUpManagerAddressStr)) | |
482 | 480 | then failTopupManagerOnly(topUpManagerAddressStr) | |
483 | - | else if (!(valid)) | |
484 | - | then throw("validation failed") | |
485 | - | else if ((topupIntervalInBlocks > (height - topUpLastHeight))) | |
486 | - | then throw((("1 topup per " + toString(topupIntervalInBlocks)) + " blocks from the same address is allowed")) | |
487 | - | else { | |
488 | - | let price = genericCalcPrice(internalBaseAssetStr, baseAssetId, income, shareAssetId, priceMult)._1 | |
489 | - | let diffTuple = calcTotalLockedDiff("topup", "", internalBaseAssetStr, price, priceMult, 0, baseAssetId, shareAssetId) | |
490 | - | let topupTotalDiff = diffTuple._1 | |
491 | - | let priceAthKEY = keyPriceATH(internalBaseAssetStr) | |
492 | - | let prevPriceATH = valueOrElse(getInteger(this, priceAthKEY), 0) | |
493 | - | ((((((([IntegerEntry(keyPriceLast(internalBaseAssetStr), price), IntegerEntry(keyPriceHistory(internalBaseAssetStr, height, lastBlock.timestamp), price), IntegerEntry(keyPriceByTopUpIdx(internalBaseAssetStr, currentTopUpIdx), price), IntegerEntry(topUpCurrentIdxKEY, currentTopUpIdx), IntegerEntry(priceAthKEY, if ((price > prevPriceATH)) | |
494 | - | then price | |
495 | - | else prevPriceATH), IntegerEntry(topUpLastHeightKEY, height)] :+ TotalLockedStringEntry("DECREMENT", keyTotalLocked(internalBaseAssetStr), topupTotalDiff)) :+ TopupMutexIntEntry(internalBaseAssetStr, 0)) :+ IntegerEntry(keyTopupLastTimestamp(internalBaseAssetStr), lastBlock.timestamp)) :+ RemainingLimitsStringEntry(keyLimitsRemaining(internalBaseAssetStr), submitLimitsBaseMax, submitLimitsShareMax)) :+ Burn(shareAssetId, topupTotalDiff[IdxTotalLockedInShare])) :+ Reissue(shareAssetId, -(topupTotalDiff[IdxTotalLockedOutShare]), true)) ++ (if ((0 > income)) | |
496 | - | then [ScriptTransfer(i.caller, -(income), baseAssetId)] | |
497 | - | else nil)) | |
498 | - | } | |
481 | + | else if ((topupIntervalInBlocks > (height - topUpLastHeight))) | |
482 | + | then throw((("1 topup per " + toString(topupIntervalInBlocks)) + " blocks from the same address is allowed")) | |
483 | + | else { | |
484 | + | let price = genericCalcPrice(innerBaseStr, baseAssetId, income, shareAssetId, priceMult)._1 | |
485 | + | let valid = if ((income > 0)) | |
486 | + | then { | |
487 | + | let pmt = value(i.payments[0]) | |
488 | + | let pmtAssetId = value(pmt.assetId) | |
489 | + | if ((baseAssetId != pmtAssetId)) | |
490 | + | then throw("attached payment's asset id is NOT matched passed baseAssetStr") | |
491 | + | else if ((size(i.payments) > 1)) | |
492 | + | then throw("only one payment can be attached") | |
493 | + | else if ((pmt.amount != income)) | |
494 | + | then throw("attached payment.amount is NOT matched passed income argument") | |
495 | + | else true | |
496 | + | } | |
497 | + | else if ((0 > income)) | |
498 | + | then { | |
499 | + | let minAllowedPrice = fraction(prevPriceATH, ((1 * bothAssetMult) - topupMaxNegativePart), bothAssetMult) | |
500 | + | if ((minAllowedPrice > price)) | |
501 | + | then failTopupMaxPriceDeviation(price, minAllowedPrice) | |
502 | + | else true | |
503 | + | } | |
504 | + | else throw("zero income is not allowed") | |
505 | + | if (!(valid)) | |
506 | + | then throw("validation failed") | |
507 | + | else { | |
508 | + | let diffTuple = calcTotalLockedDiff("topup", "", innerBaseStr, price, priceMult, 0, baseAssetId, shareAssetId) | |
509 | + | let topupTotalDiff = diffTuple._1 | |
510 | + | ((((((([IntE(keyPriceLast(innerBaseStr), price), IntE(keyPriceHistory(innerBaseStr, height, lastBlock.timestamp), price), IntE(keyPriceByTopUpIdx(innerBaseStr, currentTopUpIdx), price), IntE(topUpCurrentIdxKEY, currentTopUpIdx), IntE(priceAthKEY, if ((price > prevPriceATH)) | |
511 | + | then price | |
512 | + | else prevPriceATH), IntE(topUpLastHeightKEY, height)] :+ TotalLockedStringEntry("DECREMENT", keyTotalLocked(innerBaseStr), topupTotalDiff)) :+ TopupMutexIntEntry(innerBaseStr, 0)) :+ IntE(keyTopupLastTimestamp(innerBaseStr), lastBlock.timestamp)) :+ RemainingLimitsStringEntry(keyLimitsRemaining(innerBaseStr), submitLimitsBaseMax, submitLimitsShareMax)) :+ Burn(shareAssetId, topupTotalDiff[IdxTotalLockedInShare])) :+ Reissue(shareAssetId, -(topupTotalDiff[IdxTotalLockedOutShare]), true)) ++ (if ((0 > income)) | |
513 | + | then [ScriptTransfer(i.caller, -(income), baseAssetId)] | |
514 | + | else nil)) | |
515 | + | } | |
516 | + | } | |
499 | 517 | } | |
500 | 518 | ||
501 | 519 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), ("No data for this.key=" + key)) | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func getBooleanOrFail (key) = valueOrErrorMessage(getBoolean(this, key), ("No data for this.key=" + key)) | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), ("No data for this.key=" + key)) | |
13 | 13 | ||
14 | 14 | ||
15 | + | func IntE (key,val) = IntegerEntry(key, val) | |
16 | + | ||
17 | + | ||
18 | + | func StrE (key,val) = StringEntry(key, val) | |
19 | + | ||
20 | + | ||
15 | 21 | func failExecuteGet (msg,baseAssetStr,userAddressStr,submitTxIdStr,operationType) = throw(((((((((msg + ": baseAsset=") + baseAssetStr) + " userAddress=") + userAddressStr) + " submitTxId=") + submitTxIdStr) + " operation=") + operationType)) | |
16 | 22 | ||
17 | 23 | ||
18 | 24 | func failSubmitLimitsExceeds (remainingBase,remainingShare,newRemainingBase,newRemainingShare) = throw((((((((("submit operation limits have been reached: " + " remainingBaseVal=") + toString(remainingBase)) + " remainingShareVal=") + toString(remainingShare)) + " newRemainingBaseVal=") + toString(newRemainingBase)) + " newRemainingShareVal=") + toString(newRemainingShare))) | |
19 | 25 | ||
20 | 26 | ||
21 | 27 | func failTopupManagerOnly (topupManagerAddress) = throw((("opertion denied: only topUpManager=" + topupManagerAddress) + " can send such transactions")) | |
28 | + | ||
29 | + | ||
30 | + | func failTopupMaxPriceDeviation (price,minAllowedPrice) = throw(((("topup is not allowed - max deviation from ATH price exceeds: newPrice=" + toString(price)) + " minAllowedPrice=") + toString(minAllowedPrice))) | |
22 | 31 | ||
23 | 32 | ||
24 | 33 | func convertShare2Base (shareAmount,price,priceMult) = fraction(shareAmount, price, priceMult) | |
25 | 34 | ||
26 | 35 | ||
27 | 36 | func convertBase2Share (baseAmount,price,priceMult) = fraction(baseAmount, priceMult, price) | |
28 | 37 | ||
29 | 38 | ||
30 | 39 | func keyAssetCfg (baseAssetStr) = ("%s%s%s__config__asset__" + baseAssetStr) | |
31 | 40 | ||
32 | 41 | ||
33 | 42 | func keyNextInternalAssetId () = "%s__nextInternalAssetId" | |
34 | 43 | ||
35 | 44 | ||
36 | - | func keyPriceLast ( | |
45 | + | func keyPriceLast (innerBaseStr) = ("%s%s%d__price__last__" + innerBaseStr) | |
37 | 46 | ||
38 | 47 | ||
39 | - | func keyPriceATH ( | |
48 | + | func keyPriceATH (innerBaseStr) = ("%s%s%d__price__ath__" + innerBaseStr) | |
40 | 49 | ||
41 | 50 | ||
42 | - | func keyPriceByTopUpIdx ( | |
51 | + | func keyPriceByTopUpIdx (innerBaseStr,topUpIdx) = makeString(["%s%s%d%d__price__byTopUpIdx", innerBaseStr, toString(topUpIdx)], SEP) | |
43 | 52 | ||
44 | 53 | ||
45 | - | func keyPriceHistory ( | |
54 | + | func keyPriceHistory (innerBaseStr,h,timestamp) = makeString(["%s%s%d%d%d__price__history", innerBaseStr, toString(h), toString(timestamp)], SEP) | |
46 | 55 | ||
47 | 56 | ||
48 | - | func keyTotalLocked ( | |
57 | + | func keyTotalLocked (innerBaseStr) = ("%s%s%d__total__locked__" + innerBaseStr) | |
49 | 58 | ||
50 | 59 | ||
51 | - | func keyTotalLockedByUser ( | |
60 | + | func keyTotalLockedByUser (innerBaseStr,userAddressStr) = makeString(["%s%s%d%s__total__locked", innerBaseStr, userAddressStr], SEP) | |
52 | 61 | ||
53 | 62 | ||
54 | 63 | func keyMappingsInternal2baseAssetId (internalBaseAsset) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(internalBaseAsset)) | |
55 | 64 | ||
56 | 65 | ||
57 | 66 | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
58 | 67 | ||
59 | 68 | ||
60 | 69 | func keyMappingsShare2baseAssetId (shareAssetStr) = ("%s%s%s__mappings__share2baseAssetId__" + shareAssetStr) | |
61 | 70 | ||
62 | 71 | ||
63 | 72 | func keyMappingsBaseAsset2shareId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2shareId__" + baseAssetStr) | |
64 | 73 | ||
65 | 74 | ||
66 | - | func keyShutdownSubmitOperation ( | |
75 | + | func keyShutdownSubmitOperation (innerBaseStr) = ("%s%s%d__shutdown__submit__" + innerBaseStr) | |
67 | 76 | ||
68 | 77 | ||
69 | - | func keyShutdownManager ( | |
78 | + | func keyShutdownManager (innerBaseStr) = ("%s%s%d__shutdown__manager__" + innerBaseStr) | |
70 | 79 | ||
71 | 80 | ||
72 | - | func keyTopUpCurrentIdx ( | |
81 | + | func keyTopUpCurrentIdx (innerBaseStr) = ("%s%s%d__topup__currentIdx__" + innerBaseStr) | |
73 | 82 | ||
74 | 83 | ||
75 | - | func keyTopUpLastHeight ( | |
84 | + | func keyTopUpLastHeight (innerBaseStr,sender) = makeString(["%s%s%s%d%s__topup__last__height", innerBaseStr, sender], SEP) | |
76 | 85 | ||
77 | 86 | ||
78 | - | func keyTopupMutext ( | |
87 | + | func keyTopupMutext (innerBaseStr) = ("%s%s%d__topup__mutex__" + innerBaseStr) | |
79 | 88 | ||
80 | 89 | ||
81 | - | func keyTopupLastTimestamp ( | |
90 | + | func keyTopupLastTimestamp (innerBaseStr) = ("%s%s%s%d__topup__last__timestamp__" + innerBaseStr) | |
82 | 91 | ||
83 | 92 | ||
84 | - | func keyTopupHistory ( | |
93 | + | func keyTopupHistory (innerBaseStr,topupIdx) = makeString(["%s%s%d%d__topup__history", innerBaseStr, toString(topupIdx)], SEP) | |
85 | 94 | ||
86 | 95 | ||
87 | - | func keyLimitsRemaining ( | |
96 | + | func keyLimitsRemaining (innerBaseStr) = ("%s%s%d__limits__remaining__" + innerBaseStr) | |
88 | 97 | ||
89 | 98 | ||
90 | 99 | let IdxCfgShareAssetId = 1 | |
91 | 100 | ||
92 | 101 | let IdxCfgInternalBaseAsset = 2 | |
93 | 102 | ||
94 | 103 | let IdxCfgDecimalsMultBothAssets = 3 | |
95 | 104 | ||
96 | 105 | let IdxCfgDecimalsMultPrice = 4 | |
97 | 106 | ||
98 | 107 | let IdxCfgGetDelayBlocks = 5 | |
99 | 108 | ||
100 | 109 | let IdxCfgTopupIntervalInBlocks = 6 | |
101 | 110 | ||
102 | 111 | let IdxCfgTopupMaxNegativePart = 7 | |
103 | 112 | ||
104 | 113 | let IdxCfgTopupManagerAddress = 8 | |
105 | 114 | ||
106 | 115 | let IdxCfgSubmitLimitsBaseMax = 9 | |
107 | 116 | ||
108 | 117 | let IdxCfgSubmitLimitsBaseReset = 10 | |
109 | 118 | ||
110 | 119 | let IdxCfgSubmitLimitsShareMax = 11 | |
111 | 120 | ||
112 | 121 | let IdxCfgSubmitLimitsShareReset = 12 | |
113 | 122 | ||
114 | 123 | let IdxCfgAdminAddress = 13 | |
115 | 124 | ||
116 | - | func dataAssetCfg (shareAssetStr, | |
125 | + | func dataAssetCfg (shareAssetStr,innerBaseStr,decimalsMultBothAssets,decimalsMultPrice,getDelayInBlocks,topupIntervalInBlocks,topupMaxNegativePart,topupManagerAddress,submitLimitsBaseMax,submitLimitsBaseReset,submitLimitsShareMax,submitLimitsShareReset,adminAddress) = makeString(["%s%d%d%d%d%d%d%s%d%d%d%d", shareAssetStr, innerBaseStr, toString(decimalsMultBothAssets), toString(decimalsMultPrice), toString(getDelayInBlocks), toString(topupIntervalInBlocks), toString(topupMaxNegativePart), topupManagerAddress, toString(submitLimitsBaseMax), toString(submitLimitsBaseReset), toString(submitLimitsShareMax), toString(submitLimitsShareReset), adminAddress], SEP) | |
117 | 126 | ||
118 | 127 | ||
119 | 128 | let IdxTotalLockedInShare = 1 | |
120 | 129 | ||
121 | 130 | let IdxTotalLockedOutBase = 2 | |
122 | 131 | ||
123 | 132 | let IdxTotalLockedInBase = 3 | |
124 | 133 | ||
125 | 134 | let IdxTotalLockedOutShare = 4 | |
126 | 135 | ||
127 | 136 | func dataTotalLocked (inShareAmount,outBaseAmount,inBaseAmount,outShareAmount) = makeString(["%d%d%d%d", toString(inShareAmount), toString(outBaseAmount), toString(inBaseAmount), toString(outShareAmount)], SEP) | |
128 | 137 | ||
129 | 138 | ||
130 | 139 | func dataTotalLockedInt (inShareAmount,outBaseAmount,inBaseAmount,outShareAmount) = [-1, inShareAmount, outBaseAmount, inBaseAmount, outShareAmount] | |
131 | 140 | ||
132 | 141 | ||
133 | 142 | func readTotalLocked (key) = { | |
134 | 143 | let totalLockedArray = split(valueOrElse(getString(this, key), dataTotalLocked(0, 0, 0, 0)), SEP) | |
135 | 144 | dataTotalLockedInt(parseIntValue(totalLockedArray[IdxTotalLockedInShare]), parseIntValue(totalLockedArray[IdxTotalLockedOutBase]), parseIntValue(totalLockedArray[IdxTotalLockedInBase]), parseIntValue(totalLockedArray[IdxTotalLockedOutShare])) | |
136 | 145 | } | |
137 | 146 | ||
138 | 147 | ||
139 | - | func calcTotalLockedDiff (direction,operationType, | |
148 | + | func calcTotalLockedDiff (direction,operationType,innerBaseStr,price,priceMult,inAmount,baseAssetId,shareAssetId) = { | |
140 | 149 | let t = (direction + operationType) | |
150 | + | let emptyVect = fromBase58String("") | |
141 | 151 | if ((t == "submitP")) | |
142 | 152 | then { | |
143 | 153 | let totalDiff = dataTotalLockedInt(0, 0, inAmount, 0) | |
144 | 154 | let userDiff = totalDiff | |
145 | - | $ | |
155 | + | $Tuple5(totalDiff, userDiff, 0, emptyVect, false) | |
146 | 156 | } | |
147 | 157 | else if ((t == "submitG")) | |
148 | 158 | then { | |
149 | 159 | let totalDiff = dataTotalLockedInt(inAmount, 0, 0, 0) | |
150 | 160 | let userDiff = totalDiff | |
151 | - | $ | |
161 | + | $Tuple5(totalDiff, userDiff, 0, emptyVect, true) | |
152 | 162 | } | |
153 | 163 | else if ((t == "executeP")) | |
154 | 164 | then { | |
155 | 165 | let outAmount = convertBase2Share(inAmount, price, priceMult) | |
156 | 166 | let totalDiff = dataTotalLockedInt(0, 0, 0, outAmount) | |
157 | 167 | let userDiff = dataTotalLockedInt(0, 0, inAmount, 0) | |
158 | - | $ | |
168 | + | $Tuple5(totalDiff, userDiff, outAmount, shareAssetId, false) | |
159 | 169 | } | |
160 | 170 | else if ((t == "executeG")) | |
161 | 171 | then { | |
162 | 172 | let outAmount = convertShare2Base(inAmount, price, priceMult) | |
163 | 173 | let totalDiff = dataTotalLockedInt(0, outAmount, 0, 0) | |
164 | 174 | let userDiff = dataTotalLockedInt(inAmount, 0, 0, 0) | |
165 | - | $ | |
175 | + | $Tuple5(totalDiff, userDiff, outAmount, baseAssetId, false) | |
166 | 176 | } | |
167 | 177 | else if ((t == "topup")) | |
168 | 178 | then { | |
169 | - | let totalLockedArray = readTotalLocked(keyTotalLocked( | |
179 | + | let totalLockedArray = readTotalLocked(keyTotalLocked(innerBaseStr)) | |
170 | 180 | let totalLockedInBaseAmount = totalLockedArray[IdxTotalLockedInBase] | |
171 | 181 | let totalLockedInShareAmount = totalLockedArray[IdxTotalLockedInShare] | |
172 | 182 | let totalDiff = dataTotalLockedInt(totalLockedInShareAmount, (-1 * convertShare2Base(totalLockedInShareAmount, price, priceMult)), totalLockedInBaseAmount, (-1 * convertBase2Share(totalLockedInBaseAmount, price, priceMult))) | |
173 | - | $ | |
183 | + | $Tuple5(totalDiff, nil, 0, emptyVect, false) | |
174 | 184 | } | |
175 | 185 | else throw(("Unsupported Type " + t)) | |
176 | 186 | } | |
177 | 187 | ||
178 | 188 | ||
179 | 189 | func TotalLockedStringEntry (action,key,diff) = { | |
180 | 190 | func UPDATE (a,b) = if ((action == "INCREMENT")) | |
181 | 191 | then (a + b) | |
182 | 192 | else if ((action == "DECREMENT")) | |
183 | 193 | then (a - b) | |
184 | 194 | else throw(("Unsupported action " + action)) | |
185 | 195 | ||
186 | 196 | let dataArray = readTotalLocked(key) | |
187 | - | | |
197 | + | StrE(key, dataTotalLocked(UPDATE(dataArray[IdxTotalLockedInShare], diff[IdxTotalLockedInShare]), UPDATE(dataArray[IdxTotalLockedOutBase], diff[IdxTotalLockedOutBase]), UPDATE(dataArray[IdxTotalLockedInBase], diff[IdxTotalLockedInBase]), UPDATE(dataArray[IdxTotalLockedOutShare], diff[IdxTotalLockedOutShare]))) | |
188 | 198 | } | |
189 | 199 | ||
190 | 200 | ||
191 | - | func keyOperation (operationType, | |
201 | + | func keyOperation (operationType,innerBaseStr,userAddress,txId) = makeString(["%s%d%s%s", operationType, innerBaseStr, userAddress, txId], SEP) | |
192 | 202 | ||
193 | 203 | ||
194 | 204 | let IdxOperStatus = 1 | |
195 | 205 | ||
196 | 206 | let IdxOperInAmount = 2 | |
197 | 207 | ||
198 | 208 | let IdxOperPrice = 3 | |
199 | 209 | ||
200 | 210 | let IdxOperOutAmount = 4 | |
201 | 211 | ||
202 | 212 | let IdxOperStartHeight = 5 | |
203 | 213 | ||
204 | 214 | let IdxOperStartTimestamp = 6 | |
205 | 215 | ||
206 | 216 | let IdxOperEndHeight = 7 | |
207 | 217 | ||
208 | 218 | let IdxOperEndTimestamp = 8 | |
209 | 219 | ||
210 | 220 | let IdxOperTopupUnlockIdx = 9 | |
211 | 221 | ||
212 | 222 | func privateDataOperationAllStrings (status,inAssetAmount,price,outAssetAmount,startHeight,startTimestamp,endHeight,endTimestamp,lock) = makeString(["%s%d%d%d%d%d%d%d%d", status, inAssetAmount, price, outAssetAmount, startHeight, startTimestamp, endHeight, endTimestamp, lock], SEP) | |
213 | 223 | ||
214 | 224 | ||
215 | 225 | func dataOperation (status,inAssetAmount,price,outAssetAmount,startHeight,startTimestamp,endHeight,endTimestamp,topupUnlockIdx) = privateDataOperationAllStrings(status, toString(inAssetAmount), toString(price), toString(outAssetAmount), toString(startHeight), toString(startTimestamp), toString(endHeight), toString(endTimestamp), toString(topupUnlockIdx)) | |
216 | 226 | ||
217 | 227 | ||
218 | 228 | func dataOperationExecutionUpdate (currOperArray,newStatus,newPrice,newOutAmount) = privateDataOperationAllStrings(newStatus, currOperArray[IdxOperInAmount], toString(newPrice), toString(newOutAmount), currOperArray[IdxOperStartHeight], currOperArray[IdxOperStartTimestamp], toString(height), toString(lastBlock.timestamp), currOperArray[IdxOperTopupUnlockIdx]) | |
219 | 229 | ||
220 | 230 | ||
221 | 231 | func readAssetCfgOrFail (baseAssetStr) = { | |
222 | 232 | let key = keyAssetCfg(baseAssetStr) | |
223 | 233 | split(getStringOrFail(key), SEP) | |
224 | 234 | } | |
225 | 235 | ||
226 | 236 | ||
227 | 237 | let IdxLimitsRemainingBase = 1 | |
228 | 238 | ||
229 | 239 | let IdxLimitsRemainingShare = 2 | |
230 | 240 | ||
231 | - | func RemainingLimitsStringEntry (key,baseRemainingLimit,shareRemainingLimit) = | |
241 | + | func RemainingLimitsStringEntry (key,baseRemainingLimit,shareRemainingLimit) = StrE(key, makeString(["%d%d", toString(baseRemainingLimit), toString(shareRemainingLimit)], SEP)) | |
232 | 242 | ||
233 | 243 | ||
234 | - | func TopupMutexIntEntry ( | |
244 | + | func TopupMutexIntEntry (innerBaseStr,acquiredHeight) = IntE(keyTopupMutext(innerBaseStr), acquiredHeight) | |
235 | 245 | ||
236 | 246 | ||
237 | - | func genericCalcPrice ( | |
238 | - | let totalLockedArray = readTotalLocked(keyTotalLocked( | |
247 | + | func genericCalcPrice (innerBaseStr,baseAssetId,topUpBaseAmount,shareAssetId,decimalsMultPrice) = { | |
248 | + | let totalLockedArray = readTotalLocked(keyTotalLocked(innerBaseStr)) | |
239 | 249 | let totalLockedOutBaseAmount = totalLockedArray[IdxTotalLockedOutBase] | |
240 | 250 | let currIterTotalInBaseAmount = totalLockedArray[IdxTotalLockedInBase] | |
241 | 251 | let baseAssetBalance = assetBalance(this, baseAssetId) | |
242 | 252 | let baseAssetBalanceWCO = (((baseAssetBalance + topUpBaseAmount) - currIterTotalInBaseAmount) - totalLockedOutBaseAmount) | |
243 | 253 | let totalLockedOutShareAmount = totalLockedArray[IdxTotalLockedOutShare] | |
244 | 254 | let currIterTotalInShareAmount = totalLockedArray[IdxTotalLockedInShare] | |
245 | 255 | let shareEmission = value(assetInfo(shareAssetId)).quantity | |
246 | 256 | if ((0 > baseAssetBalanceWCO)) | |
247 | 257 | then throw(((("baseAssetBalanceWco < 0: baseAssettBalance=" + toString(baseAssetBalance)) + " baseAssetBalanceWco=") + toString(baseAssetBalanceWCO))) | |
248 | 258 | else { | |
249 | - | let lastPrice = getIntOrFail(keyPriceLast( | |
259 | + | let lastPrice = getIntOrFail(keyPriceLast(innerBaseStr)) | |
250 | 260 | let price = if ((shareEmission == 0)) | |
251 | 261 | then lastPrice | |
252 | 262 | else fraction(baseAssetBalanceWCO, decimalsMultPrice, shareEmission) | |
253 | 263 | $Tuple9(price, baseAssetBalance, -1, baseAssetBalanceWCO, shareEmission, currIterTotalInBaseAmount, currIterTotalInShareAmount, totalLockedOutBaseAmount, totalLockedOutShareAmount) | |
254 | 264 | } | |
255 | 265 | } | |
256 | 266 | ||
257 | 267 | ||
258 | - | func calcPrice ( | |
268 | + | func calcPrice (innerBaseStr,baseAssetId,shareAssetId,decimalsMultPrice) = genericCalcPrice(innerBaseStr, baseAssetId, 0, shareAssetId, decimalsMultPrice) | |
259 | 269 | ||
260 | 270 | ||
261 | 271 | func commonSubmit (operationType,i,inAmount,inAssetId,baseAssetStr) = { | |
262 | 272 | let inAssetStr = toBase58String(inAssetId) | |
263 | 273 | let userAddressStr = toString(i.caller) | |
264 | 274 | let baseAssetId = fromBase58String(baseAssetStr) | |
265 | 275 | let cfgArray = readAssetCfgOrFail(baseAssetStr) | |
266 | 276 | let shareAssetStr = cfgArray[IdxCfgShareAssetId] | |
267 | 277 | let shareAssetId = fromBase58String(shareAssetStr) | |
268 | 278 | let decimalsMultBothAssets = parseIntValue(cfgArray[IdxCfgDecimalsMultBothAssets]) | |
269 | - | let internalBaseAssetStr = cfgArray[IdxCfgInternalBaseAsset] | |
270 | - | let limitsKEY = keyLimitsRemaining(internalBaseAssetStr) | |
279 | + | let innerBaseStr = cfgArray[IdxCfgInternalBaseAsset] | |
280 | + | let getDelayBlocks = parseIntValue(cfgArray[IdxCfgGetDelayBlocks]) | |
281 | + | let limitsKEY = keyLimitsRemaining(innerBaseStr) | |
271 | 282 | let limitsCfgArray = split(getStringOrFail(limitsKEY), SEP) | |
272 | 283 | let limitsRemainingBase = parseIntValue(limitsCfgArray[IdxLimitsRemainingBase]) | |
273 | 284 | let limitsRemainingShare = parseIntValue(limitsCfgArray[IdxLimitsRemainingShare]) | |
274 | - | let isSubmitBlocked = valueOrElse(getBoolean(this, keyShutdownSubmitOperation( | |
285 | + | let isSubmitBlocked = valueOrElse(getBoolean(this, keyShutdownSubmitOperation(innerBaseStr)), false) | |
275 | 286 | if (isSubmitBlocked) | |
276 | 287 | then throw("submit operation is blocked") | |
277 | 288 | else { | |
278 | - | let operationsMutex = valueOrElse(getInteger(this, keyTopupMutext( | |
289 | + | let operationsMutex = valueOrElse(getInteger(this, keyTopupMutext(innerBaseStr)), 0) | |
279 | 290 | if (((operationsMutex + 60) > height)) | |
280 | 291 | then throw("submit operations are blocked by topup manager") | |
281 | 292 | else { | |
282 | - | let diffTuple = calcTotalLockedDiff("submit", operationType, | |
293 | + | let diffTuple = calcTotalLockedDiff("submit", operationType, innerBaseStr, 0, 0, inAmount, baseAssetId, shareAssetId) | |
283 | 294 | let limitsRemainingBaseNew = (limitsRemainingBase - diffTuple._2[IdxTotalLockedInBase]) | |
284 | 295 | let limitsRemainingShareNew = (limitsRemainingShare - diffTuple._2[IdxTotalLockedInShare]) | |
285 | 296 | if (if ((0 > limitsRemainingBaseNew)) | |
286 | 297 | then true | |
287 | 298 | else (0 > limitsRemainingShareNew)) | |
288 | 299 | then failSubmitLimitsExceeds(limitsRemainingBase, limitsRemainingShare, limitsRemainingBaseNew, limitsRemainingShareNew) | |
289 | 300 | else { | |
290 | - | let topUpCurrentIdx = getIntOrFail(keyTopUpCurrentIdx(internalBaseAssetStr)) | |
291 | - | ((([StringEntry(keyOperation(operationType, internalBaseAssetStr, userAddressStr, toBase58String(i.transactionId)), dataOperation("PENDING", inAmount, 0, 0, height, lastBlock.timestamp, 0, 0, (topUpCurrentIdx + 1)))] :+ TotalLockedStringEntry("INCREMENT", keyTotalLocked(internalBaseAssetStr), diffTuple._1)) :+ TotalLockedStringEntry("INCREMENT", keyTotalLockedByUser(internalBaseAssetStr, userAddressStr), diffTuple._2)) :+ RemainingLimitsStringEntry(limitsKEY, limitsRemainingBaseNew, limitsRemainingShareNew)) | |
301 | + | let topUpCurrentIdx = getIntOrFail(keyTopUpCurrentIdx(innerBaseStr)) | |
302 | + | let endHeight = if (diffTuple._5) | |
303 | + | then (height + getDelayBlocks) | |
304 | + | else height | |
305 | + | ((([StrE(keyOperation(operationType, innerBaseStr, userAddressStr, toBase58String(i.transactionId)), dataOperation("PENDING", inAmount, 0, 0, height, lastBlock.timestamp, endHeight, 0, (topUpCurrentIdx + 1)))] :+ TotalLockedStringEntry("INCREMENT", keyTotalLocked(innerBaseStr), diffTuple._1)) :+ TotalLockedStringEntry("INCREMENT", keyTotalLockedByUser(innerBaseStr, userAddressStr), diffTuple._2)) :+ RemainingLimitsStringEntry(limitsKEY, limitsRemainingBaseNew, limitsRemainingShareNew)) | |
292 | 306 | } | |
293 | 307 | } | |
294 | 308 | } | |
295 | 309 | } | |
296 | 310 | ||
297 | 311 | ||
298 | 312 | func commonExecute (operationType,baseAssetStr,userAddressStr,submitTxIdStr) = { | |
299 | 313 | let userAddress = addressFromStringValue(userAddressStr) | |
300 | 314 | let assetCfgArray = readAssetCfgOrFail(baseAssetStr) | |
301 | 315 | let shareAssetId = fromBase58String(assetCfgArray[IdxCfgShareAssetId]) | |
302 | - | let | |
316 | + | let innerBaseStr = assetCfgArray[IdxCfgInternalBaseAsset] | |
303 | 317 | let decimalsMultPrice = parseIntValue(assetCfgArray[IdxCfgDecimalsMultPrice]) | |
304 | 318 | let baseAssetId = fromBase58String(baseAssetStr) | |
305 | - | let operationKey = keyOperation(operationType, internalBaseAssetStr, userAddressStr, submitTxIdStr) | |
306 | - | let operationArray = split(getStringOrFail(operationKey), SEP) | |
307 | - | let status = operationArray[IdxOperStatus] | |
308 | - | let inAmount = parseIntValue(operationArray[IdxOperInAmount]) | |
309 | - | let topupUnlockIdx = parseIntValue(operationArray[IdxOperTopupUnlockIdx]) | |
310 | - | let currTopUpIdx = getIntOrFail(keyTopUpCurrentIdx(internalBaseAssetStr)) | |
311 | - | let priceByTopUpId = getIntOrFail(keyPriceByTopUpIdx(internalBaseAssetStr, topupUnlockIdx)) | |
319 | + | let opKey = keyOperation(operationType, innerBaseStr, userAddressStr, submitTxIdStr) | |
320 | + | let opArray = split(getStringOrFail(opKey), SEP) | |
321 | + | let status = opArray[IdxOperStatus] | |
322 | + | let inAmount = parseIntValue(opArray[IdxOperInAmount]) | |
323 | + | let topupUnlockIdx = parseIntValue(opArray[IdxOperTopupUnlockIdx]) | |
324 | + | let unlockHeight = parseIntValue(opArray[IdxOperEndHeight]) | |
325 | + | let currTopUpIdx = getIntOrFail(keyTopUpCurrentIdx(innerBaseStr)) | |
326 | + | let priceByTopUpId = getIntOrFail(keyPriceByTopUpIdx(innerBaseStr, topupUnlockIdx)) | |
312 | 327 | if ((status != "PENDING")) | |
313 | 328 | then failExecuteGet("Status is not PENDING", baseAssetStr, userAddressStr, submitTxIdStr, operationType) | |
314 | 329 | else if ((topupUnlockIdx > currTopUpIdx)) | |
315 | 330 | then failExecuteGet(((("OperLock[" + toString(topupUnlockIdx)) + "] > ") + toString(currTopUpIdx)), baseAssetStr, userAddressStr, submitTxIdStr, operationType) | |
316 | - | else { | |
317 | - | let diffTuple = calcTotalLockedDiff("execute", operationType, internalBaseAssetStr, priceByTopUpId, decimalsMultPrice, inAmount, baseAssetId, shareAssetId) | |
318 | - | let outAmount = diffTuple._3 | |
319 | - | let outTransferData = if ((diffTuple._4 == baseAssetId)) | |
320 | - | then [ScriptTransfer(userAddress, outAmount, baseAssetId)] | |
321 | - | else [ScriptTransfer(userAddress, outAmount, shareAssetId)] | |
322 | - | (((outTransferData :+ StringEntry(operationKey, dataOperationExecutionUpdate(operationArray, "FINISHED", priceByTopUpId, outAmount))) :+ TotalLockedStringEntry("DECREMENT", keyTotalLocked(internalBaseAssetStr), diffTuple._1)) :+ TotalLockedStringEntry("DECREMENT", keyTotalLockedByUser(internalBaseAssetStr, userAddressStr), diffTuple._2)) | |
323 | - | } | |
331 | + | else if ((unlockHeight > height)) | |
332 | + | then failExecuteGet(((("OperHeightLock[" + toString(unlockHeight)) + "] > ") + toString(height)), baseAssetStr, userAddressStr, submitTxIdStr, operationType) | |
333 | + | else { | |
334 | + | let diffTuple = calcTotalLockedDiff("execute", operationType, innerBaseStr, priceByTopUpId, decimalsMultPrice, inAmount, baseAssetId, shareAssetId) | |
335 | + | let outAmount = diffTuple._3 | |
336 | + | let outTransferData = if ((diffTuple._4 == baseAssetId)) | |
337 | + | then [ScriptTransfer(userAddress, outAmount, baseAssetId)] | |
338 | + | else [ScriptTransfer(userAddress, outAmount, shareAssetId)] | |
339 | + | (((outTransferData :+ StrE(opKey, dataOperationExecutionUpdate(opArray, "FINISHED", priceByTopUpId, outAmount))) :+ TotalLockedStringEntry("DECREMENT", keyTotalLocked(innerBaseStr), diffTuple._1)) :+ TotalLockedStringEntry("DECREMENT", keyTotalLockedByUser(innerBaseStr, userAddressStr), diffTuple._2)) | |
340 | + | } | |
324 | 341 | } | |
325 | 342 | ||
326 | 343 | ||
327 | 344 | func privateCurrentSysParamsREST (baseAssetStr) = { | |
328 | 345 | let baseAssetId = fromBase58String(baseAssetStr) | |
329 | 346 | let cfgArray = readAssetCfgOrFail(baseAssetStr) | |
330 | 347 | let shareAssetStr = cfgArray[IdxCfgShareAssetId] | |
331 | 348 | let shareAssetId = fromBase58String(shareAssetStr) | |
332 | 349 | let decimalsMultBothAssetsVal = parseIntValue(cfgArray[IdxCfgDecimalsMultBothAssets]) | |
333 | 350 | let decimalsMultPriceVal = parseIntValue(cfgArray[IdxCfgDecimalsMultPrice]) | |
334 | - | let | |
335 | - | let priceAthKEY = keyPriceATH( | |
351 | + | let innerBaseStr = cfgArray[IdxCfgInternalBaseAsset] | |
352 | + | let priceAthKEY = keyPriceATH(innerBaseStr) | |
336 | 353 | let priceAthVal = valueOrElse(getInteger(this, priceAthKEY), 0) | |
337 | - | let priceLastKEY = keyPriceLast( | |
354 | + | let priceLastKEY = keyPriceLast(innerBaseStr) | |
338 | 355 | let priceLastVal = valueOrElse(getInteger(this, priceLastKEY), 0) | |
339 | - | let topupLastTimeKEY = keyTopupLastTimestamp( | |
356 | + | let topupLastTimeKEY = keyTopupLastTimestamp(innerBaseStr) | |
340 | 357 | let topupLastTimeVal = valueOrElse(getInteger(this, topupLastTimeKEY), 0) | |
341 | - | let sysState = calcPrice( | |
342 | - | $Tuple14( | |
358 | + | let sysState = calcPrice(innerBaseStr, baseAssetId, shareAssetId, decimalsMultPriceVal) | |
359 | + | $Tuple14(IntE("price", priceLastVal), IntE("decimalsMultPrice", decimalsMultPriceVal), IntE("baseAssetBalance", sysState._2), IntE("-1", sysState._3), IntE("baseAssetBalanceWCO", sysState._4), IntE("shareEmission", sysState._5), IntE("currIterTotalInBaseAmount", sysState._6), IntE("currIterTotalInShareAmount", sysState._7), IntE("totalLockedOutBaseAmount", sysState._8), IntE("totalLockedOutShareAmount", sysState._9), IntE("decimalsMultBothAssets", decimalsMultBothAssetsVal), IntE("priceATH", priceAthVal), IntE("priceRecalculated", sysState._1), IntE("topupLastTimestamp", topupLastTimeVal)) | |
343 | 360 | } | |
344 | 361 | ||
345 | 362 | ||
346 | 363 | @Callable(i) | |
347 | 364 | func adminRegisterAsset (baseAssetStr,shareAssetName,shareAssetDescr,getDelayinBlocks,shutdownManagerAddress,startPrice,topupIntervalInBlocks,topupMaxNegativePart,topupManagerAddress,submitLimitsBaseMax,submitLimitsBaseReset,submitLimitsShareMax,submitLimitsShareReset,adminAddress) = { | |
348 | 365 | let baseAssetId = fromBase58String(baseAssetStr) | |
349 | 366 | let bothAssetsDecimals = value(assetInfo(baseAssetId)).decimals | |
350 | 367 | let decimalsMultBothAssets = pow(10, 0, bothAssetsDecimals, 0, 0, DOWN) | |
351 | 368 | let decimalsMultPrice = ((100 * 1000) * 1000) | |
352 | 369 | let topupMaxNegativePercents = fraction(topupMaxNegativePart, 100, decimalsMultBothAssets) | |
353 | 370 | let baseAssetBalance = assetBalance(this, baseAssetId) | |
354 | 371 | if ((i.caller != this)) | |
355 | 372 | then throw("permissions denied") | |
356 | 373 | else if ((baseAssetBalance == 0)) | |
357 | 374 | then throw(((toString(this) + " must have any initial balance of ") + baseAssetStr)) | |
358 | 375 | else if (isDefined(getString(this, keyAssetCfg(baseAssetStr)))) | |
359 | 376 | then throw((baseAssetStr + " has been already registered")) | |
360 | 377 | else if ((toString(addressFromStringValue(shutdownManagerAddress)) != shutdownManagerAddress)) | |
361 | 378 | then throw("invalid shutdownManagerAddress") | |
362 | 379 | else if ((toString(addressFromStringValue(topupManagerAddress)) != topupManagerAddress)) | |
363 | 380 | then throw("invalid topupManagerAddress") | |
364 | 381 | else if ((0 > getDelayinBlocks)) | |
365 | 382 | then throw(("invalid getDelayinBlocks=" + toString(getDelayinBlocks))) | |
366 | 383 | else if (if ((0 >= topupMaxNegativePercents)) | |
367 | 384 | then true | |
368 | 385 | else (topupMaxNegativePercents >= 99)) | |
369 | 386 | then throw("invalid topupMaxNegativePart parameter") | |
370 | 387 | else { | |
371 | 388 | let shareInitAmount = convertBase2Share(baseAssetBalance, startPrice, decimalsMultPrice) | |
372 | 389 | let shareAssetIssueAction = Issue(shareAssetName, shareAssetDescr, shareInitAmount, bothAssetsDecimals, true) | |
373 | 390 | let shareAssetId = calculateAssetId(shareAssetIssueAction) | |
374 | 391 | let shareAssetStr = toBase58String(shareAssetId) | |
375 | 392 | let internalBaseAssetId = valueOrElse(getInteger(this, keyNextInternalAssetId()), 0) | |
376 | - | let | |
377 | - | [ | |
393 | + | let innerBaseStr = toString(internalBaseAssetId) | |
394 | + | [StrE(keyAssetCfg(baseAssetStr), dataAssetCfg(shareAssetStr, innerBaseStr, decimalsMultBothAssets, decimalsMultPrice, getDelayinBlocks, topupIntervalInBlocks, topupMaxNegativePart, topupManagerAddress, submitLimitsBaseMax, submitLimitsBaseReset, submitLimitsShareMax, submitLimitsShareReset, adminAddress)), StrE(keyMappingsInternal2baseAssetId(internalBaseAssetId), baseAssetStr), StrE(keyMappingsBaseAsset2internalId(baseAssetStr), innerBaseStr), StrE(keyMappingsShare2baseAssetId(shareAssetStr), baseAssetStr), StrE(keyMappingsBaseAsset2shareId(baseAssetStr), shareAssetStr), BooleanEntry(keyShutdownSubmitOperation(innerBaseStr), false), StrE(keyShutdownManager(innerBaseStr), shutdownManagerAddress), IntE(keyNextInternalAssetId(), (internalBaseAssetId + 1)), IntE(keyPriceLast(innerBaseStr), startPrice), IntE(keyPriceATH(innerBaseStr), startPrice), IntE(keyPriceHistory(innerBaseStr, height, lastBlock.timestamp), startPrice), IntE(keyTopUpCurrentIdx(innerBaseStr), 0), RemainingLimitsStringEntry(keyLimitsRemaining(innerBaseStr), submitLimitsBaseMax, submitLimitsShareMax), shareAssetIssueAction, ScriptTransfer(addressFromStringValue(topupManagerAddress), shareInitAmount, shareAssetId)] | |
378 | 395 | } | |
379 | 396 | } | |
380 | 397 | ||
381 | 398 | ||
382 | 399 | ||
383 | 400 | @Callable(i) | |
384 | 401 | func shutdownSubmits (internalBaseAssetId) = { | |
385 | 402 | let internalBaseAssetIdStr = toString(internalBaseAssetId) | |
386 | 403 | let baseAssetIdStr = getStringOrFail(keyMappingsInternal2baseAssetId(internalBaseAssetId)) | |
387 | 404 | let shutdownManagerAddress = getStringOrFail(keyShutdownManager(internalBaseAssetIdStr)) | |
388 | 405 | if ((1 > size(baseAssetIdStr))) | |
389 | 406 | then throw("invalid internalBaseAssetId") | |
390 | 407 | else if ((toString(i.caller) != shutdownManagerAddress)) | |
391 | 408 | then throw("access denied") | |
392 | 409 | else [BooleanEntry(keyShutdownSubmitOperation(toString(internalBaseAssetId)), true)] | |
393 | 410 | } | |
394 | 411 | ||
395 | 412 | ||
396 | 413 | ||
397 | 414 | @Callable(i) | |
398 | 415 | func submitPut () = { | |
399 | 416 | let pmt = value(i.payments[0]) | |
400 | 417 | let inAmount = pmt.amount | |
401 | 418 | let inAssetId = value(pmt.assetId) | |
402 | 419 | let baseAssetStr = toBase58String(inAssetId) | |
403 | 420 | commonSubmit("P", i, inAmount, inAssetId, baseAssetStr) | |
404 | 421 | } | |
405 | 422 | ||
406 | 423 | ||
407 | 424 | ||
408 | 425 | @Callable(i) | |
409 | 426 | func submitGet () = { | |
410 | 427 | let pmt = value(i.payments[0]) | |
411 | 428 | let inAmount = pmt.amount | |
412 | 429 | let inAssetId = value(pmt.assetId) | |
413 | 430 | let shareAssetStr = toBase58String(inAssetId) | |
414 | 431 | let baseAssetStr = getStringOrFail(keyMappingsShare2baseAssetId(shareAssetStr)) | |
415 | 432 | commonSubmit("G", i, inAmount, inAssetId, baseAssetStr) | |
416 | 433 | } | |
417 | 434 | ||
418 | 435 | ||
419 | 436 | ||
420 | 437 | @Callable(i) | |
421 | 438 | func executePut (baseAssetStr,userAddressStr,submitTxIdStr) = commonExecute("P", baseAssetStr, userAddressStr, submitTxIdStr) | |
422 | 439 | ||
423 | 440 | ||
424 | 441 | ||
425 | 442 | @Callable(i) | |
426 | 443 | func executeGet (baseAssetStr,userAddressStr,submitTxIdStr) = commonExecute("G", baseAssetStr, userAddressStr, submitTxIdStr) | |
427 | 444 | ||
428 | 445 | ||
429 | 446 | ||
430 | 447 | @Callable(i) | |
431 | 448 | func operationsMutex (baseAssetStr) = { | |
432 | 449 | let assetCfgArray = readAssetCfgOrFail(baseAssetStr) | |
433 | 450 | let topUpManagerAddressStr = assetCfgArray[IdxCfgTopupManagerAddress] | |
434 | - | let | |
451 | + | let innerBaseStr = assetCfgArray[IdxCfgInternalBaseAsset] | |
435 | 452 | if ((toString(i.caller) != topUpManagerAddressStr)) | |
436 | 453 | then failTopupManagerOnly(topUpManagerAddressStr) | |
437 | - | else [TopupMutexIntEntry( | |
454 | + | else [TopupMutexIntEntry(innerBaseStr, height)] | |
438 | 455 | } | |
439 | 456 | ||
440 | 457 | ||
441 | 458 | ||
442 | 459 | @Callable(i) | |
443 | 460 | func topUpBalance (baseAssetStr,income) = { | |
444 | 461 | let baseAssetId = fromBase58String(baseAssetStr) | |
445 | - | let | |
446 | - | let shareAssetId = fromBase58String( | |
447 | - | let priceMult = parseIntValue( | |
448 | - | let bothAssetMult = parseIntValue( | |
449 | - | let topupIntervalInBlocks = parseIntValue( | |
450 | - | let topupMaxNegativePart = parseIntValue( | |
451 | - | let | |
452 | - | let topUpManagerAddressStr = | |
453 | - | let submitLimitsBaseMax = parseIntValue( | |
454 | - | let submitLimitsShareMax = parseIntValue( | |
455 | - | let topUpCurrentIdxKEY = keyTopUpCurrentIdx( | |
462 | + | let cfg = readAssetCfgOrFail(baseAssetStr) | |
463 | + | let shareAssetId = fromBase58String(cfg[IdxCfgShareAssetId]) | |
464 | + | let priceMult = parseIntValue(cfg[IdxCfgDecimalsMultPrice]) | |
465 | + | let bothAssetMult = parseIntValue(cfg[IdxCfgDecimalsMultBothAssets]) | |
466 | + | let topupIntervalInBlocks = parseIntValue(cfg[IdxCfgTopupIntervalInBlocks]) | |
467 | + | let topupMaxNegativePart = parseIntValue(cfg[IdxCfgTopupMaxNegativePart]) | |
468 | + | let innerBaseStr = cfg[IdxCfgInternalBaseAsset] | |
469 | + | let topUpManagerAddressStr = cfg[IdxCfgTopupManagerAddress] | |
470 | + | let submitLimitsBaseMax = parseIntValue(cfg[IdxCfgSubmitLimitsBaseMax]) | |
471 | + | let submitLimitsShareMax = parseIntValue(cfg[IdxCfgSubmitLimitsShareMax]) | |
472 | + | let topUpCurrentIdxKEY = keyTopUpCurrentIdx(innerBaseStr) | |
456 | 473 | let prevTopUpIdx = getIntOrFail(topUpCurrentIdxKEY) | |
457 | 474 | let currentTopUpIdx = (prevTopUpIdx + 1) | |
458 | - | let valid = if ((income > 0)) | |
459 | - | then { | |
460 | - | let pmt = value(i.payments[0]) | |
461 | - | let pmtAssetId = value(pmt.assetId) | |
462 | - | if ((baseAssetId != pmtAssetId)) | |
463 | - | then throw("attached payment's asset id is NOT matched passed baseAssetStr") | |
464 | - | else if ((size(i.payments) > 1)) | |
465 | - | then throw("only one payment can be attached") | |
466 | - | else if ((pmt.amount != income)) | |
467 | - | then throw("attached payment.amount is NOT matched passed income argument") | |
468 | - | else true | |
469 | - | } | |
470 | - | else if ((0 > income)) | |
471 | - | then { | |
472 | - | let baseBalance = assetBalance(this, baseAssetId) | |
473 | - | let allowedAmount = fraction(topupMaxNegativePart, baseBalance, bothAssetMult) | |
474 | - | if ((-(income) > allowedAmount)) | |
475 | - | then throw(("topup negative income couldn't be greater than " + toString(allowedAmount))) | |
476 | - | else true | |
477 | - | } | |
478 | - | else throw("zero income is not allowed") | |
479 | - | let topUpLastHeightKEY = keyTopUpLastHeight(internalBaseAssetStr, toString(i.caller)) | |
475 | + | let topUpLastHeightKEY = keyTopUpLastHeight(innerBaseStr, toString(i.caller)) | |
480 | 476 | let topUpLastHeight = valueOrElse(getInteger(this, topUpLastHeightKEY), 0) | |
477 | + | let priceAthKEY = keyPriceATH(innerBaseStr) | |
478 | + | let prevPriceATH = valueOrElse(getInteger(this, priceAthKEY), 0) | |
481 | 479 | if ((toString(i.caller) != topUpManagerAddressStr)) | |
482 | 480 | then failTopupManagerOnly(topUpManagerAddressStr) | |
483 | - | else if (!(valid)) | |
484 | - | then throw("validation failed") | |
485 | - | else if ((topupIntervalInBlocks > (height - topUpLastHeight))) | |
486 | - | then throw((("1 topup per " + toString(topupIntervalInBlocks)) + " blocks from the same address is allowed")) | |
487 | - | else { | |
488 | - | let price = genericCalcPrice(internalBaseAssetStr, baseAssetId, income, shareAssetId, priceMult)._1 | |
489 | - | let diffTuple = calcTotalLockedDiff("topup", "", internalBaseAssetStr, price, priceMult, 0, baseAssetId, shareAssetId) | |
490 | - | let topupTotalDiff = diffTuple._1 | |
491 | - | let priceAthKEY = keyPriceATH(internalBaseAssetStr) | |
492 | - | let prevPriceATH = valueOrElse(getInteger(this, priceAthKEY), 0) | |
493 | - | ((((((([IntegerEntry(keyPriceLast(internalBaseAssetStr), price), IntegerEntry(keyPriceHistory(internalBaseAssetStr, height, lastBlock.timestamp), price), IntegerEntry(keyPriceByTopUpIdx(internalBaseAssetStr, currentTopUpIdx), price), IntegerEntry(topUpCurrentIdxKEY, currentTopUpIdx), IntegerEntry(priceAthKEY, if ((price > prevPriceATH)) | |
494 | - | then price | |
495 | - | else prevPriceATH), IntegerEntry(topUpLastHeightKEY, height)] :+ TotalLockedStringEntry("DECREMENT", keyTotalLocked(internalBaseAssetStr), topupTotalDiff)) :+ TopupMutexIntEntry(internalBaseAssetStr, 0)) :+ IntegerEntry(keyTopupLastTimestamp(internalBaseAssetStr), lastBlock.timestamp)) :+ RemainingLimitsStringEntry(keyLimitsRemaining(internalBaseAssetStr), submitLimitsBaseMax, submitLimitsShareMax)) :+ Burn(shareAssetId, topupTotalDiff[IdxTotalLockedInShare])) :+ Reissue(shareAssetId, -(topupTotalDiff[IdxTotalLockedOutShare]), true)) ++ (if ((0 > income)) | |
496 | - | then [ScriptTransfer(i.caller, -(income), baseAssetId)] | |
497 | - | else nil)) | |
498 | - | } | |
481 | + | else if ((topupIntervalInBlocks > (height - topUpLastHeight))) | |
482 | + | then throw((("1 topup per " + toString(topupIntervalInBlocks)) + " blocks from the same address is allowed")) | |
483 | + | else { | |
484 | + | let price = genericCalcPrice(innerBaseStr, baseAssetId, income, shareAssetId, priceMult)._1 | |
485 | + | let valid = if ((income > 0)) | |
486 | + | then { | |
487 | + | let pmt = value(i.payments[0]) | |
488 | + | let pmtAssetId = value(pmt.assetId) | |
489 | + | if ((baseAssetId != pmtAssetId)) | |
490 | + | then throw("attached payment's asset id is NOT matched passed baseAssetStr") | |
491 | + | else if ((size(i.payments) > 1)) | |
492 | + | then throw("only one payment can be attached") | |
493 | + | else if ((pmt.amount != income)) | |
494 | + | then throw("attached payment.amount is NOT matched passed income argument") | |
495 | + | else true | |
496 | + | } | |
497 | + | else if ((0 > income)) | |
498 | + | then { | |
499 | + | let minAllowedPrice = fraction(prevPriceATH, ((1 * bothAssetMult) - topupMaxNegativePart), bothAssetMult) | |
500 | + | if ((minAllowedPrice > price)) | |
501 | + | then failTopupMaxPriceDeviation(price, minAllowedPrice) | |
502 | + | else true | |
503 | + | } | |
504 | + | else throw("zero income is not allowed") | |
505 | + | if (!(valid)) | |
506 | + | then throw("validation failed") | |
507 | + | else { | |
508 | + | let diffTuple = calcTotalLockedDiff("topup", "", innerBaseStr, price, priceMult, 0, baseAssetId, shareAssetId) | |
509 | + | let topupTotalDiff = diffTuple._1 | |
510 | + | ((((((([IntE(keyPriceLast(innerBaseStr), price), IntE(keyPriceHistory(innerBaseStr, height, lastBlock.timestamp), price), IntE(keyPriceByTopUpIdx(innerBaseStr, currentTopUpIdx), price), IntE(topUpCurrentIdxKEY, currentTopUpIdx), IntE(priceAthKEY, if ((price > prevPriceATH)) | |
511 | + | then price | |
512 | + | else prevPriceATH), IntE(topUpLastHeightKEY, height)] :+ TotalLockedStringEntry("DECREMENT", keyTotalLocked(innerBaseStr), topupTotalDiff)) :+ TopupMutexIntEntry(innerBaseStr, 0)) :+ IntE(keyTopupLastTimestamp(innerBaseStr), lastBlock.timestamp)) :+ RemainingLimitsStringEntry(keyLimitsRemaining(innerBaseStr), submitLimitsBaseMax, submitLimitsShareMax)) :+ Burn(shareAssetId, topupTotalDiff[IdxTotalLockedInShare])) :+ Reissue(shareAssetId, -(topupTotalDiff[IdxTotalLockedOutShare]), true)) ++ (if ((0 > income)) | |
513 | + | then [ScriptTransfer(i.caller, -(income), baseAssetId)] | |
514 | + | else nil)) | |
515 | + | } | |
516 | + | } | |
499 | 517 | } | |
500 | 518 | ||
501 | 519 | ||
502 | 520 | ||
503 | 521 | @Callable(i) | |
504 | 522 | func currentSysParamsREST (baseAssetStr) = { | |
505 | 523 | let sysStateTuple = privateCurrentSysParamsREST(baseAssetStr) | |
506 | 524 | let price = sysStateTuple._1.value | |
507 | 525 | let decimalsMultPrice = sysStateTuple._2.value | |
508 | 526 | let baseAssetBalance = sysStateTuple._3.value | |
509 | 527 | let totalLockedBaseAmount = sysStateTuple._4.value | |
510 | 528 | let baseAssetBalanceWCO = sysStateTuple._5.value | |
511 | 529 | let shareEmission = sysStateTuple._6.value | |
512 | 530 | let currIterTotalInBaseAmount = sysStateTuple._7.value | |
513 | 531 | let currIterTotalInShareAmount = sysStateTuple._8.value | |
514 | 532 | let totalLockedOutBaseAmount = sysStateTuple._9.value | |
515 | 533 | let totalLockedOutShareAmount = sysStateTuple._10.value | |
516 | 534 | let decimalsMultBothAssets = sysStateTuple._11.value | |
517 | 535 | let priceATH = sysStateTuple._12.value | |
518 | 536 | let priceRecalculated = sysStateTuple._13.value | |
519 | 537 | let topupLastTime = sysStateTuple._14.value | |
520 | 538 | let restData = makeString(["startCurrentSysParamsREST", toString(price), toString(decimalsMultPrice), toString(baseAssetBalance), toString(totalLockedBaseAmount), toString(baseAssetBalanceWCO), toString(shareEmission), toString(currIterTotalInBaseAmount), toString(currIterTotalInShareAmount), toString(totalLockedOutBaseAmount), toString(totalLockedOutShareAmount), toString(decimalsMultBothAssets), toString(priceATH), toString(priceRecalculated), toString(topupLastTime), "endCurrentSysParamsREST"], SEP) | |
521 | 539 | throw(restData) | |
522 | 540 | } | |
523 | 541 | ||
524 | 542 |
github/deemru/w8io/169f3d6 122.87 ms ◑