tx · J2ydsUi2rk7htWVU8pC6o3ZQxvkg2PBFs5wtEEudtFA4 3N5EryX3TucbwUpnjryZB3WLg3YDTcC9BbF: -1.00000000 Waves 2020.04.20 21:45 [963178] smart asset 3N5EryX3TucbwUpnjryZB3WLg3YDTcC9BbF > SELF 0.00000000 Test0003
{ "type": 15, "id": "J2ydsUi2rk7htWVU8pC6o3ZQxvkg2PBFs5wtEEudtFA4", "fee": 100000000, "feeAssetId": null, "timestamp": 1587408390752, "version": 1, "sender": "3N5EryX3TucbwUpnjryZB3WLg3YDTcC9BbF", "senderPublicKey": "B9XyW4GriR4NKr6yyp8ZS5BmRzTXAhBn9jybWtpDhQKk", "proofs": [ "4X44zuack22BcoshGGH7tCUHr5NLikGDKvasHvj2a18mfUqs7Y3xneDqZuZxcSSCKozndSxAkE1rnBFg7UPmiihA" ], "assetId": "G1sibUnEzT74RZLcP4Y6gEc8QCNhZLHaS5KKGksraacv", "script": "base64:AgQAAAAHYWRtaW5QSwEAAAAglsSJz6KFUcFtfApcMGPSTcbUtji15ZrrZdwT1HPy9xsEAAAACnNlbGxBbW91bnQAAAAAADuaygAEAAAACXNlbGxQcmljZQAAAAAABfXhAAQAAAAIYnV5UHJpY2UAAAAAAAX14P8EAAAAB2J1cm5GZWUAAAAAAB3NZQAEAAAAC2FkbWluU2lnbmVkCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAHYWRtaW5QSwQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE0V4Y2hhbmdlVHJhbnNhY3Rpb24EAAAAAWUFAAAAByRtYXRjaDAEAAAABnNlbmRlcggIBQAAAAFlAAAACXNlbGxPcmRlcgAAAAZzZW5kZXIEAAAABHNlbGwJAAH0AAAAAwgIBQAAAAFlAAAACXNlbGxPcmRlcgAAAAlib2R5Qnl0ZXMJAAGRAAAAAggIBQA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AAgkAASwAAAACAgAAAB9CdXkgcHJpY2UgbXVzdCBiZSBncmVhdGVyIHRoZW4gCQABpAAAAAEFAAAACGJ1eVByaWNlAgAAAAkgd2F2ZWxldHMGCQAAAgAAAAECAAAAFnNvbWV0aGluZyBiYWQgaGFwcGVuZWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0J1cm5UcmFuc2FjdGlvbgQAAAABYgUAAAAHJG1hdGNoMAMJAABmAAAAAgUAAAAHYnVybkZlZQgFAAAAAWIAAAADZmVlCQAAAgAAAAEJAAEsAAAAAgkAASwAAAACAgAAACVCdXJuIGZlZSBtdXN0IGJlIGdyZWF0ZXIgb3IgZXF1YWwgdG8gCQABpAAAAAEFAAAAB2J1cm5GZWUCAAAACSB3YXZlbGV0cwYDAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBgkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdNYXNzVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAYDAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgYJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAASUmVpc3N1ZVRyYW5zYWN0aW9uBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAthZG1pblNpZ25lZAcoYBFQ", "chainId": 84, "height": 963178, "spentComplexity": 0 } View: original | compacted Prev: us2R7V7pPMayDiTTGKVMJNoK14W3V43QhWFjUQrek6B Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 2 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | + | let adminPK = base58'B9XyW4GriR4NKr6yyp8ZS5BmRzTXAhBn9jybWtpDhQKk' | |
4 | + | let sellAmount = 1000000000 | |
5 | + | let sellPrice = 100000000 | |
6 | + | let buyPrice = 99999999 | |
7 | + | let burnFee = 500000000 | |
8 | + | let adminSigned = sigVerify(tx.bodyBytes, tx.proofs[0], adminPK) | |
3 | 9 | match tx { | |
4 | - | case t: TransferTransaction => | |
5 | - | (t.feeAssetId == base58'2vhhEwXpTpHKq8rnyLy3WGkQ4CLpFN5GZPyBiVKWKnG2') | |
10 | + | case e: ExchangeTransaction => | |
11 | + | let sender = e.sellOrder.sender | |
12 | + | let sell = sigVerify(e.sellOrder.bodyBytes, e.sellOrder.proofs[0], e.sellOrder.senderPublicKey) | |
13 | + | let buy = sigVerify(e.buyOrder.bodyBytes, e.buyOrder.proofs[0], e.buyOrder.senderPublicKey) | |
14 | + | let admin = (e.sellOrder.sender == addressFromPublicKey(adminPK)) | |
15 | + | if (admin) | |
16 | + | then true | |
17 | + | else if (isDefined(e.sellOrder.assetPair.priceAsset)) | |
18 | + | then throw("Only waves accepted") | |
19 | + | else if (sell) | |
20 | + | then if ((sellAmount > e.sellOrder.amount)) | |
21 | + | then throw(("Sell amount must be greater or equal to " + toString((sellAmount / 100000000)))) | |
22 | + | else if ((sellPrice >= e.sellOrder.price)) | |
23 | + | then throw((("Sell price must be greater than " + toString(sellPrice)) + " wavelets")) | |
24 | + | else true | |
25 | + | else if (buy) | |
26 | + | then if ((buyPrice >= e.sellOrder.price)) | |
27 | + | then throw((("Buy price must be greater then " + toString(buyPrice)) + " wavelets")) | |
28 | + | else true | |
29 | + | else throw("something bad happened") | |
30 | + | case b: BurnTransaction => | |
31 | + | if ((burnFee > b.fee)) | |
32 | + | then throw((("Burn fee must be greater or equal to " + toString(burnFee)) + " wavelets")) | |
33 | + | else true | |
34 | + | case t: TransferTransaction|MassTransferTransaction => | |
35 | + | true | |
36 | + | case s: SetScriptTransaction|ReissueTransaction => | |
37 | + | adminSigned | |
6 | 38 | case _ => | |
7 | - | | |
39 | + | false | |
8 | 40 | } |
github/deemru/w8io/169f3d6 30.56 ms ◑