tx · B7FojFSZys11kTL7F4LyUcok1VTP9mMCe5v1xcVsSvMg 3MovujXHPgmDiqUaxgtLavUDkoBFKotMZfT: -0.01000000 Waves 2020.01.20 15:40 [862553] smart account 3MovujXHPgmDiqUaxgtLavUDkoBFKotMZfT > SELF 0.00000000 Waves
{ "type": 13, "id": "B7FojFSZys11kTL7F4LyUcok1VTP9mMCe5v1xcVsSvMg", "fee": 1000000, "feeAssetId": null, "timestamp": 1579524133408, "version": 1, "sender": "3MovujXHPgmDiqUaxgtLavUDkoBFKotMZfT", "senderPublicKey": "5oXxNcy8pzuMng2kWL16MEVxhnmW3RaQ7deT6juhNWp7", "proofs": [ "5sgyqdnjafQWohoFBRHZ5z7VbkRpZJC4QDqau9EF6kq5c9ShMtjWVHktmtDbuL5pyVAAQA6Edtj9S2AaUvP5QUwn" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIBARIDCgEIEgAAAAA4AQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAAGGdldFN0cmluZ0J5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAYZ2V0TnVtYmVyQnlBZGRyZ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AJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAQkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAgkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAIAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAwkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAMAAAAAAAAAAAIAAAAAAAAAAAAJAABnAAAAAgUAAAAFY291bnQAAAAAAAAAAAOnKRSK", "chainId": 84, "height": 862553, "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 ((bondBalance == 0)) | |
248 | + | then throw("without bonds to sell") | |
249 | + | else if ((returnAmount > 0)) | |
250 | + | then TransferSet([ScriptTransfer(neutrinoContract, returnAmount, bondAssetId)]) | |
251 | + | else if ((orderbook == "")) | |
252 | + | then throw("empty orderbook") | |
253 | + | else { | |
254 | + | let orderId = take(orderbook, valueOrErrorMessage(indexOf(orderbook, "_"), "no orders found")) | |
255 | + | let filledTotal = getOrderFilledTotal(orderId) | |
256 | + | let orderPrice = getOrderPrice(orderId) | |
257 | + | let priceWavesByBondCents = fraction(100, 100, orderPrice) | |
258 | + | let remainedTotal = (getOrderTotal(orderId) - filledTotal) | |
259 | + | let amountToExecuteOrder = convertWavesToBond(remainedTotal, priceWavesByBondCents) | |
260 | + | let fillOrderCondition = (bondAmount >= amountToExecuteOrder) | |
261 | + | let fillableOrderAmount = if (fillOrderCondition) | |
262 | + | then amountToExecuteOrder | |
263 | + | else bondAmount | |
264 | + | let totalOrderWaveletesRequired = convertBondToWaves(fillableOrderAmount, priceWavesByBondCents) | |
265 | + | if ((amountToExecuteOrder == 0)) | |
266 | + | then ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), FILLED)]), TransferSet([ScriptTransfer(addressFromStringValue(getOrderOwner(orderId)), remainedTotal, unit)])) | |
267 | + | else if ((totalOrderWaveletesRequired == 0)) | |
268 | + | then throw("cannot fill order at the moment") | |
269 | + | else ScriptResult(WriteSet([DataEntry(OrderbookKey, if (if (fillOrderCondition) | |
270 | + | then (remainedTotal == 0) | |
271 | + | else false) | |
272 | + | then dropOrder(orderId) | |
273 | + | else orderbook), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + totalOrderWaveletesRequired)), DataEntry(getOrderStatusKey(orderId), if (if (fillOrderCondition) | |
274 | + | then (remainedTotal == 0) | |
275 | + | else false) | |
276 | + | then FILLED | |
277 | + | else NEW)]), TransferSet([ScriptTransfer(addressFromStringValue(getOrderOwner(orderId)), fillableOrderAmount, bondAssetId), ScriptTransfer(neutrinoContract, totalOrderWaveletesRequired, unit)])) | |
278 | + | } | |
279 | + | } | |
280 | + | ||
281 | + | ||
282 | + | @Verifier(tx) | |
283 | + | func verify () = { | |
284 | + | let pubKeyAdminsList = ["BLEoguzPVKVTfXxxT3W7Rqf8aUm2ggC9Vemd2MQawM2G", "FWVffYr2ALmHMejZm3WqeLz6Sdym3gLFGtJn4KTwyU5x", "3Wh2LaWcb5gg7K2pPcW3Ep6EAuRBzYkAgrdpt43jTDFa", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
285 | + | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
286 | + | then 1 | |
287 | + | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
288 | + | then 1 | |
289 | + | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
290 | + | then 1 | |
291 | + | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
292 | + | then 2 | |
293 | + | else 0)) | |
294 | + | (count >= 3) | |
295 | + | } | |
296 | + |
github/deemru/w8io/026f985 39.99 ms ◑