tx · 3HqRsvwheyUVo339BMrfSiu9bekcnhSxRWAnEC5Dwi8B
3P9c8eRDJFBAXCzah6J2QTJoK7VNBtkSGpd: -1.00000000 Waves
2019.06.10 19:12 [1565798] smart asset 3P9c8eRDJFBAXCzah6J2QTJoK7VNBtkSGpd > SELF 0.00000000 FullMoon
{
"type": 15,
"id": "3HqRsvwheyUVo339BMrfSiu9bekcnhSxRWAnEC5Dwi8B",
"fee": 100000000,
"feeAssetId": null,
"timestamp": 1560183170161,
"version": 1,
"sender": "3P9c8eRDJFBAXCzah6J2QTJoK7VNBtkSGpd",
"senderPublicKey": "5dcFNWcem3VanKMErViDMkr9oEVaNUrsGnYcAqXHnByG",
"proofs": [
"2uQQbQtAemwgKPbv3oyu3QeWDEJZhVFC45VuNpp28Vnp9RssztgD9zLbVQNWs7Q4LgrdnpTbJRimdJmxCvVh3xk3"
],
"assetId": "9hTBhvaSFB3H8jmsZw2ZHsNuwsLK9wHQTwgE1a3kZ8k7",
"script": "base64:AgQAAAAGQ09JTklkAQAAACBSDUX5Hu+dDoJ9IoSDMka9tZ0K6G9XzGwdBcTtE/lf9AQAAAAKaGVpZ2h0RGlmZgAAAAAAAAAAAQQAAAAOcHJpY2VEaWZmQ29uc3QAAAAAAAAAAAIEAAAAD2V4cGlyYXRpb25Ib3VycwAAAAAAAAAAAQQAAAANbWF4RXhwaXJhdGlvbgkAAGgAAAACCQAAaAAAAAIJAABoAAAAAgUAAAAPZXhwaXJhdGlvbkhvdXJzAAAAAAAAAAA8AAAAAAAAAAA8AAAAAAAAAAPoBAAAAAtzdGFydEhlaWdodAAAAAAAABfkaAQAAAAGY3ljbGVzCQAAaQAAAAIJAABlAAAAAgUAAAAGaGVpZ2h0BQAAAAtzdGFydEhlaWdodAUAAAAKaGVpZ2h0RGlmZgQAAAAJcHJpY2VEaWZmCQAAaAAAAAIFAAAADnByaWNlRGlmZkNvbnN0BQAAAAZjeWNsZXMEAAAADXN0YXJ0QnV5UHJpY2UAAAAAAAAAAA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0FxO0T+V/0BgkAAAIAAAABBQAAABB0cmFuc2ZlckZlZUVycm9yAwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXTWFzc1RyYW5zZmVyVHJhbnNhY3Rpb24GCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0J1cm5UcmFuc2FjdGlvbgYGPtfYNQ==",
"chainId": 87,
"height": 1565798,
"spentComplexity": 0
}
View: original | compacted
Prev: 5igkXKJ4hfDW8wmnt9YzDibsYFrgZ4Fx1zQTD9Q496ar
Next: none
Diff:
Old | New | | Differences |
---|
5 | 5 | | let priceDiffConst = 2 |
---|
6 | 6 | | let expirationHours = 1 |
---|
7 | 7 | | let maxExpiration = (((expirationHours * 60) * 60) * 1000) |
---|
8 | | - | let startHeight = 1517760 |
---|
| 8 | + | let startHeight = 1565800 |
---|
9 | 9 | | let cycles = ((height - startHeight) / heightDiff) |
---|
10 | | - | let startHeightDown = 1519200 |
---|
11 | | - | let cyclesDown = ((height - startHeightDown) / heightDiff) |
---|
12 | 10 | | let priceDiff = (priceDiffConst * cycles) |
---|
13 | | - | let priceDiffDown = (priceDiffConst * cyclesDown) |
---|
14 | 11 | | let startBuyPrice = 2 |
---|
15 | 12 | | let minBuyPrice = (startBuyPrice + priceDiff) |
---|
16 | | - | let startBuyPriceDown = 2666 |
---|
17 | | - | let minBuyPriceDown = (startBuyPriceDown - priceDiffDown) |
---|
18 | 13 | | let startSellPrice = 1 |
---|
19 | 14 | | let minSellPrice = (startSellPrice + priceDiff) |
---|
20 | | - | let startSellPriceDown = 3666 |
---|
21 | | - | let minSellPriceDown = (startSellPriceDown - priceDiffDown) |
---|
22 | 15 | | let expirationError = "Order time should be less than 1 hour" |
---|
23 | | - | let buyPriceError = (("Buy price should be <= " + toString(minBuyPrice)) + " Money Energy Cents in a Rising Moon. Price UP ~1 minute!") |
---|
24 | | - | let sellPriceError = (("Sell price should be >= " + toString(minSellPrice)) + " Money Energy Cents in a Rising Moon. Price UP ~1 minute!") |
---|
25 | | - | let buyPriceErrorDown = (("Buy price should be >= " + toString(minBuyPriceDown)) + " Money Energy Cents in a Falling Moon. Price DOWN ~1 minute!") |
---|
26 | | - | let sellPriceErrorDown = (("Sell price should be <= " + toString(minSellPriceDown)) + " Money Energy Cents in a Falling Moon. Price DOWN ~1 minute!") |
---|
| 16 | + | let buyPriceError = (("Buy price should be <= " + toString(minBuyPrice)) + " pips in a Rising Moon. Price UP ~1 minute!") |
---|
| 17 | + | let sellPriceError = (("Sell price should be >= " + toString(minSellPrice)) + " pips in a Rising Moon. Price UP ~1 minute!") |
---|
27 | 18 | | let transferFeeError = "Use Money Energy token to pay transfer fee!" |
---|
28 | 19 | | let coinBalanceError = "You must hold 100+ Money Energy tokens to be allowed to trade!" |
---|
29 | 20 | | match tx { |
---|
|
41 | 32 | | then buy |
---|
42 | 33 | | else false) |
---|
43 | 34 | | then true |
---|
44 | | - | else if (((height % 2880) >= 1440)) |
---|
45 | | - | then if (sell) |
---|
46 | | - | then if (if ((e.sellOrder.price > minSellPriceDown)) |
---|
47 | | - | then true |
---|
48 | | - | else (e.sellOrder.assetPair.priceAsset != COINId)) |
---|
49 | | - | then throw(sellPriceErrorDown) |
---|
| 35 | + | else if (sell) |
---|
| 36 | + | then if ((minSellPrice > e.sellOrder.price)) |
---|
| 37 | + | then throw(sellPriceError) |
---|
| 38 | + | else true |
---|
| 39 | + | else if (buy) |
---|
| 40 | + | then if ((e.buyOrder.price > minBuyPrice)) |
---|
| 41 | + | then throw(buyPriceError) |
---|
50 | 42 | | else true |
---|
51 | | - | else if (buy) |
---|
52 | | - | then if (if ((minBuyPriceDown > e.buyOrder.price)) |
---|
53 | | - | then true |
---|
54 | | - | else (e.sellOrder.assetPair.priceAsset != COINId)) |
---|
55 | | - | then throw(buyPriceErrorDown) |
---|
56 | | - | else true |
---|
57 | | - | else false |
---|
58 | | - | else if (sell) |
---|
59 | | - | then if (if ((minSellPrice > e.sellOrder.price)) |
---|
60 | | - | then true |
---|
61 | | - | else (e.sellOrder.assetPair.priceAsset != COINId)) |
---|
62 | | - | then throw(sellPriceError) |
---|
63 | | - | else true |
---|
64 | | - | else if (buy) |
---|
65 | | - | then if (if ((e.buyOrder.price > minBuyPrice)) |
---|
66 | | - | then true |
---|
67 | | - | else (e.sellOrder.assetPair.priceAsset != COINId)) |
---|
68 | | - | then throw(buyPriceError) |
---|
69 | | - | else true |
---|
70 | | - | else false |
---|
| 43 | + | else false |
---|
71 | 44 | | } |
---|
72 | 45 | | case t: TransferTransaction => |
---|
73 | 46 | | if ((t.feeAssetId == base58'6XJAscmejGPTLAdKsg12MynB5rNQzNiZz8Yj81SWeFrj')) |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 2 #-} |
---|
2 | 2 | | {-# CONTENT_TYPE EXPRESSION #-} |
---|
3 | 3 | | let COINId = base58'6XJAscmejGPTLAdKsg12MynB5rNQzNiZz8Yj81SWeFrj' |
---|
4 | 4 | | let heightDiff = 1 |
---|
5 | 5 | | let priceDiffConst = 2 |
---|
6 | 6 | | let expirationHours = 1 |
---|
7 | 7 | | let maxExpiration = (((expirationHours * 60) * 60) * 1000) |
---|
8 | | - | let startHeight = 1517760 |
---|
| 8 | + | let startHeight = 1565800 |
---|
9 | 9 | | let cycles = ((height - startHeight) / heightDiff) |
---|
10 | | - | let startHeightDown = 1519200 |
---|
11 | | - | let cyclesDown = ((height - startHeightDown) / heightDiff) |
---|
12 | 10 | | let priceDiff = (priceDiffConst * cycles) |
---|
13 | | - | let priceDiffDown = (priceDiffConst * cyclesDown) |
---|
14 | 11 | | let startBuyPrice = 2 |
---|
15 | 12 | | let minBuyPrice = (startBuyPrice + priceDiff) |
---|
16 | | - | let startBuyPriceDown = 2666 |
---|
17 | | - | let minBuyPriceDown = (startBuyPriceDown - priceDiffDown) |
---|
18 | 13 | | let startSellPrice = 1 |
---|
19 | 14 | | let minSellPrice = (startSellPrice + priceDiff) |
---|
20 | | - | let startSellPriceDown = 3666 |
---|
21 | | - | let minSellPriceDown = (startSellPriceDown - priceDiffDown) |
---|
22 | 15 | | let expirationError = "Order time should be less than 1 hour" |
---|
23 | | - | let buyPriceError = (("Buy price should be <= " + toString(minBuyPrice)) + " Money Energy Cents in a Rising Moon. Price UP ~1 minute!") |
---|
24 | | - | let sellPriceError = (("Sell price should be >= " + toString(minSellPrice)) + " Money Energy Cents in a Rising Moon. Price UP ~1 minute!") |
---|
25 | | - | let buyPriceErrorDown = (("Buy price should be >= " + toString(minBuyPriceDown)) + " Money Energy Cents in a Falling Moon. Price DOWN ~1 minute!") |
---|
26 | | - | let sellPriceErrorDown = (("Sell price should be <= " + toString(minSellPriceDown)) + " Money Energy Cents in a Falling Moon. Price DOWN ~1 minute!") |
---|
| 16 | + | let buyPriceError = (("Buy price should be <= " + toString(minBuyPrice)) + " pips in a Rising Moon. Price UP ~1 minute!") |
---|
| 17 | + | let sellPriceError = (("Sell price should be >= " + toString(minSellPrice)) + " pips in a Rising Moon. Price UP ~1 minute!") |
---|
27 | 18 | | let transferFeeError = "Use Money Energy token to pay transfer fee!" |
---|
28 | 19 | | let coinBalanceError = "You must hold 100+ Money Energy tokens to be allowed to trade!" |
---|
29 | 20 | | match tx { |
---|
30 | 21 | | case e: ExchangeTransaction => |
---|
31 | 22 | | if (if ((10000 > assetBalance(e.sellOrder.sender, COINId))) |
---|
32 | 23 | | then (10000 > assetBalance(e.buyOrder.sender, COINId)) |
---|
33 | 24 | | else false) |
---|
34 | 25 | | then throw(coinBalanceError) |
---|
35 | 26 | | else if (((e.sellOrder.expiration - e.sellOrder.timestamp) > maxExpiration)) |
---|
36 | 27 | | then throw(expirationError) |
---|
37 | 28 | | else { |
---|
38 | 29 | | let sell = sigVerify(e.sellOrder.bodyBytes, e.sellOrder.proofs[0], e.sellOrder.senderPublicKey) |
---|
39 | 30 | | let buy = sigVerify(e.buyOrder.bodyBytes, e.buyOrder.proofs[0], e.buyOrder.senderPublicKey) |
---|
40 | 31 | | if (if (sell) |
---|
41 | 32 | | then buy |
---|
42 | 33 | | else false) |
---|
43 | 34 | | then true |
---|
44 | | - | else if (((height % 2880) >= 1440)) |
---|
45 | | - | then if (sell) |
---|
46 | | - | then if (if ((e.sellOrder.price > minSellPriceDown)) |
---|
47 | | - | then true |
---|
48 | | - | else (e.sellOrder.assetPair.priceAsset != COINId)) |
---|
49 | | - | then throw(sellPriceErrorDown) |
---|
| 35 | + | else if (sell) |
---|
| 36 | + | then if ((minSellPrice > e.sellOrder.price)) |
---|
| 37 | + | then throw(sellPriceError) |
---|
| 38 | + | else true |
---|
| 39 | + | else if (buy) |
---|
| 40 | + | then if ((e.buyOrder.price > minBuyPrice)) |
---|
| 41 | + | then throw(buyPriceError) |
---|
50 | 42 | | else true |
---|
51 | | - | else if (buy) |
---|
52 | | - | then if (if ((minBuyPriceDown > e.buyOrder.price)) |
---|
53 | | - | then true |
---|
54 | | - | else (e.sellOrder.assetPair.priceAsset != COINId)) |
---|
55 | | - | then throw(buyPriceErrorDown) |
---|
56 | | - | else true |
---|
57 | | - | else false |
---|
58 | | - | else if (sell) |
---|
59 | | - | then if (if ((minSellPrice > e.sellOrder.price)) |
---|
60 | | - | then true |
---|
61 | | - | else (e.sellOrder.assetPair.priceAsset != COINId)) |
---|
62 | | - | then throw(sellPriceError) |
---|
63 | | - | else true |
---|
64 | | - | else if (buy) |
---|
65 | | - | then if (if ((e.buyOrder.price > minBuyPrice)) |
---|
66 | | - | then true |
---|
67 | | - | else (e.sellOrder.assetPair.priceAsset != COINId)) |
---|
68 | | - | then throw(buyPriceError) |
---|
69 | | - | else true |
---|
70 | | - | else false |
---|
| 43 | + | else false |
---|
71 | 44 | | } |
---|
72 | 45 | | case t: TransferTransaction => |
---|
73 | 46 | | if ((t.feeAssetId == base58'6XJAscmejGPTLAdKsg12MynB5rNQzNiZz8Yj81SWeFrj')) |
---|
74 | 47 | | then true |
---|
75 | 48 | | else throw(transferFeeError) |
---|
76 | 49 | | case _: MassTransferTransaction|BurnTransaction => |
---|
77 | 50 | | true |
---|
78 | 51 | | case _ => |
---|
79 | 52 | | true |
---|
80 | 53 | | } |
---|