tx · 3Q2KWr3DkdbTpjDvfbHvvusfFs2pteJRB2cSgKvqLaSD 3N6mVEULck7uViUaDo1wi98wch9XzYNXriv: -1.00000000 Waves 2019.02.22 07:07 [505970] smart asset 3N6mVEULck7uViUaDo1wi98wch9XzYNXriv > SELF 0.00000000 test exchange
{ "type": 15, "id": "3Q2KWr3DkdbTpjDvfbHvvusfFs2pteJRB2cSgKvqLaSD", "fee": 100000000, "feeAssetId": null, "timestamp": 1550808427792, "version": 1, "sender": "3N6mVEULck7uViUaDo1wi98wch9XzYNXriv", "senderPublicKey": "GMCkL2F7fYotQtrpQq5sjNm5cjpR7CSfawr9kMSKLHVs", "proofs": [ "2du8cjoccDUVZmAqSjpk9B8Wg25vH8yAnZg5M3Z6nUfoVpyMVwatqRWgWu1PKxNFfd5HGBSongGi3ZeJKAYaJtA1" ], "assetId": "AykeKGsut1Qdg5khPSYPBZj3iNorAVjJBm7bn7zahUMq", "script": "base64:AQQAAAAKaGVpZ2h0RGlmZgAAAAAAAAAABQQAAAAOcHJpY2VEaWZmQ29uc3QAAAAAAAABhqAEAAAAD2V4cGlyYXRpb25Ib3VycwAAAAAAAAAAGAQAAAANbWF4RXhwaXJhdGlvbgkAAGgAAAACCQAAaAAAAAIJAABoAAAAAgUAAAAPZXhwaXJhdGlvbkhvdXJzAAAAAAAAAAA8AAAAAAAAAAA8AAAAAAAAAAPoBAAAAAtzdGFydEhlaWdodAAAAAAAAAe4cgQAAAAGY3ljbGVzCQAAaQAAAAIJAABlAAAAAgUAAAAGaGVpZ2h0BQAAAAtzdGFydEhlaWdodAUAAAAKaGVpZ2h0RGlmZgQAAAAJcHJpY2VEaWZmCQAAaAAAAAIFAAAADnByaWNlRGlmZkNvbnN0BQAAAAZjeWNsZXMEAAAADXN0YXJ0QnV5UHJpY2UAAAAAAACYloAEAAAAC21pbkJ1eVByaWNlCQAAZAAAAAIFAAAADXN0YXJ0QnV5UHJpY2UFAAAACXByaWNlRGlmZgQAAAAMbWF4QnV5QW1vd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FAAAADWJ1eVByaWNlRXJyb3IGBwMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAF01hc3NUcmFuc2ZlclRyYW5zYWN0aW9uBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPQnVyblRyYW5zYWN0aW9uBgkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwBgYnIh0X", "chainId": 84, "height": 505970, "spentComplexity": 0 } View: original | compacted Prev: e7aD8VxeDQUKugjvfAZsaqfBKci7oxzsweEEr4Uq2db Next: JCzH6pUjBts7aP6x1adRZVK3XBoWy9EVX74DZXY3Ae8b Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 1 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | + | let heightDiff = 5 | |
4 | + | let priceDiffConst = 100000 | |
5 | + | let expirationHours = 24 | |
6 | + | let maxExpiration = (((expirationHours * 60) * 60) * 1000) | |
7 | + | let startHeight = 505970 | |
8 | + | let cycles = ((height - startHeight) / heightDiff) | |
9 | + | let priceDiff = (priceDiffConst * cycles) | |
10 | + | let startBuyPrice = 10000000 | |
11 | + | let minBuyPrice = (startBuyPrice + priceDiff) | |
12 | + | let maxBuyAmount = 1000000000 | |
13 | + | let startSellPrice = 10000000 | |
14 | + | let minSellPrice = (startSellPrice + priceDiff) | |
15 | + | let minSellAmount = 10000000 | |
16 | + | let expirationError = "Expiration must be <= 24 hours" | |
17 | + | let buyAmountError = ("Buy amount must be <= " + toString((maxBuyAmount / 100000000))) | |
18 | + | let buyPriceError = (((("Buy price must be <= " + toString(minBuyPrice)) + " wavelets (cycles: ") + toString(cycles)) + ")") | |
19 | + | let sellAmountError = ("Sell amount must be >= " + toString((minSellAmount / 100000000))) | |
20 | + | let sellPriceError = (((("Sell price must be >= " + toString(minSellPrice)) + " wavelets (cycles: ") + toString(cycles)) + ")") | |
3 | 21 | match tx { | |
4 | 22 | case e: ExchangeTransaction => | |
5 | - | if (((e.sellOrder.expiration - e.sellOrder.timestamp) > | |
6 | - | then throw( | |
23 | + | if (((e.sellOrder.expiration - e.sellOrder.timestamp) > maxExpiration)) | |
24 | + | then throw(expirationError) | |
7 | 25 | else { | |
8 | 26 | let sell = sigVerify(e.sellOrder.bodyBytes, e.sellOrder.proofs[0], e.sellOrder.senderPublicKey) | |
9 | 27 | let buy = sigVerify(e.buyOrder.bodyBytes, e.buyOrder.proofs[0], e.buyOrder.senderPublicKey) | |
10 | 28 | if (sell) | |
11 | - | then if (( | |
12 | - | then throw( | |
13 | - | else if (if (( | |
29 | + | then if ((minSellAmount > e.sellOrder.amount)) | |
30 | + | then throw(sellAmountError) | |
31 | + | else if (if ((minSellPrice > e.sellOrder.price)) | |
14 | 32 | then true | |
15 | 33 | else isDefined(e.sellOrder.assetPair.priceAsset)) | |
16 | - | then throw( | |
34 | + | then throw(sellPriceError) | |
17 | 35 | else true | |
18 | 36 | else if (buy) | |
19 | - | then if ((e.buyOrder.amount > | |
20 | - | then throw( | |
21 | - | else if (if ((e.buyOrder.price > | |
37 | + | then if ((e.buyOrder.amount > maxBuyAmount)) | |
38 | + | then throw(buyAmountError) | |
39 | + | else if (if ((e.buyOrder.price > minBuyPrice)) | |
22 | 40 | then true | |
23 | 41 | else isDefined(e.buyOrder.assetPair.priceAsset)) | |
24 | - | then throw( | |
42 | + | then throw(buyPriceError) | |
25 | 43 | else true | |
26 | 44 | else false | |
27 | 45 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 1 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | + | let heightDiff = 5 | |
4 | + | let priceDiffConst = 100000 | |
5 | + | let expirationHours = 24 | |
6 | + | let maxExpiration = (((expirationHours * 60) * 60) * 1000) | |
7 | + | let startHeight = 505970 | |
8 | + | let cycles = ((height - startHeight) / heightDiff) | |
9 | + | let priceDiff = (priceDiffConst * cycles) | |
10 | + | let startBuyPrice = 10000000 | |
11 | + | let minBuyPrice = (startBuyPrice + priceDiff) | |
12 | + | let maxBuyAmount = 1000000000 | |
13 | + | let startSellPrice = 10000000 | |
14 | + | let minSellPrice = (startSellPrice + priceDiff) | |
15 | + | let minSellAmount = 10000000 | |
16 | + | let expirationError = "Expiration must be <= 24 hours" | |
17 | + | let buyAmountError = ("Buy amount must be <= " + toString((maxBuyAmount / 100000000))) | |
18 | + | let buyPriceError = (((("Buy price must be <= " + toString(minBuyPrice)) + " wavelets (cycles: ") + toString(cycles)) + ")") | |
19 | + | let sellAmountError = ("Sell amount must be >= " + toString((minSellAmount / 100000000))) | |
20 | + | let sellPriceError = (((("Sell price must be >= " + toString(minSellPrice)) + " wavelets (cycles: ") + toString(cycles)) + ")") | |
3 | 21 | match tx { | |
4 | 22 | case e: ExchangeTransaction => | |
5 | - | if (((e.sellOrder.expiration - e.sellOrder.timestamp) > | |
6 | - | then throw( | |
23 | + | if (((e.sellOrder.expiration - e.sellOrder.timestamp) > maxExpiration)) | |
24 | + | then throw(expirationError) | |
7 | 25 | else { | |
8 | 26 | let sell = sigVerify(e.sellOrder.bodyBytes, e.sellOrder.proofs[0], e.sellOrder.senderPublicKey) | |
9 | 27 | let buy = sigVerify(e.buyOrder.bodyBytes, e.buyOrder.proofs[0], e.buyOrder.senderPublicKey) | |
10 | 28 | if (sell) | |
11 | - | then if (( | |
12 | - | then throw( | |
13 | - | else if (if (( | |
29 | + | then if ((minSellAmount > e.sellOrder.amount)) | |
30 | + | then throw(sellAmountError) | |
31 | + | else if (if ((minSellPrice > e.sellOrder.price)) | |
14 | 32 | then true | |
15 | 33 | else isDefined(e.sellOrder.assetPair.priceAsset)) | |
16 | - | then throw( | |
34 | + | then throw(sellPriceError) | |
17 | 35 | else true | |
18 | 36 | else if (buy) | |
19 | - | then if ((e.buyOrder.amount > | |
20 | - | then throw( | |
21 | - | else if (if ((e.buyOrder.price > | |
37 | + | then if ((e.buyOrder.amount > maxBuyAmount)) | |
38 | + | then throw(buyAmountError) | |
39 | + | else if (if ((e.buyOrder.price > minBuyPrice)) | |
22 | 40 | then true | |
23 | 41 | else isDefined(e.buyOrder.assetPair.priceAsset)) | |
24 | - | then throw( | |
42 | + | then throw(buyPriceError) | |
25 | 43 | else true | |
26 | 44 | else false | |
27 | 45 | } | |
28 | 46 | case t: MassTransferTransaction|BurnTransaction|TransferTransaction => | |
29 | 47 | true | |
30 | 48 | case _ => | |
31 | 49 | true | |
32 | 50 | } |
github/deemru/w8io/169f3d6 37.69 ms ◑