tx · GtW3gBibgPQcnsSgmknLb4U5k9D5tBemAfGF3V925YfL

3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N:  -0.02000000 Waves

2020.05.26 20:53 [1015632] smart account 3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N > SELF 0.00000000 Waves

{ "type": 13, "id": "GtW3gBibgPQcnsSgmknLb4U5k9D5tBemAfGF3V925YfL", "fee": 2000000, "feeAssetId": null, "timestamp": 1590515679734, "version": 1, "sender": "3MxbR7b3gHF4XdQKNTT5aQMRiazHvrVWC8N", "senderPublicKey": "4bj7YXaphTC4Ldx7DqqMmrTjNshRtw1yNsej2XXZcAzS", "proofs": [ "FhEuomYrRg27Fqi8f5RGLjwXM3peyURMDWskkNDX7W3ci3F5astCyuurykHXezGPd7H7LoxYNdbJx2qBJixh9dm", "3X22FA2mZUjFeENrjfJeqsKqm1hjKYEBAqtSQgYpcogCzi7jTWTcYL9RiZGK7v5vAkDmLLtBiCQ2USsJgfVrZ3rH", "2EVmkd3SVgVmqnQMrQqhzuQCQdKUUs2gyNZC9QP7xsbSCbmLi67Q8QPvgnbpeGaFRASjTF6B7QkZaV6TwhGdjucX" ], "script": "base64:AAIDAAAAAAAAABYIARIDCgEBEgQKAgEIEgMKAQgSABIAAAAAOAEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAAAQAAABZnZXRCb29sQnlBZGRyZXNzQW5kS2V5AAAAAgA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5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAACAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAMJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAADAAAAAAAAAAACAAAAAAAAAAAACQAAZwAAAAIFAAAABWNvdW50AAAAAAAAAAADbT7EMg==", "chainId": 84, "height": 1015632, "spentComplexity": 0 } View: original | compacted Prev: 3xvBfT2e68aAGGFdZFWpMKzVBbPW1Rm8rs8RkWjWMhTQ Next: H8wCYZ6UZPhzUhg9Jo3zNPj77upM4U8N4cJ8qEBWhJAk Diff:
OldNewDifferences
250250
251251
252252 @Callable(i)
253-func instantBuyNsbtOrFail (roi,prevOrder) = {
253+func instantBuyNsbtOrFail (roi) = {
254254 let pmt = extract(i.payment)
255- internalAddBuyBondOrder(roi, prevOrder, i, true)
255+ internalAddBuyBondOrder(roi, "", i, true)
256256 }
257257
258258
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getNumberByKey (key) = match getInteger(this, key) {
55 case a: Int =>
66 a
77 case _ =>
88 0
99 }
1010
1111
1212 func getStringByKey (key) = match getString(this, key) {
1313 case a: String =>
1414 a
1515 case _ =>
1616 ""
1717 }
1818
1919
2020 func getBoolByAddressAndKey (address,key) = match getBoolean(address, key) {
2121 case a: Boolean =>
2222 a
2323 case _ =>
2424 false
2525 }
2626
2727
2828 func getStringByAddressAndKey (address,key) = match getString(address, key) {
2929 case a: String =>
3030 a
3131 case _ =>
3232 ""
3333 }
3434
3535
3636 func getNumberByAddressAndKey (address,key) = match getInteger(address, key) {
3737 case a: Int =>
3838 a
3939 case _ =>
4040 0
4141 }
4242
4343
4444 let WAVELET = 100000000
4545
4646 let PAULI = 1000000
4747
4848 let MINORDERTOTAL = (10 * WAVELET)
4949
5050 let MAXROI = 95
5151
5252 let CANCELED = "canceled"
5353
5454 let NEW = "new"
5555
5656 let FILLED = "filled"
5757
5858 let NeutrinoContractKey = "neutrino_contract"
5959
6060 let PriceKey = "price"
6161
6262 let BondAssetIdKey = "bond_asset_id"
6363
6464 let NeutrinoAssetIdKey = "neutrino_asset_id"
6565
6666 let ControlContractKey = "control_contract"
6767
6868 let BalanceLockedkKey = "balance_lock_"
6969
7070 let WavesLockedBalanceKey = (BalanceLockedkKey + "waves")
7171
7272 let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino")
7373
7474 let LiquidationContractKey = "liquidation_contract"
7575
7676 let FirstOrderKey = "order_first"
7777
7878 func getRoiByOrderIdKey (orderId) = ("debug_order_roi_" + orderId)
7979
8080
8181 func getOrderPriceKey (orderId) = ("order_price_" + orderId)
8282
8383
8484 func getOrderTotalKey (orderId) = ("order_total_" + orderId)
8585
8686
8787 func getOrderOwnerKey (orderId) = ("order_owner_" + orderId)
8888
8989
9090 func getOrderHeightKey (orderId) = ("order_height_" + orderId)
9191
9292
9393 func getOrderStatusKey (orderId) = ("order_status_" + orderId)
9494
9595
9696 func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId)
9797
9898
9999 func getPrevOrderKey (orderId) = ("order_prev_" + orderId)
100100
101101
102102 func getNextOrderKey (orderId) = ("order_next_" + orderId)
103103
104104
105105 func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI)
106106
107107
108108 func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET)
109109
110110
111111 func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price)
112112
113113
114114 func convertBondToWaves (amount,price) = convertNeutrinoToWaves(amount, price)
115115
116116
117117 let neutrinoContract = Address(base58'3Mzbx34Ex5rRbn39vUHx9kiwh3nneF8S5we')
118118
119119 let controlContract = Address(base58'3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx')
120120
121121 let liquidationContract = Address(base58'3N5nmMvMH8o3RPEyCKCaoWahBTYTexnZy62')
122122
123123 let neutrinoAssetId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'
124124
125125 let bondAssetId = base58'BGhPYquXSK6UYjnPLEn94gFhetp4Jvf7toekEY4x1VDH'
126126
127127 let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked")
128128
129129 let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey)
130130
131131 let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey)
132132
133133 let reserve = (wavesBalance(neutrinoContract) - getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey))
134134
135135 let neutrinoSupply = (((neutrinoLockedBalance + extract(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId))
136136
137137 let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice))
138138
139139 let firstOrder = getStringByKey(FirstOrderKey)
140140
141141 func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id))
142142
143143
144144 func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id))
145145
146146
147147 func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id))
148148
149149
150150 func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id))
151151
152152
153153 func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id))
154154
155155
156156 func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id))
157157
158158
159159 func getNextOrder (id) = getStringByKey(getNextOrderKey(id))
160160
161161
162162 func internalSellBond (pFirstOrder,pNextOrder,pFilledTotal,pRoi,pPaymentWavelets,orderOwnerAddress) = if ((pFirstOrder == ""))
163163 then throw("empty orderbook")
164164 else {
165165 let priceWavesByBondCents = fraction((100 + pRoi), currentPrice, 100)
166166 let remainedTotal = (pPaymentWavelets - pFilledTotal)
167167 let fillableOrderAmount = convertWavesToBond(remainedTotal, priceWavesByBondCents)
168168 let totalOrderWaveletesRequired = convertBondToWaves(fillableOrderAmount, priceWavesByBondCents)
169169 let nbTokensSellCondition = (fraction(deficit, 100, neutrinoSupply) >= pRoi)
170170 if (!(nbTokensSellCondition))
171171 then throw(("innapropriate roi: " + toString(pRoi)))
172172 else if ((totalOrderWaveletesRequired == 0))
173173 then throw("cannot fill order at the moment")
174174 else {
175175 let changeWavelets = (remainedTotal - totalOrderWaveletesRequired)
176176 let commonWriteSetData = [DataEntry(getOrderFilledTotalKey(firstOrder), (pFilledTotal + totalOrderWaveletesRequired)), DataEntry(getOrderStatusKey(firstOrder), FILLED)]
177177 let commonTransfers = [ScriptTransfer(orderOwnerAddress, fillableOrderAmount, bondAssetId), ScriptTransfer(neutrinoContract, totalOrderWaveletesRequired, unit), ScriptTransfer(orderOwnerAddress, changeWavelets, unit)]
178178 let writeSetData = if ((pFirstOrder == firstOrder))
179179 then [DataEntry(getPrevOrderKey(pNextOrder), ""), DataEntry(FirstOrderKey, pNextOrder)] :: commonWriteSetData
180180 else commonWriteSetData
181181 ScriptResult(WriteSet(writeSetData), TransferSet(commonTransfers))
182182 }
183183 }
184184
185185
186186 func internalAddBuyBondOrder (roi,prevOrder,inv,instant) = {
187187 let pmt = extract(inv.payment)
188188 let newOrderId = toBase58String(inv.transactionId)
189189 if (isBlocked)
190190 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
191191 else if ((MINORDERTOTAL > pmt.amount))
192192 then throw(("min order total equals " + toString(MINORDERTOTAL)))
193193 else if ((roi > MAXROI))
194194 then throw("max setOrder ROI is 95%")
195195 else if (if ((deficit > 0))
196196 then (0 > roi)
197197 else false)
198198 then throw("can't place order with negative roi during deficit")
199199 else if ((-(MAXROI) > roi))
200200 then throw("min setOrder ROI is -95%")
201201 else if ((roi == 0))
202202 then throw("roi should not be equal to 0")
203203 else if (isDefined(pmt.assetId))
204204 then throw("can use waves only")
205205 else if ((getOrderOwner(newOrderId) != ""))
206206 then throw("order exists")
207207 else if (if ((prevOrder != ""))
208208 then (getOrderStatus(prevOrder) != NEW)
209209 else false)
210210 then throw("prev order status is not new")
211211 else {
212212 let isNewOrderAtFirstPosition = (prevOrder == "")
213213 let owner = toString(inv.caller)
214214 let nextOrder = if (isNewOrderAtFirstPosition)
215215 then firstOrder
216216 else getNextOrder(prevOrder)
217217 let nextOrderRoi = getNumberByKey(getRoiByOrderIdKey(nextOrder))
218218 let isNextOrderError = if (if ((nextOrder != ""))
219219 then (roi >= nextOrderRoi)
220220 else false)
221221 then true
222222 else false
223223 let prevOrderRoi = getNumberByKey(getRoiByOrderIdKey(prevOrder))
224224 let isPrevOrderError = if (if ((prevOrder != ""))
225225 then (prevOrderRoi > roi)
226226 else false)
227227 then true
228228 else false
229229 if (if (isNextOrderError)
230230 then true
231231 else isPrevOrderError)
232232 then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError)))
233233 else if (if (isNewOrderAtFirstPosition)
234234 then instant
235235 else false)
236236 then internalSellBond(newOrderId, nextOrder, 0, roi, pmt.amount, inv.caller)
237237 else if (instant)
238238 then throw("Instant order couldn't be added into waiting queue")
239239 else WriteSet([DataEntry(getPrevOrderKey(newOrderId), prevOrder), DataEntry(getNextOrderKey(newOrderId), nextOrder), DataEntry(getNextOrderKey(prevOrder), if ((prevOrder == ""))
240240 then ""
241241 else newOrderId), DataEntry(getPrevOrderKey(nextOrder), if ((nextOrder == ""))
242242 then ""
243243 else newOrderId), DataEntry(FirstOrderKey, if (if ((firstOrder == ""))
244244 then true
245245 else (firstOrder == nextOrder))
246246 then newOrderId
247247 else firstOrder), DataEntry(getOrderTotalKey(newOrderId), pmt.amount), DataEntry(getOrderOwnerKey(newOrderId), owner), DataEntry(getOrderHeightKey(newOrderId), height), DataEntry(getOrderStatusKey(newOrderId), NEW), DataEntry(("debug_order_currentPrice_" + newOrderId), currentPrice), DataEntry(getRoiByOrderIdKey(newOrderId), roi)])
248248 }
249249 }
250250
251251
252252 @Callable(i)
253-func instantBuyNsbtOrFail (roi,prevOrder) = {
253+func instantBuyNsbtOrFail (roi) = {
254254 let pmt = extract(i.payment)
255- internalAddBuyBondOrder(roi, prevOrder, i, true)
255+ internalAddBuyBondOrder(roi, "", i, true)
256256 }
257257
258258
259259
260260 @Callable(i)
261261 func addBuyBondOrder (price,prevOrder) = {
262262 let pmt = extract(i.payment)
263263 let priceWavesByBondCents = fraction(100, 100, price)
264264 let roi = fraction((priceWavesByBondCents - currentPrice), 100, currentPrice)
265265 if ((0 >= price))
266266 then throw("price less zero")
267267 else internalAddBuyBondOrder(roi, prevOrder, i, false)
268268 }
269269
270270
271271
272272 @Callable(i)
273273 func cancelOrder (orderId) = {
274274 let owner = getOrderOwner(orderId)
275275 let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId))
276276 let caller = toString(i.caller)
277277 let nextOrder = getNextOrder(orderId)
278278 let prevOrder = getPrevOrder(orderId)
279279 if (isBlocked)
280280 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
281281 else if ((owner != caller))
282282 then throw("permission denied")
283283 else if ((getOrderStatus(orderId) != NEW))
284284 then throw("invalid order status")
285285 else ScriptResult(WriteSet([DataEntry(FirstOrderKey, if ((firstOrder == orderId))
286286 then nextOrder
287287 else firstOrder), DataEntry(getNextOrderKey(prevOrder), nextOrder), DataEntry(getPrevOrderKey(nextOrder), prevOrder), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
288288 }
289289
290290
291291
292292 @Callable(i)
293293 func sellBond () = if (isBlocked)
294294 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
295295 else if ((firstOrder == ""))
296296 then throw("empty orderbook")
297297 else {
298298 let nextOrder = getNextOrder(firstOrder)
299299 let filledTotal = getOrderFilledTotal(firstOrder)
300300 let orderPrice = getOrderPrice(firstOrder)
301301 let roi = getNumberByKey(getRoiByOrderIdKey(firstOrder))
302302 let paymentWavelets = getOrderTotal(firstOrder)
303303 let orderOwnerAddress = Address(fromBase58String(getOrderOwner(firstOrder)))
304304 internalSellBond(firstOrder, nextOrder, filledTotal, roi, paymentWavelets, orderOwnerAddress)
305305 }
306306
307307
308308
309309 @Callable(i)
310310 func updateReservesAndNeutrinoSupply () = {
311311 func getNumberByKeyInternal (key) = match getInteger(this, key) {
312312 case a: Int =>
313313 a
314314 case _ =>
315315 0
316316 }
317317
318318 let idx = getNumberByKeyInternal("updateReservesAndNeutrinoSupplyIdx")
319319 let newIdx = (idx + 1)
320320 WriteSet([DataEntry("updateReservesAndNeutrinoSupplyIdx", newIdx), DataEntry("reserve", reserve), DataEntry("neutrinoSupply", neutrinoSupply), DataEntry("deficit", deficit)])
321321 }
322322
323323
324324 @Verifier(tx)
325325 func verify () = {
326326 let pubKeyAdminsList = ["GXxmZaCigPgJsT6d1cLr8nUXA65nGX8V7FuAzzrY8wQE", "3xumx4hrPpeeoo79HLGbZCgfz95L39ZFdxxwWeSUC2Pu", "D4CqtK5fBsnzRo33ZMhrM7niLseDH2uRoK6weBq2JQ3A", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"]
327327 let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
328328 then 1
329329 else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
330330 then 1
331331 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2])))
332332 then 1
333333 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3])))
334334 then 2
335335 else 0))
336336 (count >= 3)
337337 }
338338

github/deemru/w8io/169f3d6 
56.91 ms