tx · 2vtG2vuqFB1gkrbT64yfoefTuLx4FEBEKHSkNVWTLqqc

3MrtHeXquGPcRd3YjJQHfY1Ss6oSDpfxGuL:  -0.01400000 Waves

2019.09.09 23:06 [669008] smart account 3MrtHeXquGPcRd3YjJQHfY1Ss6oSDpfxGuL > SELF 0.00000000 Waves

{ "type": 13, "id": "2vtG2vuqFB1gkrbT64yfoefTuLx4FEBEKHSkNVWTLqqc", "fee": 1400000, "feeAssetId": null, "timestamp": 1568059649841, "version": 1, "sender": "3MrtHeXquGPcRd3YjJQHfY1Ss6oSDpfxGuL", "senderPublicKey": "3nmDHSgwcZ79tNbGjppGBY9MbYm4qLZEJcZ32D2WmxkG", "proofs": [ "2qz9sARqQrQEiBwLF7PSthGruzgADnVHPHdPabHJSDwggasedqX3q4f6ZzRYeNHyFwYFzX8c31dWGWMawus1YrGZ" ], "script": "base64:AAIDAAAAAAAAAAAAAABDAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAADGdldEJvb2xCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAHQm9vbGVhbgQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQcBAAAAGGdldE51bWJlckJ5S2V5QW5kQWRkcmVzcwAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByR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AAAgUAAAAMbm9kZVByb3ZpZGVyBQAAAAVibG9jawMJAAAAAAAAAgkBAAAAEWlzU2VudE5vZGVCYWxhbmNlAAAAAgUAAAAMbm9kZVByb3ZpZGVyBQAAAAVibG9jawYJAAACAAAAAQIAAAAPZnVuZHMgd2VyZSBzZW50AwkAAGYAAAACBQAAAAZoZWlnaHQJAABkAAAAAgUAAAAFYmxvY2sFAAAAEUFwcGx5QmxvY2tUaW1lb3V0CQAAAgAAAAEJAAEsAAAAAgkAASwAAAACAgAAABthcHBseSBzZXR0aW5nIHRpbWUgZXhwaXJlICgJAAGkAAAAAQkAAGQAAAACBQAAAAVibG9jawUAAAARQXBwbHlCbG9ja1RpbWVvdXQCAAAAASkJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAABRJc1NlbnROb2RlQmFsYW5jZUtleQUAAAAMbm9kZVByb3ZpZGVyBQAAAA9MaXN0U3BsaXRTeW1ib2wJAAGkAAAAAQUAAAAFYmxvY2sGBQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAxub2RlUHJvdmlkZXIFAAAACm5vZGVBbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAABCGz5B", "chainId": 84, "height": 669008, "spentComplexity": 0 } View: original | compacted Prev: 8KJ96TC6unKnXX6iuHjjY1AYvFtwFmxwbPqvgYagvevL Next: 56HhfMQMKU1CCYdEKMTkyyyiPBpn6rSpgAxRhhaNpeRa 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 getBoolByKey (key) = match getBoolean(this, key) {
2121 case a: Boolean =>
2222 a
2323 case _ =>
2424 false
2525 }
2626
2727
2828 func getNumberByKeyAndAddress (address,key) = match getInteger(addressFromStringValue(address), key) {
2929 case a: Int =>
3030 a
3131 case _ =>
3232 0
3333 }
3434
3535
3636 func getStringByKeyAndAddress (address,key) = match getString(addressFromStringValue(address), key) {
3737 case a: String =>
3838 a
3939 case _ =>
4040 ""
4141 }
4242
4343
4444 func getBoolByKeyAndAddress (address,key) = match getBoolean(addressFromStringValue(address), key) {
4545 case a: Boolean =>
4646 a
4747 case _ =>
4848 false
4949 }
5050
5151
5252 let ListSplitSymbol = "_"
5353
5454 let SnapshotBlockExpire = 10
5555
5656 let BalanceLockBlock = 2
5757
5858 let ListDataSplitSymbol = "+"
5959
6060 let Wavelet = 100000000
6161
6262 let MinimalBondOrder = (10 * Wavelet)
6363
6464 let MinimalSurplus = (10 * Wavelet)
6565
6666 let ApplyBlockTimeout = 10
6767
6868 let LeaseContractKey = "lease_contract"
6969
7070 let NeutrinoAssetIdKey = "neutrino_asset_id"
7171
7272 let BondAssetIdKey = "bond_asset_id"
7373
7474 let AuctionContractKey = "auction_contract"
7575
7676 let PriceKey = "price"
7777
7878 let NeutrinoSupplyKey = "neutrino_supply"
7979
8080 let WavesReserveKey = "waves_reserve"
8181
8282 let NeutrinoBalanceKey = "neutrino_"
8383
8484 let WavesBalanceKey = "waves_"
8585
8686 let BalanceBlockKey = "balance_block_"
8787
8888 let OrderbookKey = "orderbook"
8989
9090 let OrderTotalKey = "order_total_"
9191
9292 let OrderOwnerKey = "order_owner_"
9393
9494 let OrderHeightKey = "order_height_"
9595
9696 let OrderbookTotalKey = "orderbook_total"
9797
9898 let OrderbookTotalSnapshotKey = "orderbook_total_snapshot"
9999
100100 let SurplusKey = "surplus"
101101
102102 let SnapshotBlockKey = "snapshot_block"
103103
104104 let OrderbookSnapshotKey = "orderbook_snapshot"
105105
106106 let BondGeneratedBlockKey = "bond_generated_block"
107107
108108 let AccountSnapshotBlockKey = "account_snapshot_block_"
109109
110110 let AccountSnapshotOwnerKey = "account_snapshot_owner_"
111111
112112 let AccountSnapshotAmountKey = "account_snapshot_amount_"
113113
114114 let AccountSnapshotNodeKey = "account_snapshot_node_"
115115
116116 let SnapshotNodeBalanceKey = "snapshot_node_balance_"
117117
118118 let NodeBalanceKey = "node_balance_"
119119
120120 let IsSentNodeBalanceKey = "is_sent_node_balance_"
121121
122122 let NodeProviderStatus = "node_status"
123123
124124 let price = getNumberByKey(PriceKey)
125125
126126 let reserve = getNumberByKey(WavesReserveKey)
127127
128128 let neutrinoSupply = getNumberByKey(NeutrinoSupplyKey)
129129
130130 let orderbookTotal = getNumberByKey(OrderbookTotalKey)
131131
132132 let orderbook = getStringByKey(OrderbookKey)
133133
134134 let surplus = getNumberByKey(SurplusKey)
135135
136136 let snapshotBlock = getNumberByKey(SnapshotBlockKey)
137137
138138 let lastBondGenerated = getNumberByKey(BondGeneratedBlockKey)
139139
140140 let orderbookSnapshot = getStringByKey(OrderbookSnapshotKey)
141141
142142 let orderbookTotalSnapshot = getNumberByKey(OrderbookTotalSnapshotKey)
143143
144144 let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey))
145145
146146 let bondAssetId = fromBase58String(getStringByKey(BondAssetIdKey))
147147
148148 let auctionContract = getStringByKey(AuctionContractKey)
149149
150150 let leaseContract = getStringByKey(LeaseContractKey)
151151
152152 let bondSupply = {
153153 let info = extract(assetInfo(bondAssetId))
154154 (info.quantity - assetBalance(this, bondAssetId))
155155 }
156156
157157 func getWavesBalance (owner) = getNumberByKey((WavesBalanceKey + owner))
158158
159159
160160 func getNeutrinoBalance (owner) = getNumberByKey((NeutrinoBalanceKey + owner))
161161
162162
163163 func getBalanceBlock (owner) = getNumberByKey((BalanceBlockKey + owner))
164164
165165
166166 func getOrderTotal (id) = getNumberByKey((OrderTotalKey + id))
167167
168168
169169 func getOrderOwner (id) = getStringByKey((OrderOwnerKey + id))
170170
171171
172172 func getAccountSnapshotBlock (id) = getNumberByKey((AccountSnapshotBlockKey + id))
173173
174174
175175 func getAccountSnapshotOwner (id) = getStringByKey((AccountSnapshotOwnerKey + id))
176176
177177
178178 func getAccountSnapshotAmount (id) = getNumberByKey((AccountSnapshotAmountKey + id))
179179
180180
181181 func getNodeBalance (address,block) = getNumberByKeyAndAddress(leaseContract, (((NodeBalanceKey + address) + ListSplitSymbol) + toString(block)))
182182
183183
184184 func isSentNodeBalance (address,block) = getBoolByKey((((IsSentNodeBalanceKey + address) + ListSplitSymbol) + toString(block)))
185185
186186
187187 @Callable(i)
188188 func setCurrentPrice (price) = WriteSet([DataEntry(PriceKey, price)])
189189
190190
191191
192192 @Callable(i)
193193 func swapWavesToNeutrino () = {
194194 let pmt = extract(i.payment)
195195 if (isDefined(pmt.assetId))
196196 then throw("can use waves only")
197197 else {
198198 let account = toBase58String(i.caller.bytes)
199199 let amount = (((pmt.amount * price) / 100) + getNeutrinoBalance(account))
200200 WriteSet([DataEntry((NeutrinoBalanceKey + toString(i.caller)), amount), DataEntry((BalanceBlockKey + toString(i.caller)), height), DataEntry(WavesReserveKey, (reserve + pmt.amount)), DataEntry(NeutrinoSupplyKey, (neutrinoSupply + amount))])
201201 }
202202 }
203203
204204
205205
206206 @Callable(i)
207207 func swapNeutrinoToWaves () = {
208208 let pmt = extract(i.payment)
209209 if ((pmt.assetId != neutrinoAssetId))
210210 then throw("can use neutrino only")
211211 else {
212212 let account = toBase58String(i.caller.bytes)
213213 let amount = (((pmt.amount / price) * 100) + getWavesBalance(account))
214214 WriteSet([DataEntry((WavesBalanceKey + toString(i.caller)), amount), DataEntry((BalanceBlockKey + toString(i.caller)), height), DataEntry(WavesReserveKey, (reserve - amount)), DataEntry(NeutrinoSupplyKey, (neutrinoSupply - pmt.amount))])
215215 }
216216 }
217217
218218
219219
220220 @Callable(i)
221221 func withdraw (account) = if (((getBalanceBlock(account) + BalanceLockBlock) > height))
222222 then throw("wait a couple of blocks for withdraw")
223223 else ScriptResult(WriteSet([DataEntry((WavesBalanceKey + account), 0), DataEntry((NeutrinoBalanceKey + account), 0)]), TransferSet([ScriptTransfer(i.caller, getNeutrinoBalance(account), neutrinoAssetId), ScriptTransfer(i.caller, getWavesBalance(account), unit)]))
224224
225225
226226
227227 @Callable(i)
228228 func generateBond () = {
229229 let deficit = (neutrinoSupply - (((reserve * price) / 100) / Wavelet))
230230 if (if ((deficit >= MinimalBondOrder))
231231 then (height > (lastBondGenerated + SnapshotBlockExpire))
232232 else false)
233233 then ScriptResult(WriteSet([DataEntry(BondGeneratedBlockKey, height)]), TransferSet([ScriptTransfer(addressFromStringValue(auctionContract), (deficit / Wavelet), bondAssetId)]))
234234 else throw(("deficit did not reach the threshold. deficit =" + toString(deficit)))
235235 }
236236
237237
238238
239239 @Callable(i)
240240 func setOrder () = {
241241 let pmt = extract(i.payment)
242242 let newOrderId = toBase58String(keccak256(((toBytes(pmt.amount) + i.caller.bytes) + toBytes(height))))
243243 if ((pmt.assetId != bondAssetId))
244244 then throw("can use bond only")
245245 else if ((getOrderOwner(newOrderId) != ""))
246246 then throw("order exists")
247247 else WriteSet([DataEntry(OrderbookTotalKey, (orderbookTotal + pmt.amount)), DataEntry(OrderbookKey, ((orderbook + newOrderId) + ListSplitSymbol)), DataEntry((OrderTotalKey + newOrderId), pmt.amount), DataEntry((OrderOwnerKey + newOrderId), toString(i.caller)), DataEntry((OrderHeightKey + newOrderId), height)])
248248 }
249249
250250
251251
252252 @Callable(i)
253253 func cancelOrder (orderId) = {
254254 let owner = getOrderOwner(orderId)
255255 let total = getOrderTotal(orderId)
256256 if ((owner != toString(i.caller)))
257257 then throw("permission denied")
258258 else {
259259 let newOrderBookOnePart = split(orderbook, (orderId + ListSplitSymbol))[0]
260260 let newOrderBookTwoPart = split(orderbook, (orderId + ListSplitSymbol))[1]
261261 ScriptResult(WriteSet([DataEntry(OrderbookTotalKey, (orderbookTotal - total)), DataEntry(OrderbookKey, (newOrderBookOnePart + newOrderBookTwoPart)), DataEntry((OrderTotalKey + orderId), 0)]), TransferSet([ScriptTransfer(i.caller, total, unit)]))
262262 }
263263 }
264264
265265
266266
267267 @Callable(i)
268268 func executeOrder () = {
269269 let orderId = split(orderbookSnapshot, ListSplitSymbol)[0]
270270 let orderTotal = getOrderTotal(orderId)
271271 if ((0 >= surplus))
272272 then throw("surplus is less than zero")
273273 else {
274274 let parts = split(orderbook, (orderId + ListSplitSymbol))
275275 let newActualOrderbook = (parts[0] + parts[1])
276276 let amount = ((orderTotal - (surplus / Wavelet)) * Wavelet)
277277 ScriptResult(WriteSet([DataEntry(OrderbookTotalKey, (orderbookTotal - (if ((surplus >= orderTotal))
278278 then orderTotal
279279 else surplus))), DataEntry(OrderbookKey, newActualOrderbook), DataEntry(OrderbookSnapshotKey, split(orderbookSnapshot, (orderId + ListSplitSymbol))[1]), DataEntry((OrderTotalKey + orderId), if ((0 >= amount))
280280 then 0
281281 else amount)]), TransferSet([ScriptTransfer(i.caller, if ((surplus >= orderTotal))
282282 then (orderTotal * Wavelet)
283283 else surplus, neutrinoAssetId)]))
284284 }
285285 }
286286
287287
288288
289289 @Callable(i)
290290 func createSnapshot () = {
291291 let newSurplus = (((reserve * price) / 100) - neutrinoSupply)
292292 if (if ((0 >= newSurplus))
293293 then true
294294 else (MinimalSurplus > newSurplus))
295295 then throw("surplus is less minimum")
296296 else if ((height >= (snapshotBlock + SnapshotBlockExpire)))
297297 then WriteSet([DataEntry(OrderbookSnapshotKey, orderbook), DataEntry(OrderbookTotalSnapshotKey, orderbookTotal), DataEntry(SnapshotBlockKey, height), DataEntry(SurplusKey, surplus)])
298298 else throw("error create new snapshot")
299299 }
300300
301301
302302
303303 @Callable(i)
304304 func snapshotNeutrino (address) = {
305305 let owner = addressFromStringValue(address)
306306 let userNeutrinoBalance = assetBalance(owner, neutrinoAssetId)
307307 let userBondBalance = assetBalance(owner, bondAssetId)
308308 let amount = (userBondBalance + userNeutrinoBalance)
309309 let id = toBase58String(keccak256(((toBytes(amount) + owner.bytes) + toBytes(height))))
310310 if ((getAccountSnapshotOwner(id) != ""))
311311 then throw("id exists")
312312 else WriteSet([DataEntry((AccountSnapshotAmountKey + id), amount), DataEntry((AccountSnapshotBlockKey + id), height), DataEntry((AccountSnapshotOwnerKey + id), toString(i.caller))])
313313 }
314314
315315
316316
317317 @Callable(i)
318318 func getNewNeutrino (id) = {
319319 let userNeutrinoBalance = assetBalance(i.caller, neutrinoAssetId)
320320 let userBondBalance = assetBalance(i.caller, bondAssetId)
321321 let allowBond = (bondSupply - orderbookTotalSnapshot)
322322 let balanceSurplus = (surplus - (orderbookTotalSnapshot * Wavelet))
323323 let block = getAccountSnapshotBlock(id)
324324 let amount = getAccountSnapshotAmount(id)
325325 if ((0 >= balanceSurplus))
326326 then throw("surplus is less than zero")
327327 else if ((block > snapshotBlock))
328328 then throw("wait new snapshot")
329329 else if ((amount > (userBondBalance + userNeutrinoBalance)))
330330 then throw("invalid balance snapshot")
331331 else ScriptResult(WriteSet([DataEntry((AccountSnapshotAmountKey + id), 0), DataEntry((AccountSnapshotBlockKey + id), 0)]), TransferSet([ScriptTransfer(i.caller, ((balanceSurplus * ((amount * 100) / (neutrinoSupply + allowBond))) / 100), neutrinoAssetId)]))
332332 }
333333
334334
335335
336336 @Callable(i)
337337 func sendToLeasing (nodeProvider,block) = {
338338 let nodeAmount = getNodeBalance(nodeProvider, block)
339339 if ((isSentNodeBalance(nodeProvider, block) == true))
340340 then throw("funds were sent")
341341 else if ((height > (block + ApplyBlockTimeout)))
342342 then throw((("apply setting time expire (" + toString((block + ApplyBlockTimeout))) + ")"))
343343 else ScriptResult(WriteSet([DataEntry((((IsSentNodeBalanceKey + nodeProvider) + ListSplitSymbol) + toString(block)), true)]), TransferSet([ScriptTransfer(addressFromStringValue(nodeProvider), nodeAmount, unit)]))
344344 }
345345
346346

github/deemru/w8io/169f3d6 
45.81 ms