tx · 9wZwj18qCh1QMfRKaxzXwxG7uwvchbS6utsMjc6td8ML 3MwLuek2V6JjKybacSPjk4uo78pNkttERW1: -0.01400000 Waves 2019.10.08 13:45 [710720] smart account 3MwLuek2V6JjKybacSPjk4uo78pNkttERW1 > SELF 0.00000000 Waves
{ "type": 13, "id": "9wZwj18qCh1QMfRKaxzXwxG7uwvchbS6utsMjc6td8ML", "fee": 1400000, "feeAssetId": null, "timestamp": 1570531535796, "version": 1, "sender": "3MwLuek2V6JjKybacSPjk4uo78pNkttERW1", "senderPublicKey": "J9XYsY58fH56YchACAvg2gFhmBF95dSf8LXAJB499n1J", "proofs": [ "2CCBmriCE2ATTc38MAZ2uqigGnZw2drmbENzeNGPb8evX1drR6k2t9KQMFhtpcW59vbDQrNozRm31T9Z6fEoe1SM" ], "script": "base64:AAIDAAAAAAAAAAAAAAApAQAAABhnZXROdW1iZXJCeUFkZHJlc3NBbmRLZXkAAAACAAAAB2FkZHJlc3MAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAHYWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAYZ2V0U3R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kAAGkAAAACCQAAaAAAAAIFAAAADGZpbGxlZEFtb3VudAUAAAAKb3JkZXJQcmljZQAAAAAAAAAAZAUAAAANQ0VOVFNJTkRPTExBUgQAAAAGc3RhdHVzAwkAAGcAAAACBQAAAApib25kQW1vdW50BQAAAAZhbW91bnQFAAAABkZJTExFRAUAAAADTkVXCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAMT3JkZXJCb29rS2V5BQAAAAxuZXdPcmRlcmJvb2sJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABZnZXRPcmRlckZpbGxlZFRvdGFsS2V5AAAAAQUAAAAHb3JkZXJJZAkAAGQAAAACBQAAAAtmaWxsZWRUb3RhbAUAAAAFdG90YWwJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABFnZXRPcmRlclN0YXR1c0tleQAAAAEFAAAAB29yZGVySWQFAAAABnN0YXR1cwUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAKb3JkZXJPd25lcgUAAAAMZmlsbGVkQW1vdW50BQAAAAtib25kQXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAAEG5ldXRyaW5vQ29udHJhY3QFAAAABXRvdGFsBQAAAA9uZXV0cmlub0Fzc2V0SWQFAAAAA25pbAAAAAAJin7r", "chainId": 84, "height": 710720, "spentComplexity": 0 } View: original | compacted Prev: DRMj4qAzS5cn8zDw9jmVZKyxwpYHguNEgpXAyEyHCHDE Next: H5rvSmHfZ2Zn7K4uEUhYt7WZeh1XoEHNE9RMpwNpDWxs Diff:
Old | New | Differences | |
---|---|---|---|
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | + | func getStringByAddressAndKey (address,key) = match getString(this, key) { | |
29 | + | case a: String => | |
30 | + | a | |
31 | + | case _ => | |
32 | + | "" | |
33 | + | } | |
34 | + | ||
35 | + | ||
28 | 36 | let ORDERSPLITSYMBOL = "_" | |
29 | 37 | ||
30 | - | let | |
38 | + | let CENTSINDOLLAR = 100 | |
31 | 39 | ||
32 | 40 | let CANCELED = "canceled" | |
33 | 41 | ||
75 | 83 | func getOrderFilledTotalKey (orderId) = (OrderFilledTotalKey + orderId) | |
76 | 84 | ||
77 | 85 | ||
78 | - | let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey)) | |
79 | - | ||
80 | - | let bondAssetId = fromBase58String(getStringByKey(BondAssetIdKey)) | |
81 | - | ||
82 | 86 | let neutrinoContract = getStringByKey(NeutrinoContractKey) | |
83 | 87 | ||
84 | 88 | let price = getNumberByAddressAndKey(neutrinoContract, PriceKey) | |
89 | + | ||
90 | + | let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey)) | |
91 | + | ||
92 | + | let bondAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, BondAssetIdKey)) | |
85 | 93 | ||
86 | 94 | let orderbook = getStringByKey(OrderBookKey) | |
87 | 95 | ||
180 | 188 | @Callable(i) | |
181 | 189 | func executeOrder () = { | |
182 | 190 | let bondBalance = assetBalance(this, bondAssetId) | |
183 | - | let deficit = ((neutrinoSupply - ((reserve * price) / 100)) / | |
191 | + | let deficit = ((neutrinoSupply - ((reserve * price) / 100)) / CENTSINDOLLAR) | |
184 | 192 | let deficitPositive = if ((0 >= deficit)) | |
185 | 193 | then 0 | |
186 | 194 | else deficit | |
198 | 206 | let orderTotal = getOrderTotal(orderId) | |
199 | 207 | let orderPrice = getOrderPrice(orderId) | |
200 | 208 | let orderOwner = getOrderOwner(orderId) | |
201 | - | let amount = ((((orderTotal - filledTotal) * 100) / orderPrice) / | |
209 | + | let amount = ((((orderTotal - filledTotal) * 100) / orderPrice) / CENTSINDOLLAR) | |
202 | 210 | let newOrderbook = if ((bondAmount >= amount)) | |
203 | 211 | then dropOrder(orderId) | |
204 | 212 | else orderbook | |
205 | 213 | let filledAmount = if ((bondAmount >= amount)) | |
206 | 214 | then amount | |
207 | 215 | else bondAmount | |
208 | - | let total = (((filledAmount * orderPrice) / 100) * | |
216 | + | let total = (((filledAmount * orderPrice) / 100) * CENTSINDOLLAR) | |
209 | 217 | let status = if ((bondAmount >= amount)) | |
210 | 218 | then FILLED | |
211 | 219 | else NEW |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getNumberByAddressAndKey (address,key) = match getInteger(addressFromStringValue(address), key) { | |
5 | 5 | case a: Int => | |
6 | 6 | a | |
7 | 7 | case _ => | |
8 | 8 | 0 | |
9 | 9 | } | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func getNumberByKey (key) = match getInteger(this, key) { | |
13 | 13 | case a: Int => | |
14 | 14 | a | |
15 | 15 | case _ => | |
16 | 16 | 0 | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func getStringByKey (key) = match getString(this, key) { | |
21 | 21 | case a: String => | |
22 | 22 | a | |
23 | 23 | case _ => | |
24 | 24 | "" | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | + | func getStringByAddressAndKey (address,key) = match getString(this, key) { | |
29 | + | case a: String => | |
30 | + | a | |
31 | + | case _ => | |
32 | + | "" | |
33 | + | } | |
34 | + | ||
35 | + | ||
28 | 36 | let ORDERSPLITSYMBOL = "_" | |
29 | 37 | ||
30 | - | let | |
38 | + | let CENTSINDOLLAR = 100 | |
31 | 39 | ||
32 | 40 | let CANCELED = "canceled" | |
33 | 41 | ||
34 | 42 | let NEW = "new" | |
35 | 43 | ||
36 | 44 | let FILLED = "filled" | |
37 | 45 | ||
38 | 46 | let OrderBookKey = "orderbook" | |
39 | 47 | ||
40 | 48 | let OrderPriceKey = "order_price_" | |
41 | 49 | ||
42 | 50 | let OrderTotalKey = "order_total_" | |
43 | 51 | ||
44 | 52 | let OrderFilledTotalKey = "order_filled_total_" | |
45 | 53 | ||
46 | 54 | let OrderOwnerKey = "order_owner_" | |
47 | 55 | ||
48 | 56 | let OrderHeightKey = "order_height_" | |
49 | 57 | ||
50 | 58 | let OrderStatusKey = "order_status_" | |
51 | 59 | ||
52 | 60 | let PriceKey = "price" | |
53 | 61 | ||
54 | 62 | let BondAssetIdKey = "bond_asset_id" | |
55 | 63 | ||
56 | 64 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
57 | 65 | ||
58 | 66 | let NeutrinoContractKey = "neutrino_contract" | |
59 | 67 | ||
60 | 68 | func getOrderPriceKey (orderId) = (OrderPriceKey + orderId) | |
61 | 69 | ||
62 | 70 | ||
63 | 71 | func getOrderTotalKey (orderId) = (OrderTotalKey + orderId) | |
64 | 72 | ||
65 | 73 | ||
66 | 74 | func getOrderOwnerKey (orderId) = (OrderOwnerKey + orderId) | |
67 | 75 | ||
68 | 76 | ||
69 | 77 | func getOrderHeightKey (orderId) = (OrderHeightKey + orderId) | |
70 | 78 | ||
71 | 79 | ||
72 | 80 | func getOrderStatusKey (orderId) = (OrderStatusKey + orderId) | |
73 | 81 | ||
74 | 82 | ||
75 | 83 | func getOrderFilledTotalKey (orderId) = (OrderFilledTotalKey + orderId) | |
76 | 84 | ||
77 | 85 | ||
78 | - | let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey)) | |
79 | - | ||
80 | - | let bondAssetId = fromBase58String(getStringByKey(BondAssetIdKey)) | |
81 | - | ||
82 | 86 | let neutrinoContract = getStringByKey(NeutrinoContractKey) | |
83 | 87 | ||
84 | 88 | let price = getNumberByAddressAndKey(neutrinoContract, PriceKey) | |
89 | + | ||
90 | + | let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey)) | |
91 | + | ||
92 | + | let bondAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, BondAssetIdKey)) | |
85 | 93 | ||
86 | 94 | let orderbook = getStringByKey(OrderBookKey) | |
87 | 95 | ||
88 | 96 | let reserve = wavesBalance(addressFromStringValue(neutrinoContract)) | |
89 | 97 | ||
90 | 98 | let neutrinoSupply = { | |
91 | 99 | let info = extract(assetInfo(neutrinoAssetId)) | |
92 | 100 | (info.quantity - assetBalance(addressFromStringValue(neutrinoContract), neutrinoAssetId)) | |
93 | 101 | } | |
94 | 102 | ||
95 | 103 | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
96 | 104 | ||
97 | 105 | ||
98 | 106 | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
99 | 107 | ||
100 | 108 | ||
101 | 109 | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
102 | 110 | ||
103 | 111 | ||
104 | 112 | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
105 | 113 | ||
106 | 114 | ||
107 | 115 | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
108 | 116 | ||
109 | 117 | ||
110 | 118 | func getOrderElementById (id) = (id + ORDERSPLITSYMBOL) | |
111 | 119 | ||
112 | 120 | ||
113 | 121 | func addOrder (orderId,position) = { | |
114 | 122 | let orders = split(orderbook, ORDERSPLITSYMBOL) | |
115 | 123 | let newOrder = getOrderElementById(orderId) | |
116 | 124 | if ((position == 0)) | |
117 | 125 | then (newOrder + orderbook) | |
118 | 126 | else if ((position >= (size(orders) - 1))) | |
119 | 127 | then (orderbook + newOrder) | |
120 | 128 | else { | |
121 | 129 | let parts = split(orderbook, getOrderElementById(orders[position])) | |
122 | 130 | (((parts[0] + newOrder) + getOrderElementById(orders[position])) + parts[1]) | |
123 | 131 | } | |
124 | 132 | } | |
125 | 133 | ||
126 | 134 | ||
127 | 135 | func dropOrder (orderId) = { | |
128 | 136 | let parts = split(orderbook, getOrderElementById(orderId)) | |
129 | 137 | (parts[0] + parts[1]) | |
130 | 138 | } | |
131 | 139 | ||
132 | 140 | ||
133 | 141 | @Callable(i) | |
134 | 142 | func setOrder (price,position) = { | |
135 | 143 | let pmt = extract(i.payment) | |
136 | 144 | let newOrderId = toBase58String(keccak256((((toBytes(price) + toBytes(pmt.amount)) + i.caller.bytes) + toBytes(height)))) | |
137 | 145 | if ((pmt.assetId != neutrinoAssetId)) | |
138 | 146 | then throw("can use neutrino only") | |
139 | 147 | else if ((0 >= price)) | |
140 | 148 | then throw("price less zero") | |
141 | 149 | else if ((getOrderOwner(newOrderId) != "")) | |
142 | 150 | then throw("order exists") | |
143 | 151 | else { | |
144 | 152 | let orders = split(orderbook, ORDERSPLITSYMBOL) | |
145 | 153 | let nextOrderId = if ((position == 0)) | |
146 | 154 | then "" | |
147 | 155 | else orders[(position - 1)] | |
148 | 156 | let nextOrderPrice = getOrderPrice(nextOrderId) | |
149 | 157 | let isNextOrderError = if (if ((nextOrderId != "")) | |
150 | 158 | then (price > nextOrderPrice) | |
151 | 159 | else false) | |
152 | 160 | then true | |
153 | 161 | else false | |
154 | 162 | let prevOrderId = orders[position] | |
155 | 163 | let prevOrderPrice = getOrderPrice(prevOrderId) | |
156 | 164 | let isPrevOrderError = if ((prevOrderPrice >= price)) | |
157 | 165 | then true | |
158 | 166 | else false | |
159 | 167 | if (if (isNextOrderError) | |
160 | 168 | then true | |
161 | 169 | else isPrevOrderError) | |
162 | 170 | then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError))) | |
163 | 171 | 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)]) | |
164 | 172 | } | |
165 | 173 | } | |
166 | 174 | ||
167 | 175 | ||
168 | 176 | ||
169 | 177 | @Callable(i) | |
170 | 178 | func cancelOrder (orderId) = { | |
171 | 179 | let owner = getOrderOwner(orderId) | |
172 | 180 | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
173 | 181 | if ((owner != toString(i.caller))) | |
174 | 182 | then throw("permission denied") | |
175 | 183 | else ScriptResult(WriteSet([DataEntry(OrderBookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, neutrinoAssetId)])) | |
176 | 184 | } | |
177 | 185 | ||
178 | 186 | ||
179 | 187 | ||
180 | 188 | @Callable(i) | |
181 | 189 | func executeOrder () = { | |
182 | 190 | let bondBalance = assetBalance(this, bondAssetId) | |
183 | - | let deficit = ((neutrinoSupply - ((reserve * price) / 100)) / | |
191 | + | let deficit = ((neutrinoSupply - ((reserve * price) / 100)) / CENTSINDOLLAR) | |
184 | 192 | let deficitPositive = if ((0 >= deficit)) | |
185 | 193 | then 0 | |
186 | 194 | else deficit | |
187 | 195 | let bondAmount = if ((deficitPositive >= bondBalance)) | |
188 | 196 | then bondBalance | |
189 | 197 | else deficitPositive | |
190 | 198 | let returnAmount = if ((deficitPositive >= bondBalance)) | |
191 | 199 | then 0 | |
192 | 200 | else (bondBalance - deficitPositive) | |
193 | 201 | if ((bondAmount == 0)) | |
194 | 202 | then TransferSet([ScriptTransfer(addressFromStringValue(neutrinoContract), returnAmount, bondAssetId)]) | |
195 | 203 | else { | |
196 | 204 | let orderId = split(orderbook, ORDERSPLITSYMBOL)[0] | |
197 | 205 | let filledTotal = getOrderFilledTotal(orderId) | |
198 | 206 | let orderTotal = getOrderTotal(orderId) | |
199 | 207 | let orderPrice = getOrderPrice(orderId) | |
200 | 208 | let orderOwner = getOrderOwner(orderId) | |
201 | - | let amount = ((((orderTotal - filledTotal) * 100) / orderPrice) / | |
209 | + | let amount = ((((orderTotal - filledTotal) * 100) / orderPrice) / CENTSINDOLLAR) | |
202 | 210 | let newOrderbook = if ((bondAmount >= amount)) | |
203 | 211 | then dropOrder(orderId) | |
204 | 212 | else orderbook | |
205 | 213 | let filledAmount = if ((bondAmount >= amount)) | |
206 | 214 | then amount | |
207 | 215 | else bondAmount | |
208 | - | let total = (((filledAmount * orderPrice) / 100) * | |
216 | + | let total = (((filledAmount * orderPrice) / 100) * CENTSINDOLLAR) | |
209 | 217 | let status = if ((bondAmount >= amount)) | |
210 | 218 | then FILLED | |
211 | 219 | else NEW | |
212 | 220 | ScriptResult(WriteSet([DataEntry(OrderBookKey, newOrderbook), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + total)), DataEntry(getOrderStatusKey(orderId), status)]), TransferSet([ScriptTransfer(addressFromStringValue(orderOwner), filledAmount, bondAssetId), ScriptTransfer(addressFromStringValue(neutrinoContract), total, neutrinoAssetId)])) | |
213 | 221 | } | |
214 | 222 | } | |
215 | 223 | ||
216 | 224 |
github/deemru/w8io/026f985 55.30 ms ◑