tx · J72w5kDP7DzZfYgftP3EbZN2HpNNvcNEiVeHbjHtapvw 3MuTTNitiCXtwNMFnExx77b8xiTBFVYyMVB: -1.00000000 Waves 2019.02.08 21:54 [486496] smart asset 3MuTTNitiCXtwNMFnExx77b8xiTBFVYyMVB > SELF 0.00000000 test
{ "type": 15, "id": "J72w5kDP7DzZfYgftP3EbZN2HpNNvcNEiVeHbjHtapvw", "fee": 100000000, "feeAssetId": null, "timestamp": 1549652149185, "version": 1, "sender": "3MuTTNitiCXtwNMFnExx77b8xiTBFVYyMVB", "senderPublicKey": "AjiJTAnh1zMMUTHYCyrN4XzdpDb9YtU5xe8hD1Su7vSV", "proofs": [ "5D3n9oAWraXYg4KWgCJiHuh7UHkdaoBJwZVydnWifPrbG2HLa4sqjks4MEDcLRJrKJg9CX1ctFxqFw69DUeGZ6Tf" ], "assetId": "81bYhTjXoXFeDkYUiDxaYnX1tk38W69Jr3KgtCAK5WZT", "script": "base64:AQQAAAAOYWRtaW5QdWJsaWNLZXkBAAAAIJCqRn76vzIaLRPZfQ76udpC5ZaY6zUPmJGk4a239ScKBAAAAAxhZG1pbkFkZHJlc3MJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEFAAAADmFkbWluUHVibGljS2V5BAAAAAckbWF0Y2gwBQAAAAJ0eAMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24GCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE0V4Y2hhbmdlVHJhbnNhY3Rpb24EAAAABWFsbG93BQAAAAckbWF0Y2gwBAAAAAdhc3NldElkBAAAAAckbWF0Y2gxBQAAAAVhbGxvdwMJAAABAAAAAgUAAAAHJG1hdGNoMQIAAAATRXhjaGFuZ2VUcmFuc2FjdGlvbgQAAAABZQUAAAAHJG1hdGNoMQgICAUAAAABZQAAAAlzZWxsT3JkZXIAAAAJYXNzZXRQYWlyAAAAC2Ftb3VudEFzc2V0AwkAAAEAAAACBQAAA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AgUAAAAQd2hpdGVsaXN0QWRkcmVzcwkAAlgAAAABCAUAAAAQcmVjaXBpZW50QWRkcmVzcwAAAAVieXRlcwQAAAAHJG1hdGNoMQUAAAAFYWxsb3cDCQAAAQAAAAIFAAAAByRtYXRjaDECAAAAE0V4Y2hhbmdlVHJhbnNhY3Rpb24EAAAAAWUFAAAAByRtYXRjaDEDCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABBQAAAA5zZW5kZXJBY2NlcHRlZAkBAAAABXRocm93AAAAAAkBAAAAB2V4dHJhY3QAAAABBQAAAA5zZW5kZXJBY2NlcHRlZAMJAAABAAAAAgUAAAAHJG1hdGNoMQIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMQMDCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABBQAAAA5zZW5kZXJBY2NlcHRlZAYJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAAAAEFAAAAEXJlY2lwaWVudEFjY2VwdGVkCQEAAAAFdGhyb3cAAAAAAwkBAAAAB2V4dHJhY3QAAAABBQAAAA5zZW5kZXJBY2NlcHRlZAkBAAAAB2V4dHJhY3QAAAABBQAAABFyZWNpcGllbnRBY2NlcHRlZAcJAQAAAAV0aHJvdwAAAAAGEP2BDQ==", "chainId": 84, "height": 486496, "spentComplexity": 0 } View: original | compacted Prev: 998XomAJxVp3nzJF6mFc8xpg6xqQeF64cRL6C1ttHhEJ Next: none Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | case _ => | |
30 | 30 | throw() | |
31 | 31 | } | |
32 | - | let senderAccepted = | |
33 | - | let recipientAccepted = | |
32 | + | let senderAccepted = getBoolean(whitelistAddress, toBase58String(senderAddress.bytes)) | |
33 | + | let recipientAccepted = getBoolean(whitelistAddress, toBase58String(recipientAddress.bytes)) | |
34 | 34 | match allow { | |
35 | 35 | case e: ExchangeTransaction => | |
36 | - | senderAccepted | |
36 | + | if (!(isDefined(senderAccepted))) | |
37 | + | then throw() | |
38 | + | else extract(senderAccepted) | |
37 | 39 | case t: TransferTransaction => | |
38 | - | if (senderAccepted) | |
39 | - | then recipientAccepted | |
40 | - | else false | |
40 | + | if (if (!(isDefined(senderAccepted))) | |
41 | + | then true | |
42 | + | else !(isDefined(recipientAccepted))) | |
43 | + | then throw() | |
44 | + | else if (extract(senderAccepted)) | |
45 | + | then extract(recipientAccepted) | |
46 | + | else false | |
41 | 47 | case _ => | |
42 | 48 | throw() | |
43 | 49 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 1 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | 3 | let adminPublicKey = base58'AjiJTAnh1zMMUTHYCyrN4XzdpDb9YtU5xe8hD1Su7vSV' | |
4 | 4 | let adminAddress = addressFromPublicKey(adminPublicKey) | |
5 | 5 | match tx { | |
6 | 6 | case allow: TransferTransaction|ExchangeTransaction => | |
7 | 7 | let assetId = match allow { | |
8 | 8 | case e: ExchangeTransaction => | |
9 | 9 | e.sellOrder.assetPair.amountAsset | |
10 | 10 | case t: TransferTransaction => | |
11 | 11 | t.assetId | |
12 | 12 | case _ => | |
13 | 13 | throw() | |
14 | 14 | } | |
15 | 15 | let assetIdString = toBase58String(extract(assetId)) | |
16 | 16 | let whitelistPK = extract(getString(adminAddress, assetIdString)) | |
17 | 17 | let whitelistAddress = extract(addressFromPublicKey(fromBase58String(whitelistPK))) | |
18 | 18 | let senderAddress = match allow { | |
19 | 19 | case e: ExchangeTransaction => | |
20 | 20 | e.sellOrder.sender | |
21 | 21 | case t: TransferTransaction => | |
22 | 22 | t.sender | |
23 | 23 | case _ => | |
24 | 24 | throw() | |
25 | 25 | } | |
26 | 26 | let recipientAddress = match allow { | |
27 | 27 | case t: TransferTransaction => | |
28 | 28 | addressFromRecipient(t.recipient) | |
29 | 29 | case _ => | |
30 | 30 | throw() | |
31 | 31 | } | |
32 | - | let senderAccepted = | |
33 | - | let recipientAccepted = | |
32 | + | let senderAccepted = getBoolean(whitelistAddress, toBase58String(senderAddress.bytes)) | |
33 | + | let recipientAccepted = getBoolean(whitelistAddress, toBase58String(recipientAddress.bytes)) | |
34 | 34 | match allow { | |
35 | 35 | case e: ExchangeTransaction => | |
36 | - | senderAccepted | |
36 | + | if (!(isDefined(senderAccepted))) | |
37 | + | then throw() | |
38 | + | else extract(senderAccepted) | |
37 | 39 | case t: TransferTransaction => | |
38 | - | if (senderAccepted) | |
39 | - | then recipientAccepted | |
40 | - | else false | |
40 | + | if (if (!(isDefined(senderAccepted))) | |
41 | + | then true | |
42 | + | else !(isDefined(recipientAccepted))) | |
43 | + | then throw() | |
44 | + | else if (extract(senderAccepted)) | |
45 | + | then extract(recipientAccepted) | |
46 | + | else false | |
41 | 47 | case _ => | |
42 | 48 | throw() | |
43 | 49 | } | |
44 | 50 | case _ => | |
45 | 51 | true | |
46 | 52 | } |
github/deemru/w8io/026f985 22.28 ms ◑