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