tx · EKrJfYM3KNJPPPu5F4Lt9vZGZjbGXDcm8LzGvim2MJ69 3N7d3jPxKqSi3XVnAgg8oFsHLcrgctFWpVw: -0.01000000 Waves 2019.10.22 00:06 [730357] smart account 3N7d3jPxKqSi3XVnAgg8oFsHLcrgctFWpVw > SELF 0.00000000 Waves
{ "type": 13, "id": "EKrJfYM3KNJPPPu5F4Lt9vZGZjbGXDcm8LzGvim2MJ69", "fee": 1000000, "feeAssetId": null, "timestamp": 1571692107763, "version": 1, "sender": "3N7d3jPxKqSi3XVnAgg8oFsHLcrgctFWpVw", "senderPublicKey": "GHnaLgezSnGCGe7LuhRy8j4JzCcySjwndqh6X9xHQNhz", "proofs": [ "4EaTsBxEdKeWirJr7xd8a4WEeZ65Xq8u862GL2FR3oS6SFXfu6H5GfGWmZUPet7p6g5x1WcPT1TY6tEqTbE5zaAH" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIBARIDCgEIEgAAAAA3AQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAAGGdldFN0cmluZ0J5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAYZ2V0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ABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEmdldE9yZGVySGlzdG9yeUtleQAAAAEFAAAABmhlaWdodAUAAAAKb3JkZXJQcmljZQUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAKb3JkZXJPd25lcgUAAAAMZmlsbGVkQW1vdW50BQAAAAtib25kQXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABBuZXV0cmlub0NvbnRyYWN0BQAAAAV0b3RhbAUAAAAPbmV1dHJpbm9Bc3NldElkBQAAAANuaWwAAAAAjAaP+Q==", "chainId": 84, "height": 730357, "spentComplexity": 0 } View: original | compacted Prev: none Next: 4gUdK8m5AW1i7V99LMhDzajkGG64k8UExbA9waGYMBBK Full:
Old | New | Differences | |
---|---|---|---|
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 CANCELED = "canceled" | |
43 | + | ||
44 | + | let NEW = "new" | |
45 | + | ||
46 | + | let FILLED = "filled" | |
47 | + | ||
48 | + | let PERCENTACCURACY = 1000 | |
49 | + | ||
50 | + | let OrderBookKey = "orderbook" | |
51 | + | ||
52 | + | let OrderPriceKey = "order_price_" | |
53 | + | ||
54 | + | let OrderTotalKey = "order_total_" | |
55 | + | ||
56 | + | let OrderFilledTotalKey = "order_filled_total_" | |
57 | + | ||
58 | + | let OrderOwnerKey = "order_owner_" | |
59 | + | ||
60 | + | let OrderHeightKey = "order_height_" | |
61 | + | ||
62 | + | let OrderStatusKey = "order_status_" | |
63 | + | ||
64 | + | let PriceKey = "price" | |
65 | + | ||
66 | + | let BondAssetIdKey = "bond_asset_id" | |
67 | + | ||
68 | + | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
69 | + | ||
70 | + | let NeutrinoContractKey = "neutrino_contract" | |
71 | + | ||
72 | + | let ControlContractKey = "control_contract" | |
73 | + | ||
74 | + | let OrderHistoryKey = "order_history_" | |
75 | + | ||
76 | + | let SwapLockedBalanceKey = "swap_locked_balance" | |
77 | + | ||
78 | + | func getOrderPriceKey (orderId) = (OrderPriceKey + orderId) | |
79 | + | ||
80 | + | ||
81 | + | func getOrderTotalKey (orderId) = (OrderTotalKey + orderId) | |
82 | + | ||
83 | + | ||
84 | + | func getOrderOwnerKey (orderId) = (OrderOwnerKey + orderId) | |
85 | + | ||
86 | + | ||
87 | + | func getOrderHeightKey (orderId) = (OrderHeightKey + orderId) | |
88 | + | ||
89 | + | ||
90 | + | func getOrderStatusKey (orderId) = (OrderStatusKey + orderId) | |
91 | + | ||
92 | + | ||
93 | + | func getOrderFilledTotalKey (orderId) = (OrderFilledTotalKey + orderId) | |
94 | + | ||
95 | + | ||
96 | + | func getOrderHistoryKey (height) = (OrderHistoryKey + toString(height)) | |
97 | + | ||
98 | + | ||
99 | + | let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey)) | |
100 | + | ||
101 | + | let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey)) | |
102 | + | ||
103 | + | let priceNeutrino = getNumberByAddressAndKey(controlContract, PriceKey) | |
104 | + | ||
105 | + | func convertNeutrinoToWaves (amount) = ((((amount * 100) / priceNeutrino) * WAVELET) / PAULI) | |
106 | + | ||
107 | + | ||
108 | + | func convertWavesToNeutrino (amount) = ((((amount * priceNeutrino) / 100) * PAULI) / WAVELET) | |
109 | + | ||
110 | + | ||
111 | + | func convertNeutrinoToBond (amount) = (amount / PAULI) | |
112 | + | ||
113 | + | ||
114 | + | func convertBondToNeutrino (amount) = (amount * PAULI) | |
115 | + | ||
116 | + | ||
117 | + | func convertWavesToBond (amount) = convertNeutrinoToBond(convertWavesToNeutrino(amount)) | |
118 | + | ||
119 | + | ||
120 | + | let swapLockedBalance = getNumberByAddressAndKey(neutrinoContract, SwapLockedBalanceKey) | |
121 | + | ||
122 | + | let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey)) | |
123 | + | ||
124 | + | let bondAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, BondAssetIdKey)) | |
125 | + | ||
126 | + | let orderbook = getStringByKey(OrderBookKey) | |
127 | + | ||
128 | + | let reserve = (wavesBalance(this) - swapLockedBalance) | |
129 | + | ||
130 | + | let neutrinoSupply = { | |
131 | + | let info = extract(assetInfo(neutrinoAssetId)) | |
132 | + | (info.quantity - assetBalance(neutrinoContract, neutrinoAssetId)) | |
133 | + | } | |
134 | + | ||
135 | + | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve)) | |
136 | + | ||
137 | + | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
138 | + | ||
139 | + | ||
140 | + | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
141 | + | ||
142 | + | ||
143 | + | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
144 | + | ||
145 | + | ||
146 | + | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
147 | + | ||
148 | + | ||
149 | + | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
150 | + | ||
151 | + | ||
152 | + | func getOrderElementById (id) = (id + ORDERSPLITSYMBOL) | |
153 | + | ||
154 | + | ||
155 | + | func addOrder (orderId,position) = { | |
156 | + | let orders = split(orderbook, ORDERSPLITSYMBOL) | |
157 | + | let newOrder = getOrderElementById(orderId) | |
158 | + | if ((position == 0)) | |
159 | + | then (newOrder + orderbook) | |
160 | + | else if ((position >= (size(orders) - 1))) | |
161 | + | then (orderbook + newOrder) | |
162 | + | else { | |
163 | + | let parts = split(orderbook, getOrderElementById(orders[position])) | |
164 | + | (((parts[0] + newOrder) + getOrderElementById(orders[position])) + parts[1]) | |
165 | + | } | |
166 | + | } | |
167 | + | ||
168 | + | ||
169 | + | func dropOrder (orderId) = { | |
170 | + | let parts = split(orderbook, getOrderElementById(orderId)) | |
171 | + | (parts[0] + parts[1]) | |
172 | + | } | |
173 | + | ||
174 | + | ||
175 | + | @Callable(i) | |
176 | + | func setOrder (price,position) = { | |
177 | + | let pmt = extract(i.payment) | |
178 | + | 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 | + | } | |
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 executeOrder () = { | |
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 { | |
243 | + | let orderId = split(orderbook, ORDERSPLITSYMBOL)[0] | |
244 | + | let filledTotal = getOrderFilledTotal(orderId) | |
245 | + | let orderTotal = getOrderTotal(orderId) | |
246 | + | let orderPrice = getOrderPrice(orderId) | |
247 | + | let orderOwner = getOrderOwner(orderId) | |
248 | + | let amount = convertNeutrinoToBond((((orderTotal - filledTotal) * 100) / orderPrice)) | |
249 | + | let newOrderbook = if ((bondAmount >= amount)) | |
250 | + | then dropOrder(orderId) | |
251 | + | else orderbook | |
252 | + | let filledAmount = if ((bondAmount >= amount)) | |
253 | + | then amount | |
254 | + | else bondAmount | |
255 | + | let total = (((filledAmount * orderPrice) * PAULI) / 100) | |
256 | + | let status = if ((bondAmount >= amount)) | |
257 | + | then FILLED | |
258 | + | else NEW | |
259 | + | if ((total == 0)) | |
260 | + | then throw("total equal zero") | |
261 | + | 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)])) | |
262 | + | } | |
263 | + | } | |
264 | + | ||
265 | + |
github/deemru/w8io/169f3d6 38.30 ms ◑