tx · DKF1cPYMdt8yN2Dg73VHU9iLDqjW7XYVzHbDFfeMKtQp

3MwiWPgTR9hudDuq4gdiBNTpuTTKDwd6DNN:  -0.01000000 Waves

2020.02.10 17:37 [893302] smart account 3MwiWPgTR9hudDuq4gdiBNTpuTTKDwd6DNN > SELF 0.00000000 Waves

{ "type": 13, "id": "DKF1cPYMdt8yN2Dg73VHU9iLDqjW7XYVzHbDFfeMKtQp", "fee": 1000000, "feeAssetId": null, "timestamp": 1581345486793, "version": 1, "sender": "3MwiWPgTR9hudDuq4gdiBNTpuTTKDwd6DNN", "senderPublicKey": "6Y1ch895NG9HEC95KHF6aZjUKgqTmaEYGneqQB53oA6V", "proofs": [ "2SvxQ1uT5RojL1VeagsXXyJyGUFc37g37SxeBTqR6pxy65NfGeVkiRxn4LjDvBnG2seQSqmesRuNmavwTWoTQZbP" ], "script": "base64:AAIDAAAAAAAAAAsIARIAEgMKAQgSAAAAADgBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAYZ2V0U3RyaW5nQnlBZGRyZXNzQW5kS2V5AAAAAgAAAAdhZGRyZXNzAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAAAQAAABhnZXROdW1iZXJCeUFkZHJ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AAAJRGF0YUVudHJ5AAAAAgUAAAAMTGFzdE9yZGVyS2V5AwMJAAAAAAAAAgUAAAAJbmV3U3RhdHVzBQAAAAZGSUxMRUQJAAAAAAAAAgUAAAAKZmlyc3RPcmRlcgUAAAAJbGFzdE9yZGVyBwIAAAAABQAAAAlsYXN0T3JkZXIJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABZnZXRPcmRlckZpbGxlZFRvdGFsS2V5AAAAAQUAAAAKZmlyc3RPcmRlcgkAAGQAAAACBQAAAAtmaWxsZWRUb3RhbAUAAAATZmlsbGFibGVPcmRlckFtb3VudAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEWdldE9yZGVyU3RhdHVzS2V5AAAAAQUAAAAKZmlyc3RPcmRlcgUAAAAJbmV3U3RhdHVzBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAApvcmRlck93bmVyCQEAAAAVY29udmVydEJvbmRUb05ldXRyaW5vAAAAAQUAAAATZmlsbGFibGVPcmRlckFtb3VudAUAAAAPbmV1dHJpbm9Bc3NldElkBQAAAANuaWwAAAAAjsqaJQ==", "chainId": 84, "height": 893302, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+func getNumberByKey (key) = match getInteger(this, key) {
5+ case a: Int =>
6+ a
7+ case _ =>
8+ 0
9+}
10+
11+
12+func getStringByKey (key) = match getString(this, key) {
13+ case a: String =>
14+ a
15+ case _ =>
16+ ""
17+}
18+
19+
20+func getStringByAddressAndKey (address,key) = match getString(address, key) {
21+ case a: String =>
22+ a
23+ case _ =>
24+ ""
25+}
26+
27+
28+func getNumberByAddressAndKey (address,key) = match getInteger(address, key) {
29+ case a: Int =>
30+ a
31+ case _ =>
32+ 0
33+}
34+
35+
36+let WAVELET = 100000000
37+
38+let ORDERSPLITSYMBOL = "_"
39+
40+let PAULI = 1000000
41+
42+let PERCENTACCURACY = 1000
43+
44+let MAXDISCOUNT = 50
45+
46+let CANCELED = "canceled"
47+
48+let NEW = "new"
49+
50+let FILLED = "filled"
51+
52+let NeutrinoContractKey = "neutrino_contract"
53+
54+let PriceKey = "price"
55+
56+let BondAssetIdKey = "bond_asset_id"
57+
58+let NeutrinoAssetIdKey = "neutrino_asset_id"
59+
60+let ControlContractKey = "control_contract"
61+
62+let BalanceLockedkKey = "balance_lock_"
63+
64+let WavesLockedBalanceKey = (BalanceLockedkKey + "waves")
65+
66+let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino")
67+
68+let FirstOrderKey = "order_first"
69+
70+let LastOrderKey = "order_last"
71+
72+func getOrderPrevKey (orderId) = ("order_prev_" + orderId)
73+
74+
75+func getOrderNextKey (orderId) = ("order_next_" + orderId)
76+
77+
78+func getOrderTotalKey (orderId) = ("order_total_" + orderId)
79+
80+
81+func getOrderOwnerKey (orderId) = ("order_owner_" + orderId)
82+
83+
84+func getOrderHeightKey (orderId) = ("order_height_" + orderId)
85+
86+
87+func getOrderStatusKey (orderId) = ("order_status_" + orderId)
88+
89+
90+func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId)
91+
92+
93+func getLastOrderOwnerKey (owner) = ("last_order_owner_" + owner)
94+
95+
96+func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI)
97+
98+
99+func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET)
100+
101+
102+func convertNeutrinoToBond (amount) = (amount / PAULI)
103+
104+
105+func convertBondToNeutrino (amount) = (amount * PAULI)
106+
107+
108+func convertWavesToBond (amount,price) = convertNeutrinoToBond(convertWavesToNeutrino(amount, price))
109+
110+
111+let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey))
112+
113+let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey))
114+
115+let liquidationContract = this
116+
117+let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey))
118+
119+let bondAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, BondAssetIdKey))
120+
121+let firstOrder = getStringByKey(FirstOrderKey)
122+
123+let lastOrder = getStringByKey(LastOrderKey)
124+
125+let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey)
126+
127+let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey)
128+
129+let wavesLockedBalance = getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey)
130+
131+let reserve = (wavesBalance(neutrinoContract) - wavesLockedBalance)
132+
133+let neutrinoSupply = (((neutrinoLockedBalance + extract(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId))
134+
135+let surplus = (convertWavesToNeutrino(reserve, currentPrice) - neutrinoSupply)
136+
137+func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id))
138+
139+
140+func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id))
141+
142+
143+func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id))
144+
145+
146+func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id))
147+
148+
149+func getOrderPrev (id) = getStringByKey(getOrderPrevKey(id))
150+
151+
152+func getOrderNext (id) = getStringByKey(getOrderNextKey(id))
153+
154+
155+func getOrderHeight (id) = getNumberByKey(getOrderHeightKey(id))
156+
157+
158+func getLastOrderOwner (owner) = getStringByKey(getLastOrderOwnerKey(owner))
159+
160+
161+@Callable(i)
162+func addLiquidationOrder () = {
163+ let pmt = extract(i.payment)
164+ let newOrderId = toBase58String(keccak256((((toBytes(pmt.amount) + i.caller.bytes) + toBytes(height)) + i.transactionId)))
165+ let nextOrder = getOrderNext(lastOrder)
166+ let orderStatus = getOrderStatus(lastOrder)
167+ let owner = toString(i.caller)
168+ if ((pmt.assetId != bondAssetId))
169+ then throw("can use appropriate neutrino bonds tokens only")
170+ else if ((getOrderOwner(newOrderId) != ""))
171+ then throw("an order is already exists")
172+ else if ((nextOrder != ""))
173+ then throw(("nextOrder is not last. Info:" + nextOrder))
174+ else if (if ((firstOrder != ""))
175+ then (lastOrder == "")
176+ else false)
177+ then throw("invalid last order")
178+ else if (if ((firstOrder != ""))
179+ then (orderStatus != NEW)
180+ else false)
181+ then throw("last order status is not new")
182+ else WriteSet([DataEntry(getLastOrderOwnerKey(owner), newOrderId), DataEntry(getOrderPrevKey(newOrderId), lastOrder), DataEntry(getOrderNextKey(lastOrder), if ((lastOrder == ""))
183+ then ""
184+ else newOrderId), DataEntry(FirstOrderKey, if ((firstOrder == ""))
185+ then newOrderId
186+ else firstOrder), DataEntry(LastOrderKey, newOrderId), DataEntry(getOrderTotalKey(newOrderId), pmt.amount), DataEntry(getOrderOwnerKey(newOrderId), owner), DataEntry(getOrderHeightKey(newOrderId), height), DataEntry(getOrderStatusKey(newOrderId), NEW)])
187+ }
188+
189+
190+
191+@Callable(i)
192+func cancelOrder (orderId) = {
193+ let owner = getOrderOwner(orderId)
194+ let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId))
195+ let nextOrder = getOrderNext(orderId)
196+ let prevOrder = getOrderPrev(orderId)
197+ if ((owner != toString(i.caller)))
198+ then throw("permission denied")
199+ else if ((getOrderStatus(orderId) != NEW))
200+ then throw("invalid order status")
201+ else ScriptResult(WriteSet([DataEntry(FirstOrderKey, if ((firstOrder == orderId))
202+ then nextOrder
203+ else firstOrder), DataEntry(LastOrderKey, if ((lastOrder == orderId))
204+ then prevOrder
205+ else lastOrder), DataEntry(getOrderNextKey(prevOrder), nextOrder), DataEntry(getOrderPrevKey(nextOrder), prevOrder), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, bondAssetId)]))
206+ }
207+
208+
209+
210+@Callable(i)
211+func liquidateBond () = {
212+ let surplusPositive = if ((0 >= surplus))
213+ then 0
214+ else surplus
215+ let liquidationBalance = assetBalance(this, neutrinoAssetId)
216+ let returnAmount = if ((surplusPositive >= liquidationBalance))
217+ then 0
218+ else (liquidationBalance - surplusPositive)
219+ let surplusBond = convertNeutrinoToBond(surplusPositive)
220+ if (if ((returnAmount == 0))
221+ then (liquidationBalance == 0)
222+ else false)
223+ then throw("cannot liquidate order without neutrino on the smart contract")
224+ else if ((returnAmount > 0))
225+ then TransferSet([ScriptTransfer(neutrinoContract, returnAmount, neutrinoAssetId)])
226+ else if ((0 >= surplusBond))
227+ then throw("there is no proficit on the smart contract now")
228+ else if ((firstOrder == ""))
229+ then throw("empty orderbook")
230+ else {
231+ let nextOrder = getOrderNext(firstOrder)
232+ let orderTotal = getOrderTotal(firstOrder)
233+ let orderOwner = getOrderOwner(firstOrder)
234+ let filledTotal = getOrderFilledTotal(firstOrder)
235+ let amount = (orderTotal - filledTotal)
236+ let newStatus = if ((surplusBond >= amount))
237+ then FILLED
238+ else NEW
239+ let fillableOrderAmount = if ((surplusBond >= amount))
240+ then amount
241+ else surplusBond
242+ ScriptResult(WriteSet([DataEntry(getOrderPrevKey(nextOrder), if ((newStatus == FILLED))
243+ then ""
244+ else firstOrder), DataEntry(FirstOrderKey, if ((newStatus == FILLED))
245+ then nextOrder
246+ else firstOrder), DataEntry(LastOrderKey, if (if ((newStatus == FILLED))
247+ then (firstOrder == lastOrder)
248+ else false)
249+ then ""
250+ else lastOrder), DataEntry(getOrderFilledTotalKey(firstOrder), (filledTotal + fillableOrderAmount)), DataEntry(getOrderStatusKey(firstOrder), newStatus)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), convertBondToNeutrino(fillableOrderAmount), neutrinoAssetId)]))
251+ }
252+ }
253+
254+

github/deemru/w8io/169f3d6 
37.29 ms