tx · 8P9d3gwNufwnQtSxMJpUv1n3yDhyLfpoe9LY1aXLdCH1 3MtHweJiyA6ikkkPCn4ssqpi4Nokcrf9hT9: -1.00000000 Waves 2019.03.19 05:15 [542495] smart asset 3MtHweJiyA6ikkkPCn4ssqpi4Nokcrf9hT9 > SELF 0.00000000 2020
{ "type": 15, "id": "8P9d3gwNufwnQtSxMJpUv1n3yDhyLfpoe9LY1aXLdCH1", "fee": 100000000, "feeAssetId": null, "timestamp": 1552961754784, "version": 1, "sender": "3MtHweJiyA6ikkkPCn4ssqpi4Nokcrf9hT9", "senderPublicKey": "5HwUTPzUP1wy7djMELX2wLNmasSaARD4kw1xpAyeJw1h", "proofs": [ "61M98rzKTabiZK5PfF6WxReoKiUWYDGYgw1EU8YVZ2oP6vy2YN4YbLjximy4426grzdkPCSm5nygRcv14yKF5xJt" ], "assetId": "Cj5PHEx7yo2DSCyP3DdVSq9xuPuLMNpQWbTPcDoUBUCn", "script": "base64:AgQAAAAGaXNzdWVyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUMALd3HQqggV4csLYbBu0QaHaUC3AkGsMBAAAAAdhc3NldElkAQAAACCuN+hG5QXNWmrs7C+qkKjbR9QaS6zpVjI/kDAkUBLC9wQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE0V4Y2hhbmdlVHJhbnNhY3Rpb24EAAAAAmV4BQAAAAckbWF0Y2gwBAAAAARwYWlyCQEAAAAJQXNzZXRQYWlyAAAAAgUAAAAHYXNzZXRJZAUAAAAEdW5pdAQAAAAEcmF0ZQkBAAAAB2V4dHJhY3QAAAABCQAEGgAAAAIFAAAABmlzc3VlcgIAAAACMTAEAAAACHJhdGVEaWZmCQAAZQAAAAIFAAAABHJhdGUJAABrAAAAAwAAAAAABfXhAAgFAAAAAmV4AAAABXByaWNlCAUAAAACZXgAAAAGYW1vdW50AwMJAAAAAAAAAggIBQAAAAJleAAAAAhidXlPcmRlcgAAAAlhc3NldFBhaXIFAAAABHBhaXIJAABmAAAAAgUAAAAIcmF0ZURpZmYA/////////5wHCQAAZgAAAAIAAAAAAAAAAGQFAAAACHJhdGVEaWZmBwY3+L5B", "chainId": 84, "height": 542495, "spentComplexity": 0 } View: original | compacted Prev: 54PWbLgjbrGY1DMhjphqvL9oRcFyjwS92Ng1jrnN2gNw Next: 8kpr1M9Qqx7ySTtuHEcA6C5f5jGRe3Rcnf1pgu9K1oEA Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 2 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | - | let addr = Address(base58'3MtHweJiyA6ikkkPCn4ssqpi4Nokcrf9hT9') | |
3 | + | let issuer = Address(base58'3MtHweJiyA6ikkkPCn4ssqpi4Nokcrf9hT9') | |
4 | + | let assetId = base58'Cj5PHEx7yo2DSCyP3DdVSq9xuPuLMNpQWbTPcDoUBUCn' | |
4 | 5 | match tx { | |
5 | - | case e: ExchangeTransaction => | |
6 | - | let withWaves = if (!(isDefined(e.sellOrder.assetPair.priceAsset))) | |
7 | - | then true | |
8 | - | else !(isDefined(e.sellOrder.assetPair.amountAsset)) | |
9 | - | if ((withWaves == false)) | |
10 | - | then { | |
11 | - | let priceAssetKey = (("status_<" + toBase58String(extract(e.sellOrder.assetPair.priceAsset))) + ">") | |
12 | - | let priceAssetInOracle = (getInteger(addr, priceAssetKey) == 2) | |
13 | - | let amountAssetKey = (("status_<" + toBase58String(extract(e.sellOrder.assetPair.amountAsset))) + ">") | |
14 | - | let amountAssetInOracle = (getInteger(addr, priceAssetKey) == 2) | |
15 | - | if (priceAssetInOracle) | |
16 | - | then true | |
17 | - | else amountAssetInOracle | |
18 | - | } | |
19 | - | else true | |
6 | + | case ex: ExchangeTransaction => | |
7 | + | let pair = AssetPair(assetId, unit) | |
8 | + | let rate = extract(getInteger(issuer, "10")) | |
9 | + | let rateDiff = (rate - fraction(100000000, ex.price, ex.amount)) | |
10 | + | if (if ((ex.buyOrder.assetPair == pair)) | |
11 | + | then (rateDiff > -100) | |
12 | + | else false) | |
13 | + | then (100 > rateDiff) | |
14 | + | else false | |
20 | 15 | case _ => | |
21 | 16 | true | |
22 | 17 | } |
github/deemru/w8io/026f985 18.74 ms ◑