tx · 7WK3nbW4XPavzAUPK3qe13NSXDW2wd8a2p1TuKWSD4A7 3NBuDtQkhUjztpDF7qyYBXHzBRxzWuT1VCS: -0.01000000 Waves 2020.01.17 23:37 [858655] smart account 3NBuDtQkhUjztpDF7qyYBXHzBRxzWuT1VCS > SELF 0.00000000 Waves
{ "type": 13, "id": "7WK3nbW4XPavzAUPK3qe13NSXDW2wd8a2p1TuKWSD4A7", "fee": 1000000, "feeAssetId": null, "timestamp": 1579293470789, "version": 1, "sender": "3NBuDtQkhUjztpDF7qyYBXHzBRxzWuT1VCS", "senderPublicKey": "AYMDMq9Bt9p416yBQAnvvz6f4FjoS8DvPFDhvCNRLaM6", "proofs": [ "36FQYJcFJy4HKmu3ziGJ6uvdWJAx7zGWrFpvqTDXvkcN7yWDaZgxuLTtzCFNVmV92CpYtjGMVdDLjYnBFpP7UpZG" ], "script": "base64:AAIDAAAAAAAAAAsIARIAEgMKAQgSAAAAADMBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAYZ2V0U3RyaW5nQnlBZGRyZXNzQW5kS2V5AAAAAgAAAAdhZGRyZXNzAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAAAQAAABhnZXROdW1iZXJCeU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AAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAgkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAIAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAwkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAMAAAAAAAAAAAIAAAAAAAAAAAAJAABnAAAAAgUAAAAFY291bnQAAAAAAAAAAAP9Ccwu", "chainId": 84, "height": 858655, "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 ORDERSPLITSYMBOL = "_" | |
39 | + | ||
40 | + | let PAULI = 1000000 | |
41 | + | ||
42 | + | let PERCENTACCURACY = 1000 | |
43 | + | ||
44 | + | let MAXDISCOUNT = 50 | |
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 | + | func getOrderTotalKey (orderId) = ("order_total_" + orderId) | |
71 | + | ||
72 | + | ||
73 | + | func getOrderOwnerKey (orderId) = ("order_owner_" + orderId) | |
74 | + | ||
75 | + | ||
76 | + | func getOrderHeightKey (orderId) = ("order_height_" + orderId) | |
77 | + | ||
78 | + | ||
79 | + | func getOrderStatusKey (orderId) = ("order_status_" + orderId) | |
80 | + | ||
81 | + | ||
82 | + | func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId) | |
83 | + | ||
84 | + | ||
85 | + | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI) | |
86 | + | ||
87 | + | ||
88 | + | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET) | |
89 | + | ||
90 | + | ||
91 | + | func convertNeutrinoToBond (amount) = (amount / PAULI) | |
92 | + | ||
93 | + | ||
94 | + | func convertBondToNeutrino (amount) = (amount * PAULI) | |
95 | + | ||
96 | + | ||
97 | + | func convertWavesToBond (amount,price) = convertNeutrinoToBond(convertWavesToNeutrino(amount, price)) | |
98 | + | ||
99 | + | ||
100 | + | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
101 | + | ||
102 | + | ||
103 | + | let orderbook = getStringByKey(OrderbookKey) | |
104 | + | ||
105 | + | let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey)) | |
106 | + | ||
107 | + | let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey)) | |
108 | + | ||
109 | + | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
110 | + | ||
111 | + | let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey) | |
112 | + | ||
113 | + | let wavesLockedBalance = getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey) | |
114 | + | ||
115 | + | let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey)) | |
116 | + | ||
117 | + | let bondAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, BondAssetIdKey)) | |
118 | + | ||
119 | + | let reserve = (wavesBalance(neutrinoContract) - wavesLockedBalance) | |
120 | + | ||
121 | + | let neutrinoSupply = (((extract(assetInfo(neutrinoAssetId)).quantity - assetBalance(neutrinoContract, neutrinoAssetId)) + neutrinoLockedBalance) - assetBalance(this, neutrinoAssetId)) | |
122 | + | ||
123 | + | let surplus = (convertWavesToNeutrino(reserve, currentPrice) - neutrinoSupply) | |
124 | + | ||
125 | + | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
126 | + | ||
127 | + | ||
128 | + | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
129 | + | ||
130 | + | ||
131 | + | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
132 | + | ||
133 | + | ||
134 | + | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
135 | + | ||
136 | + | ||
137 | + | func getOrderElementById (id) = (id + ORDERSPLITSYMBOL) | |
138 | + | ||
139 | + | ||
140 | + | func addOrder (orderId,position) = { | |
141 | + | let orders = split(orderbook, ORDERSPLITSYMBOL) | |
142 | + | let newOrder = getOrderElementById(orderId) | |
143 | + | if ((position == 0)) | |
144 | + | then (newOrder + orderbook) | |
145 | + | else if ((position >= (size(orders) - 1))) | |
146 | + | then (orderbook + newOrder) | |
147 | + | else { | |
148 | + | let parts = split(orderbook, getOrderElementById(orders[position])) | |
149 | + | (((parts[0] + newOrder) + getOrderElementById(orders[position])) + parts[1]) | |
150 | + | } | |
151 | + | } | |
152 | + | ||
153 | + | ||
154 | + | func dropOrder (orderId) = { | |
155 | + | let parts = split(orderbook, getOrderElementById(orderId)) | |
156 | + | (parts[0] + parts[1]) | |
157 | + | } | |
158 | + | ||
159 | + | ||
160 | + | func getOrdersInOrderbook (orderbook) = split(orderbook, ORDERSPLITSYMBOL) | |
161 | + | ||
162 | + | ||
163 | + | @Callable(i) | |
164 | + | func addLiquidationOrder () = { | |
165 | + | let pmt = extract(i.payment) | |
166 | + | let newOrderId = toBase58String(keccak256(((toBytes(pmt.amount) + i.caller.bytes) + toBytes(height)))) | |
167 | + | if ((pmt.assetId != bondAssetId)) | |
168 | + | then throw("can use appropriate neutrino bonds tokens only") | |
169 | + | else if ((getOrderOwner(newOrderId) != "")) | |
170 | + | then throw("an order is already exists") | |
171 | + | else WriteSet([DataEntry(OrderbookKey, addOrder(newOrderId, size(getOrdersInOrderbook(orderbook)))), DataEntry(getOrderTotalKey(newOrderId), pmt.amount), DataEntry(getOrderOwnerKey(newOrderId), toString(i.caller)), DataEntry(getOrderHeightKey(newOrderId), height), DataEntry(getOrderStatusKey(newOrderId), NEW)]) | |
172 | + | } | |
173 | + | ||
174 | + | ||
175 | + | ||
176 | + | @Callable(i) | |
177 | + | func cancelOrder (orderId) = { | |
178 | + | let owner = getOrderOwner(orderId) | |
179 | + | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
180 | + | if ((owner != toString(i.caller))) | |
181 | + | then throw("permission denied") | |
182 | + | else if ((getOrderStatus(orderId) != NEW)) | |
183 | + | then throw("invalid order status") | |
184 | + | else ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, bondAssetId)])) | |
185 | + | } | |
186 | + | ||
187 | + | ||
188 | + | ||
189 | + | @Callable(i) | |
190 | + | func liquidateBond () = { | |
191 | + | let surplusBond = convertNeutrinoToBond(surplus) | |
192 | + | let neutrinoBalance = assetBalance(this, neutrinoAssetId) | |
193 | + | let surplusPositive = if ((0 >= surplus)) | |
194 | + | then 0 | |
195 | + | else surplus | |
196 | + | let bondAmount = if ((surplusPositive >= neutrinoBalance)) | |
197 | + | then neutrinoBalance | |
198 | + | else surplusPositive | |
199 | + | let returnAmount = if ((surplusPositive >= neutrinoBalance)) | |
200 | + | then 0 | |
201 | + | else (neutrinoBalance - surplusPositive) | |
202 | + | if (if ((returnAmount == 0)) | |
203 | + | then (neutrinoBalance == 0) | |
204 | + | else false) | |
205 | + | then throw("without surplus") | |
206 | + | else if (if ((0 >= surplusBond)) | |
207 | + | then (returnAmount > 0) | |
208 | + | else false) | |
209 | + | then TransferSet([ScriptTransfer(neutrinoContract, returnAmount, neutrinoAssetId)]) | |
210 | + | else if ((0 >= surplusBond)) | |
211 | + | then throw("there is no proficit on the smart contract now") | |
212 | + | else if ((orderbook == "")) | |
213 | + | then throw("empty orderbook") | |
214 | + | else { | |
215 | + | let orderId = getOrdersInOrderbook(orderbook)[0] | |
216 | + | let orderTotal = getOrderTotal(orderId) | |
217 | + | let orderOwner = getOrderOwner(orderId) | |
218 | + | let filledTotal = getOrderFilledTotal(orderId) | |
219 | + | let amount = (orderTotal - filledTotal) | |
220 | + | let status = if ((surplusBond >= amount)) | |
221 | + | then FILLED | |
222 | + | else NEW | |
223 | + | let newTotal = if ((surplusBond >= amount)) | |
224 | + | then amount | |
225 | + | else surplusBond | |
226 | + | ScriptResult(WriteSet([DataEntry(OrderbookKey, if ((status == FILLED)) | |
227 | + | then dropOrder(orderId) | |
228 | + | else orderbook), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + newTotal)), DataEntry(getOrderStatusKey(orderId), status)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), convertBondToNeutrino(newTotal), neutrinoAssetId), ScriptTransfer(neutrinoContract, returnAmount, neutrinoAssetId)])) | |
229 | + | } | |
230 | + | } | |
231 | + | ||
232 | + | ||
233 | + | @Verifier(tx) | |
234 | + | func verify () = { | |
235 | + | let pubKeyAdminsList = ["BLEoguzPVKVTfXxxT3W7Rqf8aUm2ggC9Vemd2MQawM2G", "FWVffYr2ALmHMejZm3WqeLz6Sdym3gLFGtJn4KTwyU5x", "3Wh2LaWcb5gg7K2pPcW3Ep6EAuRBzYkAgrdpt43jTDFa", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
236 | + | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
237 | + | then 1 | |
238 | + | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
239 | + | then 1 | |
240 | + | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
241 | + | then 1 | |
242 | + | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
243 | + | then 2 | |
244 | + | else 0)) | |
245 | + | (count >= 3) | |
246 | + | } | |
247 | + |
github/deemru/w8io/026f985 37.62 ms ◑