tx · 3CASbjoKQeTEJyQoXgKG948Nd8V7dm4vqWnk55uRWrJi 3N8nPqPBGYNuxPmDC8QBUAkqd25oHt78Q1W: -0.01000000 Waves 2019.12.24 17:24 [823202] smart account 3N8nPqPBGYNuxPmDC8QBUAkqd25oHt78Q1W > SELF 0.00000000 Waves
{ "type": 13, "id": "3CASbjoKQeTEJyQoXgKG948Nd8V7dm4vqWnk55uRWrJi", "fee": 1000000, "feeAssetId": null, "timestamp": 1577197457777, "version": 1, "sender": "3N8nPqPBGYNuxPmDC8QBUAkqd25oHt78Q1W", "senderPublicKey": "ZyDggzduMRPn6gbuaHWGMJHhQmHbohgDB6xuaeWTsXM", "proofs": [ "64dYuvdqPH8FZhn4nScKmt2DFJod6iHMe4ifTfaf1TVxZKt1STMEfN1smgYZkUvcKYa5d4Ex8SZZdh8Jzc8yNSYH" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIBARIDCgEIEgAAAAA2AQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAAGGdldFN0cmluZ0J5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAYZ2V0TnVtY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AAAABCQEAAAANZ2V0T3JkZXJPd25lcgAAAAEFAAAAB29yZGVySWQFAAAADmZpbGxhYmxlQW1vdW50BQAAAAtib25kQXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABBuZXV0cmlub0NvbnRyYWN0BQAAAAV0b3RhbAUAAAAEdW5pdAUAAAADbmlsAAAAAAc5wPg=", "chainId": 84, "height": 823202, "spentComplexity": 0 } View: original | compacted Prev: none Next: EwdZwXCmVtw2cSFG363nnJLBbQy73X6HDSUy881WMoJ2 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 CANCELED = "canceled" | |
45 | + | ||
46 | + | let NEW = "new" | |
47 | + | ||
48 | + | let FILLED = "filled" | |
49 | + | ||
50 | + | let NeutrinoContractKey = "neutrino_contract" | |
51 | + | ||
52 | + | let OrderbookKey = "orderbook" | |
53 | + | ||
54 | + | let PriceKey = "price" | |
55 | + | ||
56 | + | let BondAssetIdKey = "bond_asset_id" | |
57 | + | ||
58 | + | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
59 | + | ||
60 | + | let ControlContractKey = "control_contract" | |
61 | + | ||
62 | + | let BalanceLockedkKey = "balance_lock_" | |
63 | + | ||
64 | + | let WavesLockedBalanceKey = (BalanceLockedkKey + "waves") | |
65 | + | ||
66 | + | let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino") | |
67 | + | ||
68 | + | let LiquidationContractKey = "liquidation_contract" | |
69 | + | ||
70 | + | func getOrderPriceKey (orderId) = ("order_price_" + orderId) | |
71 | + | ||
72 | + | ||
73 | + | func getOrderTotalKey (orderId) = ("order_total_" + orderId) | |
74 | + | ||
75 | + | ||
76 | + | func getOrderOwnerKey (orderId) = ("order_owner_" + orderId) | |
77 | + | ||
78 | + | ||
79 | + | func getOrderHeightKey (orderId) = ("order_height_" + orderId) | |
80 | + | ||
81 | + | ||
82 | + | func getOrderStatusKey (orderId) = ("order_status_" + orderId) | |
83 | + | ||
84 | + | ||
85 | + | func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId) | |
86 | + | ||
87 | + | ||
88 | + | func getOrderHistoryKey (height) = ("order_history_" + toString(height)) | |
89 | + | ||
90 | + | ||
91 | + | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI) | |
92 | + | ||
93 | + | ||
94 | + | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET) | |
95 | + | ||
96 | + | ||
97 | + | func convertNeutrinoToBond (amount) = (amount / PAULI) | |
98 | + | ||
99 | + | ||
100 | + | func convertBondToNeutrino (amount) = (amount * PAULI) | |
101 | + | ||
102 | + | ||
103 | + | func convertWavesToBond (amount,price) = convertNeutrinoToBond(convertWavesToNeutrino(amount, price)) | |
104 | + | ||
105 | + | ||
106 | + | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
107 | + | ||
108 | + | ||
109 | + | let orderbook = getStringByKey(OrderbookKey) | |
110 | + | ||
111 | + | let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey)) | |
112 | + | ||
113 | + | let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey)) | |
114 | + | ||
115 | + | let liquidationContract = getStringByAddressAndKey(neutrinoContract, LiquidationContractKey) | |
116 | + | ||
117 | + | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
118 | + | ||
119 | + | let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey) | |
120 | + | ||
121 | + | let wavesLockedBalance = getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey) | |
122 | + | ||
123 | + | let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey)) | |
124 | + | ||
125 | + | let bondAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, BondAssetIdKey)) | |
126 | + | ||
127 | + | let reserve = (wavesBalance(neutrinoContract) - wavesLockedBalance) | |
128 | + | ||
129 | + | let neutrinoSupply = (((extract(assetInfo(neutrinoAssetId)).quantity - assetBalance(neutrinoContract, neutrinoAssetId)) + neutrinoLockedBalance) - assetBalance(addressFromStringValue(liquidationContract), neutrinoAssetId)) | |
130 | + | ||
131 | + | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice)) | |
132 | + | ||
133 | + | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
134 | + | ||
135 | + | ||
136 | + | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
137 | + | ||
138 | + | ||
139 | + | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
140 | + | ||
141 | + | ||
142 | + | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
143 | + | ||
144 | + | ||
145 | + | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
146 | + | ||
147 | + | ||
148 | + | func getOrderElementById (id) = (id + "_") | |
149 | + | ||
150 | + | ||
151 | + | func addOrder (orderId,position) = { | |
152 | + | let orders = split(orderbook, "_") | |
153 | + | let newOrder = getOrderElementById(orderId) | |
154 | + | if ((position == 0)) | |
155 | + | then (newOrder + orderbook) | |
156 | + | else if ((position >= (size(orders) - 1))) | |
157 | + | then (orderbook + newOrder) | |
158 | + | else { | |
159 | + | let parts = split(orderbook, getOrderElementById(orders[position])) | |
160 | + | (((parts[0] + newOrder) + getOrderElementById(orders[position])) + parts[1]) | |
161 | + | } | |
162 | + | } | |
163 | + | ||
164 | + | ||
165 | + | func dropOrder (orderId) = { | |
166 | + | let parts = split(orderbook, getOrderElementById(orderId)) | |
167 | + | (parts[0] + parts[1]) | |
168 | + | } | |
169 | + | ||
170 | + | ||
171 | + | @Callable(i) | |
172 | + | func addBuyBondOrder (price,position) = { | |
173 | + | let pmt = extract(i.payment) | |
174 | + | let newOrderId = toBase58String(keccak256((((toBytes(price) + toBytes(pmt.amount)) + i.caller.bytes) + toBytes(height)))) | |
175 | + | if ((MINORDERTOTAL > pmt.amount)) | |
176 | + | then throw(("min order total equals " + toString(MINORDERTOTAL))) | |
177 | + | else if (isDefined(pmt.assetId)) | |
178 | + | then throw("can use waves only") | |
179 | + | else if ((0 >= price)) | |
180 | + | then throw("price less zero") | |
181 | + | else if ((getOrderOwner(newOrderId) != "")) | |
182 | + | then throw("order exists") | |
183 | + | else { | |
184 | + | let orders = split(orderbook, "_") | |
185 | + | let nextOrderId = if ((position == 0)) | |
186 | + | then "" | |
187 | + | else orders[(position - 1)] | |
188 | + | let nextOrderPrice = getOrderPrice(nextOrderId) | |
189 | + | let isNextOrderError = if (if ((nextOrderId != "")) | |
190 | + | then (price > nextOrderPrice) | |
191 | + | else false) | |
192 | + | then true | |
193 | + | else false | |
194 | + | let prevOrderId = orders[position] | |
195 | + | let prevOrderPrice = getOrderPrice(prevOrderId) | |
196 | + | let isPrevOrderError = if ((prevOrderPrice >= price)) | |
197 | + | then true | |
198 | + | else false | |
199 | + | if (if (isNextOrderError) | |
200 | + | then true | |
201 | + | else isPrevOrderError) | |
202 | + | then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError))) | |
203 | + | 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)]) | |
204 | + | } | |
205 | + | } | |
206 | + | ||
207 | + | ||
208 | + | ||
209 | + | @Callable(i) | |
210 | + | func cancelOrder (orderId) = { | |
211 | + | let owner = getOrderOwner(orderId) | |
212 | + | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
213 | + | if ((owner != toString(i.caller))) | |
214 | + | then throw("permission denied") | |
215 | + | else if ((getOrderStatus(orderId) != NEW)) | |
216 | + | then throw("invalid order status") | |
217 | + | else ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
218 | + | } | |
219 | + | ||
220 | + | ||
221 | + | ||
222 | + | @Callable(i) | |
223 | + | func sellBond () = { | |
224 | + | let bondBalance = assetBalance(this, bondAssetId) | |
225 | + | let deficitPositive = if ((0 >= deficit)) | |
226 | + | then 0 | |
227 | + | else deficit | |
228 | + | let bondAmount = if ((deficitPositive >= bondBalance)) | |
229 | + | then bondBalance | |
230 | + | else deficitPositive | |
231 | + | let returnAmount = if ((deficitPositive >= bondBalance)) | |
232 | + | then 0 | |
233 | + | else (bondBalance - deficitPositive) | |
234 | + | if (if ((returnAmount == 0)) | |
235 | + | then (bondAmount == 0) | |
236 | + | else false) | |
237 | + | then throw("without deficit") | |
238 | + | else if ((bondAmount == 0)) | |
239 | + | then TransferSet([ScriptTransfer(neutrinoContract, returnAmount, bondAssetId)]) | |
240 | + | else if ((orderbook == "")) | |
241 | + | then throw("empty orderbook") | |
242 | + | else { | |
243 | + | let orderId = split(orderbook, "_")[0] | |
244 | + | let filledTotal = getOrderFilledTotal(orderId) | |
245 | + | let orderPrice = getOrderPrice(orderId) | |
246 | + | let freeTotal = (getOrderTotal(orderId) - filledTotal) | |
247 | + | let amount = convertWavesToBond(freeTotal, orderPrice) | |
248 | + | let fillableAmount = if ((bondAmount >= amount)) | |
249 | + | then amount | |
250 | + | else bondAmount | |
251 | + | let total = fraction((fillableAmount * orderPrice), PAULI, 100) | |
252 | + | if (if ((total == 0)) | |
253 | + | then true | |
254 | + | else (amount == 0)) | |
255 | + | then ScriptResult(WriteSet([DataEntry(OrderbookKey, dropOrder(orderId)), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(addressFromStringValue(getOrderOwner(orderId)), freeTotal, unit)])) | |
256 | + | else ScriptResult(WriteSet([DataEntry(OrderbookKey, if ((bondAmount >= amount)) | |
257 | + | then dropOrder(orderId) | |
258 | + | else orderbook), DataEntry(getOrderFilledTotalKey(orderId), (filledTotal + total)), DataEntry(getOrderStatusKey(orderId), if ((bondAmount >= amount)) | |
259 | + | then FILLED | |
260 | + | else NEW), DataEntry(getOrderHistoryKey(height), orderPrice)]), TransferSet([ScriptTransfer(addressFromStringValue(getOrderOwner(orderId)), fillableAmount, bondAssetId), ScriptTransfer(neutrinoContract, total, unit)])) | |
261 | + | } | |
262 | + | } | |
263 | + | ||
264 | + |
github/deemru/w8io/169f3d6 28.75 ms ◑