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