tx · 8e5TX1FMWdLeqSvHtP1CF35dvmxojnNrYvtbrkZJwH6j

3MpABcPJLQiG9Yxzk3ZV8e2nEbRe1gZHbZe:  -0.02000000 Waves

2020.06.16 18:04 [1046225] smart account 3MpABcPJLQiG9Yxzk3ZV8e2nEbRe1gZHbZe > SELF 0.00000000 Waves

{ "type": 13, "id": "8e5TX1FMWdLeqSvHtP1CF35dvmxojnNrYvtbrkZJwH6j", "fee": 2000000, "feeAssetId": null, "timestamp": 1592319931055, "version": 1, "sender": "3MpABcPJLQiG9Yxzk3ZV8e2nEbRe1gZHbZe", "senderPublicKey": "AixLFScfYY3rkC6MkFBBW8xXM1a6q3i79CUrcgykP4V3", "proofs": [ "v7L8DY72MFhdow84gSJAEqTkAxKniu8euAaYMjbhDQikHriQvbsJz5jhaXfPzhZZVM8gxAKYhnjVBbvaXVwAfT2", "5MVL6SJk29UYXJ7Z1mN8cB4pNuTRYAgT3m4o4CfzQnXYPFEvGR8HSSDEjvGy6qgAHUnjh1Kbz1FcpL3rG1wTmP6K", "2vibLhD3aor5mMYDhq5P43D5bdqDx17QKxr3rQQmJBrV83VviFxPa23RK76jc63ALnAaZHp3eADJgB8LaCkzEbGZ" ], "script": "base64:AAIDAAAAAAAAABYIARIDCgEBEgQKAgEIEgMKAQgSABIAAAAAOQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAAAQAAABZnZXRCb29sQnlBZGRyZXNzQW5k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1pbnNMaXN0AAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAABAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAACAAAAAAAAAAABAAAAAAAAAAAAAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAMJAAJZAAAAAQkAAZEAAAACBQAAABBwdWJLZXlBZG1pbnNMaXN0AAAAAAAAAAADAAAAAAAAAAACAAAAAAAAAAAACQAAZwAAAAIFAAAABWNvdW50AAAAAAAAAAADYUxMwg==", "chainId": 84, "height": 1046225, "spentComplexity": 0 } View: original | compacted Prev: 7aXzT2M3BtjQo56PDyrbf77U47QocVeQh8Yxps2cbmLn Next: 5ThEbLvHfGqPkKRZKQraMMQYKw1N1vqjoaNyfY1Ry4tV Diff:
OldNewDifferences
4444 let WAVELET = 100000000
4545
4646 let PAULI = 1000000
47-
48-let PRICELET = 1000000
4947
5048 let MINORDERTOTAL = (10 * WAVELET)
5149
104102 func getNextOrderKey (orderId) = ("order_next_" + orderId)
105103
106104
107-func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI)
105+func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI)
108106
109107
110-func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET)
108+func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET)
111109
112110
113111 func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price)
254252 func instantBuyNsbtOrFail (roi) = {
255253 let pmt = extract(i.payment)
256254 let priceWavesByBondCents = fraction((100 + roi), currentPrice, 100)
257- let price = ((PRICELET * PRICELET) / priceWavesByBondCents)
255+ let price = ((100 * 100) / priceWavesByBondCents)
258256 internalAddBuyBondOrder(roi, price, "", i, true)
259257 }
260258
263261 @Callable(i)
264262 func addBuyBondOrder (price,prevOrder) = {
265263 let pmt = extract(i.payment)
266- let priceWavesByBondCents = fraction(PRICELET, PRICELET, price)
264+ let priceWavesByBondCents = fraction(100, 100, price)
267265 let roi = fraction((priceWavesByBondCents - currentPrice), 100, currentPrice)
268266 if ((0 >= price))
269267 then throw("price less zero")
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
47-
48-let PRICELET = 1000000
4947
5048 let MINORDERTOTAL = (10 * WAVELET)
5149
5250 let MAXROI = 95
5351
5452 let CANCELED = "canceled"
5553
5654 let NEW = "new"
5755
5856 let FILLED = "filled"
5957
6058 let NeutrinoContractKey = "neutrino_contract"
6159
6260 let PriceKey = "price"
6361
6462 let BondAssetIdKey = "bond_asset_id"
6563
6664 let NeutrinoAssetIdKey = "neutrino_asset_id"
6765
6866 let ControlContractKey = "control_contract"
6967
7068 let BalanceLockedkKey = "balance_lock_"
7169
7270 let WavesLockedBalanceKey = (BalanceLockedkKey + "waves")
7371
7472 let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino")
7573
7674 let LiquidationContractKey = "liquidation_contract"
7775
7876 let FirstOrderKey = "order_first"
7977
8078 func getRoiByOrderIdKey (orderId) = ("debug_order_roi_" + orderId)
8179
8280
8381 func getOrderPriceKey (orderId) = ("order_price_" + orderId)
8482
8583
8684 func getOrderTotalKey (orderId) = ("order_total_" + orderId)
8785
8886
8987 func getOrderOwnerKey (orderId) = ("order_owner_" + orderId)
9088
9189
9290 func getOrderHeightKey (orderId) = ("order_height_" + orderId)
9391
9492
9593 func getOrderStatusKey (orderId) = ("order_status_" + orderId)
9694
9795
9896 func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId)
9997
10098
10199 func getPrevOrderKey (orderId) = ("order_prev_" + orderId)
102100
103101
104102 func getNextOrderKey (orderId) = ("order_next_" + orderId)
105103
106104
107-func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI)
105+func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI)
108106
109107
110-func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET)
108+func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET)
111109
112110
113111 func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price)
114112
115113
116114 func convertBondToWaves (amount,price) = convertNeutrinoToWaves(amount, price)
117115
118116
119117 let neutrinoContract = Address(base58'3MxUeE9rS9G3ap3kSrw67vkjYyTL3QLJnk3')
120118
121119 let controlContract = Address(base58'3MzosTW6DBBjpRwTZUWFhZo6UFW1yrmfdtB')
122120
123121 let liquidationContract = Address(base58'3N1SXpSHeCeqSewbXS79otbnmP89uKUkWyf')
124122
125123 let neutrinoAssetId = base58'EHLhLVDUufqQytiAjBHzPhsPZgqsX6XfSCrVdxYeC4QN'
126124
127125 let bondAssetId = base58'91QmVf3hZQJeUX11nurBX76Quf94kQgVMDesqALsjQFN'
128126
129127 let isBlocked = getBoolByAddressAndKey(controlContract, "is_blocked")
130128
131129 let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey)
132130
133131 let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey)
134132
135133 let reserve = (wavesBalance(neutrinoContract) - getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey))
136134
137135 let neutrinoSupply = (((neutrinoLockedBalance + extract(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId))
138136
139137 let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice))
140138
141139 let firstOrder = getStringByKey(FirstOrderKey)
142140
143141 func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id))
144142
145143
146144 func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id))
147145
148146
149147 func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id))
150148
151149
152150 func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id))
153151
154152
155153 func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id))
156154
157155
158156 func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id))
159157
160158
161159 func getNextOrder (id) = getStringByKey(getNextOrderKey(id))
162160
163161
164162 func orderData (orderId,totalWavelets,owner,status,roi,price) = [DataEntry(getOrderPriceKey(orderId), price), DataEntry(getOrderTotalKey(orderId), totalWavelets), DataEntry(getOrderOwnerKey(orderId), owner), DataEntry(getOrderHeightKey(orderId), height), DataEntry(getOrderStatusKey(orderId), status), DataEntry(("debug_order_currentPrice_" + orderId), currentPrice), DataEntry(getRoiByOrderIdKey(orderId), roi)]
165163
166164
167165 func internalSellBond (pFirstOrder,pNextOrder,pFilledTotal,pRoi,pPrice,pPaymentWavelets,orderOwnerAddress,instantOrder) = {
168166 let priceWavesByBondCents = fraction((100 + pRoi), currentPrice, 100)
169167 let remainedTotal = (pPaymentWavelets - pFilledTotal)
170168 let fillableOrderAmount = convertWavesToBond(remainedTotal, priceWavesByBondCents)
171169 let totalOrderWaveletesRequired = convertBondToWaves(fillableOrderAmount, priceWavesByBondCents)
172170 let nbTokensSellCondition = (fraction(deficit, 100, neutrinoSupply) >= pRoi)
173171 if (!(nbTokensSellCondition))
174172 then throw(("innapropriate roi: " + toString(pRoi)))
175173 else if ((totalOrderWaveletesRequired == 0))
176174 then throw("cannot fill order at the moment")
177175 else {
178176 let changeWavelets = (remainedTotal - totalOrderWaveletesRequired)
179177 let writeSetData = if (instantOrder)
180178 then [DataEntry(getOrderPriceKey(pFirstOrder), pPrice), DataEntry(getOrderTotalKey(pFirstOrder), pPaymentWavelets), DataEntry(getOrderOwnerKey(pFirstOrder), toBase58String(orderOwnerAddress.bytes)), DataEntry(getOrderHeightKey(pFirstOrder), height), DataEntry(getOrderStatusKey(pFirstOrder), FILLED), DataEntry(("debug_order_currentPrice_" + pFirstOrder), currentPrice), DataEntry(getRoiByOrderIdKey(pFirstOrder), pRoi)]
181179 else [DataEntry(getOrderFilledTotalKey(pFirstOrder), (pFilledTotal + totalOrderWaveletesRequired)), DataEntry(getOrderStatusKey(pFirstOrder), FILLED), DataEntry(getOrderTotalKey(pFirstOrder), pPaymentWavelets), DataEntry(getPrevOrderKey(pNextOrder), ""), DataEntry(FirstOrderKey, pNextOrder)]
182180 ScriptResult(WriteSet(writeSetData), TransferSet([ScriptTransfer(orderOwnerAddress, fillableOrderAmount, bondAssetId), ScriptTransfer(neutrinoContract, totalOrderWaveletesRequired, unit), ScriptTransfer(orderOwnerAddress, changeWavelets, unit)]))
183181 }
184182 }
185183
186184
187185 func internalAddBuyBondOrder (roi,price,prevOrder,inv,instantOrder) = {
188186 let pmt = extract(inv.payment)
189187 let newOrderId = toBase58String(inv.transactionId)
190188 if (isBlocked)
191189 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
192190 else if ((MINORDERTOTAL > pmt.amount))
193191 then throw(("min order total equals " + toString(MINORDERTOTAL)))
194192 else if ((roi > MAXROI))
195193 then throw("max setOrder ROI is 95%")
196194 else if (if ((deficit > 0))
197195 then (0 > roi)
198196 else false)
199197 then throw("can't place order with negative roi during deficit")
200198 else if ((-(MAXROI) > roi))
201199 then throw("min setOrder ROI is -95%")
202200 else if ((roi == 0))
203201 then throw("roi should not be equal to 0")
204202 else if (isDefined(pmt.assetId))
205203 then throw("can use waves only")
206204 else if ((getOrderOwner(newOrderId) != ""))
207205 then throw("order exists")
208206 else if (if ((prevOrder != ""))
209207 then (getOrderStatus(prevOrder) != NEW)
210208 else false)
211209 then throw("prev order status is not new")
212210 else {
213211 let isNewOrderAtFirstPosition = (prevOrder == "")
214212 let owner = toString(inv.caller)
215213 let nextOrder = if (isNewOrderAtFirstPosition)
216214 then firstOrder
217215 else getNextOrder(prevOrder)
218216 let nextOrderRoi = getNumberByKey(getRoiByOrderIdKey(nextOrder))
219217 let isNextOrderError = if (if ((nextOrder != ""))
220218 then (roi >= nextOrderRoi)
221219 else false)
222220 then true
223221 else false
224222 let prevOrderRoi = getNumberByKey(getRoiByOrderIdKey(prevOrder))
225223 let isPrevOrderError = if (if ((prevOrder != ""))
226224 then (prevOrderRoi > roi)
227225 else false)
228226 then true
229227 else false
230228 if (if (isNextOrderError)
231229 then true
232230 else isPrevOrderError)
233231 then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError)))
234232 else if (if (isNewOrderAtFirstPosition)
235233 then instantOrder
236234 else false)
237235 then internalSellBond(newOrderId, nextOrder, 0, roi, price, pmt.amount, inv.caller, true)
238236 else if (instantOrder)
239237 then throw("Instant order couldn't be added into waiting queue")
240238 else WriteSet([DataEntry(getPrevOrderKey(newOrderId), prevOrder), DataEntry(getNextOrderKey(newOrderId), nextOrder), DataEntry(getNextOrderKey(prevOrder), if ((prevOrder == ""))
241239 then ""
242240 else newOrderId), DataEntry(getPrevOrderKey(nextOrder), if ((nextOrder == ""))
243241 then ""
244242 else newOrderId), DataEntry(FirstOrderKey, if (if ((firstOrder == ""))
245243 then true
246244 else (firstOrder == nextOrder))
247245 then newOrderId
248246 else firstOrder), orderData(newOrderId, pmt.amount, owner, NEW, roi, price)])
249247 }
250248 }
251249
252250
253251 @Callable(i)
254252 func instantBuyNsbtOrFail (roi) = {
255253 let pmt = extract(i.payment)
256254 let priceWavesByBondCents = fraction((100 + roi), currentPrice, 100)
257- let price = ((PRICELET * PRICELET) / priceWavesByBondCents)
255+ let price = ((100 * 100) / priceWavesByBondCents)
258256 internalAddBuyBondOrder(roi, price, "", i, true)
259257 }
260258
261259
262260
263261 @Callable(i)
264262 func addBuyBondOrder (price,prevOrder) = {
265263 let pmt = extract(i.payment)
266- let priceWavesByBondCents = fraction(PRICELET, PRICELET, price)
264+ let priceWavesByBondCents = fraction(100, 100, price)
267265 let roi = fraction((priceWavesByBondCents - currentPrice), 100, currentPrice)
268266 if ((0 >= price))
269267 then throw("price less zero")
270268 else internalAddBuyBondOrder(roi, price, prevOrder, i, false)
271269 }
272270
273271
274272
275273 @Callable(i)
276274 func cancelOrder (orderId) = {
277275 let owner = getOrderOwner(orderId)
278276 let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId))
279277 let caller = toString(i.caller)
280278 let nextOrder = getNextOrder(orderId)
281279 let prevOrder = getPrevOrder(orderId)
282280 if (isBlocked)
283281 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
284282 else if ((owner != caller))
285283 then throw("permission denied")
286284 else if ((getOrderStatus(orderId) != NEW))
287285 then throw("invalid order status")
288286 else ScriptResult(WriteSet([DataEntry(FirstOrderKey, if ((firstOrder == orderId))
289287 then nextOrder
290288 else firstOrder), DataEntry(getNextOrderKey(prevOrder), nextOrder), DataEntry(getPrevOrderKey(nextOrder), prevOrder), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
291289 }
292290
293291
294292
295293 @Callable(i)
296294 func sellBond () = if (isBlocked)
297295 then throw("contract is blocked by EMERGENCY SHUTDOWN actions until reactivation by emergency oracles")
298296 else if ((firstOrder == ""))
299297 then throw("empty orderbook")
300298 else {
301299 let nextOrder = getNextOrder(firstOrder)
302300 let filledTotal = getOrderFilledTotal(firstOrder)
303301 let orderPrice = getOrderPrice(firstOrder)
304302 let roi = getNumberByKey(getRoiByOrderIdKey(firstOrder))
305303 let paymentWavelets = getOrderTotal(firstOrder)
306304 let orderOwnerAddress = Address(fromBase58String(getOrderOwner(firstOrder)))
307305 internalSellBond(firstOrder, nextOrder, filledTotal, roi, orderPrice, paymentWavelets, orderOwnerAddress, false)
308306 }
309307
310308
311309
312310 @Callable(i)
313311 func updateReservesAndNeutrinoSupply () = {
314312 func getNumberByKeyInternal (key) = match getInteger(this, key) {
315313 case a: Int =>
316314 a
317315 case _ =>
318316 0
319317 }
320318
321319 let idx = getNumberByKeyInternal("updateReservesAndNeutrinoSupplyIdx")
322320 let newIdx = (idx + 1)
323321 WriteSet([DataEntry("updateReservesAndNeutrinoSupplyIdx", newIdx), DataEntry("reserve", reserve), DataEntry("neutrinoSupply", neutrinoSupply), DataEntry("deficit", deficit)])
324322 }
325323
326324
327325 @Verifier(tx)
328326 func verify () = {
329327 let pubKeyAdminsList = ["D96T5UoL7E2FERaEwov9Frx8XFVPNGqZ4TyDiWvn1urJ", "Fk2zgbrRA8KytTVMVy6Df5i4tTEsKaqg6ybh6x6Hehjj", "37f1yE54FyMKwEkg413peq5Gbze9sBavASVeTYbQLTvJ", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"]
330328 let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
331329 then 1
332330 else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
333331 then 1
334332 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2])))
335333 then 1
336334 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3])))
337335 then 2
338336 else 0))
339337 (count >= 3)
340338 }
341339

github/deemru/w8io/026f985 
51.94 ms