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