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