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:AAIEAAAAAAAAADsIAhIQCg4ICAgBCAEBAQgBAQEBCBIDCgEBEgASABIFCgMICAgSBQoDCAgIEgMKAQgSBAoCCAESAwoBCAAAAE4AAAAAA1NFUAIAAAACX18BAAAAD2dldFN0cmluZ09yRmFpbAAAAAEAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5CQABLAAAAAICAAAAFU5vIGRhdGEgZm9yIHRoaXMua2V5PQUAAAADa2V5AQAAABBnZXRCb29sZWFuT3JGYWlsAAAAAQAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABBsAAAACBQAAAAR0aGlzBQAAAANrZXkJAAEsAAAAAgIAAAAVTm8gZGF0YSBmb3IgdGhpcy5rZXk9BQAAAANrZXkBAAAADGdldEludE9yRmFpbAAAAAEAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5CQABLAAAAAICAAAAFU5vIGRhdGEgZm9yIHRo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YWxhbmNlV0NPCQAETAAAAAIJAAGkAAAAAQUAAAANc2hhcmVFbWlzc2lvbgkABEwAAAACCQABpAAAAAEFAAAAGWN1cnJJdGVyVG90YWxJbkJhc2VBbW91bnQJAARMAAAAAgkAAaQAAAABBQAAABpjdXJySXRlclRvdGFsSW5TaGFyZUFtb3VudAkABEwAAAACCQABpAAAAAEFAAAAGHRvdGFsTG9ja2VkT3V0QmFzZUFtb3VudAkABEwAAAACCQABpAAAAAEFAAAAGXRvdGFsTG9ja2VkT3V0U2hhcmVBbW91bnQJAARMAAAAAgkAAaQAAAABBQAAABZkZWNpbWFsc011bHRCb3RoQXNzZXRzCQAETAAAAAIJAAGkAAAAAQUAAAAIcHJpY2VBVEgJAARMAAAAAgkAAaQAAAABBQAAABFwcmljZVJlY2FsY3VsYXRlZAkABEwAAAACCQABpAAAAAEFAAAADXRvcHVwTGFzdFRpbWUJAARMAAAAAgIAAAAXZW5kQ3VycmVudFN5c1BhcmFtc1JFU1QFAAAAA25pbAUAAAADU0VQCQAAAgAAAAEFAAAACHJlc3REYXRhAAAAAE0a1O4=", "chainId": 84, "height": 1479416, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Ejm9dCEZ8C5yuYQQ7q7LfCiRbvA9YtZSx1kpLsFbe3Eo Next: none Diff:
OldNewDifferences
1212 func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), ("No data for this.key=" + key))
1313
1414
15+func IntE (key,val) = IntegerEntry(key, val)
16+
17+
18+func StrE (key,val) = StringEntry(key, val)
19+
20+
1521 func failExecuteGet (msg,baseAssetStr,userAddressStr,submitTxIdStr,operationType) = throw(((((((((msg + ": baseAsset=") + baseAssetStr) + " userAddress=") + userAddressStr) + " submitTxId=") + submitTxIdStr) + " operation=") + operationType))
1622
1723
1925
2026
2127 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)))
2231
2332
2433 func convertShare2Base (shareAmount,price,priceMult) = fraction(shareAmount, price, priceMult)
3342 func keyNextInternalAssetId () = "%s__nextInternalAssetId"
3443
3544
36-func keyPriceLast (internalBasetAssetStr) = ("%s%s%d__price__last__" + internalBasetAssetStr)
45+func keyPriceLast (innerBaseStr) = ("%s%s%d__price__last__" + innerBaseStr)
3746
3847
39-func keyPriceATH (internalBasetAssetStr) = ("%s%s%d__price__ath__" + internalBasetAssetStr)
48+func keyPriceATH (innerBaseStr) = ("%s%s%d__price__ath__" + innerBaseStr)
4049
4150
42-func keyPriceByTopUpIdx (internalBaseAssetStr,topUpIdx) = makeString(["%s%s%d%d__price__byTopUpIdx", internalBaseAssetStr, toString(topUpIdx)], SEP)
51+func keyPriceByTopUpIdx (innerBaseStr,topUpIdx) = makeString(["%s%s%d%d__price__byTopUpIdx", innerBaseStr, toString(topUpIdx)], SEP)
4352
4453
45-func keyPriceHistory (internalBasetAssetStr,h,timestamp) = makeString(["%s%s%d%d%d__price__history", internalBasetAssetStr, toString(h), toString(timestamp)], SEP)
54+func keyPriceHistory (innerBaseStr,h,timestamp) = makeString(["%s%s%d%d%d__price__history", innerBaseStr, toString(h), toString(timestamp)], SEP)
4655
4756
48-func keyTotalLocked (internalBasetAssetStr) = ("%s%s%d__total__locked__" + internalBasetAssetStr)
57+func keyTotalLocked (innerBaseStr) = ("%s%s%d__total__locked__" + innerBaseStr)
4958
5059
51-func keyTotalLockedByUser (internalBaseAssetStr,userAddressStr) = makeString(["%s%s%d%s__total__locked", internalBaseAssetStr, userAddressStr], SEP)
60+func keyTotalLockedByUser (innerBaseStr,userAddressStr) = makeString(["%s%s%d%s__total__locked", innerBaseStr, userAddressStr], SEP)
5261
5362
5463 func keyMappingsInternal2baseAssetId (internalBaseAsset) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(internalBaseAsset))
6372 func keyMappingsBaseAsset2shareId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2shareId__" + baseAssetStr)
6473
6574
66-func keyShutdownSubmitOperation (internalBaseAssetStr) = ("%s%s%d__shutdown__submit__" + internalBaseAssetStr)
75+func keyShutdownSubmitOperation (innerBaseStr) = ("%s%s%d__shutdown__submit__" + innerBaseStr)
6776
6877
69-func keyShutdownManager (internalBaseAssetStr) = ("%s%s%d__shutdown__manager__" + internalBaseAssetStr)
78+func keyShutdownManager (innerBaseStr) = ("%s%s%d__shutdown__manager__" + innerBaseStr)
7079
7180
72-func keyTopUpCurrentIdx (internalBaseAssetStr) = ("%s%s%d__topup__currentIdx__" + internalBaseAssetStr)
81+func keyTopUpCurrentIdx (innerBaseStr) = ("%s%s%d__topup__currentIdx__" + innerBaseStr)
7382
7483
75-func keyTopUpLastHeight (internalBasetAssetStr,sender) = makeString(["%s%s%s%d%s__topup__last__height", internalBasetAssetStr, sender], SEP)
84+func keyTopUpLastHeight (innerBaseStr,sender) = makeString(["%s%s%s%d%s__topup__last__height", innerBaseStr, sender], SEP)
7685
7786
78-func keyTopupMutext (internalBasetAssetStr) = ("%s%s%d__topup__mutex__" + internalBasetAssetStr)
87+func keyTopupMutext (innerBaseStr) = ("%s%s%d__topup__mutex__" + innerBaseStr)
7988
8089
81-func keyTopupLastTimestamp (internalBasetAssetStr) = ("%s%s%s%d__topup__last__timestamp__" + internalBasetAssetStr)
90+func keyTopupLastTimestamp (innerBaseStr) = ("%s%s%s%d__topup__last__timestamp__" + innerBaseStr)
8291
8392
84-func keyTopupHistory (internalBasetAssetStr,topupIdx) = makeString(["%s%s%d%d__topup__history", internalBasetAssetStr, toString(topupIdx)], SEP)
93+func keyTopupHistory (innerBaseStr,topupIdx) = makeString(["%s%s%d%d__topup__history", innerBaseStr, toString(topupIdx)], SEP)
8594
8695
87-func keyLimitsRemaining (internalBasetAssetStr) = ("%s%s%d__limits__remaining__" + internalBasetAssetStr)
96+func keyLimitsRemaining (innerBaseStr) = ("%s%s%d__limits__remaining__" + innerBaseStr)
8897
8998
9099 let IdxCfgShareAssetId = 1
113122
114123 let IdxCfgAdminAddress = 13
115124
116-func dataAssetCfg (shareAssetStr,internalBaseAssetStr,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, internalBaseAssetStr, toString(decimalsMultBothAssets), toString(decimalsMultPrice), toString(getDelayInBlocks), toString(topupIntervalInBlocks), toString(topupMaxNegativePart), topupManagerAddress, toString(submitLimitsBaseMax), toString(submitLimitsBaseReset), toString(submitLimitsShareMax), toString(submitLimitsShareReset), adminAddress], SEP)
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)
117126
118127
119128 let IdxTotalLockedInShare = 1
136145 }
137146
138147
139-func calcTotalLockedDiff (direction,operationType,internalBaseAssetStr,price,priceMult,inAmount,baseAssetId,shareAssetId) = {
148+func calcTotalLockedDiff (direction,operationType,innerBaseStr,price,priceMult,inAmount,baseAssetId,shareAssetId) = {
140149 let t = (direction + operationType)
150+ let emptyVect = fromBase58String("")
141151 if ((t == "submitP"))
142152 then {
143153 let totalDiff = dataTotalLockedInt(0, 0, inAmount, 0)
144154 let userDiff = totalDiff
145- $Tuple4(totalDiff, userDiff, 0, fromBase58String(""))
155+ $Tuple5(totalDiff, userDiff, 0, emptyVect, false)
146156 }
147157 else if ((t == "submitG"))
148158 then {
149159 let totalDiff = dataTotalLockedInt(inAmount, 0, 0, 0)
150160 let userDiff = totalDiff
151- $Tuple4(totalDiff, userDiff, 0, fromBase58String(""))
161+ $Tuple5(totalDiff, userDiff, 0, emptyVect, true)
152162 }
153163 else if ((t == "executeP"))
154164 then {
155165 let outAmount = convertBase2Share(inAmount, price, priceMult)
156166 let totalDiff = dataTotalLockedInt(0, 0, 0, outAmount)
157167 let userDiff = dataTotalLockedInt(0, 0, inAmount, 0)
158- $Tuple4(totalDiff, userDiff, outAmount, shareAssetId)
168+ $Tuple5(totalDiff, userDiff, outAmount, shareAssetId, false)
159169 }
160170 else if ((t == "executeG"))
161171 then {
162172 let outAmount = convertShare2Base(inAmount, price, priceMult)
163173 let totalDiff = dataTotalLockedInt(0, outAmount, 0, 0)
164174 let userDiff = dataTotalLockedInt(inAmount, 0, 0, 0)
165- $Tuple4(totalDiff, userDiff, outAmount, baseAssetId)
175+ $Tuple5(totalDiff, userDiff, outAmount, baseAssetId, false)
166176 }
167177 else if ((t == "topup"))
168178 then {
169- let totalLockedArray = readTotalLocked(keyTotalLocked(internalBaseAssetStr))
179+ let totalLockedArray = readTotalLocked(keyTotalLocked(innerBaseStr))
170180 let totalLockedInBaseAmount = totalLockedArray[IdxTotalLockedInBase]
171181 let totalLockedInShareAmount = totalLockedArray[IdxTotalLockedInShare]
172182 let totalDiff = dataTotalLockedInt(totalLockedInShareAmount, (-1 * convertShare2Base(totalLockedInShareAmount, price, priceMult)), totalLockedInBaseAmount, (-1 * convertBase2Share(totalLockedInBaseAmount, price, priceMult)))
173- $Tuple4(totalDiff, nil, 0, fromBase58String(""))
183+ $Tuple5(totalDiff, nil, 0, emptyVect, false)
174184 }
175185 else throw(("Unsupported Type " + t))
176186 }
184194 else throw(("Unsupported action " + action))
185195
186196 let dataArray = readTotalLocked(key)
187- StringEntry(key, dataTotalLocked(UPDATE(dataArray[IdxTotalLockedInShare], diff[IdxTotalLockedInShare]), UPDATE(dataArray[IdxTotalLockedOutBase], diff[IdxTotalLockedOutBase]), UPDATE(dataArray[IdxTotalLockedInBase], diff[IdxTotalLockedInBase]), UPDATE(dataArray[IdxTotalLockedOutShare], diff[IdxTotalLockedOutShare])))
197+ StrE(key, dataTotalLocked(UPDATE(dataArray[IdxTotalLockedInShare], diff[IdxTotalLockedInShare]), UPDATE(dataArray[IdxTotalLockedOutBase], diff[IdxTotalLockedOutBase]), UPDATE(dataArray[IdxTotalLockedInBase], diff[IdxTotalLockedInBase]), UPDATE(dataArray[IdxTotalLockedOutShare], diff[IdxTotalLockedOutShare])))
188198 }
189199
190200
191-func keyOperation (operationType,internalBaseAssetStr,userAddress,txId) = makeString(["%s%d%s%s", operationType, internalBaseAssetStr, userAddress, txId], SEP)
201+func keyOperation (operationType,innerBaseStr,userAddress,txId) = makeString(["%s%d%s%s", operationType, innerBaseStr, userAddress, txId], SEP)
192202
193203
194204 let IdxOperStatus = 1
228238
229239 let IdxLimitsRemainingShare = 2
230240
231-func RemainingLimitsStringEntry (key,baseRemainingLimit,shareRemainingLimit) = StringEntry(key, makeString(["%d%d", toString(baseRemainingLimit), toString(shareRemainingLimit)], SEP))
241+func RemainingLimitsStringEntry (key,baseRemainingLimit,shareRemainingLimit) = StrE(key, makeString(["%d%d", toString(baseRemainingLimit), toString(shareRemainingLimit)], SEP))
232242
233243
234-func TopupMutexIntEntry (internalBaseAssetStr,acquiredHeight) = IntegerEntry(keyTopupMutext(internalBaseAssetStr), acquiredHeight)
244+func TopupMutexIntEntry (innerBaseStr,acquiredHeight) = IntE(keyTopupMutext(innerBaseStr), acquiredHeight)
235245
236246
237-func genericCalcPrice (internalBaseAssetStr,baseAssetId,topUpBaseAmount,shareAssetId,decimalsMultPrice) = {
238- let totalLockedArray = readTotalLocked(keyTotalLocked(internalBaseAssetStr))
247+func genericCalcPrice (innerBaseStr,baseAssetId,topUpBaseAmount,shareAssetId,decimalsMultPrice) = {
248+ let totalLockedArray = readTotalLocked(keyTotalLocked(innerBaseStr))
239249 let totalLockedOutBaseAmount = totalLockedArray[IdxTotalLockedOutBase]
240250 let currIterTotalInBaseAmount = totalLockedArray[IdxTotalLockedInBase]
241251 let baseAssetBalance = assetBalance(this, baseAssetId)
246256 if ((0 > baseAssetBalanceWCO))
247257 then throw(((("baseAssetBalanceWco < 0: baseAssettBalance=" + toString(baseAssetBalance)) + " baseAssetBalanceWco=") + toString(baseAssetBalanceWCO)))
248258 else {
249- let lastPrice = getIntOrFail(keyPriceLast(internalBaseAssetStr))
259+ let lastPrice = getIntOrFail(keyPriceLast(innerBaseStr))
250260 let price = if ((shareEmission == 0))
251261 then lastPrice
252262 else fraction(baseAssetBalanceWCO, decimalsMultPrice, shareEmission)
255265 }
256266
257267
258-func calcPrice (internalBaseAssetStr,baseAssetId,shareAssetId,decimalsMultPrice) = genericCalcPrice(internalBaseAssetStr, baseAssetId, 0, shareAssetId, decimalsMultPrice)
268+func calcPrice (innerBaseStr,baseAssetId,shareAssetId,decimalsMultPrice) = genericCalcPrice(innerBaseStr, baseAssetId, 0, shareAssetId, decimalsMultPrice)
259269
260270
261271 func commonSubmit (operationType,i,inAmount,inAssetId,baseAssetStr) = {
266276 let shareAssetStr = cfgArray[IdxCfgShareAssetId]
267277 let shareAssetId = fromBase58String(shareAssetStr)
268278 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)
271282 let limitsCfgArray = split(getStringOrFail(limitsKEY), SEP)
272283 let limitsRemainingBase = parseIntValue(limitsCfgArray[IdxLimitsRemainingBase])
273284 let limitsRemainingShare = parseIntValue(limitsCfgArray[IdxLimitsRemainingShare])
274- let isSubmitBlocked = valueOrElse(getBoolean(this, keyShutdownSubmitOperation(internalBaseAssetStr)), false)
285+ let isSubmitBlocked = valueOrElse(getBoolean(this, keyShutdownSubmitOperation(innerBaseStr)), false)
275286 if (isSubmitBlocked)
276287 then throw("submit operation is blocked")
277288 else {
278- let operationsMutex = valueOrElse(getInteger(this, keyTopupMutext(internalBaseAssetStr)), 0)
289+ let operationsMutex = valueOrElse(getInteger(this, keyTopupMutext(innerBaseStr)), 0)
279290 if (((operationsMutex + 60) > height))
280291 then throw("submit operations are blocked by topup manager")
281292 else {
282- let diffTuple = calcTotalLockedDiff("submit", operationType, internalBaseAssetStr, 0, 0, inAmount, baseAssetId, shareAssetId)
293+ let diffTuple = calcTotalLockedDiff("submit", operationType, innerBaseStr, 0, 0, inAmount, baseAssetId, shareAssetId)
283294 let limitsRemainingBaseNew = (limitsRemainingBase - diffTuple._2[IdxTotalLockedInBase])
284295 let limitsRemainingShareNew = (limitsRemainingShare - diffTuple._2[IdxTotalLockedInShare])
285296 if (if ((0 > limitsRemainingBaseNew))
287298 else (0 > limitsRemainingShareNew))
288299 then failSubmitLimitsExceeds(limitsRemainingBase, limitsRemainingShare, limitsRemainingBaseNew, limitsRemainingShareNew)
289300 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))
292306 }
293307 }
294308 }
299313 let userAddress = addressFromStringValue(userAddressStr)
300314 let assetCfgArray = readAssetCfgOrFail(baseAssetStr)
301315 let shareAssetId = fromBase58String(assetCfgArray[IdxCfgShareAssetId])
302- let internalBaseAssetStr = assetCfgArray[IdxCfgInternalBaseAsset]
316+ let innerBaseStr = assetCfgArray[IdxCfgInternalBaseAsset]
303317 let decimalsMultPrice = parseIntValue(assetCfgArray[IdxCfgDecimalsMultPrice])
304318 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))
312327 if ((status != "PENDING"))
313328 then failExecuteGet("Status is not PENDING", baseAssetStr, userAddressStr, submitTxIdStr, operationType)
314329 else if ((topupUnlockIdx > currTopUpIdx))
315330 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+ }
324341 }
325342
326343
331348 let shareAssetId = fromBase58String(shareAssetStr)
332349 let decimalsMultBothAssetsVal = parseIntValue(cfgArray[IdxCfgDecimalsMultBothAssets])
333350 let decimalsMultPriceVal = parseIntValue(cfgArray[IdxCfgDecimalsMultPrice])
334- let internalBaseAssetStr = cfgArray[IdxCfgInternalBaseAsset]
335- let priceAthKEY = keyPriceATH(internalBaseAssetStr)
351+ let innerBaseStr = cfgArray[IdxCfgInternalBaseAsset]
352+ let priceAthKEY = keyPriceATH(innerBaseStr)
336353 let priceAthVal = valueOrElse(getInteger(this, priceAthKEY), 0)
337- let priceLastKEY = keyPriceLast(internalBaseAssetStr)
354+ let priceLastKEY = keyPriceLast(innerBaseStr)
338355 let priceLastVal = valueOrElse(getInteger(this, priceLastKEY), 0)
339- let topupLastTimeKEY = keyTopupLastTimestamp(internalBaseAssetStr)
356+ let topupLastTimeKEY = keyTopupLastTimestamp(innerBaseStr)
340357 let topupLastTimeVal = valueOrElse(getInteger(this, topupLastTimeKEY), 0)
341- let sysState = calcPrice(internalBaseAssetStr, baseAssetId, shareAssetId, decimalsMultPriceVal)
342- $Tuple14(IntegerEntry("price", priceLastVal), IntegerEntry("decimalsMultPrice", decimalsMultPriceVal), IntegerEntry("baseAssetBalance", sysState._2), IntegerEntry("-1", sysState._3), IntegerEntry("baseAssetBalanceWCO", sysState._4), IntegerEntry("shareEmission", sysState._5), IntegerEntry("currIterTotalInBaseAmount", sysState._6), IntegerEntry("currIterTotalInShareAmount", sysState._7), IntegerEntry("totalLockedOutBaseAmount", sysState._8), IntegerEntry("totalLockedOutShareAmount", sysState._9), IntegerEntry("decimalsMultBothAssets", decimalsMultBothAssetsVal), IntegerEntry("priceATH", priceAthVal), IntegerEntry("priceRecalculated", sysState._1), IntegerEntry("topupLastTimestamp", topupLastTimeVal))
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))
343360 }
344361
345362
373390 let shareAssetId = calculateAssetId(shareAssetIssueAction)
374391 let shareAssetStr = toBase58String(shareAssetId)
375392 let internalBaseAssetId = valueOrElse(getInteger(this, keyNextInternalAssetId()), 0)
376- let internalBaseAssetStr = toString(internalBaseAssetId)
377-[StringEntry(keyAssetCfg(baseAssetStr), dataAssetCfg(shareAssetStr, internalBaseAssetStr, decimalsMultBothAssets, decimalsMultPrice, getDelayinBlocks, topupIntervalInBlocks, topupMaxNegativePart, topupManagerAddress, submitLimitsBaseMax, submitLimitsBaseReset, submitLimitsShareMax, submitLimitsShareReset, adminAddress)), StringEntry(keyMappingsInternal2baseAssetId(internalBaseAssetId), baseAssetStr), StringEntry(keyMappingsBaseAsset2internalId(baseAssetStr), internalBaseAssetStr), StringEntry(keyMappingsShare2baseAssetId(shareAssetStr), baseAssetStr), StringEntry(keyMappingsBaseAsset2shareId(baseAssetStr), shareAssetStr), BooleanEntry(keyShutdownSubmitOperation(internalBaseAssetStr), false), StringEntry(keyShutdownManager(internalBaseAssetStr), shutdownManagerAddress), IntegerEntry(keyNextInternalAssetId(), (internalBaseAssetId + 1)), IntegerEntry(keyPriceLast(internalBaseAssetStr), startPrice), IntegerEntry(keyPriceHistory(internalBaseAssetStr, height, lastBlock.timestamp), startPrice), IntegerEntry(keyTopUpCurrentIdx(internalBaseAssetStr), 0), RemainingLimitsStringEntry(keyLimitsRemaining(internalBaseAssetStr), submitLimitsBaseMax, submitLimitsShareMax), shareAssetIssueAction, ScriptTransfer(addressFromStringValue(topupManagerAddress), shareInitAmount, shareAssetId)]
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)]
378395 }
379396 }
380397
431448 func operationsMutex (baseAssetStr) = {
432449 let assetCfgArray = readAssetCfgOrFail(baseAssetStr)
433450 let topUpManagerAddressStr = assetCfgArray[IdxCfgTopupManagerAddress]
434- let internalBaseAssetStr = assetCfgArray[IdxCfgInternalBaseAsset]
451+ let innerBaseStr = assetCfgArray[IdxCfgInternalBaseAsset]
435452 if ((toString(i.caller) != topUpManagerAddressStr))
436453 then failTopupManagerOnly(topUpManagerAddressStr)
437- else [TopupMutexIntEntry(internalBaseAssetStr, height)]
454+ else [TopupMutexIntEntry(innerBaseStr, height)]
438455 }
439456
440457
442459 @Callable(i)
443460 func topUpBalance (baseAssetStr,income) = {
444461 let baseAssetId = fromBase58String(baseAssetStr)
445- let assetCfgArray = readAssetCfgOrFail(baseAssetStr)
446- let shareAssetId = fromBase58String(assetCfgArray[IdxCfgShareAssetId])
447- let priceMult = parseIntValue(assetCfgArray[IdxCfgDecimalsMultPrice])
448- let bothAssetMult = parseIntValue(assetCfgArray[IdxCfgDecimalsMultBothAssets])
449- let topupIntervalInBlocks = parseIntValue(assetCfgArray[IdxCfgTopupIntervalInBlocks])
450- let topupMaxNegativePart = parseIntValue(assetCfgArray[IdxCfgTopupMaxNegativePart])
451- let internalBaseAssetStr = assetCfgArray[IdxCfgInternalBaseAsset]
452- let topUpManagerAddressStr = assetCfgArray[IdxCfgTopupManagerAddress]
453- let submitLimitsBaseMax = parseIntValue(assetCfgArray[IdxCfgSubmitLimitsBaseMax])
454- let submitLimitsShareMax = parseIntValue(assetCfgArray[IdxCfgSubmitLimitsShareMax])
455- let topUpCurrentIdxKEY = keyTopUpCurrentIdx(internalBaseAssetStr)
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)
456473 let prevTopUpIdx = getIntOrFail(topUpCurrentIdxKEY)
457474 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))
480476 let topUpLastHeight = valueOrElse(getInteger(this, topUpLastHeightKEY), 0)
477+ let priceAthKEY = keyPriceATH(innerBaseStr)
478+ let prevPriceATH = valueOrElse(getInteger(this, priceAthKEY), 0)
481479 if ((toString(i.caller) != topUpManagerAddressStr))
482480 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+ }
499517 }
500518
501519
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), ("No data for this.key=" + key))
77
88
99 func getBooleanOrFail (key) = valueOrErrorMessage(getBoolean(this, key), ("No data for this.key=" + key))
1010
1111
1212 func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), ("No data for this.key=" + key))
1313
1414
15+func IntE (key,val) = IntegerEntry(key, val)
16+
17+
18+func StrE (key,val) = StringEntry(key, val)
19+
20+
1521 func failExecuteGet (msg,baseAssetStr,userAddressStr,submitTxIdStr,operationType) = throw(((((((((msg + ": baseAsset=") + baseAssetStr) + " userAddress=") + userAddressStr) + " submitTxId=") + submitTxIdStr) + " operation=") + operationType))
1622
1723
1824 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)))
1925
2026
2127 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)))
2231
2332
2433 func convertShare2Base (shareAmount,price,priceMult) = fraction(shareAmount, price, priceMult)
2534
2635
2736 func convertBase2Share (baseAmount,price,priceMult) = fraction(baseAmount, priceMult, price)
2837
2938
3039 func keyAssetCfg (baseAssetStr) = ("%s%s%s__config__asset__" + baseAssetStr)
3140
3241
3342 func keyNextInternalAssetId () = "%s__nextInternalAssetId"
3443
3544
36-func keyPriceLast (internalBasetAssetStr) = ("%s%s%d__price__last__" + internalBasetAssetStr)
45+func keyPriceLast (innerBaseStr) = ("%s%s%d__price__last__" + innerBaseStr)
3746
3847
39-func keyPriceATH (internalBasetAssetStr) = ("%s%s%d__price__ath__" + internalBasetAssetStr)
48+func keyPriceATH (innerBaseStr) = ("%s%s%d__price__ath__" + innerBaseStr)
4049
4150
42-func keyPriceByTopUpIdx (internalBaseAssetStr,topUpIdx) = makeString(["%s%s%d%d__price__byTopUpIdx", internalBaseAssetStr, toString(topUpIdx)], SEP)
51+func keyPriceByTopUpIdx (innerBaseStr,topUpIdx) = makeString(["%s%s%d%d__price__byTopUpIdx", innerBaseStr, toString(topUpIdx)], SEP)
4352
4453
45-func keyPriceHistory (internalBasetAssetStr,h,timestamp) = makeString(["%s%s%d%d%d__price__history", internalBasetAssetStr, toString(h), toString(timestamp)], SEP)
54+func keyPriceHistory (innerBaseStr,h,timestamp) = makeString(["%s%s%d%d%d__price__history", innerBaseStr, toString(h), toString(timestamp)], SEP)
4655
4756
48-func keyTotalLocked (internalBasetAssetStr) = ("%s%s%d__total__locked__" + internalBasetAssetStr)
57+func keyTotalLocked (innerBaseStr) = ("%s%s%d__total__locked__" + innerBaseStr)
4958
5059
51-func keyTotalLockedByUser (internalBaseAssetStr,userAddressStr) = makeString(["%s%s%d%s__total__locked", internalBaseAssetStr, userAddressStr], SEP)
60+func keyTotalLockedByUser (innerBaseStr,userAddressStr) = makeString(["%s%s%d%s__total__locked", innerBaseStr, userAddressStr], SEP)
5261
5362
5463 func keyMappingsInternal2baseAssetId (internalBaseAsset) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(internalBaseAsset))
5564
5665
5766 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
5867
5968
6069 func keyMappingsShare2baseAssetId (shareAssetStr) = ("%s%s%s__mappings__share2baseAssetId__" + shareAssetStr)
6170
6271
6372 func keyMappingsBaseAsset2shareId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2shareId__" + baseAssetStr)
6473
6574
66-func keyShutdownSubmitOperation (internalBaseAssetStr) = ("%s%s%d__shutdown__submit__" + internalBaseAssetStr)
75+func keyShutdownSubmitOperation (innerBaseStr) = ("%s%s%d__shutdown__submit__" + innerBaseStr)
6776
6877
69-func keyShutdownManager (internalBaseAssetStr) = ("%s%s%d__shutdown__manager__" + internalBaseAssetStr)
78+func keyShutdownManager (innerBaseStr) = ("%s%s%d__shutdown__manager__" + innerBaseStr)
7079
7180
72-func keyTopUpCurrentIdx (internalBaseAssetStr) = ("%s%s%d__topup__currentIdx__" + internalBaseAssetStr)
81+func keyTopUpCurrentIdx (innerBaseStr) = ("%s%s%d__topup__currentIdx__" + innerBaseStr)
7382
7483
75-func keyTopUpLastHeight (internalBasetAssetStr,sender) = makeString(["%s%s%s%d%s__topup__last__height", internalBasetAssetStr, sender], SEP)
84+func keyTopUpLastHeight (innerBaseStr,sender) = makeString(["%s%s%s%d%s__topup__last__height", innerBaseStr, sender], SEP)
7685
7786
78-func keyTopupMutext (internalBasetAssetStr) = ("%s%s%d__topup__mutex__" + internalBasetAssetStr)
87+func keyTopupMutext (innerBaseStr) = ("%s%s%d__topup__mutex__" + innerBaseStr)
7988
8089
81-func keyTopupLastTimestamp (internalBasetAssetStr) = ("%s%s%s%d__topup__last__timestamp__" + internalBasetAssetStr)
90+func keyTopupLastTimestamp (innerBaseStr) = ("%s%s%s%d__topup__last__timestamp__" + innerBaseStr)
8291
8392
84-func keyTopupHistory (internalBasetAssetStr,topupIdx) = makeString(["%s%s%d%d__topup__history", internalBasetAssetStr, toString(topupIdx)], SEP)
93+func keyTopupHistory (innerBaseStr,topupIdx) = makeString(["%s%s%d%d__topup__history", innerBaseStr, toString(topupIdx)], SEP)
8594
8695
87-func keyLimitsRemaining (internalBasetAssetStr) = ("%s%s%d__limits__remaining__" + internalBasetAssetStr)
96+func keyLimitsRemaining (innerBaseStr) = ("%s%s%d__limits__remaining__" + innerBaseStr)
8897
8998
9099 let IdxCfgShareAssetId = 1
91100
92101 let IdxCfgInternalBaseAsset = 2
93102
94103 let IdxCfgDecimalsMultBothAssets = 3
95104
96105 let IdxCfgDecimalsMultPrice = 4
97106
98107 let IdxCfgGetDelayBlocks = 5
99108
100109 let IdxCfgTopupIntervalInBlocks = 6
101110
102111 let IdxCfgTopupMaxNegativePart = 7
103112
104113 let IdxCfgTopupManagerAddress = 8
105114
106115 let IdxCfgSubmitLimitsBaseMax = 9
107116
108117 let IdxCfgSubmitLimitsBaseReset = 10
109118
110119 let IdxCfgSubmitLimitsShareMax = 11
111120
112121 let IdxCfgSubmitLimitsShareReset = 12
113122
114123 let IdxCfgAdminAddress = 13
115124
116-func dataAssetCfg (shareAssetStr,internalBaseAssetStr,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, internalBaseAssetStr, toString(decimalsMultBothAssets), toString(decimalsMultPrice), toString(getDelayInBlocks), toString(topupIntervalInBlocks), toString(topupMaxNegativePart), topupManagerAddress, toString(submitLimitsBaseMax), toString(submitLimitsBaseReset), toString(submitLimitsShareMax), toString(submitLimitsShareReset), adminAddress], SEP)
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)
117126
118127
119128 let IdxTotalLockedInShare = 1
120129
121130 let IdxTotalLockedOutBase = 2
122131
123132 let IdxTotalLockedInBase = 3
124133
125134 let IdxTotalLockedOutShare = 4
126135
127136 func dataTotalLocked (inShareAmount,outBaseAmount,inBaseAmount,outShareAmount) = makeString(["%d%d%d%d", toString(inShareAmount), toString(outBaseAmount), toString(inBaseAmount), toString(outShareAmount)], SEP)
128137
129138
130139 func dataTotalLockedInt (inShareAmount,outBaseAmount,inBaseAmount,outShareAmount) = [-1, inShareAmount, outBaseAmount, inBaseAmount, outShareAmount]
131140
132141
133142 func readTotalLocked (key) = {
134143 let totalLockedArray = split(valueOrElse(getString(this, key), dataTotalLocked(0, 0, 0, 0)), SEP)
135144 dataTotalLockedInt(parseIntValue(totalLockedArray[IdxTotalLockedInShare]), parseIntValue(totalLockedArray[IdxTotalLockedOutBase]), parseIntValue(totalLockedArray[IdxTotalLockedInBase]), parseIntValue(totalLockedArray[IdxTotalLockedOutShare]))
136145 }
137146
138147
139-func calcTotalLockedDiff (direction,operationType,internalBaseAssetStr,price,priceMult,inAmount,baseAssetId,shareAssetId) = {
148+func calcTotalLockedDiff (direction,operationType,innerBaseStr,price,priceMult,inAmount,baseAssetId,shareAssetId) = {
140149 let t = (direction + operationType)
150+ let emptyVect = fromBase58String("")
141151 if ((t == "submitP"))
142152 then {
143153 let totalDiff = dataTotalLockedInt(0, 0, inAmount, 0)
144154 let userDiff = totalDiff
145- $Tuple4(totalDiff, userDiff, 0, fromBase58String(""))
155+ $Tuple5(totalDiff, userDiff, 0, emptyVect, false)
146156 }
147157 else if ((t == "submitG"))
148158 then {
149159 let totalDiff = dataTotalLockedInt(inAmount, 0, 0, 0)
150160 let userDiff = totalDiff
151- $Tuple4(totalDiff, userDiff, 0, fromBase58String(""))
161+ $Tuple5(totalDiff, userDiff, 0, emptyVect, true)
152162 }
153163 else if ((t == "executeP"))
154164 then {
155165 let outAmount = convertBase2Share(inAmount, price, priceMult)
156166 let totalDiff = dataTotalLockedInt(0, 0, 0, outAmount)
157167 let userDiff = dataTotalLockedInt(0, 0, inAmount, 0)
158- $Tuple4(totalDiff, userDiff, outAmount, shareAssetId)
168+ $Tuple5(totalDiff, userDiff, outAmount, shareAssetId, false)
159169 }
160170 else if ((t == "executeG"))
161171 then {
162172 let outAmount = convertShare2Base(inAmount, price, priceMult)
163173 let totalDiff = dataTotalLockedInt(0, outAmount, 0, 0)
164174 let userDiff = dataTotalLockedInt(inAmount, 0, 0, 0)
165- $Tuple4(totalDiff, userDiff, outAmount, baseAssetId)
175+ $Tuple5(totalDiff, userDiff, outAmount, baseAssetId, false)
166176 }
167177 else if ((t == "topup"))
168178 then {
169- let totalLockedArray = readTotalLocked(keyTotalLocked(internalBaseAssetStr))
179+ let totalLockedArray = readTotalLocked(keyTotalLocked(innerBaseStr))
170180 let totalLockedInBaseAmount = totalLockedArray[IdxTotalLockedInBase]
171181 let totalLockedInShareAmount = totalLockedArray[IdxTotalLockedInShare]
172182 let totalDiff = dataTotalLockedInt(totalLockedInShareAmount, (-1 * convertShare2Base(totalLockedInShareAmount, price, priceMult)), totalLockedInBaseAmount, (-1 * convertBase2Share(totalLockedInBaseAmount, price, priceMult)))
173- $Tuple4(totalDiff, nil, 0, fromBase58String(""))
183+ $Tuple5(totalDiff, nil, 0, emptyVect, false)
174184 }
175185 else throw(("Unsupported Type " + t))
176186 }
177187
178188
179189 func TotalLockedStringEntry (action,key,diff) = {
180190 func UPDATE (a,b) = if ((action == "INCREMENT"))
181191 then (a + b)
182192 else if ((action == "DECREMENT"))
183193 then (a - b)
184194 else throw(("Unsupported action " + action))
185195
186196 let dataArray = readTotalLocked(key)
187- StringEntry(key, dataTotalLocked(UPDATE(dataArray[IdxTotalLockedInShare], diff[IdxTotalLockedInShare]), UPDATE(dataArray[IdxTotalLockedOutBase], diff[IdxTotalLockedOutBase]), UPDATE(dataArray[IdxTotalLockedInBase], diff[IdxTotalLockedInBase]), UPDATE(dataArray[IdxTotalLockedOutShare], diff[IdxTotalLockedOutShare])))
197+ StrE(key, dataTotalLocked(UPDATE(dataArray[IdxTotalLockedInShare], diff[IdxTotalLockedInShare]), UPDATE(dataArray[IdxTotalLockedOutBase], diff[IdxTotalLockedOutBase]), UPDATE(dataArray[IdxTotalLockedInBase], diff[IdxTotalLockedInBase]), UPDATE(dataArray[IdxTotalLockedOutShare], diff[IdxTotalLockedOutShare])))
188198 }
189199
190200
191-func keyOperation (operationType,internalBaseAssetStr,userAddress,txId) = makeString(["%s%d%s%s", operationType, internalBaseAssetStr, userAddress, txId], SEP)
201+func keyOperation (operationType,innerBaseStr,userAddress,txId) = makeString(["%s%d%s%s", operationType, innerBaseStr, userAddress, txId], SEP)
192202
193203
194204 let IdxOperStatus = 1
195205
196206 let IdxOperInAmount = 2
197207
198208 let IdxOperPrice = 3
199209
200210 let IdxOperOutAmount = 4
201211
202212 let IdxOperStartHeight = 5
203213
204214 let IdxOperStartTimestamp = 6
205215
206216 let IdxOperEndHeight = 7
207217
208218 let IdxOperEndTimestamp = 8
209219
210220 let IdxOperTopupUnlockIdx = 9
211221
212222 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)
213223
214224
215225 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))
216226
217227
218228 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])
219229
220230
221231 func readAssetCfgOrFail (baseAssetStr) = {
222232 let key = keyAssetCfg(baseAssetStr)
223233 split(getStringOrFail(key), SEP)
224234 }
225235
226236
227237 let IdxLimitsRemainingBase = 1
228238
229239 let IdxLimitsRemainingShare = 2
230240
231-func RemainingLimitsStringEntry (key,baseRemainingLimit,shareRemainingLimit) = StringEntry(key, makeString(["%d%d", toString(baseRemainingLimit), toString(shareRemainingLimit)], SEP))
241+func RemainingLimitsStringEntry (key,baseRemainingLimit,shareRemainingLimit) = StrE(key, makeString(["%d%d", toString(baseRemainingLimit), toString(shareRemainingLimit)], SEP))
232242
233243
234-func TopupMutexIntEntry (internalBaseAssetStr,acquiredHeight) = IntegerEntry(keyTopupMutext(internalBaseAssetStr), acquiredHeight)
244+func TopupMutexIntEntry (innerBaseStr,acquiredHeight) = IntE(keyTopupMutext(innerBaseStr), acquiredHeight)
235245
236246
237-func genericCalcPrice (internalBaseAssetStr,baseAssetId,topUpBaseAmount,shareAssetId,decimalsMultPrice) = {
238- let totalLockedArray = readTotalLocked(keyTotalLocked(internalBaseAssetStr))
247+func genericCalcPrice (innerBaseStr,baseAssetId,topUpBaseAmount,shareAssetId,decimalsMultPrice) = {
248+ let totalLockedArray = readTotalLocked(keyTotalLocked(innerBaseStr))
239249 let totalLockedOutBaseAmount = totalLockedArray[IdxTotalLockedOutBase]
240250 let currIterTotalInBaseAmount = totalLockedArray[IdxTotalLockedInBase]
241251 let baseAssetBalance = assetBalance(this, baseAssetId)
242252 let baseAssetBalanceWCO = (((baseAssetBalance + topUpBaseAmount) - currIterTotalInBaseAmount) - totalLockedOutBaseAmount)
243253 let totalLockedOutShareAmount = totalLockedArray[IdxTotalLockedOutShare]
244254 let currIterTotalInShareAmount = totalLockedArray[IdxTotalLockedInShare]
245255 let shareEmission = value(assetInfo(shareAssetId)).quantity
246256 if ((0 > baseAssetBalanceWCO))
247257 then throw(((("baseAssetBalanceWco < 0: baseAssettBalance=" + toString(baseAssetBalance)) + " baseAssetBalanceWco=") + toString(baseAssetBalanceWCO)))
248258 else {
249- let lastPrice = getIntOrFail(keyPriceLast(internalBaseAssetStr))
259+ let lastPrice = getIntOrFail(keyPriceLast(innerBaseStr))
250260 let price = if ((shareEmission == 0))
251261 then lastPrice
252262 else fraction(baseAssetBalanceWCO, decimalsMultPrice, shareEmission)
253263 $Tuple9(price, baseAssetBalance, -1, baseAssetBalanceWCO, shareEmission, currIterTotalInBaseAmount, currIterTotalInShareAmount, totalLockedOutBaseAmount, totalLockedOutShareAmount)
254264 }
255265 }
256266
257267
258-func calcPrice (internalBaseAssetStr,baseAssetId,shareAssetId,decimalsMultPrice) = genericCalcPrice(internalBaseAssetStr, baseAssetId, 0, shareAssetId, decimalsMultPrice)
268+func calcPrice (innerBaseStr,baseAssetId,shareAssetId,decimalsMultPrice) = genericCalcPrice(innerBaseStr, baseAssetId, 0, shareAssetId, decimalsMultPrice)
259269
260270
261271 func commonSubmit (operationType,i,inAmount,inAssetId,baseAssetStr) = {
262272 let inAssetStr = toBase58String(inAssetId)
263273 let userAddressStr = toString(i.caller)
264274 let baseAssetId = fromBase58String(baseAssetStr)
265275 let cfgArray = readAssetCfgOrFail(baseAssetStr)
266276 let shareAssetStr = cfgArray[IdxCfgShareAssetId]
267277 let shareAssetId = fromBase58String(shareAssetStr)
268278 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)
271282 let limitsCfgArray = split(getStringOrFail(limitsKEY), SEP)
272283 let limitsRemainingBase = parseIntValue(limitsCfgArray[IdxLimitsRemainingBase])
273284 let limitsRemainingShare = parseIntValue(limitsCfgArray[IdxLimitsRemainingShare])
274- let isSubmitBlocked = valueOrElse(getBoolean(this, keyShutdownSubmitOperation(internalBaseAssetStr)), false)
285+ let isSubmitBlocked = valueOrElse(getBoolean(this, keyShutdownSubmitOperation(innerBaseStr)), false)
275286 if (isSubmitBlocked)
276287 then throw("submit operation is blocked")
277288 else {
278- let operationsMutex = valueOrElse(getInteger(this, keyTopupMutext(internalBaseAssetStr)), 0)
289+ let operationsMutex = valueOrElse(getInteger(this, keyTopupMutext(innerBaseStr)), 0)
279290 if (((operationsMutex + 60) > height))
280291 then throw("submit operations are blocked by topup manager")
281292 else {
282- let diffTuple = calcTotalLockedDiff("submit", operationType, internalBaseAssetStr, 0, 0, inAmount, baseAssetId, shareAssetId)
293+ let diffTuple = calcTotalLockedDiff("submit", operationType, innerBaseStr, 0, 0, inAmount, baseAssetId, shareAssetId)
283294 let limitsRemainingBaseNew = (limitsRemainingBase - diffTuple._2[IdxTotalLockedInBase])
284295 let limitsRemainingShareNew = (limitsRemainingShare - diffTuple._2[IdxTotalLockedInShare])
285296 if (if ((0 > limitsRemainingBaseNew))
286297 then true
287298 else (0 > limitsRemainingShareNew))
288299 then failSubmitLimitsExceeds(limitsRemainingBase, limitsRemainingShare, limitsRemainingBaseNew, limitsRemainingShareNew)
289300 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))
292306 }
293307 }
294308 }
295309 }
296310
297311
298312 func commonExecute (operationType,baseAssetStr,userAddressStr,submitTxIdStr) = {
299313 let userAddress = addressFromStringValue(userAddressStr)
300314 let assetCfgArray = readAssetCfgOrFail(baseAssetStr)
301315 let shareAssetId = fromBase58String(assetCfgArray[IdxCfgShareAssetId])
302- let internalBaseAssetStr = assetCfgArray[IdxCfgInternalBaseAsset]
316+ let innerBaseStr = assetCfgArray[IdxCfgInternalBaseAsset]
303317 let decimalsMultPrice = parseIntValue(assetCfgArray[IdxCfgDecimalsMultPrice])
304318 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))
312327 if ((status != "PENDING"))
313328 then failExecuteGet("Status is not PENDING", baseAssetStr, userAddressStr, submitTxIdStr, operationType)
314329 else if ((topupUnlockIdx > currTopUpIdx))
315330 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+ }
324341 }
325342
326343
327344 func privateCurrentSysParamsREST (baseAssetStr) = {
328345 let baseAssetId = fromBase58String(baseAssetStr)
329346 let cfgArray = readAssetCfgOrFail(baseAssetStr)
330347 let shareAssetStr = cfgArray[IdxCfgShareAssetId]
331348 let shareAssetId = fromBase58String(shareAssetStr)
332349 let decimalsMultBothAssetsVal = parseIntValue(cfgArray[IdxCfgDecimalsMultBothAssets])
333350 let decimalsMultPriceVal = parseIntValue(cfgArray[IdxCfgDecimalsMultPrice])
334- let internalBaseAssetStr = cfgArray[IdxCfgInternalBaseAsset]
335- let priceAthKEY = keyPriceATH(internalBaseAssetStr)
351+ let innerBaseStr = cfgArray[IdxCfgInternalBaseAsset]
352+ let priceAthKEY = keyPriceATH(innerBaseStr)
336353 let priceAthVal = valueOrElse(getInteger(this, priceAthKEY), 0)
337- let priceLastKEY = keyPriceLast(internalBaseAssetStr)
354+ let priceLastKEY = keyPriceLast(innerBaseStr)
338355 let priceLastVal = valueOrElse(getInteger(this, priceLastKEY), 0)
339- let topupLastTimeKEY = keyTopupLastTimestamp(internalBaseAssetStr)
356+ let topupLastTimeKEY = keyTopupLastTimestamp(innerBaseStr)
340357 let topupLastTimeVal = valueOrElse(getInteger(this, topupLastTimeKEY), 0)
341- let sysState = calcPrice(internalBaseAssetStr, baseAssetId, shareAssetId, decimalsMultPriceVal)
342- $Tuple14(IntegerEntry("price", priceLastVal), IntegerEntry("decimalsMultPrice", decimalsMultPriceVal), IntegerEntry("baseAssetBalance", sysState._2), IntegerEntry("-1", sysState._3), IntegerEntry("baseAssetBalanceWCO", sysState._4), IntegerEntry("shareEmission", sysState._5), IntegerEntry("currIterTotalInBaseAmount", sysState._6), IntegerEntry("currIterTotalInShareAmount", sysState._7), IntegerEntry("totalLockedOutBaseAmount", sysState._8), IntegerEntry("totalLockedOutShareAmount", sysState._9), IntegerEntry("decimalsMultBothAssets", decimalsMultBothAssetsVal), IntegerEntry("priceATH", priceAthVal), IntegerEntry("priceRecalculated", sysState._1), IntegerEntry("topupLastTimestamp", topupLastTimeVal))
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))
343360 }
344361
345362
346363 @Callable(i)
347364 func adminRegisterAsset (baseAssetStr,shareAssetName,shareAssetDescr,getDelayinBlocks,shutdownManagerAddress,startPrice,topupIntervalInBlocks,topupMaxNegativePart,topupManagerAddress,submitLimitsBaseMax,submitLimitsBaseReset,submitLimitsShareMax,submitLimitsShareReset,adminAddress) = {
348365 let baseAssetId = fromBase58String(baseAssetStr)
349366 let bothAssetsDecimals = value(assetInfo(baseAssetId)).decimals
350367 let decimalsMultBothAssets = pow(10, 0, bothAssetsDecimals, 0, 0, DOWN)
351368 let decimalsMultPrice = ((100 * 1000) * 1000)
352369 let topupMaxNegativePercents = fraction(topupMaxNegativePart, 100, decimalsMultBothAssets)
353370 let baseAssetBalance = assetBalance(this, baseAssetId)
354371 if ((i.caller != this))
355372 then throw("permissions denied")
356373 else if ((baseAssetBalance == 0))
357374 then throw(((toString(this) + " must have any initial balance of ") + baseAssetStr))
358375 else if (isDefined(getString(this, keyAssetCfg(baseAssetStr))))
359376 then throw((baseAssetStr + " has been already registered"))
360377 else if ((toString(addressFromStringValue(shutdownManagerAddress)) != shutdownManagerAddress))
361378 then throw("invalid shutdownManagerAddress")
362379 else if ((toString(addressFromStringValue(topupManagerAddress)) != topupManagerAddress))
363380 then throw("invalid topupManagerAddress")
364381 else if ((0 > getDelayinBlocks))
365382 then throw(("invalid getDelayinBlocks=" + toString(getDelayinBlocks)))
366383 else if (if ((0 >= topupMaxNegativePercents))
367384 then true
368385 else (topupMaxNegativePercents >= 99))
369386 then throw("invalid topupMaxNegativePart parameter")
370387 else {
371388 let shareInitAmount = convertBase2Share(baseAssetBalance, startPrice, decimalsMultPrice)
372389 let shareAssetIssueAction = Issue(shareAssetName, shareAssetDescr, shareInitAmount, bothAssetsDecimals, true)
373390 let shareAssetId = calculateAssetId(shareAssetIssueAction)
374391 let shareAssetStr = toBase58String(shareAssetId)
375392 let internalBaseAssetId = valueOrElse(getInteger(this, keyNextInternalAssetId()), 0)
376- let internalBaseAssetStr = toString(internalBaseAssetId)
377-[StringEntry(keyAssetCfg(baseAssetStr), dataAssetCfg(shareAssetStr, internalBaseAssetStr, decimalsMultBothAssets, decimalsMultPrice, getDelayinBlocks, topupIntervalInBlocks, topupMaxNegativePart, topupManagerAddress, submitLimitsBaseMax, submitLimitsBaseReset, submitLimitsShareMax, submitLimitsShareReset, adminAddress)), StringEntry(keyMappingsInternal2baseAssetId(internalBaseAssetId), baseAssetStr), StringEntry(keyMappingsBaseAsset2internalId(baseAssetStr), internalBaseAssetStr), StringEntry(keyMappingsShare2baseAssetId(shareAssetStr), baseAssetStr), StringEntry(keyMappingsBaseAsset2shareId(baseAssetStr), shareAssetStr), BooleanEntry(keyShutdownSubmitOperation(internalBaseAssetStr), false), StringEntry(keyShutdownManager(internalBaseAssetStr), shutdownManagerAddress), IntegerEntry(keyNextInternalAssetId(), (internalBaseAssetId + 1)), IntegerEntry(keyPriceLast(internalBaseAssetStr), startPrice), IntegerEntry(keyPriceHistory(internalBaseAssetStr, height, lastBlock.timestamp), startPrice), IntegerEntry(keyTopUpCurrentIdx(internalBaseAssetStr), 0), RemainingLimitsStringEntry(keyLimitsRemaining(internalBaseAssetStr), submitLimitsBaseMax, submitLimitsShareMax), shareAssetIssueAction, ScriptTransfer(addressFromStringValue(topupManagerAddress), shareInitAmount, shareAssetId)]
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)]
378395 }
379396 }
380397
381398
382399
383400 @Callable(i)
384401 func shutdownSubmits (internalBaseAssetId) = {
385402 let internalBaseAssetIdStr = toString(internalBaseAssetId)
386403 let baseAssetIdStr = getStringOrFail(keyMappingsInternal2baseAssetId(internalBaseAssetId))
387404 let shutdownManagerAddress = getStringOrFail(keyShutdownManager(internalBaseAssetIdStr))
388405 if ((1 > size(baseAssetIdStr)))
389406 then throw("invalid internalBaseAssetId")
390407 else if ((toString(i.caller) != shutdownManagerAddress))
391408 then throw("access denied")
392409 else [BooleanEntry(keyShutdownSubmitOperation(toString(internalBaseAssetId)), true)]
393410 }
394411
395412
396413
397414 @Callable(i)
398415 func submitPut () = {
399416 let pmt = value(i.payments[0])
400417 let inAmount = pmt.amount
401418 let inAssetId = value(pmt.assetId)
402419 let baseAssetStr = toBase58String(inAssetId)
403420 commonSubmit("P", i, inAmount, inAssetId, baseAssetStr)
404421 }
405422
406423
407424
408425 @Callable(i)
409426 func submitGet () = {
410427 let pmt = value(i.payments[0])
411428 let inAmount = pmt.amount
412429 let inAssetId = value(pmt.assetId)
413430 let shareAssetStr = toBase58String(inAssetId)
414431 let baseAssetStr = getStringOrFail(keyMappingsShare2baseAssetId(shareAssetStr))
415432 commonSubmit("G", i, inAmount, inAssetId, baseAssetStr)
416433 }
417434
418435
419436
420437 @Callable(i)
421438 func executePut (baseAssetStr,userAddressStr,submitTxIdStr) = commonExecute("P", baseAssetStr, userAddressStr, submitTxIdStr)
422439
423440
424441
425442 @Callable(i)
426443 func executeGet (baseAssetStr,userAddressStr,submitTxIdStr) = commonExecute("G", baseAssetStr, userAddressStr, submitTxIdStr)
427444
428445
429446
430447 @Callable(i)
431448 func operationsMutex (baseAssetStr) = {
432449 let assetCfgArray = readAssetCfgOrFail(baseAssetStr)
433450 let topUpManagerAddressStr = assetCfgArray[IdxCfgTopupManagerAddress]
434- let internalBaseAssetStr = assetCfgArray[IdxCfgInternalBaseAsset]
451+ let innerBaseStr = assetCfgArray[IdxCfgInternalBaseAsset]
435452 if ((toString(i.caller) != topUpManagerAddressStr))
436453 then failTopupManagerOnly(topUpManagerAddressStr)
437- else [TopupMutexIntEntry(internalBaseAssetStr, height)]
454+ else [TopupMutexIntEntry(innerBaseStr, height)]
438455 }
439456
440457
441458
442459 @Callable(i)
443460 func topUpBalance (baseAssetStr,income) = {
444461 let baseAssetId = fromBase58String(baseAssetStr)
445- let assetCfgArray = readAssetCfgOrFail(baseAssetStr)
446- let shareAssetId = fromBase58String(assetCfgArray[IdxCfgShareAssetId])
447- let priceMult = parseIntValue(assetCfgArray[IdxCfgDecimalsMultPrice])
448- let bothAssetMult = parseIntValue(assetCfgArray[IdxCfgDecimalsMultBothAssets])
449- let topupIntervalInBlocks = parseIntValue(assetCfgArray[IdxCfgTopupIntervalInBlocks])
450- let topupMaxNegativePart = parseIntValue(assetCfgArray[IdxCfgTopupMaxNegativePart])
451- let internalBaseAssetStr = assetCfgArray[IdxCfgInternalBaseAsset]
452- let topUpManagerAddressStr = assetCfgArray[IdxCfgTopupManagerAddress]
453- let submitLimitsBaseMax = parseIntValue(assetCfgArray[IdxCfgSubmitLimitsBaseMax])
454- let submitLimitsShareMax = parseIntValue(assetCfgArray[IdxCfgSubmitLimitsShareMax])
455- let topUpCurrentIdxKEY = keyTopUpCurrentIdx(internalBaseAssetStr)
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)
456473 let prevTopUpIdx = getIntOrFail(topUpCurrentIdxKEY)
457474 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))
480476 let topUpLastHeight = valueOrElse(getInteger(this, topUpLastHeightKEY), 0)
477+ let priceAthKEY = keyPriceATH(innerBaseStr)
478+ let prevPriceATH = valueOrElse(getInteger(this, priceAthKEY), 0)
481479 if ((toString(i.caller) != topUpManagerAddressStr))
482480 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+ }
499517 }
500518
501519
502520
503521 @Callable(i)
504522 func currentSysParamsREST (baseAssetStr) = {
505523 let sysStateTuple = privateCurrentSysParamsREST(baseAssetStr)
506524 let price = sysStateTuple._1.value
507525 let decimalsMultPrice = sysStateTuple._2.value
508526 let baseAssetBalance = sysStateTuple._3.value
509527 let totalLockedBaseAmount = sysStateTuple._4.value
510528 let baseAssetBalanceWCO = sysStateTuple._5.value
511529 let shareEmission = sysStateTuple._6.value
512530 let currIterTotalInBaseAmount = sysStateTuple._7.value
513531 let currIterTotalInShareAmount = sysStateTuple._8.value
514532 let totalLockedOutBaseAmount = sysStateTuple._9.value
515533 let totalLockedOutShareAmount = sysStateTuple._10.value
516534 let decimalsMultBothAssets = sysStateTuple._11.value
517535 let priceATH = sysStateTuple._12.value
518536 let priceRecalculated = sysStateTuple._13.value
519537 let topupLastTime = sysStateTuple._14.value
520538 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)
521539 throw(restData)
522540 }
523541
524542

github/deemru/w8io/169f3d6 
122.87 ms