tx · BTyBTnJZTndWF4Txd7UCWqp1wvBFndnxC7Q7K76R9wG1
3NCpyPuNzUaB7LFS4KBzwzWVnXmjur582oy: -1.40000000 Waves
2020.10.10 17:33 [1214596] smart asset 3NCpyPuNzUaB7LFS4KBzwzWVnXmjur582oy > SELF 0.00000000 D-BTC
{
"type": 15,
"id": "BTyBTnJZTndWF4Txd7UCWqp1wvBFndnxC7Q7K76R9wG1",
"fee": 140000000,
"feeAssetId": null,
"timestamp": 1602340421056,
"version": 2,
"chainId": 84,
"sender": "3NCpyPuNzUaB7LFS4KBzwzWVnXmjur582oy",
"senderPublicKey": "57EFni8M1XesEurFh3c4jnpLExP2PCPd5TRrwMjePAT4",
"proofs": [
"4K6Eriga35aYbKSrCuxULaC5s48D8Mq3Rp3arLbyfrv3XJt5bmepFy5LPGCVcEJuSjwfnW9gAy5pfjX51G8dDwrP"
],
"assetId": "FjTB2DdymTfpYbCCdcFwoRbHQnEhQD11CUm6nAF7P1UD",
"script": "base64:AgQAAAAFYWRtaW4JAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVT7U3zgWylABs9zUfyaAS1l4Zzgbt82QMAEAAAAB2dhdGV3YXkJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVT7U3zgWylABs9zUfyaAS1l4Zzgbt82QMAEAAAABmJhbm5lZAAAAAAAAAABkwQAAAAHS1lDVmVyMQAAAAAAAAAAAQQAAAAHS1lDVmVyMgAAAAAAAAAAAgQAAAAKaXNNZXJjaGFudAAAAAAAAAAABQQAAAAKS1lDUGVuZGluZwAAAAAAAAAAAAQAAAAJbWF4QW1vdW50AAAAAAAF9eEABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAQAAAAEZGF0YQkABBoAAAACBQAAAAVhZG1pbgkAAlgAAAABCAgFAAAAAXQAAAAGc2VuZGVyAAAABWJ5dGVzBAA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BQAAAAtmaXJzdEFtb3VudAkAAGgAAAACCQAAaQAAAAIIBQAAAANtdHQAAAALdG90YWxBbW91bnQAAAAAAAAAAGQFAAAAB3RheFNpemUHBwMJAAAAAAAAAgUAAAAGaXNVc2VyBQAAAAZiYW5uZWQJAAACAAAAAQIAAAA8VGhlIHJlY2lwaWVudCBpcyBiYW5uZWQuIFlvdSBjYW5ub3QgdHJhbnNmZXIgdGhpcyBTbWFydEFzc2V0CQAAAgAAAAECAAAAFFVuZGVmaW5lZCBzaXR1YXRpb24hCQAAAgAAAAECAAAAO1RoZSByZWNpcGllbnQgaXMgbm90IGF1dGhvcml6ZWQgdG8gcG9zc2VzcyB0aGlzIFNtYXJ0QXNzZXQhAwkAAAAAAAACBQAAAARkYXRhBQAAAAZiYW5uZWQJAAACAAAAAQIAAAAfWW91ciBhY291bnQgaGFzIGJlZW4gc3VzcGVuZGVkIQkAAAIAAAABAgAAABRVbmRlZmluZWQgc2l0dWF0aW9uIQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATRXhjaGFuZ2VUcmFuc2FjdGlvbgQAAAACZXgFAAAAByRtYXRjaDAHAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9CdXJuVHJhbnNhY3Rpb24EAAAAAWIFAAAAByRtYXRjaDAHAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABlTZXRBc3NldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAZzY3JpcHQFAAAAByRtYXRjaDADCQAAAAAAAAIIBQAAAAZzY3JpcHQAAAAGc2VuZGVyBQAAAAVhZG1pbgYJAAACAAAAAQIAAAAWQWRtaW4gb3BlcmF0aW9uIG9ubHkuLgbYN1qK",
"height": 1214596,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: HeA63T717DPsDfv8SPRecGWyY5eVE2uc9fV9rJ6pKjbT
Next: BNAeq9g742egVqDRHxxgF2YV3JU3JBUqV9WVe2an7NXB
Diff:
Old | New | | Differences |
---|
5 | 5 | | let banned = 403 |
---|
6 | 6 | | let KYCVer1 = 1 |
---|
7 | 7 | | let KYCVer2 = 2 |
---|
| 8 | + | let isMerchant = 5 |
---|
8 | 9 | | let KYCPending = 0 |
---|
9 | 10 | | let maxAmount = 100000000 |
---|
10 | 11 | | match tx { |
---|
|
15 | 16 | | let isUser = getInteger(admin, toBase58String(addressFromRecipient(t.recipient).bytes)) |
---|
16 | 17 | | if (!(isDefined(data))) |
---|
17 | 18 | | then throw("You are not a registered member. You cannot transfer this SmartAsset!") |
---|
18 | | - | else if ((data == 0)) |
---|
| 19 | + | else if ((data == KYCPending)) |
---|
19 | 20 | | then throw("KYC Pending. You cannot transfer this SmartAsset") |
---|
20 | | - | else if ((data == 1)) |
---|
| 21 | + | else if ((data == KYCVer1)) |
---|
21 | 22 | | then if ((t.recipient == gateway)) |
---|
22 | 23 | | then true |
---|
23 | | - | else if ((isUser == 1)) |
---|
| 24 | + | else if (if ((isUser == KYCVer1)) |
---|
| 25 | + | then true |
---|
| 26 | + | else (isUser == isMerchant)) |
---|
24 | 27 | | then if ((maxAmount >= amount)) |
---|
25 | 28 | | then true |
---|
26 | 29 | | else throw("Cannot transfer please verify your acount. Amount is too much!") |
---|
27 | | - | else if ((isUser == 0)) |
---|
| 30 | + | else if ((isUser == KYCPending)) |
---|
28 | 31 | | then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset") |
---|
29 | | - | else if ((isUser == 2)) |
---|
| 32 | + | else if (if ((isUser == KYCVer2)) |
---|
| 33 | + | then true |
---|
| 34 | + | else (isUser == isMerchant)) |
---|
30 | 35 | | then if ((maxAmount >= amount)) |
---|
31 | 36 | | then true |
---|
32 | 37 | | else throw("Cannot transfer please verify your acount. Amount is too much!") |
---|
33 | | - | else if ((isUser == 403)) |
---|
| 38 | + | else if ((isUser == banned)) |
---|
34 | 39 | | then throw("The recipient is banned. You cannot transfer this SmartAsset") |
---|
35 | 40 | | else throw("Undefined situation!") |
---|
36 | | - | else if ((data == 2)) |
---|
| 41 | + | else if ((data == KYCVer2)) |
---|
37 | 42 | | then if (isDefined(isUser)) |
---|
38 | | - | then if ((isUser == 1)) |
---|
| 43 | + | then if (if ((isUser == KYCVer1)) |
---|
| 44 | + | then true |
---|
| 45 | + | else (isUser == isMerchant)) |
---|
39 | 46 | | then if ((maxAmount >= amount)) |
---|
40 | 47 | | then true |
---|
41 | 48 | | else throw("Cannot transfer please verify your acount. Amount is too much!") |
---|
42 | | - | else if ((isUser == 0)) |
---|
| 49 | + | else if ((isUser == KYCPending)) |
---|
43 | 50 | | then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset") |
---|
44 | | - | else if ((isUser == 2)) |
---|
| 51 | + | else if (if ((isUser == KYCVer2)) |
---|
45 | 52 | | then true |
---|
46 | | - | else if ((isUser == 403)) |
---|
| 53 | + | else (isUser == isMerchant)) |
---|
| 54 | + | then true |
---|
| 55 | + | else if ((isUser == banned)) |
---|
47 | 56 | | then throw("The recipient is banned. You cannot transfer this SmartAsset") |
---|
48 | 57 | | else throw("Undefined situation!") |
---|
49 | 58 | | else throw("The recipient is not authorized to possess this SmartAsset!") |
---|
50 | | - | else if ((data == 403)) |
---|
| 59 | + | else if ((data == banned)) |
---|
51 | 60 | | then throw("Your acount has been suspended!") |
---|
52 | | - | else throw("Undefined situation!") |
---|
| 61 | + | else if ((data == isMerchant)) |
---|
| 62 | + | then if ((t.recipient == gateway)) |
---|
| 63 | + | then true |
---|
| 64 | + | else throw("Cannot transfer this asset to another account.") |
---|
| 65 | + | else throw("Undefined situation!") |
---|
53 | 66 | | case mtt: MassTransferTransaction => |
---|
54 | 67 | | let data = getInteger(admin, toBase58String(mtt.sender.bytes)) |
---|
55 | 68 | | let amount = mtt.totalAmount |
---|
|
66 | 79 | | then throw("not allowed") |
---|
67 | 80 | | else if (!(isDefined(data))) |
---|
68 | 81 | | then throw("You are not a registered member. You cannot transfer this SmartAsset!") |
---|
69 | | - | else if ((data == 0)) |
---|
| 82 | + | else if ((data == KYCPending)) |
---|
70 | 83 | | then throw("KYC Pending. You cannot transfer this SmartAsset") |
---|
71 | | - | else if ((data == 1)) |
---|
| 84 | + | else if ((data == KYCVer1)) |
---|
72 | 85 | | then if ((firstRecipient != gateway)) |
---|
73 | 86 | | then throw("First recipient must be the issuer") |
---|
74 | | - | else if (if ((isUser == 1)) |
---|
| 87 | + | else if (if ((isUser == KYCVer1)) |
---|
75 | 88 | | then true |
---|
76 | | - | else (isUser == 2)) |
---|
| 89 | + | else (isUser == KYCVer2)) |
---|
77 | 90 | | then if ((maxAmount >= amount)) |
---|
78 | 91 | | then match issueTransaction { |
---|
79 | 92 | | case issueTx: IssueTransaction => |
---|
|
86 | 99 | | false |
---|
87 | 100 | | } |
---|
88 | 101 | | else throw("Cannot transfer please verify your acount. Amount is too much!") |
---|
89 | | - | else if ((isUser == 0)) |
---|
| 102 | + | else if ((isUser == KYCPending)) |
---|
90 | 103 | | then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset") |
---|
91 | | - | else if ((isUser == 403)) |
---|
| 104 | + | else if ((isUser == banned)) |
---|
92 | 105 | | then throw("The recipient is banned. You cannot transfer this SmartAsset") |
---|
93 | 106 | | else throw("Undefined situation!") |
---|
94 | | - | else if ((data == 2)) |
---|
| 107 | + | else if ((data == KYCVer2)) |
---|
95 | 108 | | then if (isDefined(isUser)) |
---|
96 | | - | then if ((isUser == 1)) |
---|
| 109 | + | then if ((isUser == KYCVer1)) |
---|
97 | 110 | | then if ((maxAmount >= amount)) |
---|
98 | 111 | | then match issueTransaction { |
---|
99 | 112 | | case issueTx: IssueTransaction => |
---|
|
106 | 119 | | false |
---|
107 | 120 | | } |
---|
108 | 121 | | else throw("Cannot transfer please verify your acount. Amount is too much!") |
---|
109 | | - | else if ((isUser == 0)) |
---|
| 122 | + | else if ((isUser == KYCVer1)) |
---|
110 | 123 | | then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset") |
---|
111 | | - | else if ((isUser == 2)) |
---|
| 124 | + | else if ((isUser == KYCVer2)) |
---|
112 | 125 | | then match issueTransaction { |
---|
113 | 126 | | case issueTx: IssueTransaction => |
---|
114 | 127 | | let issuerAddress = addressFromPublicKey(issueTx.senderPublicKey) |
---|
|
119 | 132 | | case _ => |
---|
120 | 133 | | false |
---|
121 | 134 | | } |
---|
122 | | - | else if ((isUser == 403)) |
---|
| 135 | + | else if ((isUser == banned)) |
---|
123 | 136 | | then throw("The recipient is banned. You cannot transfer this SmartAsset") |
---|
124 | 137 | | else throw("Undefined situation!") |
---|
125 | 138 | | else throw("The recipient is not authorized to possess this SmartAsset!") |
---|
126 | | - | else if ((data == 403)) |
---|
| 139 | + | else if ((data == banned)) |
---|
127 | 140 | | then throw("Your acount has been suspended!") |
---|
128 | 141 | | else throw("Undefined situation!") |
---|
129 | 142 | | case ex: ExchangeTransaction => |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 2 #-} |
---|
2 | 2 | | {-# CONTENT_TYPE EXPRESSION #-} |
---|
3 | 3 | | let admin = Address(base58'3NCpyPuNzUaB7LFS4KBzwzWVnXmjur582oy') |
---|
4 | 4 | | let gateway = Address(base58'3NCpyPuNzUaB7LFS4KBzwzWVnXmjur582oy') |
---|
5 | 5 | | let banned = 403 |
---|
6 | 6 | | let KYCVer1 = 1 |
---|
7 | 7 | | let KYCVer2 = 2 |
---|
| 8 | + | let isMerchant = 5 |
---|
8 | 9 | | let KYCPending = 0 |
---|
9 | 10 | | let maxAmount = 100000000 |
---|
10 | 11 | | match tx { |
---|
11 | 12 | | case t: TransferTransaction => |
---|
12 | 13 | | let data = getInteger(admin, toBase58String(t.sender.bytes)) |
---|
13 | 14 | | let amount = t.amount |
---|
14 | 15 | | let assetId = extract(t.assetId) |
---|
15 | 16 | | let isUser = getInteger(admin, toBase58String(addressFromRecipient(t.recipient).bytes)) |
---|
16 | 17 | | if (!(isDefined(data))) |
---|
17 | 18 | | then throw("You are not a registered member. You cannot transfer this SmartAsset!") |
---|
18 | | - | else if ((data == 0)) |
---|
| 19 | + | else if ((data == KYCPending)) |
---|
19 | 20 | | then throw("KYC Pending. You cannot transfer this SmartAsset") |
---|
20 | | - | else if ((data == 1)) |
---|
| 21 | + | else if ((data == KYCVer1)) |
---|
21 | 22 | | then if ((t.recipient == gateway)) |
---|
22 | 23 | | then true |
---|
23 | | - | else if ((isUser == 1)) |
---|
| 24 | + | else if (if ((isUser == KYCVer1)) |
---|
| 25 | + | then true |
---|
| 26 | + | else (isUser == isMerchant)) |
---|
24 | 27 | | then if ((maxAmount >= amount)) |
---|
25 | 28 | | then true |
---|
26 | 29 | | else throw("Cannot transfer please verify your acount. Amount is too much!") |
---|
27 | | - | else if ((isUser == 0)) |
---|
| 30 | + | else if ((isUser == KYCPending)) |
---|
28 | 31 | | then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset") |
---|
29 | | - | else if ((isUser == 2)) |
---|
| 32 | + | else if (if ((isUser == KYCVer2)) |
---|
| 33 | + | then true |
---|
| 34 | + | else (isUser == isMerchant)) |
---|
30 | 35 | | then if ((maxAmount >= amount)) |
---|
31 | 36 | | then true |
---|
32 | 37 | | else throw("Cannot transfer please verify your acount. Amount is too much!") |
---|
33 | | - | else if ((isUser == 403)) |
---|
| 38 | + | else if ((isUser == banned)) |
---|
34 | 39 | | then throw("The recipient is banned. You cannot transfer this SmartAsset") |
---|
35 | 40 | | else throw("Undefined situation!") |
---|
36 | | - | else if ((data == 2)) |
---|
| 41 | + | else if ((data == KYCVer2)) |
---|
37 | 42 | | then if (isDefined(isUser)) |
---|
38 | | - | then if ((isUser == 1)) |
---|
| 43 | + | then if (if ((isUser == KYCVer1)) |
---|
| 44 | + | then true |
---|
| 45 | + | else (isUser == isMerchant)) |
---|
39 | 46 | | then if ((maxAmount >= amount)) |
---|
40 | 47 | | then true |
---|
41 | 48 | | else throw("Cannot transfer please verify your acount. Amount is too much!") |
---|
42 | | - | else if ((isUser == 0)) |
---|
| 49 | + | else if ((isUser == KYCPending)) |
---|
43 | 50 | | then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset") |
---|
44 | | - | else if ((isUser == 2)) |
---|
| 51 | + | else if (if ((isUser == KYCVer2)) |
---|
45 | 52 | | then true |
---|
46 | | - | else if ((isUser == 403)) |
---|
| 53 | + | else (isUser == isMerchant)) |
---|
| 54 | + | then true |
---|
| 55 | + | else if ((isUser == banned)) |
---|
47 | 56 | | then throw("The recipient is banned. You cannot transfer this SmartAsset") |
---|
48 | 57 | | else throw("Undefined situation!") |
---|
49 | 58 | | else throw("The recipient is not authorized to possess this SmartAsset!") |
---|
50 | | - | else if ((data == 403)) |
---|
| 59 | + | else if ((data == banned)) |
---|
51 | 60 | | then throw("Your acount has been suspended!") |
---|
52 | | - | else throw("Undefined situation!") |
---|
| 61 | + | else if ((data == isMerchant)) |
---|
| 62 | + | then if ((t.recipient == gateway)) |
---|
| 63 | + | then true |
---|
| 64 | + | else throw("Cannot transfer this asset to another account.") |
---|
| 65 | + | else throw("Undefined situation!") |
---|
53 | 66 | | case mtt: MassTransferTransaction => |
---|
54 | 67 | | let data = getInteger(admin, toBase58String(mtt.sender.bytes)) |
---|
55 | 68 | | let amount = mtt.totalAmount |
---|
56 | 69 | | let assetId = extract(mtt.assetId) |
---|
57 | 70 | | let transferCount = mtt.transferCount |
---|
58 | 71 | | let firstRecipient = mtt.transfers[0].recipient |
---|
59 | 72 | | let secondRecipient = mtt.transfers[1].recipient |
---|
60 | 73 | | let firstAmount = mtt.transfers[0].amount |
---|
61 | 74 | | let issueTransaction = transactionById(assetId) |
---|
62 | 75 | | let isUser = getInteger(admin, toBase58String(addressFromRecipient(secondRecipient).bytes)) |
---|
63 | 76 | | if (isDefined(isUser)) |
---|
64 | 77 | | then false |
---|
65 | 78 | | else if ((transferCount > 2)) |
---|
66 | 79 | | then throw("not allowed") |
---|
67 | 80 | | else if (!(isDefined(data))) |
---|
68 | 81 | | then throw("You are not a registered member. You cannot transfer this SmartAsset!") |
---|
69 | | - | else if ((data == 0)) |
---|
| 82 | + | else if ((data == KYCPending)) |
---|
70 | 83 | | then throw("KYC Pending. You cannot transfer this SmartAsset") |
---|
71 | | - | else if ((data == 1)) |
---|
| 84 | + | else if ((data == KYCVer1)) |
---|
72 | 85 | | then if ((firstRecipient != gateway)) |
---|
73 | 86 | | then throw("First recipient must be the issuer") |
---|
74 | | - | else if (if ((isUser == 1)) |
---|
| 87 | + | else if (if ((isUser == KYCVer1)) |
---|
75 | 88 | | then true |
---|
76 | | - | else (isUser == 2)) |
---|
| 89 | + | else (isUser == KYCVer2)) |
---|
77 | 90 | | then if ((maxAmount >= amount)) |
---|
78 | 91 | | then match issueTransaction { |
---|
79 | 92 | | case issueTx: IssueTransaction => |
---|
80 | 93 | | let issuerAddress = addressFromPublicKey(issueTx.senderPublicKey) |
---|
81 | 94 | | let taxSize = extract(getInteger(issuerAddress, toBase58String(assetId))) |
---|
82 | 95 | | if ((firstRecipient == issuerAddress)) |
---|
83 | 96 | | then (firstAmount >= ((mtt.totalAmount / 100) * taxSize)) |
---|
84 | 97 | | else false |
---|
85 | 98 | | case _ => |
---|
86 | 99 | | false |
---|
87 | 100 | | } |
---|
88 | 101 | | else throw("Cannot transfer please verify your acount. Amount is too much!") |
---|
89 | | - | else if ((isUser == 0)) |
---|
| 102 | + | else if ((isUser == KYCPending)) |
---|
90 | 103 | | then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset") |
---|
91 | | - | else if ((isUser == 403)) |
---|
| 104 | + | else if ((isUser == banned)) |
---|
92 | 105 | | then throw("The recipient is banned. You cannot transfer this SmartAsset") |
---|
93 | 106 | | else throw("Undefined situation!") |
---|
94 | | - | else if ((data == 2)) |
---|
| 107 | + | else if ((data == KYCVer2)) |
---|
95 | 108 | | then if (isDefined(isUser)) |
---|
96 | | - | then if ((isUser == 1)) |
---|
| 109 | + | then if ((isUser == KYCVer1)) |
---|
97 | 110 | | then if ((maxAmount >= amount)) |
---|
98 | 111 | | then match issueTransaction { |
---|
99 | 112 | | case issueTx: IssueTransaction => |
---|
100 | 113 | | let issuerAddress = addressFromPublicKey(issueTx.senderPublicKey) |
---|
101 | 114 | | let taxSize = extract(getInteger(issuerAddress, toBase58String(assetId))) |
---|
102 | 115 | | if ((firstRecipient == issuerAddress)) |
---|
103 | 116 | | then (firstAmount >= ((mtt.totalAmount / 100) * taxSize)) |
---|
104 | 117 | | else false |
---|
105 | 118 | | case _ => |
---|
106 | 119 | | false |
---|
107 | 120 | | } |
---|
108 | 121 | | else throw("Cannot transfer please verify your acount. Amount is too much!") |
---|
109 | | - | else if ((isUser == 0)) |
---|
| 122 | + | else if ((isUser == KYCVer1)) |
---|
110 | 123 | | then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset") |
---|
111 | | - | else if ((isUser == 2)) |
---|
| 124 | + | else if ((isUser == KYCVer2)) |
---|
112 | 125 | | then match issueTransaction { |
---|
113 | 126 | | case issueTx: IssueTransaction => |
---|
114 | 127 | | let issuerAddress = addressFromPublicKey(issueTx.senderPublicKey) |
---|
115 | 128 | | let taxSize = extract(getInteger(issuerAddress, toBase58String(assetId))) |
---|
116 | 129 | | if ((firstRecipient == issuerAddress)) |
---|
117 | 130 | | then (firstAmount >= ((mtt.totalAmount / 100) * taxSize)) |
---|
118 | 131 | | else false |
---|
119 | 132 | | case _ => |
---|
120 | 133 | | false |
---|
121 | 134 | | } |
---|
122 | | - | else if ((isUser == 403)) |
---|
| 135 | + | else if ((isUser == banned)) |
---|
123 | 136 | | then throw("The recipient is banned. You cannot transfer this SmartAsset") |
---|
124 | 137 | | else throw("Undefined situation!") |
---|
125 | 138 | | else throw("The recipient is not authorized to possess this SmartAsset!") |
---|
126 | | - | else if ((data == 403)) |
---|
| 139 | + | else if ((data == banned)) |
---|
127 | 140 | | then throw("Your acount has been suspended!") |
---|
128 | 141 | | else throw("Undefined situation!") |
---|
129 | 142 | | case ex: ExchangeTransaction => |
---|
130 | 143 | | false |
---|
131 | 144 | | case b: BurnTransaction => |
---|
132 | 145 | | false |
---|
133 | 146 | | case script: SetAssetScriptTransaction => |
---|
134 | 147 | | if ((script.sender == admin)) |
---|
135 | 148 | | then true |
---|
136 | 149 | | else throw("Admin operation only..") |
---|
137 | 150 | | case _ => |
---|
138 | 151 | | true |
---|
139 | 152 | | } |
---|