tx · Ey7uNBeZTt3hMBS8NUgz8hgDAgWQNZLNnbdG3vSmRrfY 3N6NDxfGb8myQgim18s99Nb8UZY6JAuTikb: -0.01000000 Waves 2020.03.04 14:00 [894155] smart account 3N6NDxfGb8myQgim18s99Nb8UZY6JAuTikb > SELF 0.00000000 Waves
{ "type": 13, "id": "Ey7uNBeZTt3hMBS8NUgz8hgDAgWQNZLNnbdG3vSmRrfY", "fee": 1000000, "feeAssetId": null, "timestamp": 1583319639674, "version": 1, "sender": "3N6NDxfGb8myQgim18s99Nb8UZY6JAuTikb", "senderPublicKey": "63qWoDjpbLksv616SUF1o6FnS2ysUfP3wvMw9M5szRAT", "proofs": [ "tyxR8sLiSchzPDWKuvxuiXREhp5nQ4HGs5ys74QmFBf4GAoivN7nTvkCzRzjaeuUo9RqGv1zRrW1KxnnypwQ8UF" ], "script": "base64:AAIDAAAAAAAAAAsIARIAEgMKAQgSAAAAADoBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAWZ2V0Qm9vbEJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQbAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAdCb29sZWFuBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBwEAAAAYZ2V0U3RyaW5nQnlBZGRyZXNz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GFibGVPcmRlckFtb3VudAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEWdldE9yZGVyU3RhdHVzS2V5AAAAAQUAAAAKZmlyc3RPcmRlcgUAAAAJbmV3U3RhdHVzBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAApvcmRlck93bmVyCQEAAAAVY29udmVydEJvbmRUb05ldXRyaW5vAAAAAQUAAAATZmlsbGFibGVPcmRlckFtb3VudAUAAAAPbmV1dHJpbm9Bc3NldElkBQAAAANuaWwAAAAAohmxEw==", "chainId": 84, "height": 894155, "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 getBoolByAddressAndKey (address,key) = match getBoolean(address, key) { | |
21 | + | case a: Boolean => | |
22 | + | a | |
23 | + | case _ => | |
24 | + | false | |
25 | + | } | |
26 | + | ||
27 | + | ||
28 | + | func getStringByAddressAndKey (address,key) = match getString(address, key) { | |
29 | + | case a: String => | |
30 | + | a | |
31 | + | case _ => | |
32 | + | "" | |
33 | + | } | |
34 | + | ||
35 | + | ||
36 | + | func getNumberByAddressAndKey (address,key) = match getInteger(address, key) { | |
37 | + | case a: Int => | |
38 | + | a | |
39 | + | case _ => | |
40 | + | 0 | |
41 | + | } | |
42 | + | ||
43 | + | ||
44 | + | let WAVELET = 100000000 | |
45 | + | ||
46 | + | let ORDERSPLITSYMBOL = "_" | |
47 | + | ||
48 | + | let PAULI = 1000000 | |
49 | + | ||
50 | + | let PERCENTACCURACY = 1000 | |
51 | + | ||
52 | + | let MAXDISCOUNT = 50 | |
53 | + | ||
54 | + | let CANCELED = "canceled" | |
55 | + | ||
56 | + | let NEW = "new" | |
57 | + | ||
58 | + | let FILLED = "filled" | |
59 | + | ||
60 | + | let NeutrinoContractKey = "neutrino_contract" | |
61 | + | ||
62 | + | let PriceKey = "price" | |
63 | + | ||
64 | + | let BondAssetIdKey = "bond_asset_id" | |
65 | + | ||
66 | + | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
67 | + | ||
68 | + | let ControlContractKey = "control_contract" | |
69 | + | ||
70 | + | let BalanceLockedkKey = "balance_lock_" | |
71 | + | ||
72 | + | let WavesLockedBalanceKey = (BalanceLockedkKey + "waves") | |
73 | + | ||
74 | + | let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino") | |
75 | + | ||
76 | + | let FirstOrderKey = "order_first" | |
77 | + | ||
78 | + | let LastOrderKey = "order_last" | |
79 | + | ||
80 | + | func getOrderPrevKey (orderId) = ("order_prev_" + orderId) | |
81 | + | ||
82 | + | ||
83 | + | func getOrderNextKey (orderId) = ("order_next_" + orderId) | |
84 | + | ||
85 | + | ||
86 | + | func getOrderTotalKey (orderId) = ("order_total_" + orderId) | |
87 | + | ||
88 | + | ||
89 | + | func getOrderOwnerKey (orderId) = ("order_owner_" + orderId) | |
90 | + | ||
91 | + | ||
92 | + | func getOrderHeightKey (orderId) = ("order_height_" + orderId) | |
93 | + | ||
94 | + | ||
95 | + | func getOrderStatusKey (orderId) = ("order_status_" + orderId) | |
96 | + | ||
97 | + | ||
98 | + | func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId) | |
99 | + | ||
100 | + | ||
101 | + | func getLastOrderOwnerKey (owner) = ("last_order_owner_" + owner) | |
102 | + | ||
103 | + | ||
104 | + | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI) | |
105 | + | ||
106 | + | ||
107 | + | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET) | |
108 | + | ||
109 | + | ||
110 | + | func convertNeutrinoToBond (amount) = (amount / PAULI) | |
111 | + | ||
112 | + | ||
113 | + | func convertBondToNeutrino (amount) = (amount * PAULI) | |
114 | + | ||
115 | + | ||
116 | + | func convertWavesToBond (amount,price) = convertNeutrinoToBond(convertWavesToNeutrino(amount, price)) | |
117 | + | ||
118 | + | ||
119 | + | let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey)) | |
120 | + | ||
121 | + | let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey)) | |
122 | + | ||
123 | + | let liquidationContract = this | |
124 | + | ||
125 | + | let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey)) | |
126 | + | ||
127 | + | let bondAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, BondAssetIdKey)) | |
128 | + | ||
129 | + | let firstOrder = getStringByKey(FirstOrderKey) | |
130 | + | ||
131 | + | let lastOrder = getStringByKey(LastOrderKey) | |
132 | + | ||
133 | + | let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked") | |
134 | + | ||
135 | + | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
136 | + | ||
137 | + | let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey) | |
138 | + | ||
139 | + | let wavesLockedBalance = getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey) | |
140 | + | ||
141 | + | let reserve = (wavesBalance(neutrinoContract) - wavesLockedBalance) | |
142 | + | ||
143 | + | let neutrinoSupply = (((neutrinoLockedBalance + extract(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId)) | |
144 | + | ||
145 | + | let surplus = (convertWavesToNeutrino(reserve, currentPrice) - neutrinoSupply) | |
146 | + | ||
147 | + | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
148 | + | ||
149 | + | ||
150 | + | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
151 | + | ||
152 | + | ||
153 | + | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
154 | + | ||
155 | + | ||
156 | + | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
157 | + | ||
158 | + | ||
159 | + | func getOrderPrev (id) = getStringByKey(getOrderPrevKey(id)) | |
160 | + | ||
161 | + | ||
162 | + | func getOrderNext (id) = getStringByKey(getOrderNextKey(id)) | |
163 | + | ||
164 | + | ||
165 | + | func getOrderHeight (id) = getNumberByKey(getOrderHeightKey(id)) | |
166 | + | ||
167 | + | ||
168 | + | func getLastOrderOwner (owner) = getStringByKey(getLastOrderOwnerKey(owner)) | |
169 | + | ||
170 | + | ||
171 | + | @Callable(i) | |
172 | + | func addLiquidationOrder () = { | |
173 | + | let pmt = extract(i.payment) | |
174 | + | let newOrderId = toBase58String(keccak256((((toBytes(pmt.amount) + i.caller.bytes) + toBytes(height)) + i.transactionId))) | |
175 | + | let nextOrder = getOrderNext(lastOrder) | |
176 | + | let orderStatus = getOrderStatus(lastOrder) | |
177 | + | let owner = toString(i.caller) | |
178 | + | if (isBlocked) | |
179 | + | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
180 | + | else if ((pmt.assetId != bondAssetId)) | |
181 | + | then throw("can use appropriate neutrino bonds tokens only") | |
182 | + | else if ((getOrderOwner(newOrderId) != "")) | |
183 | + | then throw("an order is already exists") | |
184 | + | else if ((nextOrder != "")) | |
185 | + | then throw(("nextOrder is not last. Info:" + nextOrder)) | |
186 | + | else if (if ((firstOrder != "")) | |
187 | + | then (lastOrder == "") | |
188 | + | else false) | |
189 | + | then throw("invalid last order") | |
190 | + | else if (if ((firstOrder != "")) | |
191 | + | then (orderStatus != NEW) | |
192 | + | else false) | |
193 | + | then throw("last order status is not new") | |
194 | + | else WriteSet([DataEntry(getLastOrderOwnerKey(owner), newOrderId), DataEntry(getOrderPrevKey(newOrderId), lastOrder), DataEntry(getOrderNextKey(lastOrder), if ((lastOrder == "")) | |
195 | + | then "" | |
196 | + | else newOrderId), DataEntry(FirstOrderKey, if ((firstOrder == "")) | |
197 | + | then newOrderId | |
198 | + | else firstOrder), DataEntry(LastOrderKey, newOrderId), DataEntry(getOrderTotalKey(newOrderId), pmt.amount), DataEntry(getOrderOwnerKey(newOrderId), owner), DataEntry(getOrderHeightKey(newOrderId), height), DataEntry(getOrderStatusKey(newOrderId), NEW)]) | |
199 | + | } | |
200 | + | ||
201 | + | ||
202 | + | ||
203 | + | @Callable(i) | |
204 | + | func cancelOrder (orderId) = { | |
205 | + | let owner = getOrderOwner(orderId) | |
206 | + | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
207 | + | let nextOrder = getOrderNext(orderId) | |
208 | + | let prevOrder = getOrderPrev(orderId) | |
209 | + | if (isBlocked) | |
210 | + | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
211 | + | else if ((owner != toString(i.caller))) | |
212 | + | then throw("permission denied") | |
213 | + | else if ((getOrderStatus(orderId) != NEW)) | |
214 | + | then throw("invalid order status") | |
215 | + | else ScriptResult(WriteSet([DataEntry(FirstOrderKey, if ((firstOrder == orderId)) | |
216 | + | then nextOrder | |
217 | + | else firstOrder), DataEntry(LastOrderKey, if ((lastOrder == orderId)) | |
218 | + | then prevOrder | |
219 | + | else lastOrder), DataEntry(getOrderNextKey(prevOrder), nextOrder), DataEntry(getOrderPrevKey(nextOrder), prevOrder), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, bondAssetId)])) | |
220 | + | } | |
221 | + | ||
222 | + | ||
223 | + | ||
224 | + | @Callable(i) | |
225 | + | func liquidateBond () = { | |
226 | + | let surplusPositive = if ((0 >= surplus)) | |
227 | + | then 0 | |
228 | + | else surplus | |
229 | + | let liquidationBalance = assetBalance(this, neutrinoAssetId) | |
230 | + | let returnAmount = if ((surplusPositive >= liquidationBalance)) | |
231 | + | then 0 | |
232 | + | else (liquidationBalance - surplusPositive) | |
233 | + | let surplusBond = convertNeutrinoToBond(surplusPositive) | |
234 | + | if (isBlocked) | |
235 | + | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
236 | + | else if (if ((returnAmount == 0)) | |
237 | + | then (liquidationBalance == 0) | |
238 | + | else false) | |
239 | + | then throw("cannot liquidate order without neutrino on the smart contract") | |
240 | + | else if ((returnAmount > 0)) | |
241 | + | then TransferSet([ScriptTransfer(neutrinoContract, returnAmount, neutrinoAssetId)]) | |
242 | + | else if ((0 >= surplusBond)) | |
243 | + | then throw("there is no proficit on the smart contract now") | |
244 | + | else if ((firstOrder == "")) | |
245 | + | then throw("empty orderbook") | |
246 | + | else { | |
247 | + | let nextOrder = getOrderNext(firstOrder) | |
248 | + | let orderTotal = getOrderTotal(firstOrder) | |
249 | + | let orderOwner = getOrderOwner(firstOrder) | |
250 | + | let filledTotal = getOrderFilledTotal(firstOrder) | |
251 | + | let amount = (orderTotal - filledTotal) | |
252 | + | let newStatus = if ((surplusBond >= amount)) | |
253 | + | then FILLED | |
254 | + | else NEW | |
255 | + | let fillableOrderAmount = if ((surplusBond >= amount)) | |
256 | + | then amount | |
257 | + | else surplusBond | |
258 | + | ScriptResult(WriteSet([DataEntry(getOrderPrevKey(nextOrder), if ((newStatus == FILLED)) | |
259 | + | then "" | |
260 | + | else firstOrder), DataEntry(FirstOrderKey, if ((newStatus == FILLED)) | |
261 | + | then nextOrder | |
262 | + | else firstOrder), DataEntry(LastOrderKey, if (if ((newStatus == FILLED)) | |
263 | + | then (firstOrder == lastOrder) | |
264 | + | else false) | |
265 | + | then "" | |
266 | + | else lastOrder), DataEntry(getOrderFilledTotalKey(firstOrder), (filledTotal + fillableOrderAmount)), DataEntry(getOrderStatusKey(firstOrder), newStatus)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), convertBondToNeutrino(fillableOrderAmount), neutrinoAssetId)])) | |
267 | + | } | |
268 | + | } | |
269 | + | ||
270 | + |
github/deemru/w8io/169f3d6 46.54 ms ◑