tx · 8RumJAyh4zLqXRY71uxucByWVHNgqQqFtxLKWAsKvtGn

3MyDtNTkCNyRCw3o2qv5BPPS7vvUosiQe6F:  -0.01400000 Waves

2019.11.19 00:49 [771139] smart account 3MyDtNTkCNyRCw3o2qv5BPPS7vvUosiQe6F > SELF 0.00000000 Waves

{ "type": 13, "id": "8RumJAyh4zLqXRY71uxucByWVHNgqQqFtxLKWAsKvtGn", "fee": 1400000, "feeAssetId": null, "timestamp": 1574113749818, "version": 1, "sender": "3MyDtNTkCNyRCw3o2qv5BPPS7vvUosiQe6F", "senderPublicKey": "3z5txV1G5GKezwMRCHZDkLThqb1Yggepxvi2wq6iP6oz", "proofs": [ "3xGZ7hfzxg814jPacnVvV2fgyzZQcuJrqi7Lkiybs7Lagybkoz8xWhNRPQpkkZm9EokstSNXBkSHrdybJpGr3Tdz" ], "script": "base64:AAIDAAAAAAAAABUIARIAEgASBAoCCAESABIDCgEIEgAAAABpAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAADGdldEJvb2xCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAHQm9vbGVhbgQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQcBAAAAGGdldE51bWJlckJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzc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hc2VUcmFuc2FjdGlvbgQAAAAJbGVhc2luZ1R4BQAAAAckbWF0Y2gwAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkJAAAAAAAAAgkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQUAAAASbm9kZU9yYWNsZVByb3ZpZGVyCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABCAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5BwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkjivit", "chainId": 84, "height": 771139, "spentComplexity": 0 } View: original | compacted Prev: Ak6Sw71rxMuS9tCgNnvEvpTEsAgwyvfvk99iYHHgFP1q Next: HHamjXGthfXmbd4g9usosegLtaR1rCDXzTmzTkj3GvK4 Diff:
OldNewDifferences
104104 func getRPDContractBalanceKey (assetId) = ((RPDBalanceKey + "_") + toBase58String(assetId))
105105
106106
107+let TotalOrderbookKey = "total_orderbook"
108+
109+let TotalLiquidationOrderbookKey = "total_liquidation_orderbook"
110+
107111 let PriceKey = "price"
108112
109113 let PriceIndexKey = "price_index"
111115 let IsBlockedKey = "is_blocked"
112116
113117 let LeasingExpireBlockKey = "leasing_expire_block"
114-
115-let IsRebalanceKey = "is_rebalance"
116118
117119 let LeasingTxCountKey = "leasing_index"
118120
126128
127129 let RPDSyncIndexKey = "rpd_sync_index"
128130
131+let BalanceLocedkKey = "balance_lock_"
132+
133+let WavesLockedBalanceKey = (BalanceLocedkKey + "waves")
134+
135+let NeutrinoLockedBalanceKey = (BalanceLocedkKey + "neutrino")
136+
129137 func getRPDSnapshotContractBalanceKey (count,assetId) = ((((RPDBalanceKey + "_") + toBase58String(assetId)) + "_") + toString(count))
130138
131139
132140 func getCancelLeaseTxReserveFeeKey (hash) = (("cancel_lease_tx_reserve_fee" + "_") + hash)
133141
134142
135-func getAccountLockedBalanceKey (owner,assetId) = ((("balance_" + assetId) + "_") + owner)
143+func getWavesLockedBalanceKey (owner) = ((WavesLockedBalanceKey + "_") + owner)
136144
137145
138-func getBalanceUnlockBlockKey (owner) = ("balance_block_" + owner)
146+func getNeutrinoLockedBalanceKey (owner) = ((NeutrinoLockedBalanceKey + "_") + owner)
147+
148+
149+func getBalanceUnlockBlockKey (owner) = ("balance_unlock_block_" + owner)
139150
140151
141152 func getRPDProfitKey (count) = (("rpd_profit" + "_") + toString(count))
142-
143-
144-func getLockedBalanceKey (assetId) = ("balance_" + assetId)
145153
146154
147155 func getLeaseTxStatusKey (hash) = (("lease_tx_status" + "_") + hash)
171179 func convertWavesToBond (amount,price) = convertNeutrinoToBond(convertWavesToNeutrino(amount, price))
172180
173181
174-func getLockedBalance (assetId) = getNumberByKey(getLockedBalanceKey(assetId))
182+let neutrinoLockedBalance = getNumberByKey(NeutrinoLockedBalanceKey)
175183
184+let wavesLockedBalance = getNumberByKey(WavesLockedBalanceKey)
176185
177186 let liquidationContract = getStringByKey(LiquidationContractKey)
178187
196205
197206 let leasingTxCount = getNumberByKey(LeasingTxCountKey)
198207
199-let isRebalance = getBoolByKey(IsRebalanceKey)
200-
201208 let leasingInterval = getNumberByKey(LeasingIntervalKey)
202209
203210 let leasingExpireBlock = getNumberByKey(LeasingExpireBlockKey)
206213
207214 let nodeAddress = getStringByKey(NodeAddressKey)
208215
209-let nodeOracleProviderKey = getStringByKey(NodeOracleProviderKey)
216+let nodeOracleProvider = getStringByKey(NodeOracleProviderKey)
210217
211218 let rpdSyncIndex = getNumberByKey(RPDSyncIndexKey)
212219
216223
217224 let minNeutrinoSwapAmount = getNumberByKey(MinNeutrinoSwapAmountKey)
218225
219-let reserve = (wavesBalance(this) - getLockedBalance(WAVESASSETID))
226+let reserve = (wavesBalance(this) - wavesLockedBalance)
220227
221228 let reserveWithoutLeasing = (reserve - leasingAmount)
222229
224231
225232 let bondSupply = (extract(assetInfo(bondAssetId)).quantity - assetBalance(this, bondAssetId))
226233
227-let neutrinoSupply = ((extract(assetInfo(neutrinoAssetId)).quantity - assetBalance(this, neutrinoAssetId)) + getLockedBalance(neutrinoAssetIdString))
234+let neutrinoSupply = ((extract(assetInfo(neutrinoAssetId)).quantity - assetBalance(this, neutrinoAssetId)) + neutrinoLockedBalance)
228235
229236 let surplus = (convertWavesToNeutrino(reserve, currentPrice) - neutrinoSupply)
230237
232239
233240 func getRPDContractBalance (assetId) = getNumberByAddressAndKey(rpdContract, getRPDContractBalanceKey(assetId))
234241
242+
243+let totalLiquidationOrderbook = getNumberByAddressAndKey(auctionContract, TotalLiquidationOrderbookKey)
244+
245+let totalOrderbook = getNumberByAddressAndKey(auctionContract, TotalOrderbookKey)
235246
236247 func getPriceHistory (block) = getNumberByAddressAndKey(controlContract, getPriceHistoryKey(block))
237248
242253 func getCancelLeaseTxReserveFee (hash) = getNumberByKey(getCancelLeaseTxReserveFeeKey(hash))
243254
244255
245-func getAccountLockedBalance (owner,assetId) = getNumberByKey(getAccountLockedBalanceKey(owner, assetId))
256+func getWavesLockedBalance (owner) = getNumberByKey(getWavesLockedBalanceKey(owner))
257+
258+
259+func getNeutrinoLockedBalance (owner) = getNumberByKey(getNeutrinoLockedBalanceKey(owner))
246260
247261
248262 func getUnlockBalanceBlock (owner) = getNumberByKey(getBalanceUnlockBlockKey(owner))
275289 then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
276290 else if ((getUnlockBalanceBlock(account) > height))
277291 then throw((("await " + toString((getUnlockBalanceBlock(account) - height))) + " blocks"))
278- else if ((getAccountLockedBalance(account, WAVESASSETID) != 0))
292+ else if (if ((getNeutrinoLockedBalance(account) != 0))
293+ then true
294+ else (getWavesLockedBalance(account) != 0))
279295 then throw("please withdraw locked funds first")
280- else WriteSet([DataEntry(getAccountLockedBalanceKey(account, WAVESASSETID), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceLockInterval)), DataEntry(getLockedBalanceKey(WAVESASSETID), (getLockedBalance(WAVESASSETID) + pmt.amount))])
296+ else WriteSet([DataEntry(getWavesLockedBalanceKey(account), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceLockInterval)), DataEntry(WavesLockedBalanceKey, (wavesLockedBalance + pmt.amount))])
281297 }
282298
283299
294310 then throw("can use appropriate neutrino tokens only")
295311 else if ((getUnlockBalanceBlock(account) > height))
296312 then throw((("await " + toString((getUnlockBalanceBlock(account) - height))) + " blocks"))
297- else if ((getAccountLockedBalance(account, neutrinoAssetIdString) != 0))
313+ else if (if ((getNeutrinoLockedBalance(account) != 0))
314+ then true
315+ else (getWavesLockedBalance(account) != 0))
298316 then throw("please withdraw locked funds first")
299- else {
300- let newLockedBalance = (getLockedBalance(neutrinoAssetIdString) + pmt.amount)
301- WriteSet([DataEntry(getAccountLockedBalanceKey(account, neutrinoAssetIdString), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceLockInterval)), DataEntry(getLockedBalanceKey(neutrinoAssetIdString), newLockedBalance), DataEntry(IsRebalanceKey, if ((reserveWithoutLeasing >= convertNeutrinoToWaves(newLockedBalance, currentPrice)))
302- then false
303- else true)])
304- }
317+ else WriteSet([DataEntry(getNeutrinoLockedBalanceKey(account), pmt.amount), DataEntry(getWavesLockedBalanceKey(account), (height + balanceLockInterval)), DataEntry(NeutrinoLockedBalanceKey, (neutrinoLockedBalance + pmt.amount))])
305318 }
306319
307320
308321
309322 @Callable(i)
310-func withdraw (account,index,lockedAssetId) = {
323+func withdraw (account,index) = {
311324 let unlockHeight = getUnlockBalanceBlock(account)
312- let lockedBalance = getAccountLockedBalance(account, lockedAssetId)
325+ let userWavesLockedBalance = getWavesLockedBalance(account)
326+ let userNeutrinoLockedBalance = getNeutrinoLockedBalance(account)
313327 let indexHeight = getHeightPriceByIndex(index)
314328 let nextIndexHeight = getHeightPriceByIndex((index + 1))
315329 let priceByIndex = getPriceHistory(indexHeight)
316- let amount = if ((lockedAssetId == neutrinoAssetIdString))
317- then convertNeutrinoToWaves(lockedBalance, priceByIndex)
318- else convertWavesToNeutrino(lockedBalance, priceByIndex)
330+ let neutrinoAmount = convertWavesToNeutrino(userWavesLockedBalance, priceByIndex)
331+ let wavesAmount = convertNeutrinoToWaves(userNeutrinoLockedBalance, priceByIndex)
319332 if (isBlocked)
320333 then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
321- else if ((0 >= amount))
322- then throw((("balance equals zero (" + lockedAssetId) + ")"))
323- else if ((unlockHeight > height))
324- then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw WAVES funds"))
325- else if (if (if ((index > priceIndex))
326- then true
327- else (indexHeight > unlockHeight))
328- then true
329- else if ((nextIndexHeight != 0))
330- then (unlockHeight >= nextIndexHeight)
331- else false)
332- then throw("invalid price history index")
333- else ScriptResult(WriteSet([DataEntry(getAccountLockedBalanceKey(account, lockedAssetId), 0), DataEntry(getLockedBalanceKey(lockedAssetId), (getLockedBalance(lockedAssetId) - lockedBalance))]), TransferSet([ScriptTransfer(addressFromStringValue(account), amount, if ((lockedAssetId == neutrinoAssetIdString))
334- then unit
335- else neutrinoAssetId)]))
334+ else if ((unlockHeight > height))
335+ then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw WAVES funds"))
336+ else if (if (if ((index > priceIndex))
337+ then true
338+ else (indexHeight > unlockHeight))
339+ then true
340+ else if ((nextIndexHeight != 0))
341+ then (unlockHeight >= nextIndexHeight)
342+ else false)
343+ then throw("invalid price history index")
344+ else if (if ((0 >= neutrinoAmount))
345+ then (0 >= wavesAmount)
346+ else false)
347+ then throw("balance equals zero")
348+ else ScriptResult(WriteSet([DataEntry(getWavesLockedBalanceKey(account), 0), DataEntry(getNeutrinoLockedBalanceKey(account), 0), DataEntry(WavesLockedBalanceKey, (wavesLockedBalance - userWavesLockedBalance)), DataEntry(NeutrinoLockedBalanceKey, (neutrinoLockedBalance - userNeutrinoLockedBalance))]), TransferSet([ScriptTransfer(addressFromStringValue(account), wavesAmount, unit), ScriptTransfer(addressFromStringValue(account), neutrinoAmount, neutrinoAssetId)]))
336349 }
337350
338351
339352
340353 @Callable(i)
341354 func transferToAuction () = {
342- let deficitBondAmount = (convertNeutrinoToBond(deficit) - assetBalance(addressFromStringValue(auctionContract), bondAssetId))
343- let surplusBond = (convertNeutrinoToBond(surplus) - assetBalance(addressFromStringValue(auctionContract), neutrinoAssetId))
355+ let deficitBondAmount = ((convertNeutrinoToBond(deficit) - assetBalance(addressFromStringValue(auctionContract), bondAssetId)) - totalLiquidationOrderbook)
356+ let surplusBond = ((convertNeutrinoToBond(surplus) - assetBalance(addressFromStringValue(auctionContract), neutrinoAssetId)) - totalOrderbook)
344357 if (isBlocked)
345358 then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
346359 else if ((deficitBondAmount >= ((convertNeutrinoToBond(neutrinoSupply) * DEFICITOFFSET) / 100)))
347360 then TransferSet([ScriptTransfer(addressFromStringValue(auctionContract), deficitBondAmount, bondAssetId)])
348361 else if ((surplusBond > 0))
349362 then TransferSet([ScriptTransfer(addressFromStringValue(liquidationContract), convertBondToNeutrino(surplusBond), neutrinoAssetId)])
350- else throw("bond were generated or do not need it")
363+ else throw(((((("bond were generated or do not need it. Deficit:" + toString(deficitBondAmount)) + "|") + toString(((neutrinoSupply * DEFICITOFFSET) / 100))) + ". Surplus:") + toString(surplusBond)))
351364 }
352365
353366
375388 }
376389
377390
378-
379-@Callable(i)
380-func registrationLeaseTx (senderPublicKey,fee,timestamp,leaseTxHash) = {
381- let totalFreeReserve = (((reserve * LEASINGSHARE) / 100) - convertNeutrinoToWaves(getLockedBalance(neutrinoAssetIdString), currentPrice))
382- let amount = (totalFreeReserve / LEASINTXCOUNT)
383- let txBytes = (((((base58'3h1H' + fromBase58String(senderPublicKey)) + fromBase58String(nodeAddress)) + toBytes(amount)) + toBytes(fee)) + toBytes(timestamp))
384- let txHashBytes = blake2b256(txBytes)
385- let txHash = toBase58String(txHashBytes)
386- let pmt = extract(i.payment)
387- if ((toString(i.caller) == nodeOracleProviderKey))
388- then throw("invalid caller")
389- else if (isDefined(pmt.assetId))
390- then throw("invalid paymtn asset")
391- else if ((leaseTxHash != txHash))
392- then throw((("invalid tx hash(amount:" + toString(amount)) + ")"))
393- else if ((leasingTxCount >= LEASINTXCOUNT))
394- then throw("the number of leasing transactions is equal to the maximum")
395- else if ((this != addressFromPublicKey(fromBase58String(senderPublicKey))))
396- then throw("invalid pubKey")
397- else if (if ((lastBlock.timestamp > timestamp))
398- then true
399- else (timestamp > (lastBlock.timestamp + 5400000)))
400- then throw((("invalid timestamp(lastBlock: " + toString(lastBlock.timestamp)) + ")"))
401- else if ((getLeaseTxStatus(txHash) != ""))
402- then throw("tx is exist")
403- else if ((pmt.amount != (fee * 2)))
404- then throw("invalid payment amount")
405- else if (if ((fee > 1000000))
406- then true
407- else (500000 > fee))
408- then throw("invalid fee")
409- else if (((totalFreeReserve - (leasingAmount + amount)) > reserveWithoutLeasing))
410- then throw((("invalid amount(result:" + toString(((totalFreeReserve - (leasingAmount + amount)) > reserveWithoutLeasing))) + ")"))
411- else WriteSet([DataEntry(getCancelLeaseTxReserveFeeKey(txHash), fee), DataEntry(LeasingTxCountKey, if ((getLeaseTxStatus(txHash) == ""))
412- then (leasingTxCount + 1)
413- else leasingTxCount), DataEntry(LeasingAmountKey, (leasingAmount + amount)), DataEntry(LeasingExpireBlockKey, if ((height > leasingExpireBlock))
414- then (height + leasingInterval)
415- else leasingExpireBlock), DataEntry(getLeaseTxStatusKey(txHash), NEW), DataEntry(getLeaseTxExpireSendBlockKey(txHash), (height + SENDTXEXPIRE)), DataEntry(getLeaseTxAmountByHashKey(txHash), amount), DataEntry(getLeaseTxBytesByHashKey(txHash), toBase64String(txBytes))])
416- }
417-
418-
419-
420-@Callable(i)
421-func cancelStuckLeaseTx (txHash) = if (if (if ((getLeaseTxStatus(txHash) == NEW))
422- then !(isDefined(transactionHeightById(fromBase58String(txHash))))
423- else false)
424- then (height > getLeaseTxExpireSendBlock(txHash))
425- else false)
426- then {
427- let amount = getLeaseTxAmountByHash(txHash)
428- WriteSet([DataEntry(LeasingTxCountKey, (leasingTxCount - 1)), DataEntry(LeasingAmountKey, (leasingAmount - amount)), DataEntry(getLeaseTxStatusKey(txHash), CANCELED), DataEntry(IsRebalanceKey, if (((reserveWithoutLeasing - amount) >= convertNeutrinoToWaves(getLockedBalance(neutrinoAssetIdString), currentPrice)))
429- then false
430- else true)])
431- }
432- else throw("invalid tx hash")
433-
434-
435-
436-@Callable(i)
437-func registrationUnleaseTx (chainIdString,senderPublicKey,fee,timestamp,leaseTxHash) = {
438- let txBytes = (((((base58'gm' + toBytes(chainIdString)) + fromBase58String(senderPublicKey)) + toBytes(fee)) + toBytes(timestamp)) + fromBase58String(leaseTxHash))
439- let txHash = blake2b256(txBytes)
440- if ((getLeaseTxStatus(leaseTxHash) != NEW))
441- then throw("invalid tx status")
442- else if ((this != addressFromPublicKey(fromBase58String(senderPublicKey))))
443- then throw("invalid pubKey")
444- else if (!(isDefined(transactionHeightById(txHash))))
445- then throw("blockchain does not contain this transaction")
446- else {
447- let amount = getLeaseTxAmountByHash(leaseTxHash)
448- WriteSet([DataEntry(LeasingTxCountKey, (leasingTxCount - 1)), DataEntry(LeasingAmountKey, (leasingAmount - amount)), DataEntry(getLeaseTxStatusKey(leaseTxHash), CANCELED), DataEntry(IsRebalanceKey, if (((reserveWithoutLeasing - amount) >= convertNeutrinoToWaves(getLockedBalance(neutrinoAssetIdString), currentPrice)))
449- then false
450- else true)])
451- }
452- }
453-
454-
455391 @Verifier(tx)
456392 func verify () = {
457393 let id = toBase58String(tx.id)
458394 match tx {
459- case leaseTx: LeaseTransaction =>
460- if (if ((leasingExpireBlock >= height))
461- then (getLeaseTxExpireSendBlock(id) >= height)
462- else false)
463- then (getLeaseTxStatus(id) == NEW)
464- else false
465- case unleaseTx: LeaseCancelTransaction =>
466- let leaseId = toBase58String(unleaseTx.leaseId)
467- if (if (if ((height > leasingExpireBlock))
468- then true
469- else isRebalance)
470- then (unleaseTx.fee == getCancelLeaseTxReserveFee(leaseId))
471- else false)
472- then (getLeaseTxStatus(leaseId) == NEW)
395+ case leasingTx: LeaseCancelTransaction|LeaseTransaction =>
396+ if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
397+ then (addressFromString(nodeOracleProvider) == addressFromPublicKey(tx.senderPublicKey))
473398 else false
474399 case _ =>
475400 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getNumberByKey (key) = match getInteger(this, key) {
55 case a: Int =>
66 a
77 case _ =>
88 0
99 }
1010
1111
1212 func getStringByKey (key) = match getString(this, key) {
1313 case a: String =>
1414 a
1515 case _ =>
1616 ""
1717 }
1818
1919
2020 func getBoolByKey (key) = match getBoolean(this, key) {
2121 case a: Boolean =>
2222 a
2323 case _ =>
2424 false
2525 }
2626
2727
2828 func getNumberByAddressAndKey (address,key) = match getInteger(addressFromStringValue(address), key) {
2929 case a: Int =>
3030 a
3131 case _ =>
3232 0
3333 }
3434
3535
3636 func getStringByAddressAndKey (address,key) = match getString(addressFromStringValue(address), key) {
3737 case a: String =>
3838 a
3939 case _ =>
4040 ""
4141 }
4242
4343
4444 func getBoolByAddressAndKey (address,key) = match getBoolean(addressFromStringValue(address), key) {
4545 case a: Boolean =>
4646 a
4747 case _ =>
4848 false
4949 }
5050
5151
5252 let SENDTXEXPIRE = 30
5353
5454 let LISTSPLITSYMBOL = "_"
5555
5656 let LISTDATASYMBOL = "+"
5757
5858 let WAVELET = 100000000
5959
6060 let PAULI = 100
6161
6262 let CRYTICALSHARE = 20
6363
6464 let LEASINGSHARE = 90
6565
6666 let LEASINTXCOUNT = 10
6767
6868 let DEFICITOFFSET = 10
6969
7070 let WAVESASSETID = "waves"
7171
7272 let CANCELED = "canceled"
7373
7474 let NEW = "new"
7575
7676 let NeutrinoAssetIdKey = "neutrino_asset_id"
7777
7878 let BondAssetIdKey = "bond_asset_id"
7979
8080 let ReserveContractKey = "reserve_contract"
8181
8282 let AuctionContractKey = "auction_contract"
8383
8484 let LiquidationContractKey = "liquidation_contract"
8585
8686 let RPDContractKey = "rpd_contract"
8787
8888 let ContolContractKey = "control_contract"
8989
9090 let BalanceLockIntervalKey = "balance_lock_interval"
9191
9292 let MinWavesSwapAmountKey = "min_waves_swap_amount"
9393
9494 let MinNeutrinoSwapAmountKey = "min_neutrino_swap_amount"
9595
9696 let NodeAddressKey = "node_address"
9797
9898 let NodeOracleProviderKey = "oracle_node_provider"
9999
100100 let LeasingIntervalKey = "leasing_interval"
101101
102102 let RPDBalanceKey = "rpd_balance"
103103
104104 func getRPDContractBalanceKey (assetId) = ((RPDBalanceKey + "_") + toBase58String(assetId))
105105
106106
107+let TotalOrderbookKey = "total_orderbook"
108+
109+let TotalLiquidationOrderbookKey = "total_liquidation_orderbook"
110+
107111 let PriceKey = "price"
108112
109113 let PriceIndexKey = "price_index"
110114
111115 let IsBlockedKey = "is_blocked"
112116
113117 let LeasingExpireBlockKey = "leasing_expire_block"
114-
115-let IsRebalanceKey = "is_rebalance"
116118
117119 let LeasingTxCountKey = "leasing_index"
118120
119121 let LeasingAmountKey = "leasing_amount"
120122
121123 func getPriceHistoryKey (block) = ((PriceKey + "_") + toString(block))
122124
123125
124126 func getHeightPriceByIndexKey (index) = ((PriceIndexKey + "_") + toString(index))
125127
126128
127129 let RPDSyncIndexKey = "rpd_sync_index"
128130
131+let BalanceLocedkKey = "balance_lock_"
132+
133+let WavesLockedBalanceKey = (BalanceLocedkKey + "waves")
134+
135+let NeutrinoLockedBalanceKey = (BalanceLocedkKey + "neutrino")
136+
129137 func getRPDSnapshotContractBalanceKey (count,assetId) = ((((RPDBalanceKey + "_") + toBase58String(assetId)) + "_") + toString(count))
130138
131139
132140 func getCancelLeaseTxReserveFeeKey (hash) = (("cancel_lease_tx_reserve_fee" + "_") + hash)
133141
134142
135-func getAccountLockedBalanceKey (owner,assetId) = ((("balance_" + assetId) + "_") + owner)
143+func getWavesLockedBalanceKey (owner) = ((WavesLockedBalanceKey + "_") + owner)
136144
137145
138-func getBalanceUnlockBlockKey (owner) = ("balance_block_" + owner)
146+func getNeutrinoLockedBalanceKey (owner) = ((NeutrinoLockedBalanceKey + "_") + owner)
147+
148+
149+func getBalanceUnlockBlockKey (owner) = ("balance_unlock_block_" + owner)
139150
140151
141152 func getRPDProfitKey (count) = (("rpd_profit" + "_") + toString(count))
142-
143-
144-func getLockedBalanceKey (assetId) = ("balance_" + assetId)
145153
146154
147155 func getLeaseTxStatusKey (hash) = (("lease_tx_status" + "_") + hash)
148156
149157
150158 func getLeaseTxAmountByHashKey (hash) = ((LeasingAmountKey + "_") + hash)
151159
152160
153161 func getLeaseTxBytesByHashKey (hash) = (("lease_tx" + "_") + hash)
154162
155163
156164 func getLeaseTxExpireSendBlockKey (hash) = (("leasing_expire_send" + "_") + hash)
157165
158166
159167 func convertNeutrinoToWaves (amount,price) = ((((amount * 100) / price) * WAVELET) / PAULI)
160168
161169
162170 func convertWavesToNeutrino (amount,price) = ((((amount * price) / 100) * PAULI) / WAVELET)
163171
164172
165173 func convertNeutrinoToBond (amount) = (amount / PAULI)
166174
167175
168176 func convertBondToNeutrino (amount) = (amount * PAULI)
169177
170178
171179 func convertWavesToBond (amount,price) = convertNeutrinoToBond(convertWavesToNeutrino(amount, price))
172180
173181
174-func getLockedBalance (assetId) = getNumberByKey(getLockedBalanceKey(assetId))
182+let neutrinoLockedBalance = getNumberByKey(NeutrinoLockedBalanceKey)
175183
184+let wavesLockedBalance = getNumberByKey(WavesLockedBalanceKey)
176185
177186 let liquidationContract = getStringByKey(LiquidationContractKey)
178187
179188 let neutrinoAssetIdString = getStringByKey(NeutrinoAssetIdKey)
180189
181190 let neutrinoAssetId = fromBase58String(neutrinoAssetIdString)
182191
183192 let reserveContract = getStringByKey(ReserveContractKey)
184193
185194 let auctionContract = getStringByKey(AuctionContractKey)
186195
187196 let rpdContract = getStringByKey(RPDContractKey)
188197
189198 let controlContract = getStringByKey(ContolContractKey)
190199
191200 let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey)
192201
193202 let priceIndex = getNumberByAddressAndKey(controlContract, PriceIndexKey)
194203
195204 let isBlocked = getBoolByAddressAndKey(controlContract, IsBlockedKey)
196205
197206 let leasingTxCount = getNumberByKey(LeasingTxCountKey)
198207
199-let isRebalance = getBoolByKey(IsRebalanceKey)
200-
201208 let leasingInterval = getNumberByKey(LeasingIntervalKey)
202209
203210 let leasingExpireBlock = getNumberByKey(LeasingExpireBlockKey)
204211
205212 let leasingAmount = getNumberByKey(LeasingAmountKey)
206213
207214 let nodeAddress = getStringByKey(NodeAddressKey)
208215
209-let nodeOracleProviderKey = getStringByKey(NodeOracleProviderKey)
216+let nodeOracleProvider = getStringByKey(NodeOracleProviderKey)
210217
211218 let rpdSyncIndex = getNumberByKey(RPDSyncIndexKey)
212219
213220 let balanceLockInterval = getNumberByKey(BalanceLockIntervalKey)
214221
215222 let minWavesSwapAmount = getNumberByKey(MinWavesSwapAmountKey)
216223
217224 let minNeutrinoSwapAmount = getNumberByKey(MinNeutrinoSwapAmountKey)
218225
219-let reserve = (wavesBalance(this) - getLockedBalance(WAVESASSETID))
226+let reserve = (wavesBalance(this) - wavesLockedBalance)
220227
221228 let reserveWithoutLeasing = (reserve - leasingAmount)
222229
223230 let bondAssetId = fromBase58String(getStringByKey(BondAssetIdKey))
224231
225232 let bondSupply = (extract(assetInfo(bondAssetId)).quantity - assetBalance(this, bondAssetId))
226233
227-let neutrinoSupply = ((extract(assetInfo(neutrinoAssetId)).quantity - assetBalance(this, neutrinoAssetId)) + getLockedBalance(neutrinoAssetIdString))
234+let neutrinoSupply = ((extract(assetInfo(neutrinoAssetId)).quantity - assetBalance(this, neutrinoAssetId)) + neutrinoLockedBalance)
228235
229236 let surplus = (convertWavesToNeutrino(reserve, currentPrice) - neutrinoSupply)
230237
231238 let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice))
232239
233240 func getRPDContractBalance (assetId) = getNumberByAddressAndKey(rpdContract, getRPDContractBalanceKey(assetId))
234241
242+
243+let totalLiquidationOrderbook = getNumberByAddressAndKey(auctionContract, TotalLiquidationOrderbookKey)
244+
245+let totalOrderbook = getNumberByAddressAndKey(auctionContract, TotalOrderbookKey)
235246
236247 func getPriceHistory (block) = getNumberByAddressAndKey(controlContract, getPriceHistoryKey(block))
237248
238249
239250 func getHeightPriceByIndex (index) = getNumberByAddressAndKey(controlContract, getHeightPriceByIndexKey(index))
240251
241252
242253 func getCancelLeaseTxReserveFee (hash) = getNumberByKey(getCancelLeaseTxReserveFeeKey(hash))
243254
244255
245-func getAccountLockedBalance (owner,assetId) = getNumberByKey(getAccountLockedBalanceKey(owner, assetId))
256+func getWavesLockedBalance (owner) = getNumberByKey(getWavesLockedBalanceKey(owner))
257+
258+
259+func getNeutrinoLockedBalance (owner) = getNumberByKey(getNeutrinoLockedBalanceKey(owner))
246260
247261
248262 func getUnlockBalanceBlock (owner) = getNumberByKey(getBalanceUnlockBlockKey(owner))
249263
250264
251265 func getRPDProfit (count) = getNumberByKey(getRPDProfitKey(count))
252266
253267
254268 func getLeaseTxStatus (hash) = getStringByKey(getLeaseTxStatusKey(hash))
255269
256270
257271 func getLeaseTxAmountByHash (hash) = getNumberByKey(getLeaseTxAmountByHashKey(hash))
258272
259273
260274 func getLeaseTxBytesByHash (hash) = getStringByKey(getLeaseTxBytesByHashKey(hash))
261275
262276
263277 func getLeaseTxExpireSendBlock (hash) = getNumberByKey(getLeaseTxExpireSendBlockKey(hash))
264278
265279
266280 @Callable(i)
267281 func swapWavesToNeutrino () = {
268282 let pmt = extract(i.payment)
269283 let account = toString(i.caller)
270284 if ((minWavesSwapAmount > pmt.amount))
271285 then throw((("an amount is less than min available amount: " + toString(minWavesSwapAmount)) + " wavelets"))
272286 else if (isDefined(pmt.assetId))
273287 then throw("can use waves only")
274288 else if (isBlocked)
275289 then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
276290 else if ((getUnlockBalanceBlock(account) > height))
277291 then throw((("await " + toString((getUnlockBalanceBlock(account) - height))) + " blocks"))
278- else if ((getAccountLockedBalance(account, WAVESASSETID) != 0))
292+ else if (if ((getNeutrinoLockedBalance(account) != 0))
293+ then true
294+ else (getWavesLockedBalance(account) != 0))
279295 then throw("please withdraw locked funds first")
280- else WriteSet([DataEntry(getAccountLockedBalanceKey(account, WAVESASSETID), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceLockInterval)), DataEntry(getLockedBalanceKey(WAVESASSETID), (getLockedBalance(WAVESASSETID) + pmt.amount))])
296+ else WriteSet([DataEntry(getWavesLockedBalanceKey(account), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceLockInterval)), DataEntry(WavesLockedBalanceKey, (wavesLockedBalance + pmt.amount))])
281297 }
282298
283299
284300
285301 @Callable(i)
286302 func swapNeutrinoToWaves () = {
287303 let pmt = extract(i.payment)
288304 let account = toString(i.caller)
289305 if ((minNeutrinoSwapAmount > pmt.amount))
290306 then throw((("an amount is less than min available amount: " + toString(minNeutrinoSwapAmount)) + " neutrino cents"))
291307 else if (isBlocked)
292308 then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
293309 else if ((pmt.assetId != neutrinoAssetId))
294310 then throw("can use appropriate neutrino tokens only")
295311 else if ((getUnlockBalanceBlock(account) > height))
296312 then throw((("await " + toString((getUnlockBalanceBlock(account) - height))) + " blocks"))
297- else if ((getAccountLockedBalance(account, neutrinoAssetIdString) != 0))
313+ else if (if ((getNeutrinoLockedBalance(account) != 0))
314+ then true
315+ else (getWavesLockedBalance(account) != 0))
298316 then throw("please withdraw locked funds first")
299- else {
300- let newLockedBalance = (getLockedBalance(neutrinoAssetIdString) + pmt.amount)
301- WriteSet([DataEntry(getAccountLockedBalanceKey(account, neutrinoAssetIdString), pmt.amount), DataEntry(getBalanceUnlockBlockKey(account), (height + balanceLockInterval)), DataEntry(getLockedBalanceKey(neutrinoAssetIdString), newLockedBalance), DataEntry(IsRebalanceKey, if ((reserveWithoutLeasing >= convertNeutrinoToWaves(newLockedBalance, currentPrice)))
302- then false
303- else true)])
304- }
317+ else WriteSet([DataEntry(getNeutrinoLockedBalanceKey(account), pmt.amount), DataEntry(getWavesLockedBalanceKey(account), (height + balanceLockInterval)), DataEntry(NeutrinoLockedBalanceKey, (neutrinoLockedBalance + pmt.amount))])
305318 }
306319
307320
308321
309322 @Callable(i)
310-func withdraw (account,index,lockedAssetId) = {
323+func withdraw (account,index) = {
311324 let unlockHeight = getUnlockBalanceBlock(account)
312- let lockedBalance = getAccountLockedBalance(account, lockedAssetId)
325+ let userWavesLockedBalance = getWavesLockedBalance(account)
326+ let userNeutrinoLockedBalance = getNeutrinoLockedBalance(account)
313327 let indexHeight = getHeightPriceByIndex(index)
314328 let nextIndexHeight = getHeightPriceByIndex((index + 1))
315329 let priceByIndex = getPriceHistory(indexHeight)
316- let amount = if ((lockedAssetId == neutrinoAssetIdString))
317- then convertNeutrinoToWaves(lockedBalance, priceByIndex)
318- else convertWavesToNeutrino(lockedBalance, priceByIndex)
330+ let neutrinoAmount = convertWavesToNeutrino(userWavesLockedBalance, priceByIndex)
331+ let wavesAmount = convertNeutrinoToWaves(userNeutrinoLockedBalance, priceByIndex)
319332 if (isBlocked)
320333 then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
321- else if ((0 >= amount))
322- then throw((("balance equals zero (" + lockedAssetId) + ")"))
323- else if ((unlockHeight > height))
324- then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw WAVES funds"))
325- else if (if (if ((index > priceIndex))
326- then true
327- else (indexHeight > unlockHeight))
328- then true
329- else if ((nextIndexHeight != 0))
330- then (unlockHeight >= nextIndexHeight)
331- else false)
332- then throw("invalid price history index")
333- else ScriptResult(WriteSet([DataEntry(getAccountLockedBalanceKey(account, lockedAssetId), 0), DataEntry(getLockedBalanceKey(lockedAssetId), (getLockedBalance(lockedAssetId) - lockedBalance))]), TransferSet([ScriptTransfer(addressFromStringValue(account), amount, if ((lockedAssetId == neutrinoAssetIdString))
334- then unit
335- else neutrinoAssetId)]))
334+ else if ((unlockHeight > height))
335+ then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw WAVES funds"))
336+ else if (if (if ((index > priceIndex))
337+ then true
338+ else (indexHeight > unlockHeight))
339+ then true
340+ else if ((nextIndexHeight != 0))
341+ then (unlockHeight >= nextIndexHeight)
342+ else false)
343+ then throw("invalid price history index")
344+ else if (if ((0 >= neutrinoAmount))
345+ then (0 >= wavesAmount)
346+ else false)
347+ then throw("balance equals zero")
348+ else ScriptResult(WriteSet([DataEntry(getWavesLockedBalanceKey(account), 0), DataEntry(getNeutrinoLockedBalanceKey(account), 0), DataEntry(WavesLockedBalanceKey, (wavesLockedBalance - userWavesLockedBalance)), DataEntry(NeutrinoLockedBalanceKey, (neutrinoLockedBalance - userNeutrinoLockedBalance))]), TransferSet([ScriptTransfer(addressFromStringValue(account), wavesAmount, unit), ScriptTransfer(addressFromStringValue(account), neutrinoAmount, neutrinoAssetId)]))
336349 }
337350
338351
339352
340353 @Callable(i)
341354 func transferToAuction () = {
342- let deficitBondAmount = (convertNeutrinoToBond(deficit) - assetBalance(addressFromStringValue(auctionContract), bondAssetId))
343- let surplusBond = (convertNeutrinoToBond(surplus) - assetBalance(addressFromStringValue(auctionContract), neutrinoAssetId))
355+ let deficitBondAmount = ((convertNeutrinoToBond(deficit) - assetBalance(addressFromStringValue(auctionContract), bondAssetId)) - totalLiquidationOrderbook)
356+ let surplusBond = ((convertNeutrinoToBond(surplus) - assetBalance(addressFromStringValue(auctionContract), neutrinoAssetId)) - totalOrderbook)
344357 if (isBlocked)
345358 then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
346359 else if ((deficitBondAmount >= ((convertNeutrinoToBond(neutrinoSupply) * DEFICITOFFSET) / 100)))
347360 then TransferSet([ScriptTransfer(addressFromStringValue(auctionContract), deficitBondAmount, bondAssetId)])
348361 else if ((surplusBond > 0))
349362 then TransferSet([ScriptTransfer(addressFromStringValue(liquidationContract), convertBondToNeutrino(surplusBond), neutrinoAssetId)])
350- else throw("bond were generated or do not need it")
363+ else throw(((((("bond were generated or do not need it. Deficit:" + toString(deficitBondAmount)) + "|") + toString(((neutrinoSupply * DEFICITOFFSET) / 100))) + ". Surplus:") + toString(surplusBond)))
351364 }
352365
353366
354367
355368 @Callable(i)
356369 func transfer (account) = {
357370 let pmt = extract(i.payment)
358371 TransferSet([ScriptTransfer(addressFromStringValue(account), pmt.amount, pmt.assetId)])
359372 }
360373
361374
362375
363376 @Callable(i)
364377 func nodeReward () = {
365378 let pmt = value(i.payment)
366379 if ((i.caller != addressFromStringValue(nodeAddress)))
367380 then throw("only node account is able to transfer staking rewards from main account")
368381 else if (isDefined(pmt.assetId))
369382 then throw("waves tokens only allowed")
370383 else {
371384 let amount = convertWavesToNeutrino(pmt.amount, currentPrice)
372385 let newRpdSyncIndex = (rpdSyncIndex + 1)
373386 ScriptResult(WriteSet([DataEntry(RPDSyncIndexKey, newRpdSyncIndex), DataEntry(getRPDProfitKey(rpdSyncIndex), amount), DataEntry(getRPDSnapshotContractBalanceKey(rpdSyncIndex, neutrinoAssetId), getRPDContractBalance(neutrinoAssetId))]), TransferSet([ScriptTransfer(addressFromStringValue(rpdContract), amount, neutrinoAssetId)]))
374387 }
375388 }
376389
377390
378-
379-@Callable(i)
380-func registrationLeaseTx (senderPublicKey,fee,timestamp,leaseTxHash) = {
381- let totalFreeReserve = (((reserve * LEASINGSHARE) / 100) - convertNeutrinoToWaves(getLockedBalance(neutrinoAssetIdString), currentPrice))
382- let amount = (totalFreeReserve / LEASINTXCOUNT)
383- let txBytes = (((((base58'3h1H' + fromBase58String(senderPublicKey)) + fromBase58String(nodeAddress)) + toBytes(amount)) + toBytes(fee)) + toBytes(timestamp))
384- let txHashBytes = blake2b256(txBytes)
385- let txHash = toBase58String(txHashBytes)
386- let pmt = extract(i.payment)
387- if ((toString(i.caller) == nodeOracleProviderKey))
388- then throw("invalid caller")
389- else if (isDefined(pmt.assetId))
390- then throw("invalid paymtn asset")
391- else if ((leaseTxHash != txHash))
392- then throw((("invalid tx hash(amount:" + toString(amount)) + ")"))
393- else if ((leasingTxCount >= LEASINTXCOUNT))
394- then throw("the number of leasing transactions is equal to the maximum")
395- else if ((this != addressFromPublicKey(fromBase58String(senderPublicKey))))
396- then throw("invalid pubKey")
397- else if (if ((lastBlock.timestamp > timestamp))
398- then true
399- else (timestamp > (lastBlock.timestamp + 5400000)))
400- then throw((("invalid timestamp(lastBlock: " + toString(lastBlock.timestamp)) + ")"))
401- else if ((getLeaseTxStatus(txHash) != ""))
402- then throw("tx is exist")
403- else if ((pmt.amount != (fee * 2)))
404- then throw("invalid payment amount")
405- else if (if ((fee > 1000000))
406- then true
407- else (500000 > fee))
408- then throw("invalid fee")
409- else if (((totalFreeReserve - (leasingAmount + amount)) > reserveWithoutLeasing))
410- then throw((("invalid amount(result:" + toString(((totalFreeReserve - (leasingAmount + amount)) > reserveWithoutLeasing))) + ")"))
411- else WriteSet([DataEntry(getCancelLeaseTxReserveFeeKey(txHash), fee), DataEntry(LeasingTxCountKey, if ((getLeaseTxStatus(txHash) == ""))
412- then (leasingTxCount + 1)
413- else leasingTxCount), DataEntry(LeasingAmountKey, (leasingAmount + amount)), DataEntry(LeasingExpireBlockKey, if ((height > leasingExpireBlock))
414- then (height + leasingInterval)
415- else leasingExpireBlock), DataEntry(getLeaseTxStatusKey(txHash), NEW), DataEntry(getLeaseTxExpireSendBlockKey(txHash), (height + SENDTXEXPIRE)), DataEntry(getLeaseTxAmountByHashKey(txHash), amount), DataEntry(getLeaseTxBytesByHashKey(txHash), toBase64String(txBytes))])
416- }
417-
418-
419-
420-@Callable(i)
421-func cancelStuckLeaseTx (txHash) = if (if (if ((getLeaseTxStatus(txHash) == NEW))
422- then !(isDefined(transactionHeightById(fromBase58String(txHash))))
423- else false)
424- then (height > getLeaseTxExpireSendBlock(txHash))
425- else false)
426- then {
427- let amount = getLeaseTxAmountByHash(txHash)
428- WriteSet([DataEntry(LeasingTxCountKey, (leasingTxCount - 1)), DataEntry(LeasingAmountKey, (leasingAmount - amount)), DataEntry(getLeaseTxStatusKey(txHash), CANCELED), DataEntry(IsRebalanceKey, if (((reserveWithoutLeasing - amount) >= convertNeutrinoToWaves(getLockedBalance(neutrinoAssetIdString), currentPrice)))
429- then false
430- else true)])
431- }
432- else throw("invalid tx hash")
433-
434-
435-
436-@Callable(i)
437-func registrationUnleaseTx (chainIdString,senderPublicKey,fee,timestamp,leaseTxHash) = {
438- let txBytes = (((((base58'gm' + toBytes(chainIdString)) + fromBase58String(senderPublicKey)) + toBytes(fee)) + toBytes(timestamp)) + fromBase58String(leaseTxHash))
439- let txHash = blake2b256(txBytes)
440- if ((getLeaseTxStatus(leaseTxHash) != NEW))
441- then throw("invalid tx status")
442- else if ((this != addressFromPublicKey(fromBase58String(senderPublicKey))))
443- then throw("invalid pubKey")
444- else if (!(isDefined(transactionHeightById(txHash))))
445- then throw("blockchain does not contain this transaction")
446- else {
447- let amount = getLeaseTxAmountByHash(leaseTxHash)
448- WriteSet([DataEntry(LeasingTxCountKey, (leasingTxCount - 1)), DataEntry(LeasingAmountKey, (leasingAmount - amount)), DataEntry(getLeaseTxStatusKey(leaseTxHash), CANCELED), DataEntry(IsRebalanceKey, if (((reserveWithoutLeasing - amount) >= convertNeutrinoToWaves(getLockedBalance(neutrinoAssetIdString), currentPrice)))
449- then false
450- else true)])
451- }
452- }
453-
454-
455391 @Verifier(tx)
456392 func verify () = {
457393 let id = toBase58String(tx.id)
458394 match tx {
459- case leaseTx: LeaseTransaction =>
460- if (if ((leasingExpireBlock >= height))
461- then (getLeaseTxExpireSendBlock(id) >= height)
462- else false)
463- then (getLeaseTxStatus(id) == NEW)
464- else false
465- case unleaseTx: LeaseCancelTransaction =>
466- let leaseId = toBase58String(unleaseTx.leaseId)
467- if (if (if ((height > leasingExpireBlock))
468- then true
469- else isRebalance)
470- then (unleaseTx.fee == getCancelLeaseTxReserveFee(leaseId))
471- else false)
472- then (getLeaseTxStatus(leaseId) == NEW)
395+ case leasingTx: LeaseCancelTransaction|LeaseTransaction =>
396+ if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
397+ then (addressFromString(nodeOracleProvider) == addressFromPublicKey(tx.senderPublicKey))
473398 else false
474399 case _ =>
475400 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
476401 }
477402 }
478403

github/deemru/w8io/026f985 
81.09 ms