tx · 8KYH1J4tb6MH5aAE3G72pcEA9LJ3Z6wYUoivNZmi2f7D 3MvULNTY4FXyMBs6j1JVLBYioCCZNur3jEP: -0.01000000 Waves 2020.01.11 11:06 [849067] smart account 3MvULNTY4FXyMBs6j1JVLBYioCCZNur3jEP > SELF 0.00000000 Waves
{ "type": 13, "id": "8KYH1J4tb6MH5aAE3G72pcEA9LJ3Z6wYUoivNZmi2f7D", "fee": 1000000, "feeAssetId": null, "timestamp": 1578729858925, "version": 1, "sender": "3MvULNTY4FXyMBs6j1JVLBYioCCZNur3jEP", "senderPublicKey": "E9kDvNkMeAzwKTw1RkYQERAAS6ZfzG7mna4j8pdByq7T", "proofs": [ "iyWfyf37cdUrMPPKqFRmSmALJQEi8aqT6jM39bdnt9GaNFx138WEEo1kvhw85nVmNWwMsNZG7VtSaDEtofCF5DV" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIBARIDCgEIEgAAAAA4AQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAAGGdldFN0cmluZ0J5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAYZ2V0TnVtYmVyQ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AAAAAAAAAABAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAACAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAMJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAADAAAAAAAAAAACAAAAAAAAAAAACQAAZwAAAAIFAAAABWNvdW50AAAAAAAAAAADIDFP/w==", "chainId": 84, "height": 849067, "spentComplexity": 0 } View: original | compacted Prev: none Next: none 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 PAULI = 1000000 | |
39 | + | ||
40 | + | let PERCENTACCURACY = 1000 | |
41 | + | ||
42 | + | let MINORDERTOTAL = (10 * WAVELET) | |
43 | + | ||
44 | + | let MAXROI = 100 | |
45 | + | ||
46 | + | let CANCELED = "canceled" | |
47 | + | ||
48 | + | let NEW = "new" | |
49 | + | ||
50 | + | let FILLED = "filled" | |
51 | + | ||
52 | + | let NeutrinoContractKey = "neutrino_contract" | |
53 | + | ||
54 | + | let OrderbookKey = "orderbook" | |
55 | + | ||
56 | + | let PriceKey = "price" | |
57 | + | ||
58 | + | let BondAssetIdKey = "bond_asset_id" | |
59 | + | ||
60 | + | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
61 | + | ||
62 | + | let ControlContractKey = "control_contract" | |
63 | + | ||
64 | + | let BalanceLockedkKey = "balance_lock_" | |
65 | + | ||
66 | + | let WavesLockedBalanceKey = (BalanceLockedkKey + "waves") | |
67 | + | ||
68 | + | let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino") | |
69 | + | ||
70 | + | let LiquidationContractKey = "liquidation_contract" | |
71 | + | ||
72 | + | func getOrderPriceKey (orderId) = ("order_price_" + orderId) | |
73 | + | ||
74 | + | ||
75 | + | func getOrderTotalKey (orderId) = ("order_total_" + orderId) | |
76 | + | ||
77 | + | ||
78 | + | func getOrderOwnerKey (orderId) = ("order_owner_" + orderId) | |
79 | + | ||
80 | + | ||
81 | + | func getOrderHeightKey (orderId) = ("order_height_" + orderId) | |
82 | + | ||
83 | + | ||
84 | + | func getOrderStatusKey (orderId) = ("order_status_" + orderId) | |
85 | + | ||
86 | + | ||
87 | + | func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId) | |
88 | + | ||
89 | + | ||
90 | + | func getOrderHistoryKey (height) = ("order_history_" + toString(height)) | |
91 | + | ||
92 | + | ||
93 | + | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI) | |
94 | + | ||
95 | + | ||
96 | + | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET) | |
97 | + | ||
98 | + | ||
99 | + | func convertNeutrinoToBond (amount) = (amount / PAULI) | |
100 | + | ||
101 | + | ||
102 | + | func convertBondToNeutrino (amount) = (amount * PAULI) | |
103 | + | ||
104 | + | ||
105 | + | func convertWavesToBond (amount,price) = convertNeutrinoToBond(convertWavesToNeutrino(amount, price)) | |
106 | + | ||
107 | + | ||
108 | + | func convertBondToWaves (amount,price) = convertNeutrinoToWaves(convertBondToNeutrino(amount), price) | |
109 | + | ||
110 | + | ||
111 | + | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
112 | + | ||
113 | + | ||
114 | + | let orderbook = getStringByKey(OrderbookKey) | |
115 | + | ||
116 | + | let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey)) | |
117 | + | ||
118 | + | let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey)) | |
119 | + | ||
120 | + | let liquidationContract = getStringByAddressAndKey(neutrinoContract, LiquidationContractKey) | |
121 | + | ||
122 | + | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
123 | + | ||
124 | + | let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey) | |
125 | + | ||
126 | + | let wavesLockedBalance = getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey) | |
127 | + | ||
128 | + | let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey)) | |
129 | + | ||
130 | + | let bondAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, BondAssetIdKey)) | |
131 | + | ||
132 | + | let reserve = (wavesBalance(neutrinoContract) - wavesLockedBalance) | |
133 | + | ||
134 | + | let neutrinoSupply = (((extract(assetInfo(neutrinoAssetId)).quantity - assetBalance(neutrinoContract, neutrinoAssetId)) + neutrinoLockedBalance) - assetBalance(addressFromStringValue(liquidationContract), neutrinoAssetId)) | |
135 | + | ||
136 | + | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice)) | |
137 | + | ||
138 | + | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
139 | + | ||
140 | + | ||
141 | + | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
142 | + | ||
143 | + | ||
144 | + | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
145 | + | ||
146 | + | ||
147 | + | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
148 | + | ||
149 | + | ||
150 | + | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
151 | + | ||
152 | + | ||
153 | + | func getOrderElementById (id) = (id + "_") | |
154 | + | ||
155 | + | ||
156 | + | func addOrder (orderId,position) = { | |
157 | + | let orders = split(orderbook, "_") | |
158 | + | let newOrder = getOrderElementById(orderId) | |
159 | + | if ((position == 0)) | |
160 | + | then (newOrder + orderbook) | |
161 | + | else if ((position >= (size(orders) - 1))) | |
162 | + | then (orderbook + newOrder) | |
163 | + | else { | |
164 | + | let parts = split(orderbook, getOrderElementById(orders[position])) | |
165 | + | (((parts[0] + newOrder) + getOrderElementById(orders[position])) + parts[1]) | |
166 | + | } | |
167 | + | } | |
168 | + | ||
169 | + | ||
170 | + | func dropOrder (orderId) = { | |
171 | + | let parts = split(orderbook, getOrderElementById(orderId)) | |
172 | + | (parts[0] + parts[1]) | |
173 | + | } | |
174 | + | ||
175 | + | ||
176 | + | @Callable(i) | |
177 | + | func addBuyBondOrder (price,position) = { | |
178 | + | let pmt = extract(i.payment) | |
179 | + | let newOrderId = toBase58String(keccak256((((toBytes(price) + toBytes(pmt.amount)) + i.caller.bytes) + toBytes(height)))) | |
180 | + | let priceWavesByBondCents = fraction(100, 100, price) | |
181 | + | let roi = fraction((priceWavesByBondCents - currentPrice), 100, currentPrice) | |
182 | + | if ((MINORDERTOTAL > pmt.amount)) | |
183 | + | then throw(("min order total equals " + toString(MINORDERTOTAL))) | |
184 | + | else if ((roi > MAXROI)) | |
185 | + | then throw("max setOrder ROI is 100%") | |
186 | + | else if (isDefined(pmt.assetId)) | |
187 | + | then throw("can use waves only") | |
188 | + | else if ((0 >= price)) | |
189 | + | then throw("price less zero") | |
190 | + | else if ((getOrderOwner(newOrderId) != "")) | |
191 | + | then throw("order exists") | |
192 | + | else { | |
193 | + | let orders = split(orderbook, "_") | |
194 | + | let nextOrderId = if ((position == 0)) | |
195 | + | then "" | |
196 | + | else orders[(position - 1)] | |
197 | + | let nextOrderPrice = getOrderPrice(nextOrderId) | |
198 | + | let isNextOrderError = if (if ((nextOrderId != "")) | |
199 | + | then (price > nextOrderPrice) | |
200 | + | else false) | |
201 | + | then true | |
202 | + | else false | |
203 | + | let prevOrderId = orders[position] | |
204 | + | let prevOrderPrice = getOrderPrice(prevOrderId) | |
205 | + | let isPrevOrderError = if ((prevOrderPrice >= price)) | |
206 | + | then true | |
207 | + | else false | |
208 | + | if (if (isNextOrderError) | |
209 | + | then true | |
210 | + | else isPrevOrderError) | |
211 | + | then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError))) | |
212 | + | 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), DataEntry(("debug_order_currentPrice_" + newOrderId), currentPrice), DataEntry(("debug_order_roi_" + newOrderId), roi)]) | |
213 | + | } | |
214 | + | } | |
215 | + | ||
216 | + | ||
217 | + | ||
218 | + | @Callable(i) | |
219 | + | func cancelOrder (orderId) = { | |
220 | + | let owner = getOrderOwner(orderId) | |
221 | + | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
222 | + | if ((owner != toString(i.caller))) | |
223 | + | then throw("permission denied") | |
224 | + | else if ((getOrderStatus(orderId) != NEW)) | |
225 | + | then throw("invalid order status") | |
226 | + | else ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
227 | + | } | |
228 | + | ||
229 | + | ||
230 | + | ||
231 | + | @Callable(i) | |
232 | + | func sellBond () = { | |
233 | + | let bondBalance = assetBalance(this, bondAssetId) | |
234 | + | let deficitPositive = if ((0 >= deficit)) | |
235 | + | then 0 | |
236 | + | else (deficit / PAULI) | |
237 | + | let bondAmount = if ((deficitPositive >= bondBalance)) | |
238 | + | then bondBalance | |
239 | + | else deficitPositive | |
240 | + | let returnAmount = if ((deficitPositive >= bondBalance)) | |
241 | + | then 0 | |
242 | + | else (bondBalance - deficitPositive) | |
243 | + | if (if ((deficitPositive == 0)) | |
244 | + | then (bondBalance == 0) | |
245 | + | else false) | |
246 | + | then throw("without deficit") | |
247 | + | else if ((returnAmount > 0)) | |
248 | + | then TransferSet([ScriptTransfer(neutrinoContract, returnAmount, bondAssetId)]) | |
249 | + | else if ((orderbook == "")) | |
250 | + | then throw("empty orderbook") | |
251 | + | else { | |
252 | + | let orderId = take(orderbook, valueOrErrorMessage(indexOf(orderbook, "_"), "no orders found")) | |
253 | + | let filledTotal = getOrderFilledTotal(orderId) | |
254 | + | let orderPrice = getOrderPrice(orderId) | |
255 | + | let priceWavesByBondCents = fraction(100, 100, orderPrice) | |
256 | + | let remainedTotal = (getOrderTotal(orderId) - filledTotal) | |
257 | + | let amountToExecuteOrder = convertWavesToBond(remainedTotal, priceWavesByBondCents) | |
258 | + | let fillableOrderAmount = if ((bondAmount >= amountToExecuteOrder)) | |
259 | + | then amountToExecuteOrder | |
260 | + | else bondAmount | |
261 | + | let totalOrderWaveletesRequired = convertBondToWaves(fillableOrderAmount, priceWavesByBondCents) | |
262 | + | if (if ((totalOrderWaveletesRequired == 0)) | |
263 | + | then true | |
264 | + | else (amountToExecuteOrder == 0)) | |
265 | + | then ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(addressFromStringValue(getOrderOwner(orderId)), remainedTotal, unit)])) | |
266 | + | else ScriptResult(WriteSet([DataEntry(OrderbookKey, if ((bondAmount >= amountToExecuteOrder)) | |
267 | + | then dropOrder(orderId) | |
268 | + | else orderbook), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + totalOrderWaveletesRequired)), DataEntry(getOrderStatusKey(orderId), if ((bondAmount >= amountToExecuteOrder)) | |
269 | + | then FILLED | |
270 | + | else NEW), DataEntry(getOrderHistoryKey(height), orderPrice)]), TransferSet([ScriptTransfer(addressFromStringValue(getOrderOwner(orderId)), fillableOrderAmount, bondAssetId), ScriptTransfer(neutrinoContract, totalOrderWaveletesRequired, unit)])) | |
271 | + | } | |
272 | + | } | |
273 | + | ||
274 | + | ||
275 | + | @Verifier(tx) | |
276 | + | func verify () = { | |
277 | + | let pubKeyAdminsList = ["BLEoguzPVKVTfXxxT3W7Rqf8aUm2ggC9Vemd2MQawM2G", "FWVffYr2ALmHMejZm3WqeLz6Sdym3gLFGtJn4KTwyU5x", "3Wh2LaWcb5gg7K2pPcW3Ep6EAuRBzYkAgrdpt43jTDFa", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
278 | + | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
279 | + | then 1 | |
280 | + | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
281 | + | then 1 | |
282 | + | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
283 | + | then 1 | |
284 | + | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
285 | + | then 2 | |
286 | + | else 0)) | |
287 | + | (count >= 3) | |
288 | + | } | |
289 | + |
github/deemru/w8io/169f3d6 20.92 ms ◑