tx · 5RTSBCzM6Ccph4Z2PzDXd2jmSBL2HM3fJofSui8aBTcN

3MuA6qzM79jgGYAUZ62wACvspk7S9nxpB4d:  -0.01000000 Waves

2019.11.16 00:01 [766734] smart account 3MuA6qzM79jgGYAUZ62wACvspk7S9nxpB4d > SELF 0.00000000 Waves

{ "type": 13, "id": "5RTSBCzM6Ccph4Z2PzDXd2jmSBL2HM3fJofSui8aBTcN", "fee": 1000000, "feeAssetId": null, "timestamp": 1573851679369, "version": 1, "sender": "3MuA6qzM79jgGYAUZ62wACvspk7S9nxpB4d", "senderPublicKey": "A39XF9fVpTpsVQRVxNms4cwcv7T8caLytpFPaxHLbLgD", "proofs": [ "4B3Ejs3qBtLQsWGpvnX1EikSL5CPgd6BB18Ampp5phJET7S2e66yVQexSaQqkoqWNUrKdt13CCdGaQWnoeVJeUjZ" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIBARIDCgEIEgAAAAA3AQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAAGGdldFN0cmluZ0J5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAYZ2V0TnVtYmVyQ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AAAAZhbW91bnQFAAAABkZJTExFRAUAAAADTkVXAwkAAAAAAAACBQAAAAV0b3RhbAAAAAAAAAAAAAkAAAIAAAABAgAAABB0b3RhbCBlcXVhbCB6ZXJvCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAMT3JkZXJib29rS2V5AwkAAGcAAAACBQAAAApib25kQW1vdW50BQAAAAZhbW91bnQJAQAAAAlkcm9wT3JkZXIAAAABBQAAAAdvcmRlcklkBQAAAAlvcmRlcmJvb2sJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABZnZXRPcmRlckZpbGxlZFRvdGFsS2V5AAAAAQUAAAAHb3JkZXJJZAkAAGQAAAACBQAAAAtmaWxsZWRUb3RhbAUAAAAFdG90YWwJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABFnZXRPcmRlclN0YXR1c0tleQAAAAEFAAAAB29yZGVySWQFAAAABnN0YXR1cwkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEmdldE9yZGVySGlzdG9yeUtleQAAAAEFAAAABmhlaWdodAUAAAAKb3JkZXJQcmljZQUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAKb3JkZXJPd25lcgUAAAAMZmlsbGVkQW1vdW50BQAAAAtib25kQXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABBuZXV0cmlub0NvbnRyYWN0BQAAAAV0b3RhbAUAAAAPbmV1dHJpbm9Bc3NldElkBQAAAANuaWwAAAAAW6fmOA==", "chainId": 84, "height": 766734, "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 = 100
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 OrderbookKey = "orderbook"
53+
54+let PriceKey = "price"
55+
56+let BondAssetIdKey = "bond_asset_id"
57+
58+let NeutrinoAssetIdKey = "neutrino_asset_id"
59+
60+let NeutrinoContractKey = "neutrino_contract"
61+
62+let ControlContractKey = "control_contract"
63+
64+let SwapLockedBalanceKey = "swap_locked_balance"
65+
66+let SwapNeutrinoLockedBalanceKey = "swap_neutrino_locked_balance"
67+
68+let SwapWavesLockedBalanceKey = "swap_waves_locked_balance"
69+
70+func getOrderPriceKey (orderId) = ("order_price_" + orderId)
71+
72+
73+func getOrderTotalKey (orderId) = ("order_total_" + orderId)
74+
75+
76+func getOrderOwnerKey (orderId) = ("order_owner_" + orderId)
77+
78+
79+func getOrderHeightKey (orderId) = ("order_height_" + orderId)
80+
81+
82+func getOrderStatusKey (orderId) = ("order_status_" + orderId)
83+
84+
85+func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId)
86+
87+
88+func getOrderHistoryKey (height) = ("order_history_" + toString(height))
89+
90+
91+func convertNeutrinoToWaves (amount,price) = ((((amount * 100) / price) * WAVELET) / PAULI)
92+
93+
94+func convertWavesToNeutrino (amount,price) = ((((amount * price) / 100) * PAULI) / WAVELET)
95+
96+
97+func convertNeutrinoToBond (amount) = (amount / PAULI)
98+
99+
100+func convertBondToNeutrino (amount) = (amount * PAULI)
101+
102+
103+func convertWavesToBond (amount,price) = convertNeutrinoToBond(convertWavesToNeutrino(amount, price))
104+
105+
106+let orderbook = getStringByKey(OrderbookKey)
107+
108+let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey))
109+
110+let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey))
111+
112+let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey)
113+
114+let swapLockedBalance = getNumberByAddressAndKey(neutrinoContract, SwapLockedBalanceKey)
115+
116+let swapNeutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, SwapNeutrinoLockedBalanceKey)
117+
118+let swapWavesLockedBalance = getNumberByAddressAndKey(neutrinoContract, SwapWavesLockedBalanceKey)
119+
120+let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey))
121+
122+let bondAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, BondAssetIdKey))
123+
124+let reserve = (wavesBalance(neutrinoContract) - swapWavesLockedBalance)
125+
126+let neutrinoSupply = ((extract(assetInfo(neutrinoAssetId)).quantity - assetBalance(this, neutrinoAssetId)) + swapNeutrinoLockedBalance)
127+
128+let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice))
129+
130+let surplus = (convertWavesToNeutrino(reserve, currentPrice) - neutrinoSupply)
131+
132+func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id))
133+
134+
135+func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id))
136+
137+
138+func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id))
139+
140+
141+func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id))
142+
143+
144+func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id))
145+
146+
147+func getOrderElementById (id) = (id + ORDERSPLITSYMBOL)
148+
149+
150+func addOrder (orderId,position) = {
151+ let orders = split(orderbook, ORDERSPLITSYMBOL)
152+ let newOrder = getOrderElementById(orderId)
153+ if ((position == 0))
154+ then (newOrder + orderbook)
155+ else if ((position >= (size(orders) - 1)))
156+ then (orderbook + newOrder)
157+ else {
158+ let parts = split(orderbook, getOrderElementById(orders[position]))
159+ (((parts[0] + newOrder) + getOrderElementById(orders[position])) + parts[1])
160+ }
161+ }
162+
163+
164+func dropOrder (orderId) = {
165+ let parts = split(orderbook, getOrderElementById(orderId))
166+ (parts[0] + parts[1])
167+ }
168+
169+
170+func getOrdersInOrderbook (orderbook) = split(orderbook, ORDERSPLITSYMBOL)
171+
172+
173+@Callable(i)
174+func addBuyBondOrder (price,position) = {
175+ let pmt = extract(i.payment)
176+ let newOrderId = toBase58String(keccak256((((toBytes(price) + toBytes(pmt.amount)) + i.caller.bytes) + toBytes(height))))
177+ if ((MAXDISCOUNT > price))
178+ then throw("max discount is 50%")
179+ else if ((pmt.assetId != neutrinoAssetId))
180+ then throw("can use neutrino only")
181+ else if ((0 >= price))
182+ then throw("price less zero")
183+ else if ((getOrderOwner(newOrderId) != ""))
184+ then throw("order exists")
185+ else {
186+ let orders = getOrdersInOrderbook(orderbook)
187+ let nextOrderId = if ((position == 0))
188+ then ""
189+ else orders[(position - 1)]
190+ let nextOrderPrice = getOrderPrice(nextOrderId)
191+ let isNextOrderError = if (if ((nextOrderId != ""))
192+ then (price > nextOrderPrice)
193+ else false)
194+ then true
195+ else false
196+ let prevOrderId = orders[position]
197+ let prevOrderPrice = getOrderPrice(prevOrderId)
198+ let isPrevOrderError = if ((prevOrderPrice >= price))
199+ then true
200+ else false
201+ if (if (isNextOrderError)
202+ then true
203+ else isPrevOrderError)
204+ then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError)))
205+ else WriteSet([DataEntry(OrderbookKey, addOrder(newOrderId, position)), DataEntry(getOrderPriceKey(newOrderId), price), DataEntry(getOrderTotalKey(newOrderId), pmt.amount), DataEntry(getOrderOwnerKey(newOrderId), toString(i.caller)), DataEntry(getOrderHeightKey(newOrderId), height), DataEntry(getOrderStatusKey(newOrderId), NEW)])
206+ }
207+ }
208+
209+
210+
211+@Callable(i)
212+func cancelOrder (orderId) = {
213+ let owner = getOrderOwner(orderId)
214+ let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId))
215+ if ((owner != toString(i.caller)))
216+ then throw("permission denied")
217+ else if ((getOrderStatus(orderId) != NEW))
218+ then throw("invalid order status")
219+ else ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, neutrinoAssetId)]))
220+ }
221+
222+
223+
224+@Callable(i)
225+func sellBond () = {
226+ let bondBalance = assetBalance(this, bondAssetId)
227+ let deficitPositive = if ((0 >= deficit))
228+ then 0
229+ else deficit
230+ let bondAmount = if ((deficitPositive >= bondBalance))
231+ then bondBalance
232+ else deficitPositive
233+ let returnAmount = if ((deficitPositive >= bondBalance))
234+ then 0
235+ else (bondBalance - deficitPositive)
236+ if (if ((returnAmount == 0))
237+ then (bondAmount == 0)
238+ else false)
239+ then throw("without deficit")
240+ else if ((bondAmount == 0))
241+ then TransferSet([ScriptTransfer(neutrinoContract, returnAmount, bondAssetId)])
242+ else if ((orderbook == ""))
243+ then throw("empty orderbook")
244+ else {
245+ let orderId = getOrdersInOrderbook(orderbook)[0]
246+ let filledTotal = getOrderFilledTotal(orderId)
247+ let orderTotal = getOrderTotal(orderId)
248+ let orderPrice = getOrderPrice(orderId)
249+ let orderOwner = getOrderOwner(orderId)
250+ let amount = convertNeutrinoToBond((((orderTotal - filledTotal) * 100) / orderPrice))
251+ let filledAmount = if ((bondAmount >= amount))
252+ then amount
253+ else bondAmount
254+ let total = (((filledAmount * orderPrice) * PAULI) / 100)
255+ let status = if ((bondAmount >= amount))
256+ then FILLED
257+ else NEW
258+ if ((total == 0))
259+ then throw("total equal zero")
260+ else ScriptResult(WriteSet([DataEntry(OrderbookKey, if ((bondAmount >= amount))
261+ then dropOrder(orderId)
262+ else orderbook), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + total)), DataEntry(getOrderStatusKey(orderId), status), DataEntry(getOrderHistoryKey(height), orderPrice)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), filledAmount, bondAssetId), ScriptTransfer(neutrinoContract, total, neutrinoAssetId)]))
263+ }
264+ }
265+
266+

github/deemru/w8io/026f985 
34.98 ms