tx · 5CPs1VPXF9WwexMmWA3dYaQQENX5b7XcdSY9o7L4pXL6 3N7d3jPxKqSi3XVnAgg8oFsHLcrgctFWpVw: -0.01400000 Waves 2019.11.18 17:18 [770673] smart account 3N7d3jPxKqSi3XVnAgg8oFsHLcrgctFWpVw > SELF 0.00000000 Waves
{ "type": 13, "id": "5CPs1VPXF9WwexMmWA3dYaQQENX5b7XcdSY9o7L4pXL6", "fee": 1400000, "feeAssetId": null, "timestamp": 1574086703681, "version": 1, "sender": "3N7d3jPxKqSi3XVnAgg8oFsHLcrgctFWpVw", "senderPublicKey": "GHnaLgezSnGCGe7LuhRy8j4JzCcySjwndqh6X9xHQNhz", "proofs": [ "25P2j7ZvyYKkX1r9AcXiuwDZxRuxdEmm9wpgXmLBn6w34q8BBGV6HvMyLNCduRiVRspEJCNQj4Z3ju6wD2u6Fd25" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIBARIDCgEIEgAAAAA3AQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAAGGdldFN0cmluZ0J5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAYZ2V0Tn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AAACBQAAAApib25kQW1vdW50BQAAAAZhbW91bnQFAAAABkZJTExFRAUAAAADTkVXAwkAAAAAAAACBQAAAAV0b3RhbAAAAAAAAAAAAAkAAAIAAAABAgAAABB0b3RhbCBlcXVhbCB6ZXJvCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAMT3JkZXJib29rS2V5AwkAAGcAAAACBQAAAApib25kQW1vdW50BQAAAAZhbW91bnQJAQAAAAlkcm9wT3JkZXIAAAABBQAAAAdvcmRlcklkBQAAAAlvcmRlcmJvb2sJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABZnZXRPcmRlckZpbGxlZFRvdGFsS2V5AAAAAQUAAAAHb3JkZXJJZAkAAGQAAAACBQAAAAtmaWxsZWRUb3RhbAUAAAAFdG90YWwJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABFnZXRPcmRlclN0YXR1c0tleQAAAAEFAAAAB29yZGVySWQFAAAABnN0YXR1cwkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAAEmdldE9yZGVySGlzdG9yeUtleQAAAAEFAAAABmhlaWdodAUAAAAKb3JkZXJQcmljZQUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAKb3JkZXJPd25lcgUAAAAMZmlsbGVkQW1vdW50BQAAAAtib25kQXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABBuZXV0cmlub0NvbnRyYWN0BQAAAAV0b3RhbAUAAAAPbmV1dHJpbm9Bc3NldElkBQAAAANuaWwAAAAAwwnBAw==", "chainId": 84, "height": 770673, "spentComplexity": 0 } View: original | compacted Prev: Bqun63ddTg4Hx5iGNBiXuZrYZEre5imKs6m113FUC1at Next: H3WkATq86znFi477WTtwmvh8SjvP4MSrMNMM7tqLXbwB Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getNumberByKey (key) = match getInteger(this, key) { | |
5 | 5 | case a: Int => | |
6 | 6 | a | |
7 | 7 | case _ => | |
8 | 8 | 0 | |
9 | 9 | } | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func getStringByKey (key) = match getString(this, key) { | |
13 | 13 | case a: String => | |
14 | 14 | a | |
15 | 15 | case _ => | |
16 | 16 | "" | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func getStringByAddressAndKey (address,key) = match getString(address, key) { | |
21 | 21 | case a: String => | |
22 | 22 | a | |
23 | 23 | case _ => | |
24 | 24 | "" | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func getNumberByAddressAndKey (address,key) = match getInteger(address, key) { | |
29 | 29 | case a: Int => | |
30 | 30 | a | |
31 | 31 | case _ => | |
32 | 32 | 0 | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | let WAVELET = 100000000 | |
37 | 37 | ||
38 | 38 | let ORDERSPLITSYMBOL = "_" | |
39 | 39 | ||
40 | 40 | let PAULI = 100 | |
41 | 41 | ||
42 | 42 | let PERCENTACCURACY = 1000 | |
43 | 43 | ||
44 | 44 | let MAXDISCOUNT = 50 | |
45 | 45 | ||
46 | 46 | let CANCELED = "canceled" | |
47 | 47 | ||
48 | 48 | let NEW = "new" | |
49 | 49 | ||
50 | 50 | let FILLED = "filled" | |
51 | 51 | ||
52 | 52 | let OrderbookKey = "orderbook" | |
53 | 53 | ||
54 | 54 | let PriceKey = "price" | |
55 | 55 | ||
56 | 56 | let BondAssetIdKey = "bond_asset_id" | |
57 | 57 | ||
58 | 58 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
59 | 59 | ||
60 | 60 | let NeutrinoContractKey = "neutrino_contract" | |
61 | 61 | ||
62 | 62 | let ControlContractKey = "control_contract" | |
63 | 63 | ||
64 | 64 | let SwapLockedBalanceKey = "swap_locked_balance" | |
65 | 65 | ||
66 | 66 | let SwapNeutrinoLockedBalanceKey = "swap_neutrino_locked_balance" | |
67 | 67 | ||
68 | 68 | let SwapWavesLockedBalanceKey = "swap_waves_locked_balance" | |
69 | 69 | ||
70 | 70 | func getOrderPriceKey (orderId) = ("order_price_" + orderId) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func getOrderTotalKey (orderId) = ("order_total_" + orderId) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func getOrderOwnerKey (orderId) = ("order_owner_" + orderId) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func getOrderHeightKey (orderId) = ("order_height_" + orderId) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func getOrderStatusKey (orderId) = ("order_status_" + orderId) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func getOrderHistoryKey (height) = ("order_history_" + toString(height)) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func convertNeutrinoToWaves (amount,price) = ((((amount * 100) / price) * WAVELET) / PAULI) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func convertWavesToNeutrino (amount,price) = ((((amount * price) / 100) * PAULI) / WAVELET) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func convertNeutrinoToBond (amount) = (amount / PAULI) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func convertBondToNeutrino (amount) = (amount * PAULI) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func convertWavesToBond (amount,price) = convertNeutrinoToBond(convertWavesToNeutrino(amount, price)) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | let orderbook = getStringByKey(OrderbookKey) | |
107 | 107 | ||
108 | 108 | let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey)) | |
109 | 109 | ||
110 | 110 | let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey)) | |
111 | 111 | ||
112 | 112 | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
113 | 113 | ||
114 | 114 | let swapLockedBalance = getNumberByAddressAndKey(neutrinoContract, SwapLockedBalanceKey) | |
115 | 115 | ||
116 | 116 | let swapNeutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, SwapNeutrinoLockedBalanceKey) | |
117 | 117 | ||
118 | 118 | let swapWavesLockedBalance = getNumberByAddressAndKey(neutrinoContract, SwapWavesLockedBalanceKey) | |
119 | 119 | ||
120 | 120 | let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey)) | |
121 | 121 | ||
122 | 122 | let bondAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, BondAssetIdKey)) | |
123 | 123 | ||
124 | 124 | let reserve = (wavesBalance(neutrinoContract) - swapWavesLockedBalance) | |
125 | 125 | ||
126 | 126 | let neutrinoSupply = ((extract(assetInfo(neutrinoAssetId)).quantity - assetBalance(neutrinoContract, neutrinoAssetId)) + swapNeutrinoLockedBalance) | |
127 | 127 | ||
128 | 128 | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice)) | |
129 | 129 | ||
130 | 130 | let surplus = (convertWavesToNeutrino(reserve, currentPrice) - neutrinoSupply) | |
131 | 131 | ||
132 | 132 | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func getOrderElementById (id) = (id + ORDERSPLITSYMBOL) | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func addOrder (orderId,position) = { | |
151 | 151 | let orders = split(orderbook, ORDERSPLITSYMBOL) | |
152 | 152 | let newOrder = getOrderElementById(orderId) | |
153 | 153 | if ((position == 0)) | |
154 | 154 | then (newOrder + orderbook) | |
155 | 155 | else if ((position >= (size(orders) - 1))) | |
156 | 156 | then (orderbook + newOrder) | |
157 | 157 | else { | |
158 | 158 | let parts = split(orderbook, getOrderElementById(orders[position])) | |
159 | 159 | (((parts[0] + newOrder) + getOrderElementById(orders[position])) + parts[1]) | |
160 | 160 | } | |
161 | 161 | } | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | func dropOrder (orderId) = { | |
165 | 165 | let parts = split(orderbook, getOrderElementById(orderId)) | |
166 | 166 | (parts[0] + parts[1]) | |
167 | 167 | } | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func getOrdersInOrderbook (orderbook) = split(orderbook, ORDERSPLITSYMBOL) | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | @Callable(i) | |
174 | 174 | func addBuyBondOrder (price,position) = { | |
175 | 175 | let pmt = extract(i.payment) | |
176 | 176 | let newOrderId = toBase58String(keccak256((((toBytes(price) + toBytes(pmt.amount)) + i.caller.bytes) + toBytes(height)))) | |
177 | 177 | if ((MAXDISCOUNT > price)) | |
178 | 178 | then throw("max discount is 50%") | |
179 | 179 | else if ((pmt.assetId != neutrinoAssetId)) | |
180 | 180 | then throw("can use neutrino only") | |
181 | 181 | else if ((0 >= price)) | |
182 | 182 | then throw("price less zero") | |
183 | 183 | else if ((getOrderOwner(newOrderId) != "")) | |
184 | 184 | then throw("order exists") | |
185 | 185 | else { | |
186 | 186 | let orders = getOrdersInOrderbook(orderbook) | |
187 | 187 | let nextOrderId = if ((position == 0)) | |
188 | 188 | then "" | |
189 | 189 | else orders[(position - 1)] | |
190 | 190 | let nextOrderPrice = getOrderPrice(nextOrderId) | |
191 | 191 | let isNextOrderError = if (if ((nextOrderId != "")) | |
192 | 192 | then (price > nextOrderPrice) | |
193 | 193 | else false) | |
194 | 194 | then true | |
195 | 195 | else false | |
196 | 196 | let prevOrderId = orders[position] | |
197 | 197 | let prevOrderPrice = getOrderPrice(prevOrderId) | |
198 | 198 | let isPrevOrderError = if ((prevOrderPrice >= price)) | |
199 | 199 | then true | |
200 | 200 | else false | |
201 | 201 | if (if (isNextOrderError) | |
202 | 202 | then true | |
203 | 203 | else isPrevOrderError) | |
204 | 204 | then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError))) | |
205 | 205 | 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)]) | |
206 | 206 | } | |
207 | 207 | } | |
208 | 208 | ||
209 | 209 | ||
210 | 210 | ||
211 | 211 | @Callable(i) | |
212 | 212 | func cancelOrder (orderId) = { | |
213 | 213 | let owner = getOrderOwner(orderId) | |
214 | 214 | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
215 | 215 | if ((owner != toString(i.caller))) | |
216 | 216 | then throw("permission denied") | |
217 | 217 | else if ((getOrderStatus(orderId) != NEW)) | |
218 | 218 | then throw("invalid order status") | |
219 | 219 | else ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, neutrinoAssetId)])) | |
220 | 220 | } | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | ||
224 | 224 | @Callable(i) | |
225 | 225 | func sellBond () = { | |
226 | 226 | let bondBalance = assetBalance(this, bondAssetId) | |
227 | 227 | let deficitPositive = if ((0 >= deficit)) | |
228 | 228 | then 0 | |
229 | 229 | else deficit | |
230 | 230 | let bondAmount = if ((deficitPositive >= bondBalance)) | |
231 | 231 | then bondBalance | |
232 | 232 | else deficitPositive | |
233 | 233 | let returnAmount = if ((deficitPositive >= bondBalance)) | |
234 | 234 | then 0 | |
235 | 235 | else (bondBalance - deficitPositive) | |
236 | 236 | if (if ((returnAmount == 0)) | |
237 | 237 | then (bondAmount == 0) | |
238 | 238 | else false) | |
239 | 239 | then throw("without deficit") | |
240 | 240 | else if ((bondAmount == 0)) | |
241 | 241 | then TransferSet([ScriptTransfer(neutrinoContract, returnAmount, bondAssetId)]) | |
242 | 242 | else if ((orderbook == "")) | |
243 | 243 | then throw("empty orderbook") | |
244 | 244 | else { | |
245 | 245 | let orderId = getOrdersInOrderbook(orderbook)[0] | |
246 | 246 | let filledTotal = getOrderFilledTotal(orderId) | |
247 | 247 | let orderTotal = getOrderTotal(orderId) | |
248 | 248 | let orderPrice = getOrderPrice(orderId) | |
249 | 249 | let orderOwner = getOrderOwner(orderId) | |
250 | 250 | let amount = convertNeutrinoToBond((((orderTotal - filledTotal) * 100) / orderPrice)) | |
251 | 251 | let filledAmount = if ((bondAmount >= amount)) | |
252 | 252 | then amount | |
253 | 253 | else bondAmount | |
254 | 254 | let total = (((filledAmount * orderPrice) * PAULI) / 100) | |
255 | 255 | let status = if ((bondAmount >= amount)) | |
256 | 256 | then FILLED | |
257 | 257 | else NEW | |
258 | 258 | if ((total == 0)) | |
259 | 259 | then throw("total equal zero") | |
260 | 260 | else ScriptResult(WriteSet([DataEntry(OrderbookKey, if ((bondAmount >= amount)) | |
261 | 261 | then dropOrder(orderId) | |
262 | 262 | else orderbook), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + total)), DataEntry(getOrderStatusKey(orderId), status), DataEntry(getOrderHistoryKey(height), orderPrice)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), filledAmount, bondAssetId), ScriptTransfer(neutrinoContract, total, neutrinoAssetId)])) | |
263 | 263 | } | |
264 | 264 | } | |
265 | 265 | ||
266 | 266 |
github/deemru/w8io/169f3d6 61.17 ms ◑