tx · 6AJwR1jxJ9NbM93yMdetQKi9hVU76g2ttQ7fvuJcyEwK 3N6mVEULck7uViUaDo1wi98wch9XzYNXriv: -1.00000000 Waves 2019.02.22 09:22 [506105] smart asset 3N6mVEULck7uViUaDo1wi98wch9XzYNXriv > SELF 0.00000000 exchange
{ "type": 15, "id": "6AJwR1jxJ9NbM93yMdetQKi9hVU76g2ttQ7fvuJcyEwK", "fee": 100000000, "feeAssetId": null, "timestamp": 1550816609817, "version": 1, "sender": "3N6mVEULck7uViUaDo1wi98wch9XzYNXriv", "senderPublicKey": "GMCkL2F7fYotQtrpQq5sjNm5cjpR7CSfawr9kMSKLHVs", "proofs": [ "2ajfWifptyv4KPBEQ3ZTyTbVzYQEyfVeZPef9tE32eSNzfWfvcSLJYGzCAdhviEpUQpSAhpL8P6dWVpt5RPPqmMu" ], "assetId": "CdAw5Uu1A9RT6jafc9cQSUy16naaYjzYgcVWDY8xGw8z", "script": "base64:AQQAAAAKaGVpZ2h0RGlmZgAAAAAAAAAAAwQAAAAOcHJpY2VEaWZmQ29uc3QAAAAAAAACisgEAAAAD2V4cGlyYXRpb25Ib3VycwAAAAAAAAAAGAQAAAANbWF4RXhwaXJhdGlvbgkAAGgAAAACCQAAaAAAAAIJAABoAAAAAgUAAAAPZXhwaXJhdGlvbkhvdXJzAAAAAAAAAAA8AAAAAAAAAAA8AAAAAAAAAAPoBAAAAAtzdGFydEhlaWdodAAAAAAAAAe4+wQAAAAGY3ljbGVzCQAAaQAAAAIJAABlAAAAAgUAAAAGaGVpZ2h0BQAAAAtzdGFydEhlaWdodAUAAAAKaGVpZ2h0RGlmZgQAAAAJcHJpY2VEaWZmCQAAaAAAAAIFAAAADnByaWNlRGlmZkNvbnN0BQAAAAZjeWNsZXMEAAAADXN0YXJ0QnV5UHJpY2UAAAAAAAD+T+gEAAAAC21pbkJ1eVByaWNlCQAAZAAAAAIFAAAADXN0YXJ0QnV5UHJpY2UFAAAACXByaWNlRGlmZgQAAAAMbWF4QnV5QW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0RlZmluZWQAAAABCAgIBQAAAAFlAAAACGJ1eU9yZGVyAAAACWFzc2V0UGFpcgAAAApwcmljZUFzc2V0CQAAAgAAAAEFAAAADWJ1eVByaWNlRXJyb3IGBwMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAF01hc3NUcmFuc2ZlclRyYW5zYWN0aW9uBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPQnVyblRyYW5zYWN0aW9uBgkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBgaqC6Hc", "chainId": 84, "height": 506105, "spentComplexity": 0 } View: original | compacted Prev: 5nUbPfm2kKgMKvsRXAicw8nBRWqFAytfmvr6BbweaECd Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 1 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | - | let minBuyPrice = 16666900 | |
4 | - | let minSellPrice = 16667200 | |
3 | + | let heightDiff = 3 | |
4 | + | let priceDiffConst = 166600 | |
5 | + | let expirationHours = 24 | |
6 | + | let maxExpiration = (((expirationHours * 60) * 60) * 1000) | |
7 | + | let startHeight = 506107 | |
8 | + | let cycles = ((height - startHeight) / heightDiff) | |
9 | + | let priceDiff = (priceDiffConst * cycles) | |
10 | + | let startBuyPrice = 16666600 | |
11 | + | let minBuyPrice = (startBuyPrice + priceDiff) | |
12 | + | let maxBuyAmount = 66600000000 | |
13 | + | let startSellPrice = 16666900 | |
14 | + | let minSellPrice = (startSellPrice + priceDiff) | |
15 | + | let minSellAmount = 600000000 | |
16 | + | let expirationError = "Order life must be <= 24 hours" | |
17 | + | let buyAmountError = ("Buy amount must be <= " + toString((maxBuyAmount / 100000000))) | |
18 | + | let buyPriceError = (((("Buy price must be <= " + toString(minBuyPrice)) + " wavelets in Cycle # ") + toString(cycles)) + ". Wait next Cycle") | |
19 | + | let sellAmountError = ("Sell amount must be >= " + toString((minSellAmount / 100000000))) | |
20 | + | let sellPriceError = (((("Sell price must be >= " + toString(minSellPrice)) + " wavelets in Cycle # ") + toString(cycles)) + ". Wait next Cycle") | |
5 | 21 | match tx { | |
6 | 22 | case e: ExchangeTransaction => | |
7 | - | | |
8 | - | | |
9 | - | | |
10 | - | | |
11 | - | | |
12 | - | | |
13 | - | | |
14 | - | | |
23 | + | if (((e.sellOrder.expiration - e.sellOrder.timestamp) > maxExpiration)) | |
24 | + | then throw(expirationError) | |
25 | + | else { | |
26 | + | let sell = sigVerify(e.sellOrder.bodyBytes, e.sellOrder.proofs[0], e.sellOrder.senderPublicKey) | |
27 | + | let buy = sigVerify(e.buyOrder.bodyBytes, e.buyOrder.proofs[0], e.buyOrder.senderPublicKey) | |
28 | + | if (if (sell) | |
29 | + | then buy | |
30 | + | else false) | |
15 | 31 | then true | |
16 | - | else isDefined(e.sellOrder.assetPair.priceAsset)) | |
17 | - | then throw() | |
18 | - | else true | |
19 | - | else if (if ((e.buyOrder.price > minBuyPrice)) | |
20 | - | then true | |
21 | - | else isDefined(e.buyOrder.assetPair.priceAsset)) | |
22 | - | then throw() | |
23 | - | else true | |
32 | + | else if (sell) | |
33 | + | then if ((minSellAmount > e.sellOrder.amount)) | |
34 | + | then throw(sellAmountError) | |
35 | + | else if (if ((minSellPrice > e.sellOrder.price)) | |
36 | + | then true | |
37 | + | else isDefined(e.sellOrder.assetPair.priceAsset)) | |
38 | + | then throw(sellPriceError) | |
39 | + | else true | |
40 | + | else if (buy) | |
41 | + | then if ((e.buyOrder.amount > maxBuyAmount)) | |
42 | + | then throw(buyAmountError) | |
43 | + | else if (if ((e.buyOrder.price > minBuyPrice)) | |
44 | + | then true | |
45 | + | else isDefined(e.buyOrder.assetPair.priceAsset)) | |
46 | + | then throw(buyPriceError) | |
47 | + | else true | |
48 | + | else false | |
49 | + | } | |
50 | + | case _: MassTransferTransaction|BurnTransaction|TransferTransaction => | |
51 | + | true | |
24 | 52 | case _ => | |
25 | 53 | true | |
26 | 54 | } |
github/deemru/w8io/169f3d6 42.39 ms ◑