tx · 3cF7ukjTHrrSBDFPh8czJX4UcXhdSsVgcL4Vr8DSbMjT 3MuWyKSzxCzc5meigDpR3duBAYFSERZjRGL: -0.01000000 Waves 2020.01.20 14:33 [862490] smart account 3MuWyKSzxCzc5meigDpR3duBAYFSERZjRGL > SELF 0.00000000 Waves
{ "type": 13, "id": "3cF7ukjTHrrSBDFPh8czJX4UcXhdSsVgcL4Vr8DSbMjT", "fee": 1000000, "feeAssetId": null, "timestamp": 1579520026073, "version": 1, "sender": "3MuWyKSzxCzc5meigDpR3duBAYFSERZjRGL", "senderPublicKey": "8VQwCMstZawNw9KbojMHHmAerfgSVSKZLbcRo6ghbRdS", "proofs": [ "5EVsrpc719Zt8Ehb7wPEeVTep2LufFbS4MvHASiN3bLiPbmZjxRMP7xA5YEBcZij382yPSa6Kg5Jgzun1vAhxbQH" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIBARIDCgEIEgAAAAA1AQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAAGGdldFN0cmluZ0J5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAYZ2V0TnVtYmVyQnl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AAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAACAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAMJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAADAAAAAAAAAAACAAAAAAAAAAAACQAAZwAAAAIFAAAABWNvdW50AAAAAAAAAAADI/ahTw==", "chainId": 84, "height": 862490, "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 convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI) | |
91 | + | ||
92 | + | ||
93 | + | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET) | |
94 | + | ||
95 | + | ||
96 | + | func convertNeutrinoToBond (amount) = (amount / PAULI) | |
97 | + | ||
98 | + | ||
99 | + | func convertBondToNeutrino (amount) = (amount * PAULI) | |
100 | + | ||
101 | + | ||
102 | + | func convertWavesToBond (amount,price) = convertNeutrinoToBond(convertWavesToNeutrino(amount, price)) | |
103 | + | ||
104 | + | ||
105 | + | func convertBondToWaves (amount,price) = convertNeutrinoToWaves(convertBondToNeutrino(amount), price) | |
106 | + | ||
107 | + | ||
108 | + | let orderbook = getStringByKey(OrderbookKey) | |
109 | + | ||
110 | + | let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey)) | |
111 | + | ||
112 | + | let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey)) | |
113 | + | ||
114 | + | let liquidationContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, LiquidationContractKey)) | |
115 | + | ||
116 | + | let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey)) | |
117 | + | ||
118 | + | let bondAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, BondAssetIdKey)) | |
119 | + | ||
120 | + | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
121 | + | ||
122 | + | let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey) | |
123 | + | ||
124 | + | let reserve = ((wavesBalance(neutrinoContract) - getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey)) - convertNeutrinoToWaves(neutrinoLockedBalance, currentPrice)) | |
125 | + | ||
126 | + | let neutrinoSupply = ((extract(assetInfo(neutrinoAssetId)).quantity - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId)) | |
127 | + | ||
128 | + | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice)) | |
129 | + | ||
130 | + | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
131 | + | ||
132 | + | ||
133 | + | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
134 | + | ||
135 | + | ||
136 | + | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
137 | + | ||
138 | + | ||
139 | + | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
140 | + | ||
141 | + | ||
142 | + | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
143 | + | ||
144 | + | ||
145 | + | func getOrderElementById (id) = (id + "_") | |
146 | + | ||
147 | + | ||
148 | + | func addOrder (orderId,position) = { | |
149 | + | let orders = split(orderbook, "_") | |
150 | + | let newOrder = getOrderElementById(orderId) | |
151 | + | if ((position == 0)) | |
152 | + | then (newOrder + orderbook) | |
153 | + | else if ((position >= (size(orders) - 1))) | |
154 | + | then (orderbook + newOrder) | |
155 | + | else { | |
156 | + | let parts = split(orderbook, getOrderElementById(orders[position])) | |
157 | + | (((parts[0] + newOrder) + getOrderElementById(orders[position])) + parts[1]) | |
158 | + | } | |
159 | + | } | |
160 | + | ||
161 | + | ||
162 | + | func dropOrder (orderId) = { | |
163 | + | let parts = split(orderbook, getOrderElementById(orderId)) | |
164 | + | (parts[0] + parts[1]) | |
165 | + | } | |
166 | + | ||
167 | + | ||
168 | + | @Callable(i) | |
169 | + | func addBuyBondOrder (price,position) = { | |
170 | + | let pmt = extract(i.payment) | |
171 | + | let newOrderId = toBase58String(keccak256((((toBytes(price) + toBytes(pmt.amount)) + i.caller.bytes) + toBytes(height)))) | |
172 | + | let priceWavesByBondCents = fraction(100, 100, price) | |
173 | + | let roi = fraction((priceWavesByBondCents - currentPrice), 100, currentPrice) | |
174 | + | if ((MINORDERTOTAL > pmt.amount)) | |
175 | + | then throw(("min order total equals " + toString(MINORDERTOTAL))) | |
176 | + | else if ((roi > MAXROI)) | |
177 | + | then throw("max setOrder ROI is 100%") | |
178 | + | else if (isDefined(pmt.assetId)) | |
179 | + | then throw("can use waves only") | |
180 | + | else if ((0 >= price)) | |
181 | + | then throw("price less zero") | |
182 | + | else if ((getOrderOwner(newOrderId) != "")) | |
183 | + | then throw("order exists") | |
184 | + | else { | |
185 | + | let orders = split(orderbook, "_") | |
186 | + | let nextOrderId = if ((position == 0)) | |
187 | + | then "" | |
188 | + | else orders[(position - 1)] | |
189 | + | let nextOrderPrice = getOrderPrice(nextOrderId) | |
190 | + | let isNextOrderError = if (if ((nextOrderId != "")) | |
191 | + | then (price > nextOrderPrice) | |
192 | + | else false) | |
193 | + | then true | |
194 | + | else false | |
195 | + | let prevOrderId = orders[position] | |
196 | + | let prevOrderPrice = getOrderPrice(prevOrderId) | |
197 | + | let isPrevOrderError = if ((prevOrderPrice >= price)) | |
198 | + | then true | |
199 | + | else false | |
200 | + | if (if (isNextOrderError) | |
201 | + | then true | |
202 | + | else isPrevOrderError) | |
203 | + | then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError))) | |
204 | + | 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)]) | |
205 | + | } | |
206 | + | } | |
207 | + | ||
208 | + | ||
209 | + | ||
210 | + | @Callable(i) | |
211 | + | func cancelOrder (orderId) = { | |
212 | + | let owner = getOrderOwner(orderId) | |
213 | + | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
214 | + | if ((owner != toString(i.caller))) | |
215 | + | then throw("permission denied") | |
216 | + | else if ((getOrderStatus(orderId) != NEW)) | |
217 | + | then throw("invalid order status") | |
218 | + | else ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
219 | + | } | |
220 | + | ||
221 | + | ||
222 | + | ||
223 | + | @Callable(i) | |
224 | + | func sellBond () = { | |
225 | + | let bondBalance = assetBalance(this, bondAssetId) | |
226 | + | let deficitPositive = if ((0 >= deficit)) | |
227 | + | then 0 | |
228 | + | else (deficit / PAULI) | |
229 | + | let bondAmount = if ((deficitPositive >= bondBalance)) | |
230 | + | then bondBalance | |
231 | + | else deficitPositive | |
232 | + | let returnAmount = if ((deficitPositive >= bondBalance)) | |
233 | + | then 0 | |
234 | + | else (bondBalance - deficitPositive) | |
235 | + | if (if ((deficitPositive == 0)) | |
236 | + | then (bondBalance == 0) | |
237 | + | else false) | |
238 | + | then throw("without deficit") | |
239 | + | else if ((bondBalance == 0)) | |
240 | + | then throw("without bonds to sell") | |
241 | + | else if ((returnAmount > 0)) | |
242 | + | then TransferSet([ScriptTransfer(neutrinoContract, returnAmount, bondAssetId)]) | |
243 | + | else if ((orderbook == "")) | |
244 | + | then throw("empty orderbook") | |
245 | + | else { | |
246 | + | let orderId = take(orderbook, valueOrErrorMessage(indexOf(orderbook, "_"), "no orders found")) | |
247 | + | let filledTotal = getOrderFilledTotal(orderId) | |
248 | + | let orderPrice = getOrderPrice(orderId) | |
249 | + | let priceWavesByBondCents = fraction(100, 100, orderPrice) | |
250 | + | let remainedTotal = (getOrderTotal(orderId) - filledTotal) | |
251 | + | let amountToExecuteOrder = convertWavesToBond(remainedTotal, priceWavesByBondCents) | |
252 | + | let fillOrderCondition = (bondAmount >= amountToExecuteOrder) | |
253 | + | let fillableOrderAmount = if (fillOrderCondition) | |
254 | + | then amountToExecuteOrder | |
255 | + | else bondAmount | |
256 | + | let totalOrderWaveletesRequired = convertBondToWaves(fillableOrderAmount, priceWavesByBondCents) | |
257 | + | if ((amountToExecuteOrder == 0)) | |
258 | + | then ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), FILLED)]), TransferSet([ScriptTransfer(addressFromStringValue(getOrderOwner(orderId)), remainedTotal, unit)])) | |
259 | + | else if ((totalOrderWaveletesRequired == 0)) | |
260 | + | then throw("cannot fill order at the moment") | |
261 | + | else ScriptResult(WriteSet([DataEntry(OrderbookKey, if (if (fillOrderCondition) | |
262 | + | then (remainedTotal == 0) | |
263 | + | else false) | |
264 | + | then dropOrder(orderId) | |
265 | + | else orderbook), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + totalOrderWaveletesRequired)), DataEntry(getOrderStatusKey(orderId), if (if (fillOrderCondition) | |
266 | + | then (remainedTotal == 0) | |
267 | + | else false) | |
268 | + | then FILLED | |
269 | + | else NEW)]), TransferSet([ScriptTransfer(addressFromStringValue(getOrderOwner(orderId)), fillableOrderAmount, bondAssetId), ScriptTransfer(neutrinoContract, totalOrderWaveletesRequired, unit)])) | |
270 | + | } | |
271 | + | } | |
272 | + | ||
273 | + | ||
274 | + | @Verifier(tx) | |
275 | + | func verify () = { | |
276 | + | let pubKeyAdminsList = ["BLEoguzPVKVTfXxxT3W7Rqf8aUm2ggC9Vemd2MQawM2G", "FWVffYr2ALmHMejZm3WqeLz6Sdym3gLFGtJn4KTwyU5x", "3Wh2LaWcb5gg7K2pPcW3Ep6EAuRBzYkAgrdpt43jTDFa", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
277 | + | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
278 | + | then 1 | |
279 | + | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
280 | + | then 1 | |
281 | + | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
282 | + | then 1 | |
283 | + | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
284 | + | then 2 | |
285 | + | else 0)) | |
286 | + | (count >= 3) | |
287 | + | } | |
288 | + |
github/deemru/w8io/169f3d6 24.29 ms ◑