tx · 4gUdK8m5AW1i7V99LMhDzajkGG64k8UExbA9waGYMBBK

3N7d3jPxKqSi3XVnAgg8oFsHLcrgctFWpVw:  -0.01400000 Waves

2019.11.01 22:39 [746228] smart account 3N7d3jPxKqSi3XVnAgg8oFsHLcrgctFWpVw > SELF 0.00000000 Waves

{ "type": 13, "id": "4gUdK8m5AW1i7V99LMhDzajkGG64k8UExbA9waGYMBBK", "fee": 1400000, "feeAssetId": null, "timestamp": 1572637219642, "version": 1, "sender": "3N7d3jPxKqSi3XVnAgg8oFsHLcrgctFWpVw", "senderPublicKey": "GHnaLgezSnGCGe7LuhRy8j4JzCcySjwndqh6X9xHQNhz", "proofs": [ "4QnYEj4KKApPMKTD3PSyas8YD9PCK9GAacLLsYS5euqnzqm6N7RoqWYDQPqNXpiZK3JmMdFZH3RLKUgo3SmxtmKV" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIBARIDCgEIEgAAAAA6AQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAAGGdldFN0cmluZ0J5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAYZ2V0TnVtYmVyQ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bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAxPcmRlckJvb2tLZXkFAAAADG5ld09yZGVyYm9vawkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAFmdldE9yZGVyRmlsbGVkVG90YWxLZXkAAAABBQAAAAdvcmRlcklkCQAAZAAAAAIFAAAAC2ZpbGxlZFRvdGFsBQAAAAV0b3RhbAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEWdldE9yZGVyU3RhdHVzS2V5AAAAAQUAAAAHb3JkZXJJZAUAAAAGc3RhdHVzCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAASZ2V0T3JkZXJIaXN0b3J5S2V5AAAAAQUAAAAGaGVpZ2h0BQAAAApvcmRlclByaWNlBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAApvcmRlck93bmVyBQAAAAxmaWxsZWRBbW91bnQFAAAAC2JvbmRBc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEG5ldXRyaW5vQ29udHJhY3QFAAAABXRvdGFsBQAAAA9uZXV0cmlub0Fzc2V0SWQFAAAAA25pbAAAAABkLao/", "chainId": 84, "height": 746228, "spentComplexity": 0 } View: original | compacted Prev: EKrJfYM3KNJPPPu5F4Lt9vZGZjbGXDcm8LzGvim2MJ69 Next: CNns7pQLLqUrW5yAop7oY5rvxAFWPA2YPRWqrUiWHdaR Diff:
OldNewDifferences
4747
4848 let PERCENTACCURACY = 1000
4949
50+let MAXDISCOUNT = 50
51+
5052 let OrderBookKey = "orderbook"
5153
5254 let OrderPriceKey = "order_price_"
7476 let OrderHistoryKey = "order_history_"
7577
7678 let SwapLockedBalanceKey = "swap_locked_balance"
79+
80+let SwapNeutrinoLockedBalanceKey = "swap_neutrino_locked_balance"
7781
7882 func getOrderPriceKey (orderId) = (OrderPriceKey + orderId)
7983
119123
120124 let swapLockedBalance = getNumberByAddressAndKey(neutrinoContract, SwapLockedBalanceKey)
121125
126+let swapNeutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, SwapNeutrinoLockedBalanceKey)
127+
122128 let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey))
123129
124130 let bondAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, BondAssetIdKey))
125131
126132 let orderbook = getStringByKey(OrderBookKey)
127133
128-let reserve = (wavesBalance(this) - swapLockedBalance)
134+let reserve = (wavesBalance(neutrinoContract) - swapLockedBalance)
129135
130136 let neutrinoSupply = {
131137 let info = extract(assetInfo(neutrinoAssetId))
132- (info.quantity - assetBalance(neutrinoContract, neutrinoAssetId))
138+ ((info.quantity - assetBalance(this, neutrinoAssetId)) + swapNeutrinoLockedBalance)
133139 }
134140
135141 let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve))
176182 func setOrder (price,position) = {
177183 let pmt = extract(i.payment)
178184 let newOrderId = toBase58String(keccak256((((toBytes(price) + toBytes(pmt.amount)) + i.caller.bytes) + toBytes(height))))
179- 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 = split(orderbook, ORDERSPLITSYMBOL)
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- }
185+ if ((MAXDISCOUNT > price))
186+ then throw("max discount is 50%")
187+ else if ((pmt.assetId != neutrinoAssetId))
188+ then throw("can use neutrino only")
189+ else if ((0 >= price))
190+ then throw("price less zero")
191+ else if ((getOrderOwner(newOrderId) != ""))
192+ then throw("order exists")
193+ else {
194+ let orders = split(orderbook, ORDERSPLITSYMBOL)
195+ let nextOrderId = if ((position == 0))
196+ then ""
197+ else orders[(position - 1)]
198+ let nextOrderPrice = getOrderPrice(nextOrderId)
199+ let isNextOrderError = if (if ((nextOrderId != ""))
200+ then (price > nextOrderPrice)
201+ else false)
202+ then true
203+ else false
204+ let prevOrderId = orders[position]
205+ let prevOrderPrice = getOrderPrice(prevOrderId)
206+ let isPrevOrderError = if ((prevOrderPrice >= price))
207+ then true
208+ else false
209+ if (if (isNextOrderError)
210+ then true
211+ else isPrevOrderError)
212+ then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError)))
213+ 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)])
214+ }
207215 }
208216
209217
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 getStringByAddressAndKey (address,key) = match getString(address, key) {
2121 case a: String =>
2222 a
2323 case _ =>
2424 ""
2525 }
2626
2727
2828 func getNumberByAddressAndKey (address,key) = match getInteger(address, key) {
2929 case a: Int =>
3030 a
3131 case _ =>
3232 0
3333 }
3434
3535
3636 let WAVELET = 100000000
3737
3838 let ORDERSPLITSYMBOL = "_"
3939
4040 let PAULI = 100
4141
4242 let CANCELED = "canceled"
4343
4444 let NEW = "new"
4545
4646 let FILLED = "filled"
4747
4848 let PERCENTACCURACY = 1000
4949
50+let MAXDISCOUNT = 50
51+
5052 let OrderBookKey = "orderbook"
5153
5254 let OrderPriceKey = "order_price_"
5355
5456 let OrderTotalKey = "order_total_"
5557
5658 let OrderFilledTotalKey = "order_filled_total_"
5759
5860 let OrderOwnerKey = "order_owner_"
5961
6062 let OrderHeightKey = "order_height_"
6163
6264 let OrderStatusKey = "order_status_"
6365
6466 let PriceKey = "price"
6567
6668 let BondAssetIdKey = "bond_asset_id"
6769
6870 let NeutrinoAssetIdKey = "neutrino_asset_id"
6971
7072 let NeutrinoContractKey = "neutrino_contract"
7173
7274 let ControlContractKey = "control_contract"
7375
7476 let OrderHistoryKey = "order_history_"
7577
7678 let SwapLockedBalanceKey = "swap_locked_balance"
79+
80+let SwapNeutrinoLockedBalanceKey = "swap_neutrino_locked_balance"
7781
7882 func getOrderPriceKey (orderId) = (OrderPriceKey + orderId)
7983
8084
8185 func getOrderTotalKey (orderId) = (OrderTotalKey + orderId)
8286
8387
8488 func getOrderOwnerKey (orderId) = (OrderOwnerKey + orderId)
8589
8690
8791 func getOrderHeightKey (orderId) = (OrderHeightKey + orderId)
8892
8993
9094 func getOrderStatusKey (orderId) = (OrderStatusKey + orderId)
9195
9296
9397 func getOrderFilledTotalKey (orderId) = (OrderFilledTotalKey + orderId)
9498
9599
96100 func getOrderHistoryKey (height) = (OrderHistoryKey + toString(height))
97101
98102
99103 let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey))
100104
101105 let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey))
102106
103107 let priceNeutrino = getNumberByAddressAndKey(controlContract, PriceKey)
104108
105109 func convertNeutrinoToWaves (amount) = ((((amount * 100) / priceNeutrino) * WAVELET) / PAULI)
106110
107111
108112 func convertWavesToNeutrino (amount) = ((((amount * priceNeutrino) / 100) * PAULI) / WAVELET)
109113
110114
111115 func convertNeutrinoToBond (amount) = (amount / PAULI)
112116
113117
114118 func convertBondToNeutrino (amount) = (amount * PAULI)
115119
116120
117121 func convertWavesToBond (amount) = convertNeutrinoToBond(convertWavesToNeutrino(amount))
118122
119123
120124 let swapLockedBalance = getNumberByAddressAndKey(neutrinoContract, SwapLockedBalanceKey)
121125
126+let swapNeutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, SwapNeutrinoLockedBalanceKey)
127+
122128 let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey))
123129
124130 let bondAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, BondAssetIdKey))
125131
126132 let orderbook = getStringByKey(OrderBookKey)
127133
128-let reserve = (wavesBalance(this) - swapLockedBalance)
134+let reserve = (wavesBalance(neutrinoContract) - swapLockedBalance)
129135
130136 let neutrinoSupply = {
131137 let info = extract(assetInfo(neutrinoAssetId))
132- (info.quantity - assetBalance(neutrinoContract, neutrinoAssetId))
138+ ((info.quantity - assetBalance(this, neutrinoAssetId)) + swapNeutrinoLockedBalance)
133139 }
134140
135141 let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve))
136142
137143 func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id))
138144
139145
140146 func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id))
141147
142148
143149 func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id))
144150
145151
146152 func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id))
147153
148154
149155 func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id))
150156
151157
152158 func getOrderElementById (id) = (id + ORDERSPLITSYMBOL)
153159
154160
155161 func addOrder (orderId,position) = {
156162 let orders = split(orderbook, ORDERSPLITSYMBOL)
157163 let newOrder = getOrderElementById(orderId)
158164 if ((position == 0))
159165 then (newOrder + orderbook)
160166 else if ((position >= (size(orders) - 1)))
161167 then (orderbook + newOrder)
162168 else {
163169 let parts = split(orderbook, getOrderElementById(orders[position]))
164170 (((parts[0] + newOrder) + getOrderElementById(orders[position])) + parts[1])
165171 }
166172 }
167173
168174
169175 func dropOrder (orderId) = {
170176 let parts = split(orderbook, getOrderElementById(orderId))
171177 (parts[0] + parts[1])
172178 }
173179
174180
175181 @Callable(i)
176182 func setOrder (price,position) = {
177183 let pmt = extract(i.payment)
178184 let newOrderId = toBase58String(keccak256((((toBytes(price) + toBytes(pmt.amount)) + i.caller.bytes) + toBytes(height))))
179- 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 = split(orderbook, ORDERSPLITSYMBOL)
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- }
185+ if ((MAXDISCOUNT > price))
186+ then throw("max discount is 50%")
187+ else if ((pmt.assetId != neutrinoAssetId))
188+ then throw("can use neutrino only")
189+ else if ((0 >= price))
190+ then throw("price less zero")
191+ else if ((getOrderOwner(newOrderId) != ""))
192+ then throw("order exists")
193+ else {
194+ let orders = split(orderbook, ORDERSPLITSYMBOL)
195+ let nextOrderId = if ((position == 0))
196+ then ""
197+ else orders[(position - 1)]
198+ let nextOrderPrice = getOrderPrice(nextOrderId)
199+ let isNextOrderError = if (if ((nextOrderId != ""))
200+ then (price > nextOrderPrice)
201+ else false)
202+ then true
203+ else false
204+ let prevOrderId = orders[position]
205+ let prevOrderPrice = getOrderPrice(prevOrderId)
206+ let isPrevOrderError = if ((prevOrderPrice >= price))
207+ then true
208+ else false
209+ if (if (isNextOrderError)
210+ then true
211+ else isPrevOrderError)
212+ then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError)))
213+ 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)])
214+ }
207215 }
208216
209217
210218
211219 @Callable(i)
212220 func cancelOrder (orderId) = {
213221 let owner = getOrderOwner(orderId)
214222 let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId))
215223 if ((owner != toString(i.caller)))
216224 then throw("permission denied")
217225 else if ((getOrderStatus(orderId) != NEW))
218226 then throw("invalid order status")
219227 else ScriptResult(WriteSet([DataEntry(OrderBookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, neutrinoAssetId)]))
220228 }
221229
222230
223231
224232 @Callable(i)
225233 func executeOrder () = {
226234 let bondBalance = assetBalance(this, bondAssetId)
227235 let deficitPositive = if ((0 >= deficit))
228236 then 0
229237 else deficit
230238 let bondAmount = if ((deficitPositive >= bondBalance))
231239 then bondBalance
232240 else deficitPositive
233241 let returnAmount = if ((deficitPositive >= bondBalance))
234242 then 0
235243 else (bondBalance - deficitPositive)
236244 if (if ((returnAmount == 0))
237245 then (bondAmount == 0)
238246 else false)
239247 then throw("without deficit")
240248 else if ((bondAmount == 0))
241249 then TransferSet([ScriptTransfer(neutrinoContract, returnAmount, bondAssetId)])
242250 else {
243251 let orderId = split(orderbook, ORDERSPLITSYMBOL)[0]
244252 let filledTotal = getOrderFilledTotal(orderId)
245253 let orderTotal = getOrderTotal(orderId)
246254 let orderPrice = getOrderPrice(orderId)
247255 let orderOwner = getOrderOwner(orderId)
248256 let amount = convertNeutrinoToBond((((orderTotal - filledTotal) * 100) / orderPrice))
249257 let newOrderbook = if ((bondAmount >= amount))
250258 then dropOrder(orderId)
251259 else orderbook
252260 let filledAmount = if ((bondAmount >= amount))
253261 then amount
254262 else bondAmount
255263 let total = (((filledAmount * orderPrice) * PAULI) / 100)
256264 let status = if ((bondAmount >= amount))
257265 then FILLED
258266 else NEW
259267 if ((total == 0))
260268 then throw("total equal zero")
261269 else ScriptResult(WriteSet([DataEntry(OrderBookKey, newOrderbook), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + total)), DataEntry(getOrderStatusKey(orderId), status), DataEntry(getOrderHistoryKey(height), orderPrice)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), filledAmount, bondAssetId), ScriptTransfer(neutrinoContract, total, neutrinoAssetId)]))
262270 }
263271 }
264272
265273

github/deemru/w8io/169f3d6 
40.97 ms