tx · AsNFd69NnkoKX7UCP1WttdkZHEEyPL5mxPdfpfSLzQP9

3MuTR6FqVriefgvXkJtNxj8CNh3nBbuqidJ:  -0.01400000 Waves

2019.09.27 22:50 [695272] smart account 3MuTR6FqVriefgvXkJtNxj8CNh3nBbuqidJ > SELF 0.00000000 Waves

{ "type": 13, "id": "AsNFd69NnkoKX7UCP1WttdkZHEEyPL5mxPdfpfSLzQP9", "fee": 1400000, "feeAssetId": null, "timestamp": 1569613842181, "version": 1, "sender": "3MuTR6FqVriefgvXkJtNxj8CNh3nBbuqidJ", "senderPublicKey": "7Egc9nr6FA2hbNNbo8H21n8htzQ5nYzsLc6eku6JU5pn", "proofs": [ "5RLfVZafWcK1VkssbgSNotx4iku9zmXR8AUy3mF7dVaA18sMNm2H8pbXAHt1tv7UzCuwHUhK6ywSjtarnteyUD6W" ], "script": "base64:AAIDAAAAAAAAAAAAAAAoAQAAABhnZXROdW1iZXJCeUFkZHJlc3NBbmRLZXkAAAACAAAAB2FkZHJlc3MAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAHYWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAA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RhRW50cnkAAAACBQAAAAxPcmRlckJvb2tLZXkFAAAADG5ld09yZGVyYm9vawkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAFmdldE9yZGVyRmlsbGVkVG90YWxLZXkAAAABBQAAAAdvcmRlcklkCQAAZAAAAAIFAAAAC2ZpbGxlZFRvdGFsBQAAAAV0b3RhbAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEWdldE9yZGVyU3RhdHVzS2V5AAAAAQUAAAAHb3JkZXJJZAUAAAAGc3RhdHVzBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAApvcmRlck93bmVyBQAAAAxmaWxsZWRBbW91bnQFAAAAC2JvbmRBc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAQbmV1dHJpbm9Db250cmFjdAUAAAAFdG90YWwFAAAAD25ldXRyaW5vQXNzZXRJZAUAAAADbmlsAAAAAAfET2o=", "chainId": 84, "height": 695272, "spentComplexity": 0 } View: original | compacted Prev: 4aR2GSKzTzxqfPHnUvYtoPuU9cSyhEh3SFAUYoXUNys6 Next: 6c2P7kdQjRgRKy34VFUuH5uycQUApwXfdyrsGBSAoiXq Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let NONE = ""
5-
64 func getNumberByAddressAndKey (address,key) = match getInteger(addressFromStringValue(address), key) {
75 case a: Int =>
86 a
2321 case a: String =>
2422 a
2523 case _ =>
26- NONE
24+ ""
2725 }
2826
27+
28+let ORDERSPLITSYMBOL = "_"
29+
30+let WAVELET = 100000000
31+
32+let CANCELED = "canceled"
33+
34+let NEW = "new"
35+
36+let FILLED = "filled"
2937
3038 let OrderBookKey = "orderbook"
3139
4957
5058 let NeutrinoContractKey = "neutrino_contract"
5159
52-let orderbook = getStringByKey(OrderBookKey)
53-
54-func getOrderPrice (id) = getNumberByKey((OrderPriceKey + id))
60+func getOrderPriceKey (orderId) = (OrderPriceKey + orderId)
5561
5662
57-func getOrderTotal (id) = getNumberByKey((OrderTotalKey + id))
63+func getOrderTotalKey (orderId) = (OrderTotalKey + orderId)
5864
5965
60-func getOrderOwner (id) = getStringByKey((OrderOwnerKey + id))
66+func getOrderOwnerKey (orderId) = (OrderOwnerKey + orderId)
6167
6268
63-func getOrderStatus (id) = getStringByKey((OrderStatusKey + id))
69+func getOrderHeightKey (orderId) = (OrderHeightKey + orderId)
6470
6571
66-func getOrderFilledTotal (id) = getNumberByKey((OrderFilledTotalKey + id))
72+func getOrderStatusKey (orderId) = (OrderStatusKey + orderId)
73+
74+
75+func getOrderFilledTotalKey (orderId) = (OrderFilledTotalKey + orderId)
6776
6877
6978 let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey))
7079
80+let bondAssetId = fromBase58String(getStringByKey(BondAssetIdKey))
81+
7182 let neutrinoContract = getStringByKey(NeutrinoContractKey)
83+
84+let price = getNumberByAddressAndKey(neutrinoContract, PriceKey)
85+
86+let orderbook = getStringByKey(OrderBookKey)
7287
7388 let reserve = wavesBalance(addressFromStringValue(neutrinoContract))
7489
7792 (info.quantity - assetBalance(addressFromStringValue(neutrinoContract), neutrinoAssetId))
7893 }
7994
80-let price = getNumberByAddressAndKey(neutrinoContract, PriceKey)
95+func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id))
8196
82-let OrderSplitSymbol = "_"
8397
84-let BondAssetId = fromBase58String(getStringByKey(BondAssetIdKey))
98+func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id))
8599
86-let Wavelet = 100000000
87100
88-let CANCELED = "canceled"
101+func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id))
89102
90-let NEW = "new"
91103
92-let FILLED = "filled"
104+func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id))
93105
94-func calculateOrderbook (orderId,position) = {
95- let orders = split(orderbook, OrderSplitSymbol)
96- let newOrder = (orderId + OrderSplitSymbol)
106+
107+func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id))
108+
109+
110+func getOrderElementById (id) = (id + ORDERSPLITSYMBOL)
111+
112+
113+func addOrder (orderId,position) = {
114+ let orders = split(orderbook, ORDERSPLITSYMBOL)
115+ let newOrder = getOrderElementById(orderId)
97116 if ((position == 0))
98117 then (newOrder + orderbook)
99118 else if ((position >= (size(orders) - 1)))
100119 then (orderbook + newOrder)
101120 else {
102- let parts = split(orderbook, (orders[position] + OrderSplitSymbol))
103- (((parts[0] + newOrder) + (orders[position] + OrderSplitSymbol)) + parts[1])
121+ let parts = split(orderbook, getOrderElementById(orders[position]))
122+ (((parts[0] + newOrder) + getOrderElementById(orders[position])) + parts[1])
104123 }
124+ }
125+
126+
127+func dropOrder (orderId) = {
128+ let parts = split(orderbook, getOrderElementById(orderId))
129+ (parts[0] + parts[1])
105130 }
106131
107132
113138 then throw("can use neutrino only")
114139 else if ((0 >= price))
115140 then throw("price less zero")
116- else if ((getOrderOwner(newOrderId) != NONE))
141+ else if ((getOrderOwner(newOrderId) != ""))
117142 then throw("order exists")
118143 else {
119- let orders = split(orderbook, OrderSplitSymbol)
144+ let orders = split(orderbook, ORDERSPLITSYMBOL)
120145 let nextOrderId = if ((position == 0))
121146 then ""
122147 else orders[(position - 1)]
135160 then true
136161 else isPrevOrderError)
137162 then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError)))
138- else WriteSet([DataEntry(OrderBookKey, calculateOrderbook(newOrderId, position)), DataEntry((OrderPriceKey + newOrderId), price), DataEntry((OrderTotalKey + newOrderId), pmt.amount), DataEntry((OrderOwnerKey + newOrderId), toString(i.caller)), DataEntry((OrderHeightKey + newOrderId), height), DataEntry((OrderStatusKey + newOrderId), NEW)])
163+ 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)])
139164 }
140165 }
141166
147172 let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId))
148173 if ((owner != toString(i.caller)))
149174 then throw("permission denied")
150- else {
151- let parts = split(orderbook, (orderId + OrderSplitSymbol))
152- ScriptResult(WriteSet([DataEntry(OrderBookKey, (parts[0] + parts[1])), DataEntry((OrderStatusKey + orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, neutrinoAssetId)]))
153- }
175+ else ScriptResult(WriteSet([DataEntry(OrderBookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, neutrinoAssetId)]))
154176 }
155177
156178
157179
158180 @Callable(i)
159181 func executeOrder () = {
160- let bondBalance = assetBalance(this, BondAssetId)
161- let deficit = ((neutrinoSupply - ((reserve * price) / 100)) / Wavelet)
182+ let bondBalance = assetBalance(this, bondAssetId)
183+ let deficit = ((neutrinoSupply - ((reserve * price) / 100)) / WAVELET)
162184 let deficitPositive = if ((0 >= deficit))
163185 then 0
164186 else deficit
169191 then 0
170192 else (bondBalance - deficitPositive)
171193 if ((bondAmount == 0))
172- then TransferSet([ScriptTransfer(addressFromStringValue(neutrinoContract), returnAmount, BondAssetId)])
194+ then TransferSet([ScriptTransfer(addressFromStringValue(neutrinoContract), returnAmount, bondAssetId)])
173195 else {
174- let orderId = split(orderbook, OrderSplitSymbol)[0]
196+ let orderId = split(orderbook, ORDERSPLITSYMBOL)[0]
175197 let filledTotal = getOrderFilledTotal(orderId)
176198 let orderTotal = getOrderTotal(orderId)
177199 let orderPrice = getOrderPrice(orderId)
178200 let orderOwner = getOrderOwner(orderId)
179- let amount = ((((orderTotal - filledTotal) * 100) / orderPrice) / Wavelet)
201+ let amount = ((((orderTotal - filledTotal) * 100) / orderPrice) / WAVELET)
180202 let newOrderbook = if ((bondAmount >= amount))
181- then split(orderbook, (orderId + OrderSplitSymbol))[1]
203+ then dropOrder(orderId)
182204 else orderbook
183205 let filledAmount = if ((bondAmount >= amount))
184206 then amount
185207 else bondAmount
186- let total = (((filledAmount * orderPrice) / 100) * Wavelet)
208+ let total = (((filledAmount * orderPrice) / 100) * WAVELET)
187209 let status = if ((bondAmount >= amount))
188210 then FILLED
189211 else NEW
190- ScriptResult(WriteSet([DataEntry(OrderBookKey, newOrderbook), DataEntry((OrderFilledTotalKey + orderId), (filledTotal + total)), DataEntry((OrderStatusKey + orderId), status)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), filledAmount, BondAssetId), ScriptTransfer(addressFromStringValue(neutrinoContract), total, neutrinoAssetId), ScriptTransfer(addressFromStringValue(neutrinoContract), returnAmount, BondAssetId)]))
212+ ScriptResult(WriteSet([DataEntry(OrderBookKey, newOrderbook), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + total)), DataEntry(getOrderStatusKey(orderId), status)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), filledAmount, bondAssetId), ScriptTransfer(addressFromStringValue(neutrinoContract), total, neutrinoAssetId)]))
191213 }
192214 }
193215
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let NONE = ""
5-
64 func getNumberByAddressAndKey (address,key) = match getInteger(addressFromStringValue(address), key) {
75 case a: Int =>
86 a
97 case _ =>
108 0
119 }
1210
1311
1412 func getNumberByKey (key) = match getInteger(this, key) {
1513 case a: Int =>
1614 a
1715 case _ =>
1816 0
1917 }
2018
2119
2220 func getStringByKey (key) = match getString(this, key) {
2321 case a: String =>
2422 a
2523 case _ =>
26- NONE
24+ ""
2725 }
2826
27+
28+let ORDERSPLITSYMBOL = "_"
29+
30+let WAVELET = 100000000
31+
32+let CANCELED = "canceled"
33+
34+let NEW = "new"
35+
36+let FILLED = "filled"
2937
3038 let OrderBookKey = "orderbook"
3139
3240 let OrderPriceKey = "order_price_"
3341
3442 let OrderTotalKey = "order_total_"
3543
3644 let OrderFilledTotalKey = "order_filled_total_"
3745
3846 let OrderOwnerKey = "order_owner_"
3947
4048 let OrderHeightKey = "order_height_"
4149
4250 let OrderStatusKey = "order_status_"
4351
4452 let PriceKey = "price"
4553
4654 let BondAssetIdKey = "bond_asset_id"
4755
4856 let NeutrinoAssetIdKey = "neutrino_asset_id"
4957
5058 let NeutrinoContractKey = "neutrino_contract"
5159
52-let orderbook = getStringByKey(OrderBookKey)
53-
54-func getOrderPrice (id) = getNumberByKey((OrderPriceKey + id))
60+func getOrderPriceKey (orderId) = (OrderPriceKey + orderId)
5561
5662
57-func getOrderTotal (id) = getNumberByKey((OrderTotalKey + id))
63+func getOrderTotalKey (orderId) = (OrderTotalKey + orderId)
5864
5965
60-func getOrderOwner (id) = getStringByKey((OrderOwnerKey + id))
66+func getOrderOwnerKey (orderId) = (OrderOwnerKey + orderId)
6167
6268
63-func getOrderStatus (id) = getStringByKey((OrderStatusKey + id))
69+func getOrderHeightKey (orderId) = (OrderHeightKey + orderId)
6470
6571
66-func getOrderFilledTotal (id) = getNumberByKey((OrderFilledTotalKey + id))
72+func getOrderStatusKey (orderId) = (OrderStatusKey + orderId)
73+
74+
75+func getOrderFilledTotalKey (orderId) = (OrderFilledTotalKey + orderId)
6776
6877
6978 let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey))
7079
80+let bondAssetId = fromBase58String(getStringByKey(BondAssetIdKey))
81+
7182 let neutrinoContract = getStringByKey(NeutrinoContractKey)
83+
84+let price = getNumberByAddressAndKey(neutrinoContract, PriceKey)
85+
86+let orderbook = getStringByKey(OrderBookKey)
7287
7388 let reserve = wavesBalance(addressFromStringValue(neutrinoContract))
7489
7590 let neutrinoSupply = {
7691 let info = extract(assetInfo(neutrinoAssetId))
7792 (info.quantity - assetBalance(addressFromStringValue(neutrinoContract), neutrinoAssetId))
7893 }
7994
80-let price = getNumberByAddressAndKey(neutrinoContract, PriceKey)
95+func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id))
8196
82-let OrderSplitSymbol = "_"
8397
84-let BondAssetId = fromBase58String(getStringByKey(BondAssetIdKey))
98+func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id))
8599
86-let Wavelet = 100000000
87100
88-let CANCELED = "canceled"
101+func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id))
89102
90-let NEW = "new"
91103
92-let FILLED = "filled"
104+func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id))
93105
94-func calculateOrderbook (orderId,position) = {
95- let orders = split(orderbook, OrderSplitSymbol)
96- let newOrder = (orderId + OrderSplitSymbol)
106+
107+func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id))
108+
109+
110+func getOrderElementById (id) = (id + ORDERSPLITSYMBOL)
111+
112+
113+func addOrder (orderId,position) = {
114+ let orders = split(orderbook, ORDERSPLITSYMBOL)
115+ let newOrder = getOrderElementById(orderId)
97116 if ((position == 0))
98117 then (newOrder + orderbook)
99118 else if ((position >= (size(orders) - 1)))
100119 then (orderbook + newOrder)
101120 else {
102- let parts = split(orderbook, (orders[position] + OrderSplitSymbol))
103- (((parts[0] + newOrder) + (orders[position] + OrderSplitSymbol)) + parts[1])
121+ let parts = split(orderbook, getOrderElementById(orders[position]))
122+ (((parts[0] + newOrder) + getOrderElementById(orders[position])) + parts[1])
104123 }
124+ }
125+
126+
127+func dropOrder (orderId) = {
128+ let parts = split(orderbook, getOrderElementById(orderId))
129+ (parts[0] + parts[1])
105130 }
106131
107132
108133 @Callable(i)
109134 func setOrder (price,position) = {
110135 let pmt = extract(i.payment)
111136 let newOrderId = toBase58String(keccak256((((toBytes(price) + toBytes(pmt.amount)) + i.caller.bytes) + toBytes(height))))
112137 if ((pmt.assetId != neutrinoAssetId))
113138 then throw("can use neutrino only")
114139 else if ((0 >= price))
115140 then throw("price less zero")
116- else if ((getOrderOwner(newOrderId) != NONE))
141+ else if ((getOrderOwner(newOrderId) != ""))
117142 then throw("order exists")
118143 else {
119- let orders = split(orderbook, OrderSplitSymbol)
144+ let orders = split(orderbook, ORDERSPLITSYMBOL)
120145 let nextOrderId = if ((position == 0))
121146 then ""
122147 else orders[(position - 1)]
123148 let nextOrderPrice = getOrderPrice(nextOrderId)
124149 let isNextOrderError = if (if ((nextOrderId != ""))
125150 then (price > nextOrderPrice)
126151 else false)
127152 then true
128153 else false
129154 let prevOrderId = orders[position]
130155 let prevOrderPrice = getOrderPrice(prevOrderId)
131156 let isPrevOrderError = if ((prevOrderPrice >= price))
132157 then true
133158 else false
134159 if (if (isNextOrderError)
135160 then true
136161 else isPrevOrderError)
137162 then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError)))
138- else WriteSet([DataEntry(OrderBookKey, calculateOrderbook(newOrderId, position)), DataEntry((OrderPriceKey + newOrderId), price), DataEntry((OrderTotalKey + newOrderId), pmt.amount), DataEntry((OrderOwnerKey + newOrderId), toString(i.caller)), DataEntry((OrderHeightKey + newOrderId), height), DataEntry((OrderStatusKey + newOrderId), NEW)])
163+ 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)])
139164 }
140165 }
141166
142167
143168
144169 @Callable(i)
145170 func cancelOrder (orderId) = {
146171 let owner = getOrderOwner(orderId)
147172 let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId))
148173 if ((owner != toString(i.caller)))
149174 then throw("permission denied")
150- else {
151- let parts = split(orderbook, (orderId + OrderSplitSymbol))
152- ScriptResult(WriteSet([DataEntry(OrderBookKey, (parts[0] + parts[1])), DataEntry((OrderStatusKey + orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, neutrinoAssetId)]))
153- }
175+ else ScriptResult(WriteSet([DataEntry(OrderBookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, neutrinoAssetId)]))
154176 }
155177
156178
157179
158180 @Callable(i)
159181 func executeOrder () = {
160- let bondBalance = assetBalance(this, BondAssetId)
161- let deficit = ((neutrinoSupply - ((reserve * price) / 100)) / Wavelet)
182+ let bondBalance = assetBalance(this, bondAssetId)
183+ let deficit = ((neutrinoSupply - ((reserve * price) / 100)) / WAVELET)
162184 let deficitPositive = if ((0 >= deficit))
163185 then 0
164186 else deficit
165187 let bondAmount = if ((deficitPositive >= bondBalance))
166188 then bondBalance
167189 else deficitPositive
168190 let returnAmount = if ((deficitPositive >= bondBalance))
169191 then 0
170192 else (bondBalance - deficitPositive)
171193 if ((bondAmount == 0))
172- then TransferSet([ScriptTransfer(addressFromStringValue(neutrinoContract), returnAmount, BondAssetId)])
194+ then TransferSet([ScriptTransfer(addressFromStringValue(neutrinoContract), returnAmount, bondAssetId)])
173195 else {
174- let orderId = split(orderbook, OrderSplitSymbol)[0]
196+ let orderId = split(orderbook, ORDERSPLITSYMBOL)[0]
175197 let filledTotal = getOrderFilledTotal(orderId)
176198 let orderTotal = getOrderTotal(orderId)
177199 let orderPrice = getOrderPrice(orderId)
178200 let orderOwner = getOrderOwner(orderId)
179- let amount = ((((orderTotal - filledTotal) * 100) / orderPrice) / Wavelet)
201+ let amount = ((((orderTotal - filledTotal) * 100) / orderPrice) / WAVELET)
180202 let newOrderbook = if ((bondAmount >= amount))
181- then split(orderbook, (orderId + OrderSplitSymbol))[1]
203+ then dropOrder(orderId)
182204 else orderbook
183205 let filledAmount = if ((bondAmount >= amount))
184206 then amount
185207 else bondAmount
186- let total = (((filledAmount * orderPrice) / 100) * Wavelet)
208+ let total = (((filledAmount * orderPrice) / 100) * WAVELET)
187209 let status = if ((bondAmount >= amount))
188210 then FILLED
189211 else NEW
190- ScriptResult(WriteSet([DataEntry(OrderBookKey, newOrderbook), DataEntry((OrderFilledTotalKey + orderId), (filledTotal + total)), DataEntry((OrderStatusKey + orderId), status)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), filledAmount, BondAssetId), ScriptTransfer(addressFromStringValue(neutrinoContract), total, neutrinoAssetId), ScriptTransfer(addressFromStringValue(neutrinoContract), returnAmount, BondAssetId)]))
212+ ScriptResult(WriteSet([DataEntry(OrderBookKey, newOrderbook), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + total)), DataEntry(getOrderStatusKey(orderId), status)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), filledAmount, bondAssetId), ScriptTransfer(addressFromStringValue(neutrinoContract), total, neutrinoAssetId)]))
191213 }
192214 }
193215
194216

github/deemru/w8io/026f985 
44.28 ms