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