tx · DYyha26aTKFkqpqbHbhmUjSp6ihfinsWdZtKhNae3A63
3N6mVEULck7uViUaDo1wi98wch9XzYNXriv: -1.00000000 Waves
2019.02.19 15:48 [502090] smart asset 3N6mVEULck7uViUaDo1wi98wch9XzYNXriv > SELF 0.00000000 test666
{
"type": 15,
"id": "DYyha26aTKFkqpqbHbhmUjSp6ihfinsWdZtKhNae3A63",
"fee": 100000000,
"feeAssetId": null,
"timestamp": 1550580552047,
"version": 1,
"sender": "3N6mVEULck7uViUaDo1wi98wch9XzYNXriv",
"senderPublicKey": "GMCkL2F7fYotQtrpQq5sjNm5cjpR7CSfawr9kMSKLHVs",
"proofs": [
"KXRMzGkaCHH4Y2sD8uqT4eKubBwGJUkb8k1wG8HhcxaXEqyfSojUkX4B5YKjBtYbgU63Bi6QiBBjUqXU7gxn2GX"
],
"assetId": "5yjyBTmmUbpxnipdv8ZcS9gPn2bEXRo7fThXXruFiYXS",
"script": "base64:AQQAAAAKaGVpZ2h0RGlmZgAAAAAAAAAGggQAAAAOcHJpY2VEaWZmQ29uc3QAAAAAAAACisgEAAAAD2V4cGlyYXRpb25Ib3VycwAAAAAAAAAAGAQAAAANbWF4RXhwaXJhdGlvbgkAAGgAAAACCQAAaAAAAAIJAABoAAAAAgUAAAAPZXhwaXJhdGlvbkhvdXJzAAAAAAAAAAA8AAAAAAAAAAA8AAAAAAAAAAPoBAAAAA9leHBpcmF0aW9uRXJyb3IJAAEsAAAAAgkAASwAAAACAgAAABZFeHBpcmF0aW9uIG11c3QgYmUgPD0gCQABpAAAAAEFAAAADW1heEV4cGlyYXRpb24CAAAAAyBtcwQAAAALc3RhcnRIZWlnaHQAAAAAAAAHqT4EAAAABmN5Y2xlcwkAAGkAAAACCQAAZQAAAAIFAAAABmhlaWdodAUAAAALc3RhcnRIZWlnaHQFAAAACmhlaWdodERpZmYEAAAACXByaWNlRGlmZgkAAGgAAAACBQAAAA5wcmljZURpZmZDb25zdAUAAAAGY3ljbGVzBAAAAA1zdGFydE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ABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAMDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAAXQAAAAKZmVlQXNzZXRJZAYJAABmAAAAAgUAAAALdHJhbnNmZXJGZWUIBQAAAAF0AAAAA2ZlZQkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgIAAAAPRmVlIG11c3QgYmUgPj0gCQABpAAAAAEFAAAAC3RyYW5zZmVyRmVlAgAAAAkgd2F2ZWxldHMGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9CdXJuVHJhbnNhY3Rpb24EAAAAAWIFAAAAByRtYXRjaDADCQAAZgAAAAIFAAAAB2J1cm5GZWUIBQAAAAFiAAAAA2ZlZQkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgIAAAAPRmVlIG11c3QgYmUgPj0gCQABpAAAAAEFAAAAB2J1cm5GZWUCAAAACSB3YXZlbGV0cwYG8C2s8w==",
"chainId": 84,
"height": 502090,
"spentComplexity": 0
}
View: original | compacted
Prev: 3x1XjfVnMgHMnRjdQXxE2ZttMZz2qeNuU3DrrNTzrGxu
Next: 29Q5umtYJvQPmqmVJW8GfQvmTG2jcneuE1Dz7f1iNzNC
Diff:
Old | New | | Differences |
---|
4 | 4 | | let priceDiffConst = 166600 |
---|
5 | 5 | | let expirationHours = 24 |
---|
6 | 6 | | let maxExpiration = (((expirationHours * 60) * 60) * 1000) |
---|
| 7 | + | let expirationError = (("Expiration must be <= " + toString(maxExpiration)) + " ms") |
---|
7 | 8 | | let startHeight = 502078 |
---|
8 | 9 | | let cycles = ((height - startHeight) / heightDiff) |
---|
9 | 10 | | let priceDiff = (priceDiffConst * cycles) |
---|
10 | 11 | | let startBuyPrice = 16666600 |
---|
11 | 12 | | let minBuyPrice = (startBuyPrice + priceDiff) |
---|
| 13 | + | let buyPriceError = (("Buy price must be >= " + toString(minBuyPrice)) + " wavelets") |
---|
12 | 14 | | let maxBuyAmount = 66600000000 |
---|
| 15 | + | let buyAmountError = ("Buy amount must be < " + toString(maxBuyAmount)) |
---|
13 | 16 | | let startSellPrice = 16666900 |
---|
14 | 17 | | let minSellPrice = (startSellPrice + priceDiff) |
---|
| 18 | + | let sellPriceError = (("Sell price must be >= " + toString(minSellPrice)) + " wavelets") |
---|
15 | 19 | | let minSellAmount = 600000000 |
---|
| 20 | + | let sellAmountError = ("Sell amount must be >= " + toString(minSellAmount)) |
---|
16 | 21 | | let transferFee = 6660000 |
---|
17 | 22 | | let burnFee = 666000 |
---|
18 | 23 | | let orderFee = 666000 |
---|
19 | 24 | | match tx { |
---|
20 | 25 | | case e: ExchangeTransaction => |
---|
21 | 26 | | if (((e.sellOrder.expiration - e.sellOrder.timestamp) > maxExpiration)) |
---|
22 | | - | then throw((("Expirstion must be <= " + toString(maxExpiration)) + " ms")) |
---|
| 27 | + | then throw(expirationError) |
---|
23 | 28 | | else { |
---|
24 | 29 | | let sell = sigVerify(e.sellOrder.bodyBytes, e.sellOrder.proofs[0], e.sellOrder.senderPublicKey) |
---|
25 | 30 | | let buy = sigVerify(e.buyOrder.bodyBytes, e.buyOrder.proofs[0], e.buyOrder.senderPublicKey) |
---|
26 | 31 | | if (sell) |
---|
27 | | - | then if (if ((minSellPrice > e.sellOrder.price)) |
---|
| 32 | + | then if (if ((e.sellOrder.price > minSellPrice)) |
---|
28 | 33 | | then true |
---|
29 | 34 | | else isDefined(e.sellOrder.assetPair.priceAsset)) |
---|
30 | | - | then throw((("Sell price must be >= " + toString(minSellPrice)) + " wavelets")) |
---|
| 35 | + | then throw(sellPriceError) |
---|
31 | 36 | | else if ((minSellAmount > e.sellOrder.amount)) |
---|
32 | | - | then throw(("Sell amount must be >= " + toString(minSellAmount))) |
---|
| 37 | + | then throw(sellAmountError) |
---|
33 | 38 | | else true |
---|
34 | 39 | | else if (buy) |
---|
35 | 40 | | then if (if ((minBuyPrice > e.buyOrder.price)) |
---|
36 | 41 | | then true |
---|
37 | 42 | | else isDefined(e.buyOrder.assetPair.priceAsset)) |
---|
38 | | - | then throw((("Buy price must be >= " + toString(minBuyPrice)) + " wavelets")) |
---|
| 43 | + | then throw(buyPriceError) |
---|
39 | 44 | | else if ((e.buyOrder.amount >= maxBuyAmount)) |
---|
40 | | - | then throw(("Buy amount must be < " + toString(maxBuyAmount))) |
---|
| 45 | + | then throw(buyAmountError) |
---|
41 | 46 | | else true |
---|
42 | 47 | | else false |
---|
43 | 48 | | } |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 1 #-} |
---|
2 | 2 | | {-# CONTENT_TYPE EXPRESSION #-} |
---|
3 | 3 | | let heightDiff = 1666 |
---|
4 | 4 | | let priceDiffConst = 166600 |
---|
5 | 5 | | let expirationHours = 24 |
---|
6 | 6 | | let maxExpiration = (((expirationHours * 60) * 60) * 1000) |
---|
| 7 | + | let expirationError = (("Expiration must be <= " + toString(maxExpiration)) + " ms") |
---|
7 | 8 | | let startHeight = 502078 |
---|
8 | 9 | | let cycles = ((height - startHeight) / heightDiff) |
---|
9 | 10 | | let priceDiff = (priceDiffConst * cycles) |
---|
10 | 11 | | let startBuyPrice = 16666600 |
---|
11 | 12 | | let minBuyPrice = (startBuyPrice + priceDiff) |
---|
| 13 | + | let buyPriceError = (("Buy price must be >= " + toString(minBuyPrice)) + " wavelets") |
---|
12 | 14 | | let maxBuyAmount = 66600000000 |
---|
| 15 | + | let buyAmountError = ("Buy amount must be < " + toString(maxBuyAmount)) |
---|
13 | 16 | | let startSellPrice = 16666900 |
---|
14 | 17 | | let minSellPrice = (startSellPrice + priceDiff) |
---|
| 18 | + | let sellPriceError = (("Sell price must be >= " + toString(minSellPrice)) + " wavelets") |
---|
15 | 19 | | let minSellAmount = 600000000 |
---|
| 20 | + | let sellAmountError = ("Sell amount must be >= " + toString(minSellAmount)) |
---|
16 | 21 | | let transferFee = 6660000 |
---|
17 | 22 | | let burnFee = 666000 |
---|
18 | 23 | | let orderFee = 666000 |
---|
19 | 24 | | match tx { |
---|
20 | 25 | | case e: ExchangeTransaction => |
---|
21 | 26 | | if (((e.sellOrder.expiration - e.sellOrder.timestamp) > maxExpiration)) |
---|
22 | | - | then throw((("Expirstion must be <= " + toString(maxExpiration)) + " ms")) |
---|
| 27 | + | then throw(expirationError) |
---|
23 | 28 | | else { |
---|
24 | 29 | | let sell = sigVerify(e.sellOrder.bodyBytes, e.sellOrder.proofs[0], e.sellOrder.senderPublicKey) |
---|
25 | 30 | | let buy = sigVerify(e.buyOrder.bodyBytes, e.buyOrder.proofs[0], e.buyOrder.senderPublicKey) |
---|
26 | 31 | | if (sell) |
---|
27 | | - | then if (if ((minSellPrice > e.sellOrder.price)) |
---|
| 32 | + | then if (if ((e.sellOrder.price > minSellPrice)) |
---|
28 | 33 | | then true |
---|
29 | 34 | | else isDefined(e.sellOrder.assetPair.priceAsset)) |
---|
30 | | - | then throw((("Sell price must be >= " + toString(minSellPrice)) + " wavelets")) |
---|
| 35 | + | then throw(sellPriceError) |
---|
31 | 36 | | else if ((minSellAmount > e.sellOrder.amount)) |
---|
32 | | - | then throw(("Sell amount must be >= " + toString(minSellAmount))) |
---|
| 37 | + | then throw(sellAmountError) |
---|
33 | 38 | | else true |
---|
34 | 39 | | else if (buy) |
---|
35 | 40 | | then if (if ((minBuyPrice > e.buyOrder.price)) |
---|
36 | 41 | | then true |
---|
37 | 42 | | else isDefined(e.buyOrder.assetPair.priceAsset)) |
---|
38 | | - | then throw((("Buy price must be >= " + toString(minBuyPrice)) + " wavelets")) |
---|
| 43 | + | then throw(buyPriceError) |
---|
39 | 44 | | else if ((e.buyOrder.amount >= maxBuyAmount)) |
---|
40 | | - | then throw(("Buy amount must be < " + toString(maxBuyAmount))) |
---|
| 45 | + | then throw(buyAmountError) |
---|
41 | 46 | | else true |
---|
42 | 47 | | else false |
---|
43 | 48 | | } |
---|
44 | 49 | | case t: TransferTransaction => |
---|
45 | 50 | | if (if (isDefined(t.feeAssetId)) |
---|
46 | 51 | | then true |
---|
47 | 52 | | else (transferFee > t.fee)) |
---|
48 | 53 | | then throw((("Fee must be >= " + toString(transferFee)) + " wavelets")) |
---|
49 | 54 | | else true |
---|
50 | 55 | | case b: BurnTransaction => |
---|
51 | 56 | | if ((burnFee > b.fee)) |
---|
52 | 57 | | then throw((("Fee must be >= " + toString(burnFee)) + " wavelets")) |
---|
53 | 58 | | else true |
---|
54 | 59 | | case _ => |
---|
55 | 60 | | true |
---|
56 | 61 | | } |
---|