2019.04.18 20:07 [1488375] smart asset 3P3oH9HHoCuoqSBNvVK8kvff39ikAF9DJgV > SELF 0 WavesRewardToken
{
"type": 15,
"id": "F4xAsn3wiC7pUEorZJvMLj63aGxRzTNnwHdZ2h1fRuK9",
"fee": 100000000,
"feeAssetId": null,
"timestamp": 1555607076013,
"version": 1,
"sender": "3P3oH9HHoCuoqSBNvVK8kvff39ikAF9DJgV",
"senderPublicKey": "9q4mN91pxZeFHVPsKPVMgQT2cn9oQ2F29VneA1svPmWW",
"proofs": [
"QccmR6wyMr3fjkcVSyEUGEZ18yfhFohbN5KLC5oKkNmY3mb3Ebyp4N1PMeXCzw9VonHMma4WQMaabLxDh4pE5rB"
],
"assetId": "H1RmwqzeXsdQMt6jR6DPkGbZjA2PKUoofP4WjuCRz1st",
"script": "base64:AgQAAAAGaXNzdWVyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFXFH+ibOwBouZj+EDGJVdFHKkSrUavrIY2BAAAAAZzZW5kZXIJAAJYAAAAAQgIBQAAAAJ0eAAAAAZzZW5kZXIAAAAFYnl0ZXMEAAAADnNlbmRlckNhdGVnb3J5AwkBAAAACWlzRGVmaW5lZAAAAAEJAAQdAAAAAgUAAAAGaXNzdWVyBQAAAAZzZW5kZXIJAQAAAAdleHRyYWN0AAAAAQkABB0AAAACBQAAAAZpc3N1ZXIFAAAABnNlbmRlcgIAAAAEbm9uZQQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAAnR4BQAAAAckbWF0Y2gwBAAAAAlyZWNpcGllbnQJAAJYAAAAAQgJAAQkAAAAAQgFAAAAAnR4AAAACXJlY2lwaWVudAAAAAVieXRlcwQAAAARcmVjaXBpZW50Q2F0ZWdvcnkJAAQdAAAAAgUAAAAGaXNzdWVyBQAAAAlyZWNpcGllbnQDAwkAAAAAAAACBQAAAA5zZW5kZXJDYXRlZ29yeQIAAAAFYWRt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AAGVNldEFzc2V0U2NyaXB0VHJhbnNhY3Rpb24GCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAElJlaXNzdWVUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDAGB7ASp2I=",
"chainId": 87,
"height": 1488375,
"spentComplexity": 0
}
View: original | compacted
Prev: 3jKg3QdL1siLUiaNVGd6zSC9KFWZdNisp3J4pxupb14s
Next: none
Diff:
Old | New | | Differences |
---|
9 | 9 | | case tx: TransferTransaction => |
---|
10 | 10 | | let recipient = toBase58String(addressFromRecipient(tx.recipient).bytes) |
---|
11 | 11 | | let recipientCategory = getString(issuer, recipient) |
---|
12 | | - | if ((senderCategory == "admin")) |
---|
| 12 | + | if (if ((senderCategory == "admin")) |
---|
13 | 13 | | then true |
---|
14 | | - | else if (if (isDefined(recipientCategory)) |
---|
| 14 | + | else if (isDefined(recipientCategory)) |
---|
15 | 15 | | then if ((extract(recipientCategory) == "ambassador")) |
---|
16 | 16 | | then true |
---|
17 | 17 | | else (extract(recipientCategory) == "admin") |
---|
18 | 18 | | else false) |
---|
19 | | - | then true |
---|
20 | | - | else throw("This asset can be transferred to whitelist only") |
---|
| 19 | + | then true |
---|
| 20 | + | else throw("This asset can be transferred to whitelist only") |
---|
21 | 21 | | case tx: ExchangeTransaction => |
---|
22 | 22 | | let sell = sigVerify(tx.sellOrder.bodyBytes, tx.sellOrder.proofs[0], tx.sellOrder.senderPublicKey) |
---|
23 | 23 | | let buy = sigVerify(tx.buyOrder.bodyBytes, tx.buyOrder.proofs[0], tx.buyOrder.senderPublicKey) |
---|
|
25 | 25 | | let sellOrderSenderCategory = getString(issuer, sellOrderSender) |
---|
26 | 26 | | let buyOrderSender = toBase58String(tx.buyOrder.sender.bytes) |
---|
27 | 27 | | let buyOrderSenderCategory = getString(issuer, buyOrderSender) |
---|
28 | | - | if (if (if (buy) |
---|
| 28 | + | if (if (buy) |
---|
29 | 29 | | then if (if (isDefined(buyOrderSenderCategory)) |
---|
30 | 30 | | then (extract(buyOrderSenderCategory) == "admin") |
---|
31 | 31 | | else false) |
---|
|
33 | 33 | | else throw("You cannot buy this asset") |
---|
34 | 34 | | else false) |
---|
35 | 35 | | then true |
---|
36 | | - | else sell) |
---|
37 | | - | then if (if (isDefined(sellOrderSenderCategory)) |
---|
38 | | - | then if ((extract(sellOrderSenderCategory) == "ambassador")) |
---|
| 36 | + | else if (sell) |
---|
| 37 | + | then if (if (isDefined(sellOrderSenderCategory)) |
---|
| 38 | + | then if ((extract(sellOrderSenderCategory) == "ambassador")) |
---|
| 39 | + | then true |
---|
| 40 | + | else (extract(sellOrderSenderCategory) == "admin") |
---|
| 41 | + | else false) |
---|
39 | 42 | | then true |
---|
40 | | - | else (extract(sellOrderSenderCategory) == "admin") |
---|
41 | | - | else false) |
---|
42 | | - | then true |
---|
43 | | - | else throw("Only whitelist can sell this asset") |
---|
44 | | - | else false |
---|
| 43 | + | else throw("Only whitelist can sell this asset") |
---|
| 44 | + | else false |
---|
45 | 45 | | case tx: MassTransferTransaction => |
---|
46 | 46 | | if ((senderCategory == "admin")) |
---|
47 | 47 | | then true |
---|
|
50 | 50 | | if ((senderCategory == "admin")) |
---|
51 | 51 | | then true |
---|
52 | 52 | | else throw("You cannot burn this asset") |
---|
53 | | - | case tx: ReissueTransaction|SetAssetScriptTransaction => |
---|
| 53 | + | case tx: SetAssetScriptTransaction|ReissueTransaction => |
---|
54 | 54 | | true |
---|
55 | 55 | | case _ => |
---|
56 | 56 | | false |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 2 #-} |
---|
2 | 2 | | {-# CONTENT_TYPE EXPRESSION #-} |
---|
3 | 3 | | let issuer = Address(base58'3P3oH9HHoCuoqSBNvVK8kvff39ikAF9DJgV') |
---|
4 | 4 | | let sender = toBase58String(tx.sender.bytes) |
---|
5 | 5 | | let senderCategory = if (isDefined(getString(issuer, sender))) |
---|
6 | 6 | | then extract(getString(issuer, sender)) |
---|
7 | 7 | | else "none" |
---|
8 | 8 | | match tx { |
---|
9 | 9 | | case tx: TransferTransaction => |
---|
10 | 10 | | let recipient = toBase58String(addressFromRecipient(tx.recipient).bytes) |
---|
11 | 11 | | let recipientCategory = getString(issuer, recipient) |
---|
12 | | - | if ((senderCategory == "admin")) |
---|
| 12 | + | if (if ((senderCategory == "admin")) |
---|
13 | 13 | | then true |
---|
14 | | - | else if (if (isDefined(recipientCategory)) |
---|
| 14 | + | else if (isDefined(recipientCategory)) |
---|
15 | 15 | | then if ((extract(recipientCategory) == "ambassador")) |
---|
16 | 16 | | then true |
---|
17 | 17 | | else (extract(recipientCategory) == "admin") |
---|
18 | 18 | | else false) |
---|
19 | | - | then true |
---|
20 | | - | else throw("This asset can be transferred to whitelist only") |
---|
| 19 | + | then true |
---|
| 20 | + | else throw("This asset can be transferred to whitelist only") |
---|
21 | 21 | | case tx: ExchangeTransaction => |
---|
22 | 22 | | let sell = sigVerify(tx.sellOrder.bodyBytes, tx.sellOrder.proofs[0], tx.sellOrder.senderPublicKey) |
---|
23 | 23 | | let buy = sigVerify(tx.buyOrder.bodyBytes, tx.buyOrder.proofs[0], tx.buyOrder.senderPublicKey) |
---|
24 | 24 | | let sellOrderSender = toBase58String(tx.sellOrder.sender.bytes) |
---|
25 | 25 | | let sellOrderSenderCategory = getString(issuer, sellOrderSender) |
---|
26 | 26 | | let buyOrderSender = toBase58String(tx.buyOrder.sender.bytes) |
---|
27 | 27 | | let buyOrderSenderCategory = getString(issuer, buyOrderSender) |
---|
28 | | - | if (if (if (buy) |
---|
| 28 | + | if (if (buy) |
---|
29 | 29 | | then if (if (isDefined(buyOrderSenderCategory)) |
---|
30 | 30 | | then (extract(buyOrderSenderCategory) == "admin") |
---|
31 | 31 | | else false) |
---|
32 | 32 | | then true |
---|
33 | 33 | | else throw("You cannot buy this asset") |
---|
34 | 34 | | else false) |
---|
35 | 35 | | then true |
---|
36 | | - | else sell) |
---|
37 | | - | then if (if (isDefined(sellOrderSenderCategory)) |
---|
38 | | - | then if ((extract(sellOrderSenderCategory) == "ambassador")) |
---|
| 36 | + | else if (sell) |
---|
| 37 | + | then if (if (isDefined(sellOrderSenderCategory)) |
---|
| 38 | + | then if ((extract(sellOrderSenderCategory) == "ambassador")) |
---|
| 39 | + | then true |
---|
| 40 | + | else (extract(sellOrderSenderCategory) == "admin") |
---|
| 41 | + | else false) |
---|
39 | 42 | | then true |
---|
40 | | - | else (extract(sellOrderSenderCategory) == "admin") |
---|
41 | | - | else false) |
---|
42 | | - | then true |
---|
43 | | - | else throw("Only whitelist can sell this asset") |
---|
44 | | - | else false |
---|
| 43 | + | else throw("Only whitelist can sell this asset") |
---|
| 44 | + | else false |
---|
45 | 45 | | case tx: MassTransferTransaction => |
---|
46 | 46 | | if ((senderCategory == "admin")) |
---|
47 | 47 | | then true |
---|
48 | 48 | | else throw("You cannot send this asset via MassTransferTransaction") |
---|
49 | 49 | | case tx: BurnTransaction => |
---|
50 | 50 | | if ((senderCategory == "admin")) |
---|
51 | 51 | | then true |
---|
52 | 52 | | else throw("You cannot burn this asset") |
---|
53 | | - | case tx: ReissueTransaction|SetAssetScriptTransaction => |
---|
| 53 | + | case tx: SetAssetScriptTransaction|ReissueTransaction => |
---|
54 | 54 | | true |
---|
55 | 55 | | case _ => |
---|
56 | 56 | | false |
---|
57 | 57 | | } |
---|