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