tx · F6qPjohVAwGiuyRayjuXD82KbqjuvVdmwMt87ZWHzvma

3MsC1Cit1aGB6qPW1hvkyGP2Gx79K1mtUAk:  -0.01500000 Waves

2023.01.11 17:13 [2400400] smart account 3MsC1Cit1aGB6qPW1hvkyGP2Gx79K1mtUAk > SELF 0.00000000 Waves

{ "type": 13, "id": "F6qPjohVAwGiuyRayjuXD82KbqjuvVdmwMt87ZWHzvma", "fee": 1500000, "feeAssetId": null, "timestamp": 1673446427395, "version": 1, "sender": "3MsC1Cit1aGB6qPW1hvkyGP2Gx79K1mtUAk", "senderPublicKey": "2rdeGwVMkuRfRdUgrYaekNmjnegHokhyDx1z6TJq525F", "proofs": [ "38Nd3Q8s78XwP6teVe5vrm6EnMrgNzByTas1G56DCvfvhA3Fm636845Y7qTFfq6dAFEKEdH1miW9X7EzPjzHjdri" ], "script": "base64:BgLaEggCEgcKBQgICAEIEgMKAQESABIAEgUKAwgICBIDCgEIEgQKAgIBEgMKAQgSAwoBCBIAIgNTRVAiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiD2dldFN0cmluZ09yRmFpbCIDa2V5IhBnZXRCb29sZWFuT3JGYWlsIg5mYWlsRXhlY3V0ZUdldCIMYmFzZUFzc2V0U3RyIg51c2VyQWRkcmVzc1N0ciIKZ2V0VHhJZFN0ciILa2V5QXNzZXRDZmciFmtleU5leHRJbnRlcm5hbEFzc2V0SWQiDGtleVByaWNlTGFzdCIVaW50ZXJuYWxCYXNldEFzc2V0U3RyIhJrZXlUb3BVcExhc3RIZWlnaHQiBnNlbmRlciIPa2V5UHJpY2VIaXN0b3J5IgFoIgl0aW1lc3RhbXAiDmtleVRvdGFsTG9ja2VkIhRrZXlUb3RhbExvY2tlZEJ5VXNlciIUaW50ZXJuYWxCYXNlQXNzZXRTdHIiH2tleU1hcHBpbmdzSW50ZXJuYWwyYmFzZUFzc2V0SWQiEWludGVybmFsQmFzZUFzc2V0Ih9rZXlNYXBwaW5nc0Jhc2VBc3NldDJpbnRlc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ABAgUBTwIKQnl0ZVZlY3RvcgQBVgUBTwUBVgMJAAECBQFPAgRVbml0CAUCYksPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmJLCWJvZHlCeXRlcwkAkQMCCAUCYksGcHJvb2ZzAAAFAmJNJwf1vg==", "chainId": 84, "height": 2400400, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A6eWjiiWhq69KmqRSS3e1gcHu7Wr7sy33st6iEyA4rXZ Next: 28DAJQDGWMLhKmHRTCR72v11NDteh36ZBGJh2syKuDFX Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
6-func wrapErr (msg) = throw(makeString(["lp_staking.ride:", msg], " "))
6+func wrapErr (msg) = makeString(["lp_staking.ride:", msg], " ")
77
88
99 func throwErr (msg) = throw(wrapErr(msg))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
6-func wrapErr (msg) = throw(makeString(["lp_staking.ride:", msg], " "))
6+func wrapErr (msg) = makeString(["lp_staking.ride:", msg], " ")
77
88
99 func throwErr (msg) = throw(wrapErr(msg))
1010
1111
1212 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), ("No data for this.key=" + key))
1313
1414
1515 func getBooleanOrFail (key) = valueOrErrorMessage(getBoolean(this, key), ("No data for this.key=" + key))
1616
1717
1818 func failExecuteGet (msg,baseAssetStr,userAddressStr,getTxIdStr) = throw(((((((msg + ": baseAssetStr=") + baseAssetStr) + " userAddressStr=") + userAddressStr) + " getTxIdStr=") + getTxIdStr))
1919
2020
2121 func keyAssetCfg (baseAssetStr) = ("%s%s%s__config__asset__" + baseAssetStr)
2222
2323
2424 func keyNextInternalAssetId () = "%s__nextInternalAssetId"
2525
2626
2727 func keyPriceLast (internalBasetAssetStr) = ("%s%s%d__price__last__" + internalBasetAssetStr)
2828
2929
3030 func keyTopUpLastHeight (internalBasetAssetStr,sender) = makeString(["%s%s%s%d%s__topup__last__height", internalBasetAssetStr, sender], SEP)
3131
3232
3333 func keyPriceHistory (internalBasetAssetStr,h,timestamp) = makeString(["%s%s%d%d%d__price__history", internalBasetAssetStr, toString(h), toString(timestamp)], SEP)
3434
3535
3636 func keyTotalLocked (internalBasetAssetStr) = ("%s%s%d__total__locked__" + internalBasetAssetStr)
3737
3838
3939 func keyTotalLockedByUser (internalBaseAssetStr,userAddressStr) = makeString(["%s%s%d%s__total__locked", internalBaseAssetStr, userAddressStr], SEP)
4040
4141
4242 func keyMappingsInternal2baseAssetId (internalBaseAsset) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(internalBaseAsset))
4343
4444
4545 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
4646
4747
4848 func keyMappingsShare2baseAssetId (shareAssetStr) = ("%s%s%s__mappings__share2baseAssetId__" + shareAssetStr)
4949
5050
5151 func keyMappingsBaseAsset2shareId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2shareId__" + baseAssetStr)
5252
5353
5454 func keyShutdownPutOperation (internalBaseAssetStr) = ("%s%s%d__shutdown__put__" + internalBaseAssetStr)
5555
5656
5757 func keyShutdown (internalBaseAssetStr) = ("%s%d__shutdown__" + internalBaseAssetStr)
5858
5959
6060 func keyShutdownManager (internalBaseAssetStr) = ("%s%s%d__shutdown__manager__" + internalBaseAssetStr)
6161
6262
6363 let IdxCfgShareAssetId = 1
6464
6565 let IdxCfgInternalBaseAsset = 2
6666
6767 let IdxCfgDecimalsMultBothAssets = 3
6868
6969 let IdxCfgDecimalsMultPrice = 4
7070
7171 let IdxCfgGetDelayBlocks = 5
7272
7373 func keyManagerPublicKey () = "%s__managerPublicKey"
7474
7575
7676 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
7777
7878
7979 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
8080 case s: String =>
8181 fromBase58String(s)
8282 case _: Unit =>
8383 unit
8484 case _ =>
8585 throw("Match error")
8686 }
8787
8888
8989 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
9090 case s: String =>
9191 fromBase58String(s)
9292 case _: Unit =>
9393 unit
9494 case _ =>
9595 throw("Match error")
9696 }
9797
9898
9999 let permissionDeniedError = throw("Permission denied")
100100
101101 func mustThis (i) = if ((i.caller == this))
102102 then true
103103 else permissionDeniedError
104104
105105
106106 func mustManager (i) = match managerPublicKeyOrUnit() {
107107 case pk: ByteVector =>
108108 if ((i.callerPublicKey == pk))
109109 then true
110110 else permissionDeniedError
111111 case _: Unit =>
112112 mustThis(i)
113113 case _ =>
114114 throw("Match error")
115115 }
116116
117117
118118 func dataAssetCfg (shareAssetStr,internalBaseAssetStr,decimalsMultBothAssets,decimalsMultPrice,getDelayInBlocks) = makeString(["%s%d%d%d%d", shareAssetStr, internalBaseAssetStr, toString(decimalsMultBothAssets), toString(decimalsMultPrice), toString(getDelayInBlocks)], SEP)
119119
120120
121121 let IdxTotalLockedShare = 1
122122
123123 let IdxTotalLockedBase = 2
124124
125125 func dataTotalLocked (shareAssetAmount,baseAssetAmount) = makeString(["%d%d", toString(shareAssetAmount), toString(baseAssetAmount)], SEP)
126126
127127
128128 func readTotalLocked (key) = {
129129 let totalLockedArray = split(valueOrElse(getString(this, key), dataTotalLocked(0, 0)), SEP)
130130 [-1, parseIntValue(totalLockedArray[IdxTotalLockedShare]), parseIntValue(totalLockedArray[IdxTotalLockedBase])]
131131 }
132132
133133
134134 func keyOperation (operationType,internalBaseAssetStr,userAddress,txId) = makeString(["%s%d%s%s", operationType, internalBaseAssetStr, userAddress, txId], SEP)
135135
136136
137137 let IdxOperStatus = 1
138138
139139 let IdxOperInAmount = 2
140140
141141 let IdxOperPrice = 3
142142
143143 let IdxOperOutAmount = 4
144144
145145 let IdxOperStartHeight = 5
146146
147147 let IdxOperStartTimestamp = 6
148148
149149 let IdxOperEndHeight = 7
150150
151151 let IdxOperEndTimestamp = 8
152152
153153 func privateDataOperationAllStrings (status,inAssetAmount,price,outAssetAmount,startHeight,startTimestamp,endHeight,endTimestamp) = makeString(["%s%d%d%d%d%d%d%d", status, inAssetAmount, price, outAssetAmount, startHeight, startTimestamp, endHeight, endTimestamp], SEP)
154154
155155
156156 func dataOperation (status,inAssetAmount,price,outAssetAmount,startHeight,startTimestamp,endHeight,endTimestamp) = privateDataOperationAllStrings(status, toString(inAssetAmount), toString(price), toString(outAssetAmount), toString(startHeight), toString(startTimestamp), toString(endHeight), toString(endTimestamp))
157157
158158
159159 func dataOperationExecutionUpdate (currOperArray,newStatus,newEndTimestamp) = privateDataOperationAllStrings(newStatus, currOperArray[IdxOperInAmount], currOperArray[IdxOperPrice], currOperArray[IdxOperOutAmount], currOperArray[IdxOperStartHeight], currOperArray[IdxOperStartTimestamp], currOperArray[IdxOperEndHeight], toString(newEndTimestamp))
160160
161161
162162 func readAssetCfgOrFail (baseAssetStr) = {
163163 let key = keyAssetCfg(baseAssetStr)
164164 split(getStringOrFail(key), SEP)
165165 }
166166
167167
168168 func incrementTotalLocked (key,shareAssetAmount,baseAssetAmount) = {
169169 let dataArray = readTotalLocked(key)
170170 StringEntry(key, dataTotalLocked((dataArray[IdxTotalLockedShare] + shareAssetAmount), (dataArray[IdxTotalLockedBase] + baseAssetAmount)))
171171 }
172172
173173
174174 func decrementTotalLocked (key,shareAssetAmount,baseAssetAmount) = {
175175 let dataArray = readTotalLocked(key)
176176 StringEntry(key, dataTotalLocked((dataArray[IdxTotalLockedShare] - shareAssetAmount), (dataArray[IdxTotalLockedBase] - baseAssetAmount)))
177177 }
178178
179179
180180 func genericCalcPrice (internalBaseAssetStr,baseAssetId,topUpBaseAmount,shareAssetId,decimalsMultBothAssets,decimalsMultPrice) = {
181181 let totalLockedArray = readTotalLocked(keyTotalLocked(internalBaseAssetStr))
182182 let totalLockedBaseAmount = totalLockedArray[IdxTotalLockedBase]
183183 let baseAssetBalance = assetBalance(this, baseAssetId)
184184 let baseAssetBalanceConsideringLock = ((baseAssetBalance - totalLockedBaseAmount) + topUpBaseAmount)
185185 if ((0 > baseAssetBalanceConsideringLock))
186186 then throw(((("baseAssetBalanceConsideringLock < 0: baseAssetBalance=" + toString(baseAssetBalance)) + " baseAssetBalanceConsideringLock=") + toString(baseAssetBalanceConsideringLock)))
187187 else {
188188 let shareEmission = value(assetInfo(shareAssetId)).quantity
189189 let price = if ((shareEmission == 0))
190190 then (1 * decimalsMultPrice)
191191 else fraction(baseAssetBalanceConsideringLock, decimalsMultPrice, shareEmission)
192192 $Tuple5(price, baseAssetBalance, totalLockedBaseAmount, baseAssetBalanceConsideringLock, shareEmission)
193193 }
194194 }
195195
196196
197197 func calcPrice (internalBaseAssetStr,baseAssetId,shareAssetId,decimalsMultBothAssets,decimalsMultPrice) = genericCalcPrice(internalBaseAssetStr, baseAssetId, 0, shareAssetId, decimalsMultBothAssets, decimalsMultPrice)
198198
199199
200200 func privateCurrentSysParamsREST (baseAssetStr) = {
201201 let baseAssetId = fromBase58String(baseAssetStr)
202202 let cfgArray = readAssetCfgOrFail(baseAssetStr)
203203 let shareAssetStr = cfgArray[IdxCfgShareAssetId]
204204 let shareAssetId = fromBase58String(shareAssetStr)
205205 let decimalsMultBothAssets = parseIntValue(cfgArray[IdxCfgDecimalsMultBothAssets])
206206 let decimalsMultPrice = parseIntValue(cfgArray[IdxCfgDecimalsMultPrice])
207207 let internalBaseAssetStr = cfgArray[IdxCfgInternalBaseAsset]
208208 let sysState = calcPrice(internalBaseAssetStr, baseAssetId, shareAssetId, decimalsMultBothAssets, decimalsMultPrice)
209209 $Tuple6(IntegerEntry("price", sysState._1), IntegerEntry("decimalsMultPrice", decimalsMultPrice), IntegerEntry("baseAssetBalance", sysState._2), IntegerEntry("totalLockedBaseAmount", sysState._3), IntegerEntry("baseAssetBalanceConsideringLock", sysState._4), IntegerEntry("shareEmission", sysState._5))
210210 }
211211
212212
213213 @Callable(i)
214214 func adminRegisterAsset (baseAssetStr,shareAssetName,shareAssetDescr,getDelayinBlocks,shutdownManagerAddress) = {
215215 let baseAssetId = fromBase58String(baseAssetStr)
216216 let decimals = value(assetInfo(baseAssetId)).decimals
217217 let checkCaller = mustManager(i)
218218 if ((checkCaller == checkCaller))
219219 then if ((toString(addressFromStringValue(shutdownManagerAddress)) != shutdownManagerAddress))
220220 then throw("invalid shutdownManagerAddress")
221221 else if ((0 > getDelayinBlocks))
222222 then throw(("invalid getDelayinBlocks=" + toString(getDelayinBlocks)))
223223 else {
224224 let shareAssetIssueAction = Issue(shareAssetName, shareAssetDescr, 1, decimals, true)
225225 let shareAssetId = calculateAssetId(shareAssetIssueAction)
226226 let shareAssetStr = toBase58String(shareAssetId)
227227 let decimalsMultPrice = ((100 * 1000) * 1000)
228228 let decimalsMultBothAssets = pow(10, 0, decimals, 0, 0, DOWN)
229229 let startPrice = (1 * decimalsMultPrice)
230230 let internalBaseAssettId = valueOrElse(getInteger(this, keyNextInternalAssetId()), 0)
231231 let internalBaseAssetStr = toString(internalBaseAssettId)
232232 [StringEntry(keyAssetCfg(baseAssetStr), dataAssetCfg(shareAssetStr, internalBaseAssetStr, decimalsMultBothAssets, decimalsMultPrice, getDelayinBlocks)), StringEntry(keyMappingsInternal2baseAssetId(internalBaseAssettId), baseAssetStr), StringEntry(keyMappingsBaseAsset2internalId(baseAssetStr), internalBaseAssetStr), StringEntry(keyMappingsShare2baseAssetId(shareAssetStr), baseAssetStr), StringEntry(keyMappingsBaseAsset2shareId(baseAssetStr), shareAssetStr), BooleanEntry(keyShutdownPutOperation(internalBaseAssetStr), false), StringEntry(keyShutdownManager(internalBaseAssetStr), shutdownManagerAddress), IntegerEntry(keyNextInternalAssetId(), (internalBaseAssettId + 1)), IntegerEntry(keyPriceLast(internalBaseAssetStr), startPrice), IntegerEntry(keyPriceHistory(internalBaseAssetStr, height, lastBlock.timestamp), startPrice), shareAssetIssueAction, Burn(shareAssetId, 1)]
233233 }
234234 else throw("Strict value is not equal to itself.")
235235 }
236236
237237
238238
239239 @Callable(i)
240240 func shutdownPut (internalBaseAssetId) = {
241241 let internalBaseAssetIdStr = toString(internalBaseAssetId)
242242 let baseAssetIdStr = getStringOrFail(keyMappingsInternal2baseAssetId(internalBaseAssetId))
243243 let shutdownManagerAddress = getStringOrFail(keyShutdownManager(internalBaseAssetIdStr))
244244 if ((1 > size(baseAssetIdStr)))
245245 then throw("invalid internalBaseAssetId")
246246 else if ((toString(i.caller) != shutdownManagerAddress))
247247 then throw("access denied")
248248 else [BooleanEntry(keyShutdownPutOperation(toString(internalBaseAssetId)), true)]
249249 }
250250
251251
252252
253253 @Callable(i)
254254 func put () = {
255255 let pmt = value(i.payments[0])
256256 let baseAssetId = value(pmt.assetId)
257257 let baseAssetStr = toBase58String(baseAssetId)
258258 let userAddressStr = toString(i.caller)
259259 let cfgArray = readAssetCfgOrFail(baseAssetStr)
260260 let shareAssetStr = cfgArray[IdxCfgShareAssetId]
261261 let shareAssetId = fromBase58String(shareAssetStr)
262262 let decimalsMultBothAssets = parseIntValue(cfgArray[IdxCfgDecimalsMultBothAssets])
263263 let decimalsMultPrice = parseIntValue(cfgArray[IdxCfgDecimalsMultPrice])
264264 let internalBaseAssetStr = cfgArray[IdxCfgInternalBaseAsset]
265265 let isPutBlocked = getBooleanOrFail(keyShutdownPutOperation(internalBaseAssetStr))
266266 let shutdown = valueOrElse(getBoolean(keyShutdown(internalBaseAssetStr)), false)
267267 if (if (isPutBlocked)
268268 then true
269269 else shutdown)
270270 then throw("put operation is blocked")
271271 else {
272272 let price = calcPrice(internalBaseAssetStr, baseAssetId, shareAssetId, decimalsMultBothAssets, decimalsMultPrice)._1
273273 let shareAssetAmount = fraction(pmt.amount, decimalsMultPrice, price)
274274 [Reissue(shareAssetId, shareAssetAmount, true), ScriptTransfer(i.caller, shareAssetAmount, shareAssetId), StringEntry(keyOperation("P", internalBaseAssetStr, userAddressStr, toBase58String(i.transactionId)), dataOperation("FINISHED", pmt.amount, price, shareAssetAmount, height, lastBlock.timestamp, height, lastBlock.timestamp))]
275275 }
276276 }
277277
278278
279279
280280 @Callable(i)
281281 func submitGetRequest () = {
282282 let pmt = value(i.payments[0])
283283 let shareAssetId = value(pmt.assetId)
284284 let shareAssetStr = toBase58String(shareAssetId)
285285 let callerPubStr = toBase58String(i.callerPublicKey)
286286 let userAddress = i.caller
287287 let userAddressStr = toString(userAddress)
288288 let shareAssetAmount = pmt.amount
289289 let baseAssetStr = getStringOrFail(keyMappingsShare2baseAssetId(shareAssetStr))
290290 let baseAssetId = fromBase58String(baseAssetStr)
291291 let cfgArray = readAssetCfgOrFail(baseAssetStr)
292292 let decimalsMultBothAssets = parseIntValue(cfgArray[IdxCfgDecimalsMultBothAssets])
293293 let decimalsMultPrice = parseIntValue(cfgArray[IdxCfgDecimalsMultPrice])
294294 let getDelayBlocks = parseIntValue(cfgArray[IdxCfgGetDelayBlocks])
295295 let internalBaseAssetStr = cfgArray[IdxCfgInternalBaseAsset]
296296 let shutdown = valueOrElse(getBoolean(keyShutdown(internalBaseAssetStr)), false)
297297 if (shutdown)
298298 then throw("operation is blocked")
299299 else {
300300 let price = calcPrice(internalBaseAssetStr, baseAssetId, shareAssetId, decimalsMultBothAssets, decimalsMultPrice)._1
301301 let baseAssetAmount = fraction(shareAssetAmount, price, decimalsMultPrice)
302302 let operationKey = keyOperation("G", internalBaseAssetStr, userAddressStr, toBase58String(i.transactionId))
303303 let operationData = dataOperation("PENDING", shareAssetAmount, price, baseAssetAmount, height, lastBlock.timestamp, (height + getDelayBlocks), 0)
304304 [Burn(shareAssetId, shareAssetAmount), StringEntry(operationKey, operationData), incrementTotalLocked(keyTotalLocked(internalBaseAssetStr), shareAssetAmount, baseAssetAmount), incrementTotalLocked(keyTotalLockedByUser(internalBaseAssetStr, userAddressStr), shareAssetAmount, baseAssetAmount)]
305305 }
306306 }
307307
308308
309309
310310 @Callable(i)
311311 func executeGetRequest (baseAssetStr,userAddressStr,getTxIdStr) = {
312312 let userAddress = addressFromStringValue(userAddressStr)
313313 let assetCfgArray = readAssetCfgOrFail(baseAssetStr)
314314 let shareAssetId = fromBase58String(assetCfgArray[IdxCfgShareAssetId])
315315 let baseAssetId = fromBase58String(baseAssetStr)
316316 let internalBaseAssetStr = assetCfgArray[IdxCfgInternalBaseAsset]
317317 let shutdown = valueOrElse(getBoolean(keyShutdown(internalBaseAssetStr)), false)
318318 if (shutdown)
319319 then throw("operation is blocked")
320320 else {
321321 let operationKey = keyOperation("G", internalBaseAssetStr, userAddressStr, getTxIdStr)
322322 let operationArray = split(getStringOrFail(operationKey), SEP)
323323 let status = operationArray[IdxOperStatus]
324324 let endHeight = parseIntValue(operationArray[IdxOperEndHeight])
325325 let inShareAmount = parseIntValue(operationArray[IdxOperInAmount])
326326 let outBaseAmount = parseIntValue(operationArray[IdxOperOutAmount])
327327 if ((status != "PENDING"))
328328 then failExecuteGet("Status is not PENDING", baseAssetStr, userAddressStr, getTxIdStr)
329329 else if ((endHeight > height))
330330 then failExecuteGet(((("EndHeight[" + toString(endHeight)) + "] > ") + toString(height)), baseAssetStr, userAddressStr, getTxIdStr)
331331 else [ScriptTransfer(userAddress, outBaseAmount, baseAssetId), StringEntry(operationKey, dataOperationExecutionUpdate(operationArray, "FINISHED", lastBlock.timestamp)), decrementTotalLocked(keyTotalLocked(internalBaseAssetStr), inShareAmount, outBaseAmount), decrementTotalLocked(keyTotalLockedByUser(internalBaseAssetStr, userAddressStr), inShareAmount, outBaseAmount)]
332332 }
333333 }
334334
335335
336336
337337 @Callable(i)
338338 func topUpBalance (baseAssetStr) = {
339339 let assetCfgArray = readAssetCfgOrFail(baseAssetStr)
340340 let pmt = value(i.payments[0])
341341 let pmtAssetId = value(pmt.assetId)
342342 let pmtAssetStr = toBase58String(pmtAssetId)
343343 let shareAssetId = fromBase58String(assetCfgArray[IdxCfgShareAssetId])
344344 let decimalsMultBothAssets = parseIntValue(assetCfgArray[IdxCfgDecimalsMultBothAssets])
345345 let decimalsMultPrice = parseIntValue(assetCfgArray[IdxCfgDecimalsMultPrice])
346346 let internalBaseAssetStr = assetCfgArray[IdxCfgInternalBaseAsset]
347347 let topUpLastHeightKEY = keyTopUpLastHeight(internalBaseAssetStr, toString(i.caller))
348348 let topUpLastHeight = valueOrElse(getInteger(this, topUpLastHeightKEY), 0)
349349 let shutdown = valueOrElse(getBoolean(keyShutdown(internalBaseAssetStr)), false)
350350 if (shutdown)
351351 then throw("operation is blocked")
352352 else if ((baseAssetStr != pmtAssetStr))
353353 then throw("attached payment's asset id is NOT matched passed baseAssetStr")
354354 else if ((size(i.payments) > 1))
355355 then throw("only one payment can be attached")
356356 else if ((100 > (height - topUpLastHeight)))
357357 then throw("1 topUp per 100 blocks from the same address is allowed")
358358 else {
359359 let price = genericCalcPrice(internalBaseAssetStr, pmtAssetId, pmt.amount, shareAssetId, decimalsMultBothAssets, decimalsMultPrice)._1
360360 [IntegerEntry(keyPriceLast(internalBaseAssetStr), price), IntegerEntry(keyPriceHistory(internalBaseAssetStr, height, lastBlock.timestamp), price), IntegerEntry(topUpLastHeightKEY, height)]
361361 }
362362 }
363363
364364
365365
366366 @Callable(i)
367367 func emit (assetId,amount) = {
368368 let lpStakingPoolsContract = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(makeString(["%s", "lpStakingPoolsContract"], SEP)), wrapErr("lp_staking_pools contract address is undefined"))), wrapErr("invalid lp_staking_pools contract address"))
369369 let checks = [if ((i.caller == lpStakingPoolsContract))
370370 then true
371371 else throwErr("permission denied"), if ((amount > 0))
372372 then true
373373 else throwErr("invalid amount to emit"), if ((getString(keyMappingsShare2baseAssetId(toBase58String(assetId))) != unit))
374374 then true
375375 else throwErr("invalid assetId")]
376376 if ((checks == checks))
377377 then {
378378 let isReissuable = true
379379 $Tuple2([Reissue(assetId, amount, isReissuable), ScriptTransfer(lpStakingPoolsContract, amount, assetId)], amount)
380380 }
381381 else throw("Strict value is not equal to itself.")
382382 }
383383
384384
385385
386386 @Callable(i)
387387 func currentSysParamsREST (baseAssetStr) = {
388388 let sysStateTuple = privateCurrentSysParamsREST(baseAssetStr)
389389 let price = sysStateTuple._1.value
390390 let decimalsMultPrice = sysStateTuple._2.value
391391 let baseAssetBalance = sysStateTuple._3.value
392392 let totalLockedBaseAmount = sysStateTuple._4.value
393393 let baseAssetBalanceConsideringLock = sysStateTuple._5.value
394394 let shareEmission = sysStateTuple._6.value
395395 let restData = makeString(["startCurrentSysParamsREST", toString(price), toString(decimalsMultPrice), toString(baseAssetBalance), toString(totalLockedBaseAmount), toString(baseAssetBalanceConsideringLock), toString(shareEmission), "endCurrentSysParamsREST"], SEP)
396396 throw(restData)
397397 }
398398
399399
400400
401401 @Callable(i)
402402 func setManager (pendingManagerPublicKey) = {
403403 let checkCaller = mustManager(i)
404404 if ((checkCaller == checkCaller))
405405 then {
406406 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
407407 if ((checkManagerPublicKey == checkManagerPublicKey))
408408 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
409409 else throw("Strict value is not equal to itself.")
410410 }
411411 else throw("Strict value is not equal to itself.")
412412 }
413413
414414
415415
416416 @Callable(i)
417417 func confirmManager () = {
418418 let pm = pendingManagerPublicKeyOrUnit()
419419 let hasPM = if (isDefined(pm))
420420 then true
421421 else throwErr("no pending manager")
422422 if ((hasPM == hasPM))
423423 then {
424424 let checkPM = if ((i.callerPublicKey == value(pm)))
425425 then true
426426 else throwErr("you are not pending manager")
427427 if ((checkPM == checkPM))
428428 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
429429 else throw("Strict value is not equal to itself.")
430430 }
431431 else throw("Strict value is not equal to itself.")
432432 }
433433
434434
435435 @Verifier(tx)
436436 func verify () = {
437437 let targetPublicKey = match managerPublicKeyOrUnit() {
438438 case pk: ByteVector =>
439439 pk
440440 case _: Unit =>
441441 tx.senderPublicKey
442442 case _ =>
443443 throw("Match error")
444444 }
445445 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
446446 }
447447

github/deemru/w8io/fabc49c 
46.30 ms