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:AgQAAAAFYWRtaW4JAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVT7U3zgWylABs9zUfyaAS1l4Zzgbt82QMAEAAAAB2dhdGV3YXkJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVT7U3zgWylABs9zUfyaAS1l4Zzgbt82QMAEAAAABmJhbm5lZAAAAAAAAAABkwQAAAAHS1lDVmVyMQAAAAAAAAAAAQQAAAAHS1lDVmVyMgAAAAAAAAAAAgQAAAAKaXNNZXJjaGFudAAAAAAAAAAABQQAAAAKS1lDUGVuZGluZwAAAAAAAAAAAAQAAAAJbWF4QW1vdW50AAAAAAAF9eEABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAQAAAAEZGF0YQkABBoAAAACBQAAAAVhZG1pbgkAAlgAAAABCAgFAAAAAXQAAAAGc2VuZGVyAAAABWJ5dGVzBAAAAAZhbW91bn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JzdEFtb3VudAkAAGgAAAACCQAAaQAAAAIIBQAAAANtdHQAAAALdG90YWxBbW91bnQAAAAAAAAAAGQFAAAAB3RheFNpemUHBwMJAAAAAAAAAgUAAAAGaXNVc2VyBQAAAAZiYW5uZWQJAAACAAAAAQIAAAA8VGhlIHJlY2lwaWVudCBpcyBiYW5uZWQuIFlvdSBjYW5ub3QgdHJhbnNmZXIgdGhpcyBTbWFydEFzc2V0CQAAAgAAAAECAAAAFFVuZGVmaW5lZCBzaXR1YXRpb24hCQAAAgAAAAECAAAAO1RoZSByZWNpcGllbnQgaXMgbm90IGF1dGhvcml6ZWQgdG8gcG9zc2VzcyB0aGlzIFNtYXJ0QXNzZXQhAwkAAAAAAAACBQAAAARkYXRhBQAAAAZiYW5uZWQJAAACAAAAAQIAAAAfWW91ciBhY291bnQgaGFzIGJlZW4gc3VzcGVuZGVkIQkAAAIAAAABAgAAABRVbmRlZmluZWQgc2l0dWF0aW9uIQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATRXhjaGFuZ2VUcmFuc2FjdGlvbgQAAAACZXgFAAAAByRtYXRjaDAHAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9CdXJuVHJhbnNhY3Rpb24EAAAAAWIFAAAAByRtYXRjaDAHAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABlTZXRBc3NldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAZzY3JpcHQFAAAAByRtYXRjaDADCQAAAAAAAAIIBQAAAAZzY3JpcHQAAAAGc2VuZGVyBQAAAAVhZG1pbgYJAAACAAAAAQIAAAAWQWRtaW4gb3BlcmF0aW9uIG9ubHkuLgbYN1qK", "height": 1214596, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HeA63T717DPsDfv8SPRecGWyY5eVE2uc9fV9rJ6pKjbT Next: BNAeq9g742egVqDRHxxgF2YV3JU3JBUqV9WVe2an7NXB Diff:
OldNewDifferences
55 let banned = 403
66 let KYCVer1 = 1
77 let KYCVer2 = 2
8+let isMerchant = 5
89 let KYCPending = 0
910 let maxAmount = 100000000
1011 match tx {
1516 let isUser = getInteger(admin, toBase58String(addressFromRecipient(t.recipient).bytes))
1617 if (!(isDefined(data)))
1718 then throw("You are not a registered member. You cannot transfer this SmartAsset!")
18- else if ((data == 0))
19+ else if ((data == KYCPending))
1920 then throw("KYC Pending. You cannot transfer this SmartAsset")
20- else if ((data == 1))
21+ else if ((data == KYCVer1))
2122 then if ((t.recipient == gateway))
2223 then true
23- else if ((isUser == 1))
24+ else if (if ((isUser == KYCVer1))
25+ then true
26+ else (isUser == isMerchant))
2427 then if ((maxAmount >= amount))
2528 then true
2629 else throw("Cannot transfer please verify your acount. Amount is too much!")
27- else if ((isUser == 0))
30+ else if ((isUser == KYCPending))
2831 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))
3035 then if ((maxAmount >= amount))
3136 then true
3237 else throw("Cannot transfer please verify your acount. Amount is too much!")
33- else if ((isUser == 403))
38+ else if ((isUser == banned))
3439 then throw("The recipient is banned. You cannot transfer this SmartAsset")
3540 else throw("Undefined situation!")
36- else if ((data == 2))
41+ else if ((data == KYCVer2))
3742 then if (isDefined(isUser))
38- then if ((isUser == 1))
43+ then if (if ((isUser == KYCVer1))
44+ then true
45+ else (isUser == isMerchant))
3946 then if ((maxAmount >= amount))
4047 then true
4148 else throw("Cannot transfer please verify your acount. Amount is too much!")
42- else if ((isUser == 0))
49+ else if ((isUser == KYCPending))
4350 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))
4552 then true
46- else if ((isUser == 403))
53+ else (isUser == isMerchant))
54+ then true
55+ else if ((isUser == banned))
4756 then throw("The recipient is banned. You cannot transfer this SmartAsset")
4857 else throw("Undefined situation!")
4958 else throw("The recipient is not authorized to possess this SmartAsset!")
50- else if ((data == 403))
59+ else if ((data == banned))
5160 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!")
5366 case mtt: MassTransferTransaction =>
5467 let data = getInteger(admin, toBase58String(mtt.sender.bytes))
5568 let amount = mtt.totalAmount
6679 then throw("not allowed")
6780 else if (!(isDefined(data)))
6881 then throw("You are not a registered member. You cannot transfer this SmartAsset!")
69- else if ((data == 0))
82+ else if ((data == KYCPending))
7083 then throw("KYC Pending. You cannot transfer this SmartAsset")
71- else if ((data == 1))
84+ else if ((data == KYCVer1))
7285 then if ((firstRecipient != gateway))
7386 then throw("First recipient must be the issuer")
74- else if (if ((isUser == 1))
87+ else if (if ((isUser == KYCVer1))
7588 then true
76- else (isUser == 2))
89+ else (isUser == KYCVer2))
7790 then if ((maxAmount >= amount))
7891 then match issueTransaction {
7992 case issueTx: IssueTransaction =>
8699 false
87100 }
88101 else throw("Cannot transfer please verify your acount. Amount is too much!")
89- else if ((isUser == 0))
102+ else if ((isUser == KYCPending))
90103 then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset")
91- else if ((isUser == 403))
104+ else if ((isUser == banned))
92105 then throw("The recipient is banned. You cannot transfer this SmartAsset")
93106 else throw("Undefined situation!")
94- else if ((data == 2))
107+ else if ((data == KYCVer2))
95108 then if (isDefined(isUser))
96- then if ((isUser == 1))
109+ then if ((isUser == KYCVer1))
97110 then if ((maxAmount >= amount))
98111 then match issueTransaction {
99112 case issueTx: IssueTransaction =>
106119 false
107120 }
108121 else throw("Cannot transfer please verify your acount. Amount is too much!")
109- else if ((isUser == 0))
122+ else if ((isUser == KYCVer1))
110123 then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset")
111- else if ((isUser == 2))
124+ else if ((isUser == KYCVer2))
112125 then match issueTransaction {
113126 case issueTx: IssueTransaction =>
114127 let issuerAddress = addressFromPublicKey(issueTx.senderPublicKey)
119132 case _ =>
120133 false
121134 }
122- else if ((isUser == 403))
135+ else if ((isUser == banned))
123136 then throw("The recipient is banned. You cannot transfer this SmartAsset")
124137 else throw("Undefined situation!")
125138 else throw("The recipient is not authorized to possess this SmartAsset!")
126- else if ((data == 403))
139+ else if ((data == banned))
127140 then throw("Your acount has been suspended!")
128141 else throw("Undefined situation!")
129142 case ex: ExchangeTransaction =>
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 2 #-}
22 {-# CONTENT_TYPE EXPRESSION #-}
33 let admin = Address(base58'3NCpyPuNzUaB7LFS4KBzwzWVnXmjur582oy')
44 let gateway = Address(base58'3NCpyPuNzUaB7LFS4KBzwzWVnXmjur582oy')
55 let banned = 403
66 let KYCVer1 = 1
77 let KYCVer2 = 2
8+let isMerchant = 5
89 let KYCPending = 0
910 let maxAmount = 100000000
1011 match tx {
1112 case t: TransferTransaction =>
1213 let data = getInteger(admin, toBase58String(t.sender.bytes))
1314 let amount = t.amount
1415 let assetId = extract(t.assetId)
1516 let isUser = getInteger(admin, toBase58String(addressFromRecipient(t.recipient).bytes))
1617 if (!(isDefined(data)))
1718 then throw("You are not a registered member. You cannot transfer this SmartAsset!")
18- else if ((data == 0))
19+ else if ((data == KYCPending))
1920 then throw("KYC Pending. You cannot transfer this SmartAsset")
20- else if ((data == 1))
21+ else if ((data == KYCVer1))
2122 then if ((t.recipient == gateway))
2223 then true
23- else if ((isUser == 1))
24+ else if (if ((isUser == KYCVer1))
25+ then true
26+ else (isUser == isMerchant))
2427 then if ((maxAmount >= amount))
2528 then true
2629 else throw("Cannot transfer please verify your acount. Amount is too much!")
27- else if ((isUser == 0))
30+ else if ((isUser == KYCPending))
2831 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))
3035 then if ((maxAmount >= amount))
3136 then true
3237 else throw("Cannot transfer please verify your acount. Amount is too much!")
33- else if ((isUser == 403))
38+ else if ((isUser == banned))
3439 then throw("The recipient is banned. You cannot transfer this SmartAsset")
3540 else throw("Undefined situation!")
36- else if ((data == 2))
41+ else if ((data == KYCVer2))
3742 then if (isDefined(isUser))
38- then if ((isUser == 1))
43+ then if (if ((isUser == KYCVer1))
44+ then true
45+ else (isUser == isMerchant))
3946 then if ((maxAmount >= amount))
4047 then true
4148 else throw("Cannot transfer please verify your acount. Amount is too much!")
42- else if ((isUser == 0))
49+ else if ((isUser == KYCPending))
4350 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))
4552 then true
46- else if ((isUser == 403))
53+ else (isUser == isMerchant))
54+ then true
55+ else if ((isUser == banned))
4756 then throw("The recipient is banned. You cannot transfer this SmartAsset")
4857 else throw("Undefined situation!")
4958 else throw("The recipient is not authorized to possess this SmartAsset!")
50- else if ((data == 403))
59+ else if ((data == banned))
5160 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!")
5366 case mtt: MassTransferTransaction =>
5467 let data = getInteger(admin, toBase58String(mtt.sender.bytes))
5568 let amount = mtt.totalAmount
5669 let assetId = extract(mtt.assetId)
5770 let transferCount = mtt.transferCount
5871 let firstRecipient = mtt.transfers[0].recipient
5972 let secondRecipient = mtt.transfers[1].recipient
6073 let firstAmount = mtt.transfers[0].amount
6174 let issueTransaction = transactionById(assetId)
6275 let isUser = getInteger(admin, toBase58String(addressFromRecipient(secondRecipient).bytes))
6376 if (isDefined(isUser))
6477 then false
6578 else if ((transferCount > 2))
6679 then throw("not allowed")
6780 else if (!(isDefined(data)))
6881 then throw("You are not a registered member. You cannot transfer this SmartAsset!")
69- else if ((data == 0))
82+ else if ((data == KYCPending))
7083 then throw("KYC Pending. You cannot transfer this SmartAsset")
71- else if ((data == 1))
84+ else if ((data == KYCVer1))
7285 then if ((firstRecipient != gateway))
7386 then throw("First recipient must be the issuer")
74- else if (if ((isUser == 1))
87+ else if (if ((isUser == KYCVer1))
7588 then true
76- else (isUser == 2))
89+ else (isUser == KYCVer2))
7790 then if ((maxAmount >= amount))
7891 then match issueTransaction {
7992 case issueTx: IssueTransaction =>
8093 let issuerAddress = addressFromPublicKey(issueTx.senderPublicKey)
8194 let taxSize = extract(getInteger(issuerAddress, toBase58String(assetId)))
8295 if ((firstRecipient == issuerAddress))
8396 then (firstAmount >= ((mtt.totalAmount / 100) * taxSize))
8497 else false
8598 case _ =>
8699 false
87100 }
88101 else throw("Cannot transfer please verify your acount. Amount is too much!")
89- else if ((isUser == 0))
102+ else if ((isUser == KYCPending))
90103 then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset")
91- else if ((isUser == 403))
104+ else if ((isUser == banned))
92105 then throw("The recipient is banned. You cannot transfer this SmartAsset")
93106 else throw("Undefined situation!")
94- else if ((data == 2))
107+ else if ((data == KYCVer2))
95108 then if (isDefined(isUser))
96- then if ((isUser == 1))
109+ then if ((isUser == KYCVer1))
97110 then if ((maxAmount >= amount))
98111 then match issueTransaction {
99112 case issueTx: IssueTransaction =>
100113 let issuerAddress = addressFromPublicKey(issueTx.senderPublicKey)
101114 let taxSize = extract(getInteger(issuerAddress, toBase58String(assetId)))
102115 if ((firstRecipient == issuerAddress))
103116 then (firstAmount >= ((mtt.totalAmount / 100) * taxSize))
104117 else false
105118 case _ =>
106119 false
107120 }
108121 else throw("Cannot transfer please verify your acount. Amount is too much!")
109- else if ((isUser == 0))
122+ else if ((isUser == KYCVer1))
110123 then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset")
111- else if ((isUser == 2))
124+ else if ((isUser == KYCVer2))
112125 then match issueTransaction {
113126 case issueTx: IssueTransaction =>
114127 let issuerAddress = addressFromPublicKey(issueTx.senderPublicKey)
115128 let taxSize = extract(getInteger(issuerAddress, toBase58String(assetId)))
116129 if ((firstRecipient == issuerAddress))
117130 then (firstAmount >= ((mtt.totalAmount / 100) * taxSize))
118131 else false
119132 case _ =>
120133 false
121134 }
122- else if ((isUser == 403))
135+ else if ((isUser == banned))
123136 then throw("The recipient is banned. You cannot transfer this SmartAsset")
124137 else throw("Undefined situation!")
125138 else throw("The recipient is not authorized to possess this SmartAsset!")
126- else if ((data == 403))
139+ else if ((data == banned))
127140 then throw("Your acount has been suspended!")
128141 else throw("Undefined situation!")
129142 case ex: ExchangeTransaction =>
130143 false
131144 case b: BurnTransaction =>
132145 false
133146 case script: SetAssetScriptTransaction =>
134147 if ((script.sender == admin))
135148 then true
136149 else throw("Admin operation only..")
137150 case _ =>
138151 true
139152 }

github/deemru/w8io/6500d08 
66.16 ms